Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 23 Feb 2019 10:08:58 -0500
From: Rich Felker <>
Cc: Shane Seelig <>
Subject: Re: x87 asin and acos

On Sat, Feb 23, 2019 at 09:21:08AM -0500, Shane Seelig wrote:
> Currently 'asin' uses the algorithm:
> 	arcsin(x) == arctan(x/(sqrt((1-x)(1+x))))
> If the following algorithm were to be used instead, an 'fadd' could be
> removed.
> 	arcsin(x) == arctan(x/(sqrt(1-x**2)))

They don't seem to be numerically equal. For example, if x is smaller
than sqrt(LDBL_EPSILON/2), 1-x**2 is 1, but (1-x)*(1+x) is not. I
don't recall the process of writing the function in detail, but I'm
pretty sure this matters to the result, especially since sqrt then
expands the magnitude of the error.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.