FWIW the implementation of the special functions in the math library are implemented in Typed Racket.
It ought to be straight-forward to convert them to Scheme.

https://github.com/racket/math/tree/master/math-lib/math/private/functions

For Schemers, the notation 

    (x . fl<= . 3.0)

might be new. The reader turns the double-dot notation into

   (fl<- x 3.0).

The notation was an experiment - I believe the consensus now is that the experiment failed.

Neil Toronto and Jay McCarthy wrote a nice paper based on the experience.

    Practically Accurate Floating-Point Math. 
    https://www.cs.umd.edu/~ntoronto/papers/toronto-2014cise-floating-point.pdf

/Jens Axel



Den tors. 14. mar. 2024 kl. 21.26 skrev Pierpaolo Bernardi <xxxxxx@gmail.com>:
On Thu, Mar 14, 2024 at 1:55 PM Lassi Kortela <xxxxxx@lassi.io> wrote:
>
> The following essay is not well known but it seems well argued.
>
> Statistical Shortcomings in Standard Math Libraries (And How To Fix
> Them) --
> https://www.evanmiller.org/statistical-shortcomings-in-standard-math-libraries.html

Interesting read. Thank you.

Racket's math library has been designed by a statistician, IIRC, and
these functions are included (and much much more)
Should be even easier to port to scheme than C.


--
--
Jens Axel Søgaard