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:43:20 PDT 2004


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