Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 4 Dec 2020 18:21:12 +0100
From: Szabolcs Nagy <>
To: Paul Zimmermann <>
Subject: Re: Accuracy of Mathematical Functions in Single, Double, and
 Quadruple Precision

* Paul Zimmermann <> [2020-12-04 17:37:59 +0100]:
> I have published a new version of my note, including results for double and
> quadruple precision, and also for bivariate functions (atan2, hypot, pow):
> With Musl 1.2.1, the largest error I found in double precision is 14 ulps,
> except for the Bessel functions and the lgamma function.

bessel functions and lgamma have large errors at least near zeros,
and those would be hard to fix and i don't think we care enough to
work on them, (but patches are welcome). the generalized bessel
functions are also a denial of service attack vector (unlikely to
be relevant in practice, but that's a more significant issue than
the accuracy at zeros, all other math functions are real-time robust:
worst-case computation latency is reasonably bounded, although trig
arg reduction code could be improved in this area).

tgamma was known to have >5 ulp errors, the code was mainly optimized
to be small and simple.

exp10 has a simple naive implementation, 4 ulp is not surprising there,
we can fix this if needed (but it's a non-standard function).

erfc is good old fdlibm code, 3 ulp is ok, but i think it can be
fixed if split into more intervals (and likely made faster too if
the divisions are avoided and only polynomial approximation is used).

the rest is < 3 ulp error and the most important functions are < 1 ulp
which looks reasonable to me.

> If something changes in future versions, please tell me so that I can revise
> my note.


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.