For a good compromise between efficiency and ease of implementation, you can develop your own pow
function exp(y.ln(x))
using Taylor expansions.
The "hardest" part is the logarithm.
First normalize x
by finding the power of 2
such that x=(2^n).x'
, with 1<=x'<2
. Then ln(x) = n.ln(2) + ln(x')
.
6 = (2^2) x 1.5
Evaluate ln(x') = 2 argth((x'-1) / (x'+1))
by the inverse hyperbolic tangent series.
ln(1.5) = 2 (0.2 + 0.2^3/3 + 0.2^5/5...) =
0.4
0.405333333333
0.405461333333
0.405464990476
0.405465104254
0.405465107978
0.405465108104
0.405465108108
...
ln(6) = 2 x 0.69314718056 + 0.405465108108 = 1.791759469228
Then compute y.ln(x)
, split into integer part (use exponentiation by squaring) and fractional part.
4.3 x 1.791759469228 = 7.704565717681
e^7 = 1096.633158428
For the fractional part, use the standard Taylor development of the exponential.
e^0.704565717681 = 1 + 0.704565717681 + 0.704565717681^2/2 + 0.704565717681^3/6...
1
1.70456571768
1.95277214295
2.01106472233
2.02133246059
2.02277931986
2.0229492211
2.02296632204
2.02296782814
2.02296794604
2.02296795435
2.02296795488
2.02296795491
...
And multiply
6^4.3 = 1096.633158428 x 2.02296795491 = 2218.45373779