This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for bz#11589 - jn calculation


On Wednesday, September 14, 2011 17:08:59 Andreas Schwab wrote:
> Andreas Jaeger <aj@suse.de> writes:
> > diff --git a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
> > b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c index 0eea745..372f942 100644
> > --- a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
> > +++ b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
> > @@ -286,7 +286,16 @@ __ieee754_jnl (n, x)
> > 
> >  		    }
> >  		
> >  		}
> >  		
> >  	    }
> > 
> > -	  b = (t * __ieee754_j0l (x) / b);
> > +	  /* j0() and j1() suffer enormous loss of precision at and
> > +	   * near zero; however, we know that their zero points never
> > +	   * coincide, so just choose the one further away from zero.
> > +	   */
> > +	  z = __ieee754_j0l (x);
> > +	  w = __ieee754_j1l (x);
> > +	  if (fabsl (z) >= fabsl (w))
> > +	    b = (t * z / b);
> > +	  else
> > +	    b = (t * w / a);
> > 
> >  	}
> >  	
> >      }
> >    
> >    if (sgn == 1)
> 
> Something's fishy here.  I'm getting huge ulps both on powerpc and s390
> for all the new tests.  For example:
> 
> testing long double (without inline functions)
> Failure: Test: jn (2, 2.4048255576957729) ==
> 0.43175480701968038399746111312430703 Result:
>  is:          4.31754807019680381803e-01   0x1.ba1deea029493e99a8fcp-2
>  should be:   4.31754807019680383997e-01   0x1.ba1deea029493f3b959ep-2
>  difference:  2.19448415868800798091e-18   0x1.43d9447b3c18e0000000p-59
>  ulp       :  356075412601880.8750
>  max.ulp   :  0.0000

Mmh, how large are the ULPs without the change? Is the number not correctly 
calculated to it's last digits?

Andreas
-- 
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]