Date: Wed, 27 Sep 2023 10:57:01 +0200 From: Paul Zimmermann <Paul.Zimmermann@inria.fr> To: Alexander Leidinger <Alexander@Leidinger.net> Cc: sgk@troutmask.apl.washington.edu, freebsd-hackers@freebsd.org Subject: Re: Accuracy of Mathematical Functions Message-ID: <p9u07cocdmea.fsf@coriandre.loria.fr> In-Reply-To: <8849166a6a2deb6ebc1f307d6e8a66a9@Leidinger.net> (message from Alexander Leidinger on Wed, 27 Sep 2023 10:32:18 %2B0200) References: <p9u0h6ni1hwy.fsf@coriandre.loria.fr> <1395eeabc6d404997f6a09a7b39d3da5@Leidinger.net> <ZRMeBEZxce0xcA4U@troutmask.apl.washington.edu> <8849166a6a2deb6ebc1f307d6e8a66a9@Leidinger.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Alexander,
> A thought just crossed my mind... should we consider to provide two ABI
> compatible math libs, one fast (and "acceptable accurate"... whatever
> this means), and one accurate (and this one being the default to link
> against)? Users then could use libmap.conf(5) to use the one according
> to their needs.
this is not the same idea, but the new C standard allows to have two
functions exp and cr_exp:
See https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf, page 454,
item 4:
Function names that begin with cr_ are potentially reserved identifiers and
may be added to the <math.h> header. The cr_ prefix is intended to indicate
a correctly rounded version of the function.
Having both under the same name, and having a runtime dispatcher that chooses
either the fast version or the correctly rounded version, is a nice idea!
Paul
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p9u07cocdmea.fsf>
