From owner-freebsd-i386@FreeBSD.ORG Wed Jun 2 01:50:22 2004 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 602E516A4CE for ; Wed, 2 Jun 2004 01:50:22 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 57B1443D31 for ; Wed, 2 Jun 2004 01:50:22 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i528oMvs099204 for ; Wed, 2 Jun 2004 01:50:22 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i528oMFI099203; Wed, 2 Jun 2004 01:50:22 -0700 (PDT) (envelope-from gnats) Date: Wed, 2 Jun 2004 01:50:22 -0700 (PDT) Message-Id: <200406020850.i528oMFI099203@freefall.freebsd.org> To: freebsd-i386@FreeBSD.org From: David Schultz Subject: Re: i386/67469: src/lib/msun/i387/s_tan.S gives incorrect results for large inputs X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: David Schultz List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2004 08:50:22 -0000 The following reply was made to PR i386/67469; it has been noted by GNATS. From: David Schultz To: Bruce Evans 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...