powerTransformations.frink

View or download powerTransformations.frink in plain text format


/** This contains sloppy and non-rigorous solvers for equations containing
    exponents.  It is only intended for real-valued arguments and will not
    find all solutions.  It is used as a starting point only.
*/

transformations power
{
   // Solve x^y === z for y
   //   or, more generally, this solves
   // (a x)^((k y)^n) === z for y
   solve[((_a:1) _x) ^ ((_k:1) _y)^(_n:1) === _z, _y] :: freeOf[_k, _y] && freeOf[_a, _y] && freeOf[_n, _y] && freeOf[_z, _y] <-> solve[_y === (ln[_z] / (ln[_a _x])^(1/_n)) / _k, _y]

   // Solve c a^y b^y === z for y
   solve[(_c:1) _a^_y _b^_y === _z, _y] :: freeOf[_a, _y] && freeOf[_b, _y] && freeOf[_c, _y] && freeOf[_z, _y] <-> solve[_y === ln[_z / _c] / (ln[_a] + ln[_b]), _y]

   // Solve x^y === z for x  for irrational exponents.  (Rational exponents
   // are solved better in solvingTransformations.frink )
   solve[_x ^ _y === _z, _x] :: freeOf[_z, _x] && ! isInteger[_y] && ! isRational[_y] <-> solve[_x === _z^(1/_y), _x]
}


View or download powerTransformations.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17988 days, 19 hours, 23 minutes ago.