Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Jun 2004 01:43:13 -0700
From:      David Schultz <das@FreeBSD.ORG>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        freebsd-i386@FreeBSD.ORG
Subject:   Re: i386/67469: src/lib/msun/i387/s_tan.S gives incorrect results for large inputs
Message-ID:  <20040602084313.GA6912@VARK.homeunix.com>
In-Reply-To: <20040602172105.T23521@gamplex.bde.org>
References:  <200406012251.i51MpkkU024224@VARK.homeunix.com> <20040602172105.T23521@gamplex.bde.org>

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