about summary refs log tree commit diff
path: root/src/math/i386/exp.s
Commit message (Collapse)AuthorAgeFilesLines
* math: fix exp2l asm on x86 (raise underflow correctly)Szabolcs Nagy2013-09-051-32/+38
| | | | | | | | | | | | | | | | there were two problems: * omitted underflow on subnormal results: exp2l(-16383.5) was calculated as sqrt(2)*2^-16384, the last bits of sqrt(2) are zero so the down scaling does not underflow eventhough the result is in subnormal range * spurious underflow for subnormal inputs: exp2l(0x1p-16400) was evaluated as f2xm1(x)+1 and f2xm1 raised underflow (because inexact subnormal result) the first issue is fixed by raising underflow manually if x is in (-32768,-16382] and not integer (x-0x1p63+0x1p63 != x) the second issue is fixed by treating x in (-0x1p64,0x1p64) specially for these fixes the special case handling was completely rewritten
* math: fix x86 asin, atan, exp, log1p to raise underflowSzabolcs Nagy2013-08-151-2/+35
| | | | | | underflow is raised by an inexact subnormal float store, since subnormal operations are slow, check the underflow flag and skip the store if it's already raised
* math: fix i386/expl.s with more precise x*log2eSzabolcs Nagy2012-12-141-6/+0
| | | | | | | | | with naive exp2l(x*log2e) the last 12bits of the result was incorrect for x with large absolute value with hi + lo = x*log2e is caluclated to 128 bits precision and then expl(x) = exp2l(hi) + exp2l(hi) * f2xm1(lo) this gives <1.5ulp measured error everywhere in nearest rounding mode
* math: fix exp.s on i386 and x86_64 so the exception flags are correctnsz2012-08-081-21/+18
| | | | exp(inf), exp(-inf), exp(nan) used to raise wrong flags
* fix exp asmRich Felker2012-03-191-23/+22
| | | | | | | | | | | | exponents (base 2) near 16383 were broken due to (1) wrong cutoff, and (2) inability to fit the necessary range of scalings into a long double value. as a solution, we fall back to using frndint/fscale for insanely large exponents, and also have to special-case infinities here to avoid inf-inf generating nan. thankfully the costly code never runs in normal usage cases.
* optimize exponential asm for i386Rich Felker2012-03-191-11/+76
| | | | | | up to 30% faster exp2 by avoiding slow frndint and fscale functions. expm1 also takes a much more direct path for small arguments (the expected usage case).
* fix broken exponential asmRich Felker2012-03-181-0/+9
| | | | | | | | | infinities were getting converted into nans. the new code simply tests for infinity and replaces it with a large magnitude value of the same sign. also, the fcomi instruction is apparently not part of the i387 instruction set, so avoid using it.
* asm exponential functions for i386Rich Felker2012-03-181-0/+46