Minor tweaks: parallel lookup & FloatOrd impl

This commit is contained in:
Cian Hughes
2023-11-13 14:02:17 +00:00
parent a9b671986e
commit 1793be1439
17 changed files with 569 additions and 206 deletions
+3 -4
View File
@@ -13,11 +13,10 @@ pub mod exact {
}
include!("../src/tests/accuracy/x.rs");
#[inline]
fn dev_cos(x: f64) -> f64 {
const ONE: f64 = 1.0;
let v = ((((x + f64_consts::PI).abs()) % f64_consts::TAU) - f64_consts::PI).abs();
let qpprox = ONE - f64_consts::FRAC_2_PI * v;
qpprox + f64_consts::FRAC_PI_6 * qpprox * (ONE - qpprox * qpprox)
let qpprox = 1.0 - f64_consts::FRAC_2_PI * (((x + f64_consts::PI) % f64_consts::TAU) - f64_consts::PI).abs();
(qpprox * (1.0 + f64_consts::FRAC_PI_6)) - (qpprox.powi(3) * f64_consts::FRAC_PI_6)
}
fn devbench(group: &mut BenchmarkGroup<WallTime>) {