Skip to content

Commit 45bec81

Browse files
tgross35quaternic
andcommitted
Update libm/src/math/arch/i586.rs
Co-authored-by: Juho Kahala <[email protected]>
1 parent 068ee69 commit 45bec81

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libm/src/math/arch/i586.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ pub fn floor(mut x: f64) -> f64 {
6060
}
6161
x
6262
}
63-
63+
/// Implements the exponential functions with `x87` assembly. This relies on
64+
/// the instruction `f2xm1`, which computes `2^x - 1` (for |x| < 1). This
65+
/// transcendental instruction is documented to produce results with error
66+
/// below 1ulp (in the native double-extended precision format).
67+
/// This translates to correctly rounded results for f32, but results
68+
/// in f64 may have 1ulp error, which may depend on the hardware.
6469
macro_rules! x87exp {
6570
($float_ty:ident, $word_size:literal, $fn_name:ident, $load_op:literal) => {
6671
pub fn $fn_name(mut x: $float_ty) -> $float_ty { unsafe {

0 commit comments

Comments
 (0)