This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: acos / asin accuracy
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Henri Verbeet" <hverbeet at gmail dot com>
- Cc: libc-help at sourceware dot org
- Date: Sun, 21 Sep 2008 12:35:55 -0400
- Subject: Re: acos / asin accuracy
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=3SpBzhJHCAAuvAqqRyrql00nEoziU9rknHFvK4Q0X/w=; b=gqbYtaTPQ17WC42sTTutPr/u39VO8hVCGaHosboIpppXAZlFjyvyej6XWaXcljqDM2 9kEoOLNNnYvDXN+GPcGJgxDP5+Q164xloWaq8rTtLDpfZ1n5oA9TiZV/nDPpufWGhJRp 2RLaC25cRN/8dGHxM0Y/L2xE+Uscqli2npEyQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=JtZhCAd88t6u7iy75sq3zwCDUw0/dk43eNK4+3u2ysuJPLbaDsAgajOzZqvLZKvslE KotMP/DCZbszmftQ35Hb8DEItL0+tVeTj+VYSviG+vsvuB+s3TaJGvf5PGmiDJGPDDWw AIe/cofUW6Y3Xh75X+WZ6AA7/GjET5WX6yYpg=
- References: <d658b69e0809210804t75951f79qc6d258f9f662916b@mail.gmail.com>
On Sun, Sep 21, 2008 at 11:04 AM, Henri Verbeet <hverbeet@gmail.com> wrote:
> Acos and asin in sysdeps/i386/fpu are implemented as "atan2(sqrt(1 -
> x*x), x)" and "atan2(x, sqrt(1 - x*x))"
> (http://sources.redhat.com/git/?p=glibc.git;a=blob_plain;f=sysdeps/i386/fpu/e_acos.S;hb=HEAD
> and http://sources.redhat.com/git/?p=glibc.git;a=blob_plain;f=sysdeps/i386/fpu/e_asin.S;hb=HEAD).
> The expression "1-x*x" is bad for accuracy, especially for values of x
> close to -1 or 1 (x*x introduces rounding error, subtracting from 1
> cancels most of the remaining significant digits out). Obviously the
> problem is worse when using single precision. A much better way would
> be to use (1-x)*(1+x) instead.
Do you have a patch, with before and after results, including the
results of running the glibc math testsuite?
> I would have filed a bug in bugzilla for this, but it appears bugzilla
> doesn't send the confirmation mails for new accounts (as other people
> already noted).
I have just registered without any problems. Please email
sourcemaster@sourceware.org if you are having problems. If you don't
get a response please tell me.
Cheers,
Carlos.