3 additional checks are needed here. to avoid overflow after 63 shifts; in the case s > 63 and checking wether s push i out of the float double capacity.
we reconvert i to float for later use 20000000h integer = 41C0000000000000h float double
we convert the float decimals we stored above in base2 to float decimals in baseE. this is because we want to use Taylor series from the e^n. i choosed 10 steps max, and having -1.0 < decimals < +1.0 works enough good. NOTE: you can extend the range of action of the Taylor series up to +-8, stepping it ~20 or more times.
recall Taylor now on e^x : e^x = 1 + x + x^2 / 2! + x^3 / 3! .... + x^n / n!
now, according fundamentals of logarithms
a) if e^x = 2^q b) and generally, lgBASE(x)^n = n * lgBASE(x) then we can extend a) this way,
x * ln(e) = q * ln(2)
c) and thus x = q * ln(2) should verify the a) as true identity.
it is ~40 lines of code (my Taylors's exp() code + main routine) it accepts only +numbers for now, and makes no exaustive check on the floats. for those and negative values i leave it to the reader's creativity ( being e^-x essentially 1 / e^x ). this is the fastest method i know, it should time ~80 cycles totally, i didnt check it yet. it's not so important.
of some relevance to me was
1) avoid the Intel Approx Math library license 2) avoid things like the cmath library 3) avoid the 2 FPU slow instructions FYL2X to compute y * log2(x) F2XM1 to compute 2^x - 1 because 250/300 cycles for 2 instro it's the insanity, 100%, pure :-) especially on tests i am doing from huge RND-data outputs.
4) using Taylor series the right way, because we would need lot of steps to get the right values on plugging in large x, as in the example e^20.3
but the true-truth is that i am not yet ready for Chebyshev; simply because i need some time to understand something more of his genial calculus. if you have simplified references about him, please share it.
and not much time to write a full assembly math library. if someone is interested to contribute the library is open source, under MPL license, but assembly required, please. the library lies under the name "amrt", in the same way as my other one, "art" a-ssembly-run-t-ime. i will write/update it from time to time only on my needs. you find me on clax86.