On Fri, Nov 27, 2015 at 03:14:52PM +0500, Alexandr Shadchin wrote: > Fix wrong answer if the imaginary part is zero. > NetBSD also turn off this piece of code. > > See > http://en.cppreference.com/w/c/numeric/complex/casin > http://www.wolframalpha.com/input/?i=asin%28-2.0%29
Makes complete sense to me. FWIW: ok tb@ > > -- > Alexandr Shadchin > > Index: s_casin.c > =================================================================== > RCS file: /cvs/src/lib/libm/src/s_casin.c,v > retrieving revision 1.6 > diff -u -p -r1.6 s_casin.c > --- s_casin.c 3 Jul 2013 04:46:36 -0000 1.6 > +++ s_casin.c 27 Nov 2015 09:59:45 -0000 > @@ -63,6 +63,7 @@ casin(double complex z) > x = creal (z); > y = cimag (z); > > +#if 0 > if (y == 0.0) { > if (fabs(x) > 1.0) { > w = M_PI_2 + 0.0 * I; > @@ -73,6 +74,7 @@ casin(double complex z) > } > return (w); > } > +#endif > > /* Power series expansion */ > /* > Index: s_casinf.c > =================================================================== > RCS file: /cvs/src/lib/libm/src/s_casinf.c,v > retrieving revision 1.3 > diff -u -p -r1.3 s_casinf.c > --- s_casinf.c 20 Jul 2011 19:28:33 -0000 1.3 > +++ s_casinf.c 27 Nov 2015 09:59:45 -0000 > @@ -65,6 +65,7 @@ casinf(float complex z) > x = crealf(z); > y = cimagf(z); > > +#if 0 > if(y == 0.0f) { > if(fabsf(x) > 1.0f) { > w = (float)M_PI_2 + 0.0f * I; > @@ -75,6 +76,7 @@ casinf(float complex z) > } > return (w); > } > +#endif > > /* Power series expansion */ > /* > Index: s_casinl.c > =================================================================== > RCS file: /cvs/src/lib/libm/src/s_casinl.c,v > retrieving revision 1.3 > diff -u -p -r1.3 s_casinl.c > --- s_casinl.c 20 Jul 2011 21:02:51 -0000 1.3 > +++ s_casinl.c 27 Nov 2015 09:59:45 -0000 > @@ -71,6 +71,7 @@ casinl(long double complex z) > x = creall(z); > y = cimagl(z); > > +#if 0 > if (y == 0.0L) { > if (fabsl(x) > 1.0L) { > w = PIO2L + 0.0L * I; > @@ -81,6 +82,7 @@ casinl(long double complex z) > } > return (w); > } > +#endif > > /* Power series expansion */ > b = cabsl(z); >