Average Error: 46.3 → 43.9
Time: 19.3s
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 1.1354578312648109 \cdot 10^{+278}:\\ \;\;\;\;x \cdot \sqrt[3]{{\left(\cos \left(t \cdot \left(\left(1 + 2 \cdot a\right) \cdot \frac{b}{16}\right)\right)\right)}^{3}}\\ \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 1.1354578312648109 \cdot 10^{+278}:\\
\;\;\;\;x \cdot \sqrt[3]{{\left(\cos \left(t \cdot \left(\left(1 + 2 \cdot a\right) \cdot \frac{b}{16}\right)\right)\right)}^{3}}\\

\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) (y * 2.0)) + 1.0)) * z)) * t)) / 16.0))))) * ((double) cos((((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 ((((double) (((double) (x * ((double) cos((((double) (((double) (((double) (((double) (y * 2.0)) + 1.0)) * z)) * t)) / 16.0))))) * ((double) cos((((double) (t * ((double) (((double) (1.0 + ((double) (2.0 * a)))) * b)))) / 16.0))))) <= 1.1354578312648109e+278)) {
		VAR = ((double) (x * ((double) cbrt(((double) pow(((double) cos(((double) (t * ((double) (((double) (1.0 + ((double) (2.0 * a)))) * (b / 16.0))))))), 3.0))))));
	} else {
		VAR = x;
	}
	return VAR;
}

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.3
Target44.5
Herbie43.9
\[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 (* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0))) (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))) < 1.13545783126481091e278

    1. Initial program Error: 33.7 bits

      \[\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. SimplifiedError: 33.8 bits

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(t \cdot \left(\left(1 + 2 \cdot a\right) \cdot \frac{b}{16}\right)\right)\right)\]
    4. Using strategy rm
    5. Applied add-cbrt-cubeError: 34.5 bits

      \[\leadsto x \cdot \left(1 \cdot \color{blue}{\sqrt[3]{\left(\cos \left(t \cdot \left(\left(1 + 2 \cdot a\right) \cdot \frac{b}{16}\right)\right) \cdot \cos \left(t \cdot \left(\left(1 + 2 \cdot a\right) \cdot \frac{b}{16}\right)\right)\right) \cdot \cos \left(t \cdot \left(\left(1 + 2 \cdot a\right) \cdot \frac{b}{16}\right)\right)}}\right)\]
    6. SimplifiedError: 34.5 bits

      \[\leadsto x \cdot \left(1 \cdot \sqrt[3]{\color{blue}{{\left(\cos \left(t \cdot \left(\left(1 + 2 \cdot a\right) \cdot \frac{b}{16}\right)\right)\right)}^{3}}}\right)\]

    if 1.13545783126481091e278 < (* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0))) (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0)))

    1. Initial program Error: 63.0 bits

      \[\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. SimplifiedError: 62.4 bits

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(t \cdot \left(\left(1 + 2 \cdot a\right) \cdot \frac{b}{16}\right)\right)\right)\]
    4. Taylor expanded around 0 Error: 56.4 bits

      \[\leadsto \color{blue}{x}\]
  3. Recombined 2 regimes into one program.
  4. Final simplificationError: 43.9 bits

    \[\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 1.1354578312648109 \cdot 10^{+278}:\\ \;\;\;\;x \cdot \sqrt[3]{{\left(\cos \left(t \cdot \left(\left(1 + 2 \cdot a\right) \cdot \frac{b}{16}\right)\right)\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]

Reproduce

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