The IEEE Standard for Floating-Point Arithmetic section "9.2 Recommended correctly rounded functions" lists functions that are recommended (but not required) by a language standard to provide, among them an exp2 function as a particular example.

If a language provides exp2, does the standard require it to be correctly rounded?

As a particular example, I took the exp2 function from the openlibm library, and found it to be correctly rounded in 99.96% of cases. However, in the rest of the cases (e.g., 37 cases from 100,000), it produced an answer that was off by 1 ulp. It's obviously very accurate, but it nevertheless was not correctly rounded in those 37 cases. Does this mean that the exp2 function in openlibm is not IEEE-754 compliant?

  • 4
    $\begingroup$ So it's the difference between "(recommended correctly rounded) functions" and "recommended (correctly rounded functions)", right? $\endgroup$ – Kirill Nov 17 '17 at 19:02
  • $\begingroup$ @Kirill yes, exactly. $\endgroup$ – Ondřej Čertík Nov 18 '17 at 20:16

According to [1]: "However, the IEEE-754 standard specifies nothing for elementary functions" and "Indeed, the mathematical libraries (libm) provided by operating systems do not guarantee correct rounding.". As such, according to [1], the answer is that the IEEE-754 standard does not require the exp2 function to be correctly rounded, it only recommends it.

[1] de Dinechin, F., Ershov, A. V., & Gast, N. (2005). Towards the Post-Ultimate libm. In 17th IEEE Symposium on Computer Arithmetic (ARITH’05) (pp. 288–295). IEEE. http://doi.org/10.1109/ARITH.2005.46

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.