\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}
\mathbf{if}\;t \le -1.2171229408338382 \cdot 10^{-113}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \le 2.4281698041647806 \cdot 10^{-154}:\\
\;\;\;\;\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(a \cdot 2 + 1\right) \cdot \left(b \cdot t\right)}{16}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}double code(double x, double y, double z, double t, double a, double b) {
return ((double) (((double) (x * ((double) cos(((double) (((double) (((double) (((double) (((double) (y * 2.0)) + 1.0)) * z)) * t)) / 16.0)))))) * ((double) cos(((double) (((double) (((double) (((double) (((double) (a * 2.0)) + 1.0)) * b)) * t)) / 16.0))))));
}
double code(double x, double y, double z, double t, double a, double b) {
double VAR;
if ((t <= -1.2171229408338382e-113)) {
VAR = x;
} else {
double VAR_1;
if ((t <= 2.4281698041647806e-154)) {
VAR_1 = ((double) (((double) (x * ((double) cos(((double) (((double) (((double) (((double) (((double) (y * 2.0)) + 1.0)) * z)) * t)) / 16.0)))))) * ((double) cos(((double) (((double) (((double) (((double) (a * 2.0)) + 1.0)) * ((double) (b * t)))) / 16.0))))));
} else {
VAR_1 = x;
}
VAR = VAR_1;
}
return VAR;
}




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 | 45.9 |
|---|---|
| Target | 44.1 |
| Herbie | 43.9 |
if t < -1.2171229408338382e-113 or 2.4281698041647806e-154 < t Initial program 53.8
Taylor expanded around 0 52.9
Taylor expanded around 0 51.2
if -1.2171229408338382e-113 < t < 2.4281698041647806e-154Initial program 26.0
rmApplied associate-*l*25.3
Final simplification43.9
herbie shell --seed 2020175
(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))))