History log of /seL4-camkes-master/projects/musllibc/src/math/x86_64_sel4/acosl.s
Revision Date Author Comments
# f697d66b 04-May-2012 nsz <nsz@port70.net>

math: change the formula used for acos.s

old: 2*atan2(sqrt(1-x),sqrt(1+x))
new: atan2(fabs(sqrt((1-x)*(1+x))),x)
improvements:
* all edge cases are fixed (sign of zero in downward rounding)
* a bit faster (here a single call is about 131ns vs 162ns)
* a bit more precise (at most 1ulp error on 1M uniform random
samples in [0,1), the old formula gave some 2ulp errors as well)


# a4a0c912 22-Mar-2012 nsz <nsz@port70.net>

acos.s fix: use the formula acos(x) = atan2(sqrt(1-x),sqrt(1+x))

the old formula atan2(1,sqrt((1+x)/(1-x))) was faster but
could give nan result at x=1 when the rounding mode is
FE_DOWNWARD (so 1-1 == -0 and 2/-0 == -inf), the new formula
gives -0 at x=+-1 with downward rounding.


# 30df206c 20-Mar-2012 Rich Felker <dalias@aerifal.cx>

x86_64 math asm, long double functions only

this has not been tested heavily, but it's known to at least assemble
and run in basic usage cases. it's nearly identical to the
corresponding i386 code, and thus expected to be just as correct or
just as incorrect.