Skip to content

Commit 0416cf4

Browse files
committed
remove canonicalization
1 parent 9322bbd commit 0416cf4

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

libm/src/math/generic/fmaximum.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ use crate::support::Float;
1313

1414
#[inline]
1515
pub fn fmaximum<F: Float>(x: F, y: F) -> F {
16-
let res = if x.is_nan() {
16+
if x.is_nan() {
1717
x
1818
} else if y.is_nan() {
1919
y
2020
} else if x > y || (y.biteq(F::NEG_ZERO) && x.is_sign_positive()) {
2121
x
2222
} else {
2323
y
24-
};
25-
26-
// Canonicalize
27-
res * F::ONE
24+
}
2825
}

libm/src/math/generic/fmaximum_num.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@ use crate::support::Float;
1515

1616
#[inline]
1717
pub fn fmaximum_num<F: Float>(x: F, y: F) -> F {
18-
let res = if x > y || y.is_nan() {
18+
if x > y || y.is_nan() {
1919
x
2020
} else if y > x || x.is_nan() {
2121
y
2222
} else if x.is_sign_positive() {
2323
x
2424
} else {
2525
y
26-
};
27-
28-
// Canonicalize
29-
res * F::ONE
26+
}
3027
}

libm/src/math/generic/fminimum.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ use crate::support::Float;
1313

1414
#[inline]
1515
pub fn fminimum<F: Float>(x: F, y: F) -> F {
16-
let res = if x.is_nan() {
16+
if x.is_nan() {
1717
x
1818
} else if y.is_nan() {
1919
y
2020
} else if x < y || (x.biteq(F::NEG_ZERO) && y.is_sign_positive()) {
2121
x
2222
} else {
2323
y
24-
};
25-
26-
// Canonicalize
27-
res * F::ONE
24+
}
2825
}

libm/src/math/generic/fminimum_num.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@ use crate::support::Float;
1515

1616
#[inline]
1717
pub fn fminimum_num<F: Float>(x: F, y: F) -> F {
18-
let res = if x > y || x.is_nan() {
18+
if x > y || x.is_nan() {
1919
y
2020
} else if y > x || y.is_nan() {
2121
x
2222
} else if x.is_sign_positive() {
2323
y
2424
} else {
2525
x
26-
};
27-
28-
// Canonicalize
29-
res * F::ONE
26+
}
3027
}

0 commit comments

Comments
 (0)