bin/144306: [libm] [patch] Nasty bug in jn(3)

Bruce Evans brde at optusnet.com.au
Wed Nov 10 13:21:01 UTC 2010


On Wed, 10 Nov 2010, Bruce Evans wrote:

> [...unrelated]

Just noticed a minor bug in the float version: from the PR:

%  diff --git a/lib/msun/src/e_jnf.c b/lib/msun/src/e_jnf.c
%  index 3bbf7b7..d045bb05 100644
%  --- a/lib/msun/src/e_jnf.c
%  +++ b/lib/msun/src/e_jnf.c
%  @@ -152,7 +152,12 @@ __ieee754_jnf(int n, float x)
%   			}
%   	     	    }
%   		}
%  -	    	b = (t*__ieee754_j0f(x)/b);
%  +		z = __ieee754_j0f(x);
%  +		w = __ieee754_j1f(x);
%  +		if (fabs(z) >= fabs(w))

This should use fabsf().

%  +		    b = (t*z/b);
%  +		else
%  +		    b = (t*w/a);
%   	    }
%   	}
%   	if(sgn==1) return -b; else return b;
%

Bruce


More information about the freebsd-bugs mailing list