X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsinl.c;h=918362daa4c42a7a2d7477f32ef170b01016a89a;hb=9fbf8e1a391ab49dca9c608a32af9a42831f3445;hp=cb090b3209f4e4030e10dfa37e0695439e642db1;hpb=932b68847804db93ae058c71d6236d2dc4c905b7;p=gnulib.git diff --git a/lib/sinl.c b/lib/sinl.c index cb090b320..918362daa 100644 --- a/lib/sinl.c +++ b/lib/sinl.c @@ -13,6 +13,11 @@ * ==================================================== */ +#include + +/* Specification. */ +#include + /* sinl(x) * Return sine function of x. * @@ -44,10 +49,6 @@ * TRIG(x) returns trig(x) nearly rounded */ -#include - -#include "mathl.h" - #include "trigl.h" #include "trigl.c" #include "sincosl.c" @@ -58,13 +59,17 @@ sinl (long double x) long double y[2], z = 0.0L; int n; + /* sinl(NaN) is NaN */ + if (isnanl (x)) + return x; + /* |x| ~< pi/4 */ if (x >= -0.7853981633974483096156608458198757210492 && x <= 0.7853981633974483096156608458198757210492) return kernel_sinl (x, z, 0); - /* sinl(Inf or NaN) is NaN, sinl(0) is 0 */ - else if (x + x == x || x != x) + /* sinl(Inf) is NaN, sinl(0) is 0 */ + else if (x + x == x) return x - x; /* NaN */ /* argument reduction needed */