Skip to content

Commit

Permalink
fix polynomial_4, make test thresholds tighter
Browse files Browse the repository at this point in the history
  • Loading branch information
fu5ha committed Aug 21, 2020
1 parent 2ea0bea commit 41319b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/f32x4_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,5 +810,5 @@ impl f32x4 {
fn polynomial_4(x: f32x4, c0: f32x4, c1: f32x4, c2: f32x4, c3: f32x4, c4: f32x4) -> f32x4 {
let x2 = x * x;
let x4 = x2 * x2;
c3.mul_add(x, x2).mul_add(x2, c1.mul_add(x, c0) + c4 * x4)
c3.mul_add(x, c2).mul_add(x2, c1.mul_add(x, c0) + c4 * x4)
}
6 changes: 3 additions & 3 deletions tests/t_f32x4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ fn impl_f32x4_asin_acos() {
let actual_arr: [f32; 4] = cast(vals);
let actual = actual_arr[i];
assert!(
(actual - expected).abs() < 0.0003,
(actual - expected).abs() < 0.0000006,
"Wanted {name}({orig}) to be {expected} but got {actual}",
name = name,
orig = orig,
Expand All @@ -335,7 +335,7 @@ fn impl_f32x4_asin() {
let actual_arr: [f32; 4] = cast(vals);
let actual = actual_arr[i];
assert!(
(actual - expected).abs() < 0.0003,
(actual - expected).abs() < 0.0000006,
"Wanted {name}({orig}) to be {expected} but got {actual}",
name = name,
orig = orig,
Expand All @@ -361,7 +361,7 @@ fn impl_f32x4_acos() {
let actual_arr: [f32; 4] = cast(vals);
let actual = actual_arr[i];
assert!(
(actual - expected).abs() < 0.0003,
(actual - expected).abs() < 0.0000006,
"Wanted {name}({orig}) to be {expected} but got {actual}",
name = name,
orig = orig,
Expand Down
6 changes: 3 additions & 3 deletions tests/t_f64x2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ fn impl_f64x2_asin_acos() {
let actual_arr: [f64; 2] = cast(vals);
let actual = actual_arr[i];
assert!(
(actual - expected).abs() < 0.0003,
(actual - expected).abs() < 0.000000000000001,
"Wanted {name}({orig}) to be {expected} but got {actual}",
name = name,
orig = orig,
Expand All @@ -379,7 +379,7 @@ fn impl_f64x2_asin() {
let actual_arr: [f64; 2] = cast(vals);
let actual = actual_arr[i];
assert!(
(actual - expected).abs() < 0.0003,
(actual - expected).abs() < 0.000000000000001,
"Wanted {name}({orig}) to be {expected} but got {actual}",
name = name,
orig = orig,
Expand All @@ -405,7 +405,7 @@ fn impl_f64x2_acos() {
let actual_arr: [f64; 2] = cast(vals);
let actual = actual_arr[i];
assert!(
(actual - expected).abs() < 0.0003,
(actual - expected).abs() < 0.000000000000001,
"Wanted {name}({orig}) to be {expected} but got {actual}",
name = name,
orig = orig,
Expand Down

0 comments on commit 41319b7

Please sign in to comment.