Average Error: 46.6 → 43.8
Time: 14.6s
Precision: binary64
\[\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}\;\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 5.847335045179351 \cdot 10^{+306}:\\ \;\;\;\;\left(x \cdot \cos \left(\sqrt[3]{0.0625 + \frac{y}{8}} \cdot \left(\left(z \cdot t\right) \cdot \left(\sqrt[3]{0.0625 + \frac{y}{8}} \cdot \sqrt[3]{0.0625 + \frac{y}{8}}\right)\right)\right)\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
\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}\;\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 5.847335045179351 \cdot 10^{+306}:\\
\;\;\;\;\left(x \cdot \cos \left(\sqrt[3]{0.0625 + \frac{y}{8}} \cdot \left(\left(z \cdot t\right) \cdot \left(\sqrt[3]{0.0625 + \frac{y}{8}} \cdot \sqrt[3]{0.0625 + \frac{y}{8}}\right)\right)\right)\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\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
 (if (<=
      (*
       (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
       (cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
      5.847335045179351e+306)
   (*
    (*
     x
     (cos
      (*
       (cbrt (+ 0.0625 (/ y 8.0)))
       (*
        (* z t)
        (* (cbrt (+ 0.0625 (/ y 8.0))) (cbrt (+ 0.0625 (/ y 8.0))))))))
    (cos (* (* t b) (+ 0.0625 (/ a 8.0)))))
   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 tmp;
	if (((x * cos(((((y * 2.0) + 1.0) * z) * t) / 16.0)) * cos((t * ((1.0 + (2.0 * a)) * b)) / 16.0)) <= 5.847335045179351e+306) {
		tmp = (x * cos(cbrt(0.0625 + (y / 8.0)) * ((z * t) * (cbrt(0.0625 + (y / 8.0)) * cbrt(0.0625 + (y / 8.0)))))) * cos((t * b) * (0.0625 + (a / 8.0)));
	} else {
		tmp = x;
	}
	return tmp;
}

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.6
Target44.9
Herbie43.8
\[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. Split input into 2 regimes
  2. 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))) < 5.84733504517935093e306

    1. Initial program 34.1

      \[\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. Simplified34.1

      \[\leadsto \color{blue}{\left(x \cdot \cos \left(\left(z \cdot t\right) \cdot \left(0.0625 + \frac{y}{8}\right)\right)\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt_binary6434.2

      \[\leadsto \left(x \cdot \cos \left(\left(z \cdot t\right) \cdot \color{blue}{\left(\left(\sqrt[3]{0.0625 + \frac{y}{8}} \cdot \sqrt[3]{0.0625 + \frac{y}{8}}\right) \cdot \sqrt[3]{0.0625 + \frac{y}{8}}\right)}\right)\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\]
    5. Applied associate-*r*_binary6434.3

      \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(\left(z \cdot t\right) \cdot \left(\sqrt[3]{0.0625 + \frac{y}{8}} \cdot \sqrt[3]{0.0625 + \frac{y}{8}}\right)\right) \cdot \sqrt[3]{0.0625 + \frac{y}{8}}\right)}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\]
    6. Simplified34.3

      \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(\left(t \cdot z\right) \cdot \left(\sqrt[3]{0.0625 + \frac{y}{8}} \cdot \sqrt[3]{0.0625 + \frac{y}{8}}\right)\right)} \cdot \sqrt[3]{0.0625 + \frac{y}{8}}\right)\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\]

    if 5.84733504517935093e306 < (*.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. Initial program 64.0

      \[\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. Simplified62.8

      \[\leadsto \color{blue}{\left(x \cdot \cos \left(\left(z \cdot t\right) \cdot \left(0.0625 + \frac{y}{8}\right)\right)\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)}\]
    3. Taylor expanded around 0 60.4

      \[\leadsto \left(x \cdot \cos \left(\left(z \cdot t\right) \cdot \left(0.0625 + \frac{y}{8}\right)\right)\right) \cdot \color{blue}{1}\]
    4. Taylor expanded around 0 57.1

      \[\leadsto \color{blue}{x} \cdot 1\]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.8

    \[\leadsto \begin{array}{l} \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 5.847335045179351 \cdot 10^{+306}:\\ \;\;\;\;\left(x \cdot \cos \left(\sqrt[3]{0.0625 + \frac{y}{8}} \cdot \left(\left(z \cdot t\right) \cdot \left(\sqrt[3]{0.0625 + \frac{y}{8}} \cdot \sqrt[3]{0.0625 + \frac{y}{8}}\right)\right)\right)\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]

Reproduce

herbie shell --seed 2020224 
(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))))