i386/67469: src/lib/msun/i387/s_tan.S gives incorrect results for large inputs

David Schultz das at FreeBSD.ORG
Wed Jun 2 01:50:22 PDT 2004


The following reply was made to PR i386/67469; it has been noted by GNATS.

From: David Schultz <das at FreeBSD.ORG>
To: Bruce Evans <bde at zeta.org.au>
Cc: FreeBSD-gnats-submit at FreeBSD.ORG, freebsd-i386 at FreeBSD.ORG
Subject: Re: i386/67469: src/lib/msun/i387/s_tan.S gives incorrect results for large inputs
Date: Wed, 2 Jun 2004 01:43:13 -0700

 On Wed, Jun 02, 2004, Bruce Evans wrote:
 > > >Fix:
 > > One solution might involve doing the reduction using
 > > __ieee754_rem_pio4() instead of the fprem1 instruction.
 > > Unfortunately, since this uses pi/2 as the modulus, it
 > > is necessary to apply the identity tan(x + pi/2) = -1/tan(x)
 > > for odd-phase inputs.  I tried this for the first example
 > > input above and got an answer that was off by 2 ulps.  Close,
 > > but the MI implementation gets within 1 ulp.  I'm not sure what
 > > kind of correction (if any) should be used here.
 > 
 > I think the complete fdlibm version of tan(), sin() and cos() should
 > be used for large args.  "large" could be classified by failure of the
 > first fptan.  Or just return the TLOSS error for very large args.
 
 I was hoping it could be fixed without the bloat, but your
 solution is clean and easy to implement...


More information about the freebsd-i386 mailing list