Codec.Picture.Jpg.FastDct:referenceDct from JuicyPixels-3.2.6.1

?

Percentage Accurate: 27.6% → 32.0%
Time: 23.4s
Precision: binary64
Cost: 61764

?

\[\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} t_1 := \left(z \cdot t\right) \cdot 0.0625\\ t_2 := \left(z \cdot t\right) \cdot \left(y \cdot 0.125\right)\\ \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 \cdot 10^{+263}:\\ \;\;\;\;x \cdot \left(\log \left(e^{\cos t_1 \cdot \cos t_2 - \sin t_1 \cdot \sin t_2}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\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
 (let* ((t_1 (* (* z t) 0.0625)) (t_2 (* (* z t) (* y 0.125))))
   (if (<=
        (*
         (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
         (cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
        5e+263)
     (*
      x
      (*
       (log (exp (- (* (cos t_1) (cos t_2)) (* (sin t_1) (sin t_2)))))
       (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 t_1 = (z * t) * 0.0625;
	double t_2 = (z * t) * (y * 0.125);
	double tmp;
	if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 5e+263) {
		tmp = x * (log(exp(((cos(t_1) * cos(t_2)) - (sin(t_1) * sin(t_2))))) * cos(((t * b) * (0.0625 + (a / 8.0)))));
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = (x * cos((((((y * 2.0d0) + 1.0d0) * z) * t) / 16.0d0))) * cos((((((a * 2.0d0) + 1.0d0) * b) * t) / 16.0d0))
end function
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (z * t) * 0.0625d0
    t_2 = (z * t) * (y * 0.125d0)
    if (((x * cos((((((y * 2.0d0) + 1.0d0) * z) * t) / 16.0d0))) * cos(((t * ((1.0d0 + (2.0d0 * a)) * b)) / 16.0d0))) <= 5d+263) then
        tmp = x * (log(exp(((cos(t_1) * cos(t_2)) - (sin(t_1) * sin(t_2))))) * cos(((t * b) * (0.0625d0 + (a / 8.0d0)))))
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (x * Math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * Math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0));
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z * t) * 0.0625;
	double t_2 = (z * t) * (y * 0.125);
	double tmp;
	if (((x * Math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * Math.cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 5e+263) {
		tmp = x * (Math.log(Math.exp(((Math.cos(t_1) * Math.cos(t_2)) - (Math.sin(t_1) * Math.sin(t_2))))) * Math.cos(((t * b) * (0.0625 + (a / 8.0)))));
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	return (x * math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))
def code(x, y, z, t, a, b):
	t_1 = (z * t) * 0.0625
	t_2 = (z * t) * (y * 0.125)
	tmp = 0
	if ((x * math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * math.cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 5e+263:
		tmp = x * (math.log(math.exp(((math.cos(t_1) * math.cos(t_2)) - (math.sin(t_1) * math.sin(t_2))))) * math.cos(((t * b) * (0.0625 + (a / 8.0)))))
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	return Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(Float64(Float64(Float64(a * 2.0) + 1.0) * b) * t) / 16.0)))
end
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z * t) * 0.0625)
	t_2 = Float64(Float64(z * t) * Float64(y * 0.125))
	tmp = 0.0
	if (Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(t * Float64(Float64(1.0 + Float64(2.0 * a)) * b)) / 16.0))) <= 5e+263)
		tmp = Float64(x * Float64(log(exp(Float64(Float64(cos(t_1) * cos(t_2)) - Float64(sin(t_1) * sin(t_2))))) * cos(Float64(Float64(t * b) * Float64(0.0625 + Float64(a / 8.0))))));
	else
		tmp = x;
	end
	return tmp
end
function tmp = code(x, y, z, t, a, b)
	tmp = (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0));
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z * t) * 0.0625;
	t_2 = (z * t) * (y * 0.125);
	tmp = 0.0;
	if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 5e+263)
		tmp = x * (log(exp(((cos(t_1) * cos(t_2)) - (sin(t_1) * sin(t_2))))) * cos(((t * b) * (0.0625 + (a / 8.0)))));
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(N[(N[(N[(a * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * b), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] * N[(y * 0.125), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(t * N[(N[(1.0 + N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 5e+263], N[(x * N[(N[Log[N[Exp[N[(N[(N[Cos[t$95$1], $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t$95$1], $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t * b), $MachinePrecision] * N[(0.0625 + N[(a / 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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)
\begin{array}{l}
t_1 := \left(z \cdot t\right) \cdot 0.0625\\
t_2 := \left(z \cdot t\right) \cdot \left(y \cdot 0.125\right)\\
\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 \cdot 10^{+263}:\\
\;\;\;\;x \cdot \left(\log \left(e^{\cos t_1 \cdot \cos t_2 - \sin t_1 \cdot \sin t_2}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 7 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Bogosity?

Bogosity

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original27.6%
Target30.3%
Herbie32.0%
\[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.00000000000000022e263

    1. Initial program 46.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. Simplified46.1%

      \[\leadsto \color{blue}{x \cdot \left(\cos \left(\left(z \cdot t\right) \cdot \left(0.0625 + \frac{y}{8}\right)\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right)} \]
      Step-by-step derivation

      [Start]46.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) \]

      associate-*l* [=>]46.1%

      \[ \color{blue}{x \cdot \left(\cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)\right)} \]
    3. Applied egg-rr45.5%

      \[\leadsto x \cdot \left(\color{blue}{\log \left(e^{\cos \left(z \cdot \left(t \cdot \left(0.0625 + y \cdot 0.125\right)\right)\right)}\right)} \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]
      Step-by-step derivation

      [Start]46.1%

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

      div-inv [=>]46.1%

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

      metadata-eval [=>]46.1%

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

      *-commutative [<=]46.1%

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

      add-log-exp [=>]46.1%

      \[ x \cdot \left(\color{blue}{\log \left(e^{\cos \left(\left(z \cdot t\right) \cdot \left(0.0625 + 0.125 \cdot y\right)\right)}\right)} \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]

      associate-*l* [=>]45.5%

      \[ x \cdot \left(\log \left(e^{\cos \color{blue}{\left(z \cdot \left(t \cdot \left(0.0625 + 0.125 \cdot y\right)\right)\right)}}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]

      *-commutative [=>]45.5%

      \[ x \cdot \left(\log \left(e^{\cos \left(z \cdot \left(t \cdot \left(0.0625 + \color{blue}{y \cdot 0.125}\right)\right)\right)}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]
    4. Applied egg-rr42.9%

      \[\leadsto x \cdot \left(\log \left(e^{\cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\left(t \cdot z\right) \cdot \left(0.0625 + y \cdot 0.125\right)\right)\right)\right)}}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]
      Step-by-step derivation

      [Start]45.5%

      \[ x \cdot \left(\log \left(e^{\cos \left(z \cdot \left(t \cdot \left(0.0625 + y \cdot 0.125\right)\right)\right)}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]

      expm1-log1p-u [=>]42.8%

      \[ x \cdot \left(\log \left(e^{\cos \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(z \cdot \left(t \cdot \left(0.0625 + y \cdot 0.125\right)\right)\right)\right)\right)}}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]

      associate-*r* [=>]42.9%

      \[ x \cdot \left(\log \left(e^{\cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(z \cdot t\right) \cdot \left(0.0625 + y \cdot 0.125\right)}\right)\right)\right)}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]

      *-commutative [<=]42.9%

      \[ x \cdot \left(\log \left(e^{\cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(t \cdot z\right)} \cdot \left(0.0625 + y \cdot 0.125\right)\right)\right)\right)}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]
    5. Applied egg-rr46.6%

      \[\leadsto x \cdot \left(\log \left(e^{\color{blue}{\cos \left(\left(t \cdot z\right) \cdot 0.0625\right) \cdot \cos \left(\left(t \cdot z\right) \cdot \left(0.125 \cdot y\right)\right) - \sin \left(\left(t \cdot z\right) \cdot 0.0625\right) \cdot \sin \left(\left(t \cdot z\right) \cdot \left(0.125 \cdot y\right)\right)}}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]
      Step-by-step derivation

      [Start]42.9%

      \[ x \cdot \left(\log \left(e^{\cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\left(t \cdot z\right) \cdot \left(0.0625 + y \cdot 0.125\right)\right)\right)\right)}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]

      expm1-log1p-u [<=]46.1%

      \[ x \cdot \left(\log \left(e^{\cos \color{blue}{\left(\left(t \cdot z\right) \cdot \left(0.0625 + y \cdot 0.125\right)\right)}}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]

      distribute-lft-in [=>]46.1%

      \[ x \cdot \left(\log \left(e^{\cos \color{blue}{\left(\left(t \cdot z\right) \cdot 0.0625 + \left(t \cdot z\right) \cdot \left(y \cdot 0.125\right)\right)}}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]

      cos-sum [=>]46.6%

      \[ x \cdot \left(\log \left(e^{\color{blue}{\cos \left(\left(t \cdot z\right) \cdot 0.0625\right) \cdot \cos \left(\left(t \cdot z\right) \cdot \left(y \cdot 0.125\right)\right) - \sin \left(\left(t \cdot z\right) \cdot 0.0625\right) \cdot \sin \left(\left(t \cdot z\right) \cdot \left(y \cdot 0.125\right)\right)}}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]

      *-commutative [=>]46.6%

      \[ x \cdot \left(\log \left(e^{\cos \left(\left(t \cdot z\right) \cdot 0.0625\right) \cdot \cos \left(\left(t \cdot z\right) \cdot \color{blue}{\left(0.125 \cdot y\right)}\right) - \sin \left(\left(t \cdot z\right) \cdot 0.0625\right) \cdot \sin \left(\left(t \cdot z\right) \cdot \left(y \cdot 0.125\right)\right)}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]

      *-commutative [=>]46.6%

      \[ x \cdot \left(\log \left(e^{\cos \left(\left(t \cdot z\right) \cdot 0.0625\right) \cdot \cos \left(\left(t \cdot z\right) \cdot \left(0.125 \cdot y\right)\right) - \sin \left(\left(t \cdot z\right) \cdot 0.0625\right) \cdot \sin \left(\left(t \cdot z\right) \cdot \color{blue}{\left(0.125 \cdot y\right)}\right)}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right) \]

    if 5.00000000000000022e263 < (*.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 1.9%

      \[\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. Simplified3.9%

      \[\leadsto \color{blue}{x \cdot \left(\cos \left(\left(z \cdot t\right) \cdot \left(0.0625 + \frac{y}{8}\right)\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right)} \]
      Step-by-step derivation

      [Start]1.9%

      \[ \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) \]

      associate-*l* [=>]1.9%

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

      \[\leadsto x \cdot \left(\cos \left(\left(z \cdot t\right) \cdot \left(0.0625 + \frac{y}{8}\right)\right) \cdot \color{blue}{\cos \left(0.0625 \cdot \left(t \cdot b\right)\right)}\right) \]
    4. Simplified5.7%

      \[\leadsto x \cdot \left(\cos \left(\left(z \cdot t\right) \cdot \left(0.0625 + \frac{y}{8}\right)\right) \cdot \color{blue}{\cos \left(t \cdot \left(b \cdot 0.0625\right)\right)}\right) \]
      Step-by-step derivation

      [Start]5.7%

      \[ x \cdot \left(\cos \left(\left(z \cdot t\right) \cdot \left(0.0625 + \frac{y}{8}\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot b\right)\right)\right) \]

      *-commutative [<=]5.7%

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

      associate-*l* [=>]5.7%

      \[ x \cdot \left(\cos \left(\left(z \cdot t\right) \cdot \left(0.0625 + \frac{y}{8}\right)\right) \cdot \cos \color{blue}{\left(t \cdot \left(b \cdot 0.0625\right)\right)}\right) \]
    5. Taylor expanded in t around 0 11.2%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.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 \cdot 10^{+263}:\\ \;\;\;\;x \cdot \left(\log \left(e^{\cos \left(\left(z \cdot t\right) \cdot 0.0625\right) \cdot \cos \left(\left(z \cdot t\right) \cdot \left(y \cdot 0.125\right)\right) - \sin \left(\left(z \cdot t\right) \cdot 0.0625\right) \cdot \sin \left(\left(z \cdot t\right) \cdot \left(y \cdot 0.125\right)\right)}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternatives

Alternative 1
Accuracy32.0%
Cost61764
\[\begin{array}{l} t_1 := \left(z \cdot t\right) \cdot 0.0625\\ t_2 := \left(z \cdot t\right) \cdot \left(y \cdot 0.125\right)\\ \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 \cdot 10^{+263}:\\ \;\;\;\;x \cdot \left(\log \left(e^{\cos t_1 \cdot \cos t_2 - \sin t_1 \cdot \sin t_2}\right) \cdot \cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 2
Accuracy31.9%
Cost61764
\[\begin{array}{l} t_1 := t \cdot \left(z \cdot \left(y \cdot 0.125\right)\right)\\ t_2 := t \cdot \left(z \cdot 0.0625\right)\\ \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 10^{+106}:\\ \;\;\;\;x \cdot \left(\cos \left(\left(t \cdot b\right) \cdot \left(0.0625 + \frac{a}{8}\right)\right) \cdot \log \left(e^{\cos t_2 \cdot \cos t_1 - \sin t_2 \cdot \sin t_1}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 3
Accuracy32.0%
Cost41412
\[\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 \cdot 10^{+219}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{z \cdot \mathsf{fma}\left(y, 2, 1\right)}{\frac{16}{t}}\right) \cdot \cos \left(\frac{b \cdot \mathsf{fma}\left(a, 2, 1\right)}{\frac{16}{t}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 4
Accuracy32.0%
Cost28868
\[\begin{array}{l} t_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{t \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right)\\ \mathbf{if}\;t_1 \leq 5 \cdot 10^{+219}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 5
Accuracy29.2%
Cost13632
\[x \cdot \left(\cos \left(t \cdot \left(z \cdot 0.0625\right)\right) \cdot \cos \left(t \cdot \left(b \cdot 0.0625\right)\right)\right) \]
Alternative 6
Accuracy29.7%
Cost6848
\[x \cdot \cos \left(t \cdot \left(z \cdot 0.0625\right)\right) \]
Alternative 7
Accuracy30.7%
Cost64
\[x \]

Reproduce?

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