Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Jun 2004 01:50:22 -0700 (PDT)
From:      David Schultz <das@FreeBSD.ORG>
To:        freebsd-i386@FreeBSD.org
Subject:   Re: i386/67469: src/lib/msun/i387/s_tan.S gives incorrect results for large inputs
Message-ID:  <200406020850.i528oMFI099203@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR i386/67469; it has been noted by GNATS.

From: David Schultz <das@FreeBSD.ORG>
To: Bruce Evans <bde@zeta.org.au>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG, freebsd-i386@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...



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