\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)x \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + a \cdot 0.125\right)\right)
(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 (* x (cos (* (* t b) (+ 0.0625 (* a 0.125))))))
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) {
return x * cos((t * b) * (0.0625 + (a * 0.125)));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 46.9 |
|---|---|
| Target | 45.1 |
| Herbie | 45.8 |
Initial program 46.9
Simplified46.3
Taylor expanded around 0 45.8
Final simplification45.8
herbie shell --seed 2021118
(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))))