# Does the IEEE-754 standard mandate that exp2 is rounded correctly?

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?

• So it's the difference between "(recommended correctly rounded) functions" and "recommended (correctly rounded functions)", right? Nov 17, 2017 at 19:02
• @Kirill yes, exactly. Nov 18, 2017 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.