On Wednesday, 16 July 2014 20:39:39 UTC+1, Florian Oswald wrote: > > myexp(parameter * mylog(x) ) > > and it does make a sizeable difference. I'll try your version right now. >
Keep in mind that this is going to be less accurate than using an x^y function, as you can be approximately |y*log(x)| ulps out. I'm guessing if you're this concerned with performance then you probably won't be too concerned about losing a few significant digits, but it is worth keeping in mind. If you look at the openlibm source, you can see that this is basically the approach it uses, albeit using some strategic double-double arithmetic to keep enough extra significant digits around. Interestingly, since |y*log(x)| can be at most 710 (otherwise the resulting exp would overflow or underflow), if you could work in 80-bit extended precision, the extra 11 bits in the significand should be sufficient so that the final Float64 result should be accurate to within an ulp. -Simon
