From 668986107da6a20bdbce4fa5856c628cdaf5ccdf Mon Sep 17 00:00:00 2001 From: Steve Kargl Date: Thu, 4 Dec 2014 15:57:58 +0000 Subject: [PATCH] Fix a 20+ year bug by using an appropriate constant for the transition from one asymptotic approximation to another for the zeroth order Bessel and Neumann functions. Reviewed by: bde --- lib/msun/src/e_j0f.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msun/src/e_j0f.c b/lib/msun/src/e_j0f.c index c45faf32590..0a5bec9c133 100644 --- a/lib/msun/src/e_j0f.c +++ b/lib/msun/src/e_j0f.c @@ -62,7 +62,7 @@ __ieee754_j0f(float x) * j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x) * y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x) */ - if(ix>0x80000000) z = (invsqrtpi*cc)/sqrtf(x); + if(ix>0x54000000) z = (invsqrtpi*cc)/sqrtf(x); else { u = pzerof(x); v = qzerof(x); z = invsqrtpi*(u*cc-v*ss)/sqrtf(x); @@ -136,7 +136,7 @@ __ieee754_y0f(float x) if ((s*c)0x80000000) z = (invsqrtpi*ss)/sqrtf(x); + if(ix>0x54800000) z = (invsqrtpi*ss)/sqrtf(x); else { u = pzerof(x); v = qzerof(x); z = invsqrtpi*(u*ss+v*cc)/sqrtf(x);