Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Nov 2010 11:41:35 +0100
From:      Ulrich =?utf-8?B?U3DDtnJsZWlu?= <uqs@spoerlein.net>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/144306: [libm] [patch] Nasty bug in jn(3)
Message-ID:  <20101113104135.GN85693@acme.spoerlein.net>
In-Reply-To: <20101111001705.Q1801@besplex.bde.org>
References:  <201011092010.oA9KABNt076837@freefall.freebsd.org> <20101110225059.M1461@besplex.bde.org> <20101111001705.Q1801@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101113104135.GN85693>