Frequently Asked Questions about CORE-MATH
- Q1: Why not provide a full library?
The long-term goal of CORE-MATH is to ensure that correctly rounded
functions are available to the end-user.
We believe that collaborating with existing largely used libraries
(instead of competing with them by creating yet another library) is the
best way to reach that goal.
- Q2: Why not provide separate functions for different rounding modes
(exp_rn, exp_rz, ...) like CRlibm?
The philosophy of the IEEE 754 bindings in the C language is to use the
fesetround function to control rounding. This is how it already
works for the sqrt function, see this sample
file.
- Q3: Shouldn't the mathematical functions be correctly rounded
according to IEEE 754?
The IEEE 754 standard indeed recommends to have a correctly-rounded sine
function (for example). But it does not say that this function should be called sin.
In fact, IEEE 754 does not say anything about the names of the
functions it defines in the different programming languages. Those names are
defined by the respective language bindings. For the C language,
the language bindings are defined by the
C standard, more precisely in Annex F (IEC 60559 floating-point
arithmetic), where IEC 60559 is the direct translation of
IEEE 754. In Annex F, there is one table entitled Operation binding
which gives the correspondence between some IEEE 754 functions
and the corresponding names in the C
language. For this table, correct rounding is required. There is another
table later on, which contains the mathematical functions, for which it is
explicitly said Correct rounding, which IEC specifies for its operations,
is not required for the C functions in the table (cf page 444 of
N2596.pdf).
This is the reason why current libraries are not correctly rounded,
see Accuracy of Mathematical Functions in Single, Double, Double Extended, and Quadruple Precision.
However, N2596.pdf has reserved names cr_exp, cr_sin, cr_pow, ...
for correctly rounded functions, see page 392.