Average Error: 46.5 → 44.6
Time: 10.3s
Precision: 64
\[\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\]
\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
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) {
	return x;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original46.5
Target44.8
Herbie44.6
\[x \cdot \cos \left(\frac{b}{16} \cdot \frac{t}{\left(1 - a \cdot 2\right) + {\left(a \cdot 2\right)}^{2}}\right)\]

Derivation

  1. Initial program 46.5

    \[\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)\]
  2. Taylor expanded around 0 45.7

    \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \color{blue}{1}\]
  3. Taylor expanded around 0 44.6

    \[\leadsto \color{blue}{x} \cdot 1\]
  4. Final simplification44.6

    \[\leadsto x\]

Reproduce

herbie shell --seed 2020120 
(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) (/ t (+ (- 1 (* a 2)) (pow (* a 2) 2))))))

  (* (* x (cos (/ (* (* (+ (* y 2) 1) z) t) 16))) (cos (/ (* (* (+ (* a 2) 1) b) t) 16))))