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

Percentage Accurate: 27.4% → 30.6%
Time: 16.4s
Alternatives: 3
Speedup: 269.0×

Specification

?
\[\begin{array}{l} \\ \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) \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))))
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));
}
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
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));
}
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))
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 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
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]
\begin{array}{l}

\\
\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)
\end{array}

Sampling outcomes in binary64 precision:

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.

Accuracy vs Speed?

Herbie found 3 alternatives:

AlternativeAccuracySpeedup
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.

Initial Program: 27.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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) \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))))
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));
}
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
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));
}
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))
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 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
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]
\begin{array}{l}

\\
\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)
\end{array}

Alternative 1: 30.6% accurate, 1.8× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;t\_m \leq 9.8 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \cos \left(\frac{1}{\frac{16}{z \cdot \left(t\_m \cdot \mathsf{fma}\left(y, 2, 1\right)\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (x y z t_m a b)
 :precision binary64
 (if (<= t_m 9.8e+39)
   (* x (cos (/ 1.0 (/ 16.0 (* z (* t_m (fma y 2.0 1.0)))))))
   x))
t_m = fabs(t);
double code(double x, double y, double z, double t_m, double a, double b) {
	double tmp;
	if (t_m <= 9.8e+39) {
		tmp = x * cos((1.0 / (16.0 / (z * (t_m * fma(y, 2.0, 1.0))))));
	} else {
		tmp = x;
	}
	return tmp;
}
t_m = abs(t)
function code(x, y, z, t_m, a, b)
	tmp = 0.0
	if (t_m <= 9.8e+39)
		tmp = Float64(x * cos(Float64(1.0 / Float64(16.0 / Float64(z * Float64(t_m * fma(y, 2.0, 1.0)))))));
	else
		tmp = x;
	end
	return tmp
end
t_m = N[Abs[t], $MachinePrecision]
code[x_, y_, z_, t$95$m_, a_, b_] := If[LessEqual[t$95$m, 9.8e+39], N[(x * N[Cos[N[(1.0 / N[(16.0 / N[(z * N[(t$95$m * N[(y * 2.0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
t_m = \left|t\right|

\\
\begin{array}{l}
\mathbf{if}\;t\_m \leq 9.8 \cdot 10^{+39}:\\
\;\;\;\;x \cdot \cos \left(\frac{1}{\frac{16}{z \cdot \left(t\_m \cdot \mathsf{fma}\left(y, 2, 1\right)\right)}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 9.79999999999999974e39

    1. Initial program 33.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. Add Preprocessing
    3. Taylor expanded in b around 0

      \[\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} \]
    4. Step-by-step derivation
      1. Simplified35.9%

        \[\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} \]
      2. Applied egg-rr36.4%

        \[\leadsto \left(x \cdot \cos \color{blue}{\left(\frac{1}{\frac{16}{z \cdot \left(\mathsf{fma}\left(y, 2, 1\right) \cdot t\right)}}\right)}\right) \cdot 1 \]

      if 9.79999999999999974e39 < t

      1. Initial program 13.6%

        \[\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. Add Preprocessing
      3. Taylor expanded in b around 0

        \[\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} \]
      4. Step-by-step derivation
        1. Simplified14.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} \]
        2. Taylor expanded in z around 0

          \[\leadsto \color{blue}{x} \]
        3. Step-by-step derivation
          1. Simplified16.4%

            \[\leadsto \color{blue}{x} \]
        4. Recombined 2 regimes into one program.
        5. Final simplification32.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9.8 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \cos \left(\frac{1}{\frac{16}{z \cdot \left(t \cdot \mathsf{fma}\left(y, 2, 1\right)\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
        6. Add Preprocessing

        Alternative 2: 31.0% accurate, 0.7× speedup?

        \[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;\left(x \cdot \cos \left(\frac{t\_m \cdot \left(z \cdot \left(1 + y \cdot 2\right)\right)}{16}\right)\right) \cdot \cos \left(\frac{t\_m \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right) \leq 10^{+116}:\\ \;\;\;\;x \cdot \cos \left(\left(z \cdot \mathsf{fma}\left(y, 2, 1\right)\right) \cdot \left(t\_m \cdot 0.0625\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
        t_m = (fabs.f64 t)
        (FPCore (x y z t_m a b)
         :precision binary64
         (if (<=
              (*
               (* x (cos (/ (* t_m (* z (+ 1.0 (* y 2.0)))) 16.0)))
               (cos (/ (* t_m (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
              1e+116)
           (* x (cos (* (* z (fma y 2.0 1.0)) (* t_m 0.0625))))
           x))
        t_m = fabs(t);
        double code(double x, double y, double z, double t_m, double a, double b) {
        	double tmp;
        	if (((x * cos(((t_m * (z * (1.0 + (y * 2.0)))) / 16.0))) * cos(((t_m * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 1e+116) {
        		tmp = x * cos(((z * fma(y, 2.0, 1.0)) * (t_m * 0.0625)));
        	} else {
        		tmp = x;
        	}
        	return tmp;
        }
        
        t_m = abs(t)
        function code(x, y, z, t_m, a, b)
        	tmp = 0.0
        	if (Float64(Float64(x * cos(Float64(Float64(t_m * Float64(z * Float64(1.0 + Float64(y * 2.0)))) / 16.0))) * cos(Float64(Float64(t_m * Float64(Float64(1.0 + Float64(2.0 * a)) * b)) / 16.0))) <= 1e+116)
        		tmp = Float64(x * cos(Float64(Float64(z * fma(y, 2.0, 1.0)) * Float64(t_m * 0.0625))));
        	else
        		tmp = x;
        	end
        	return tmp
        end
        
        t_m = N[Abs[t], $MachinePrecision]
        code[x_, y_, z_, t$95$m_, a_, b_] := If[LessEqual[N[(N[(x * N[Cos[N[(N[(t$95$m * N[(z * N[(1.0 + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(t$95$m * N[(N[(1.0 + N[(2.0 * a), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e+116], N[(x * N[Cos[N[(N[(z * N[(y * 2.0 + 1.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$m * 0.0625), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], x]
        
        \begin{array}{l}
        t_m = \left|t\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\left(x \cdot \cos \left(\frac{t\_m \cdot \left(z \cdot \left(1 + y \cdot 2\right)\right)}{16}\right)\right) \cdot \cos \left(\frac{t\_m \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right) \leq 10^{+116}:\\
        \;\;\;\;x \cdot \cos \left(\left(z \cdot \mathsf{fma}\left(y, 2, 1\right)\right) \cdot \left(t\_m \cdot 0.0625\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y #s(literal 2 binary64)) #s(literal 1 binary64)) z) t) #s(literal 16 binary64)))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a #s(literal 2 binary64)) #s(literal 1 binary64)) b) t) #s(literal 16 binary64)))) < 1.00000000000000002e116

          1. Initial program 47.8%

            \[\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. Add Preprocessing
          3. Taylor expanded in b around 0

            \[\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} \]
          4. Step-by-step derivation
            1. Simplified49.1%

              \[\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} \]
            2. Applied egg-rr49.1%

              \[\leadsto \color{blue}{\cos \left(\left(z \cdot \mathsf{fma}\left(y, 2, 1\right)\right) \cdot \left(t \cdot 0.0625\right)\right) \cdot x} \]

            if 1.00000000000000002e116 < (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y #s(literal 2 binary64)) #s(literal 1 binary64)) z) t) #s(literal 16 binary64)))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a #s(literal 2 binary64)) #s(literal 1 binary64)) b) t) #s(literal 16 binary64))))

            1. Initial program 10.6%

              \[\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. Add Preprocessing
            3. Taylor expanded in b around 0

              \[\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} \]
            4. Step-by-step derivation
              1. Simplified13.6%

                \[\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} \]
              2. Taylor expanded in z around 0

                \[\leadsto \color{blue}{x} \]
              3. Step-by-step derivation
                1. Simplified17.1%

                  \[\leadsto \color{blue}{x} \]
              4. Recombined 2 regimes into one program.
              5. Final simplification33.6%

                \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot \cos \left(\frac{t \cdot \left(z \cdot \left(1 + y \cdot 2\right)\right)}{16}\right)\right) \cdot \cos \left(\frac{t \cdot \left(\left(1 + 2 \cdot a\right) \cdot b\right)}{16}\right) \leq 10^{+116}:\\ \;\;\;\;x \cdot \cos \left(\left(z \cdot \mathsf{fma}\left(y, 2, 1\right)\right) \cdot \left(t \cdot 0.0625\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
              6. Add Preprocessing

              Alternative 3: 30.3% accurate, 269.0× speedup?

              \[\begin{array}{l} t_m = \left|t\right| \\ x \end{array} \]
              t_m = (fabs.f64 t)
              (FPCore (x y z t_m a b) :precision binary64 x)
              t_m = fabs(t);
              double code(double x, double y, double z, double t_m, double a, double b) {
              	return x;
              }
              
              t_m = abs(t)
              real(8) function code(x, y, z, t_m, a, b)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t_m
                  real(8), intent (in) :: a
                  real(8), intent (in) :: b
                  code = x
              end function
              
              t_m = Math.abs(t);
              public static double code(double x, double y, double z, double t_m, double a, double b) {
              	return x;
              }
              
              t_m = math.fabs(t)
              def code(x, y, z, t_m, a, b):
              	return x
              
              t_m = abs(t)
              function code(x, y, z, t_m, a, b)
              	return x
              end
              
              t_m = abs(t);
              function tmp = code(x, y, z, t_m, a, b)
              	tmp = x;
              end
              
              t_m = N[Abs[t], $MachinePrecision]
              code[x_, y_, z_, t$95$m_, a_, b_] := x
              
              \begin{array}{l}
              t_m = \left|t\right|
              
              \\
              x
              \end{array}
              
              Derivation
              1. Initial program 29.8%

                \[\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. Add Preprocessing
              3. Taylor expanded in b around 0

                \[\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} \]
              4. Step-by-step derivation
                1. Simplified31.9%

                  \[\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} \]
                2. Taylor expanded in z around 0

                  \[\leadsto \color{blue}{x} \]
                3. Step-by-step derivation
                  1. Simplified32.7%

                    \[\leadsto \color{blue}{x} \]
                  2. Add Preprocessing

                  Developer Target 1: 30.0% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ x \cdot \cos \left(\frac{b}{16} \cdot \frac{t}{\left(1 - a \cdot 2\right) + {\left(a \cdot 2\right)}^{2}}\right) \end{array} \]
                  (FPCore (x y z t a b)
                   :precision binary64
                   (* x (cos (* (/ b 16.0) (/ t (+ (- 1.0 (* a 2.0)) (pow (* a 2.0) 2.0)))))))
                  double code(double x, double y, double z, double t, double a, double b) {
                  	return x * cos(((b / 16.0) * (t / ((1.0 - (a * 2.0)) + pow((a * 2.0), 2.0)))));
                  }
                  
                  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(((b / 16.0d0) * (t / ((1.0d0 - (a * 2.0d0)) + ((a * 2.0d0) ** 2.0d0)))))
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a, double b) {
                  	return x * Math.cos(((b / 16.0) * (t / ((1.0 - (a * 2.0)) + Math.pow((a * 2.0), 2.0)))));
                  }
                  
                  def code(x, y, z, t, a, b):
                  	return x * math.cos(((b / 16.0) * (t / ((1.0 - (a * 2.0)) + math.pow((a * 2.0), 2.0)))))
                  
                  function code(x, y, z, t, a, b)
                  	return Float64(x * cos(Float64(Float64(b / 16.0) * Float64(t / Float64(Float64(1.0 - Float64(a * 2.0)) + (Float64(a * 2.0) ^ 2.0))))))
                  end
                  
                  function tmp = code(x, y, z, t, a, b)
                  	tmp = x * cos(((b / 16.0) * (t / ((1.0 - (a * 2.0)) + ((a * 2.0) ^ 2.0)))));
                  end
                  
                  code[x_, y_, z_, t_, a_, b_] := N[(x * N[Cos[N[(N[(b / 16.0), $MachinePrecision] * N[(t / N[(N[(1.0 - N[(a * 2.0), $MachinePrecision]), $MachinePrecision] + N[Power[N[(a * 2.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  x \cdot \cos \left(\frac{b}{16} \cdot \frac{t}{\left(1 - a \cdot 2\right) + {\left(a \cdot 2\right)}^{2}}\right)
                  \end{array}
                  

                  Reproduce

                  ?
                  herbie shell --seed 2024195 
                  (FPCore (x y z t a b)
                    :name "Codec.Picture.Jpg.FastDct:referenceDct from JuicyPixels-3.2.6.1"
                    :precision binary64
                  
                    :alt
                    (! :herbie-platform default (* x (cos (* (/ b 16) (/ t (+ (- 1 (* a 2)) (pow (* a 2) 2)))))))
                  
                    (* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0))) (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))))