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

Ulrich Spörlein uqs at spoerlein.net
Sat Nov 13 10:41:38 UTC 2010


On Thu, 11.11.2010 at 00:20:55 +1100, Bruce Evans wrote:
> 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;
> %

Thanks for the detailed analysis and the bugfix. I installed pari and
compared the results. I'll commit this shortly ...

Uli


More information about the freebsd-bugs mailing list