mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Accuracy of Mathematical Functions in Single, Double, and Quadruple Precision
@ 2020-12-04 16:37 Paul Zimmermann
  2020-12-04 17:21 ` Szabolcs Nagy
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Zimmermann @ 2020-12-04 16:37 UTC (permalink / raw)
  To: musl

       Hi,

I have published a new version of my note, including results for double and
quadruple precision, and also for bivariate functions (atan2, hypot, pow):

https://homepages.loria.fr/PZimmermann/papers/#accuracy

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.

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

Best regards,
Paul Zimmermann

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [musl] Accuracy of Mathematical Functions in Single, Double, and Quadruple Precision
  2020-12-04 16:37 [musl] Accuracy of Mathematical Functions in Single, Double, and Quadruple Precision Paul Zimmermann
@ 2020-12-04 17:21 ` Szabolcs Nagy
  0 siblings, 0 replies; 2+ messages in thread
From: Szabolcs Nagy @ 2020-12-04 17:21 UTC (permalink / raw)
  To: Paul Zimmermann; +Cc: musl

* Paul Zimmermann <Paul.Zimmermann@inria.fr> [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):
> 
> https://homepages.loria.fr/PZimmermann/papers/#accuracy
> 
> 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.

ok.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-04 17:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 16:37 [musl] Accuracy of Mathematical Functions in Single, Double, and Quadruple Precision Paul Zimmermann
2020-12-04 17:21 ` Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).