mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] correctly rounded mathematical functions
@ 2022-01-03 13:07 Paul Zimmermann
  2022-01-04  0:04 ` Damian McGuckin
  2022-01-04  2:29 ` Rich Felker
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Zimmermann @ 2022-01-03 13:07 UTC (permalink / raw)
  To: musl; +Cc: sibid, christoph.lauter, Jean-Michel.Muller

      Dear Musl developers,

the current C working draft [1, p392] has reserved names for correctly
rounded functions (cr_exp, cr_log, cr_sin, ...).

We propose to provide such correctly rounded implementations
for the three IEEE formats (binary32, binary64, binary128) and the
"extended double" format (long double on x86_64).

These implementations will be correctly rounded for all rounding modes,
for example one could do the following to emulate interval arithmetic:

   fesetround (FE_DOWNWARD);
   y_lo = cr_exp (x_lo);
   fesetround (FE_UPWARD);
   y_hi = cr_exp (x_hi);

Users who want a fast implementation will call the exp/log/sin/... functions,
users who want a correctly rounded function and thus reproducible results
(whatever the hardware, compiler or operating system) will use the
cr_exp/cr_log/cr_sin/... functions. Our goal is nevertheless to get the
best performance possible.

Our objective is to provide open-source implementations that can be integrated
in the major mathematical libraries (GNU libc, Intel Math Library, AMD Libm,
Redhat Newlib, OpenLibm, Musl, llvm-libc, CUDA, ROCm).

Are developers of Musl interested by such functions?
If so, we could discuss what would be the requirements for integration in
Musl in terms of license, table size, allowed operations.

We have started to work on two functions (cbrt and acos), for which we
provide presumably correctly rounded implementations (up to the knowledge
of hard-to-round cases) [2].

Christoph Lauter
Jean-Michel Muller
Alexei Sibidanov
Paul Zimmermann


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

end of thread, other threads:[~2022-01-06  8:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 13:07 [musl] correctly rounded mathematical functions Paul Zimmermann
2022-01-04  0:04 ` Damian McGuckin
2022-01-04  2:29 ` Rich Felker
2022-01-04 14:19   ` Paul Zimmermann
2022-01-04 21:12     ` Szabolcs Nagy
2022-01-06  8:55       ` Paul Zimmermann

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

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).