OSDN Git Service

fix wrong result in casin and many related complex functions
authorRich Felker <dalias@aerifal.cx>
Mon, 9 Apr 2018 16:33:17 +0000 (12:33 -0400)
committerRich Felker <dalias@aerifal.cx>
Mon, 9 Apr 2018 17:25:35 +0000 (13:25 -0400)
commitae2a01da2e388535da243b3d974aef74a3c06ae0
tree2ab4469ed5f3989c385b3dc50c58199f9affb593
parentea81529fb92932a50f06bf7a19cae812ae6cdb59
fix wrong result in casin and many related complex functions

the factor of -i noted in the comment at the top of casin.c was
omitted from the actual code, yielding a result rotated 90 degrees and
propagating into errors in other functions defined in terms of casin.

implement multiplication by -i as a rotation of the real and imaginary
parts of the result, rather than by actual multiplication, since the
latter cannot be optimized without knowledge that the operand is
finite. here, the rotation is the actual intent, anyway.
src/complex/casin.c
src/complex/casinf.c
src/complex/casinl.c