\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)
\begin{array}{l}
t_1 := \sqrt[3]{\cos \left(t \cdot \left(b \cdot \mathsf{fma}\left(0.125, a, 0.0625\right)\right)\right)}\\
\mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{t \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right) \leq 1.548353763553088 \cdot 10^{+307}:\\
\;\;\;\;\left(\left(x \cdot \cos \left(0.0625 \cdot \left(z \cdot t\right)\right)\right) \cdot \left(t_1 \cdot t_1\right)\right) \cdot \sqrt[3]{\cos \left(\left(t \cdot b\right) \cdot \mathsf{fma}\left(a, 0.125, 0.0625\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
(FPCore (x y z t a b) :precision binary64 (* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0))) (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))))
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (cbrt (cos (* t (* b (fma 0.125 a 0.0625)))))))
(if (<=
(*
(* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
(cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
1.548353763553088e+307)
(*
(* (* x (cos (* 0.0625 (* z t)))) (* t_1 t_1))
(cbrt (cos (* (* t b) (fma a 0.125 0.0625)))))
x)))double code(double x, double y, double z, double t, double a, double b) {
return (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0));
}
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = cbrt(cos((t * (b * fma(0.125, a, 0.0625)))));
double tmp;
if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 1.548353763553088e+307) {
tmp = ((x * cos((0.0625 * (z * t)))) * (t_1 * t_1)) * cbrt(cos(((t * b) * fma(a, 0.125, 0.0625))));
} else {
tmp = x;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
| Original | 46.3 |
|---|---|
| Target | 44.4 |
| Herbie | 43.6 |
if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 1.5483537635530879e307Initial program 33.9
Simplified33.8
Taylor expanded in y around 0 34.2
Applied add-cube-cbrt_binary6434.2
Applied associate-*r*_binary6434.2
Simplified34.2
if 1.5483537635530879e307 < (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) Initial program 64.0
Simplified62.6
Taylor expanded in y around 0 61.6
Taylor expanded in t around 0 57.0
Final simplification43.6
herbie shell --seed 2022125
(FPCore (x y z t a b)
:name "Codec.Picture.Jpg.FastDct:referenceDct from JuicyPixels-3.2.6.1"
:precision binary64
:herbie-target
(* x (cos (* (/ b 16.0) (/ t (+ (- 1.0 (* a 2.0)) (pow (* a 2.0) 2.0))))))
(* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0))) (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))))