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

Percentage Accurate: 28.0% → 32.2%
Time: 27.7s
Alternatives: 12
Speedup: 225.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 12 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: 28.0% 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: 32.2% accurate, 0.3× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} t_1 := \frac{4}{\sqrt{t}}\\ \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 2 \cdot 10^{+142}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{\frac{z \cdot \mathsf{fma}\left(y, 2, 1\right)}{t_1}}{t_1}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ 4.0 (sqrt t))))
   (if (<=
        (*
         (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
         (cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
        2e+142)
     (*
      x
      (*
       (cos (/ (/ (* z (fma y 2.0 1.0)) t_1) t_1))
       (cos (* (/ t 16.0) (* b (fma 2.0 a 1.0))))))
     x)))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = 4.0 / sqrt(t);
	double tmp;
	if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 2e+142) {
		tmp = x * (cos((((z * fma(y, 2.0, 1.0)) / t_1) / t_1)) * cos(((t / 16.0) * (b * fma(2.0, a, 1.0)))));
	} else {
		tmp = x;
	}
	return tmp;
}
t = abs(t)
function code(x, y, z, t, a, b)
	t_1 = Float64(4.0 / sqrt(t))
	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))) <= 2e+142)
		tmp = Float64(x * Float64(cos(Float64(Float64(Float64(z * fma(y, 2.0, 1.0)) / t_1) / t_1)) * cos(Float64(Float64(t / 16.0) * Float64(b * fma(2.0, a, 1.0))))));
	else
		tmp = x;
	end
	return tmp
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(4.0 / N[Sqrt[t], $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], 2e+142], N[(x * N[(N[Cos[N[(N[(N[(z * N[(y * 2.0 + 1.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t / 16.0), $MachinePrecision] * N[(b * N[(2.0 * a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \frac{4}{\sqrt{t}}\\
\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 2 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{\frac{z \cdot \mathsf{fma}\left(y, 2, 1\right)}{t_1}}{t_1}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\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 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e142

    1. Initial program 51.2%

      \[\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. Simplified51.4%

      \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*51.2%

        \[\leadsto x \cdot \left(\cos \color{blue}{\left(\left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot z\right) \cdot t\right)} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      2. associate-*l/51.2%

        \[\leadsto x \cdot \left(\cos \left(\color{blue}{\frac{\mathsf{fma}\left(y, 2, 1\right) \cdot z}{16}} \cdot t\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      3. associate-/r/51.3%

        \[\leadsto x \cdot \left(\cos \color{blue}{\left(\frac{\mathsf{fma}\left(y, 2, 1\right) \cdot z}{\frac{16}{t}}\right)} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      4. add-sqr-sqrt25.2%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right) \cdot z}{\color{blue}{\sqrt{\frac{16}{t}} \cdot \sqrt{\frac{16}{t}}}}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      5. associate-/r*24.9%

        \[\leadsto x \cdot \left(\cos \color{blue}{\left(\frac{\frac{\mathsf{fma}\left(y, 2, 1\right) \cdot z}{\sqrt{\frac{16}{t}}}}{\sqrt{\frac{16}{t}}}\right)} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      6. sqrt-div24.8%

        \[\leadsto x \cdot \left(\cos \left(\frac{\frac{\mathsf{fma}\left(y, 2, 1\right) \cdot z}{\color{blue}{\frac{\sqrt{16}}{\sqrt{t}}}}}{\sqrt{\frac{16}{t}}}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      7. metadata-eval24.8%

        \[\leadsto x \cdot \left(\cos \left(\frac{\frac{\mathsf{fma}\left(y, 2, 1\right) \cdot z}{\frac{\color{blue}{4}}{\sqrt{t}}}}{\sqrt{\frac{16}{t}}}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      8. sqrt-div24.8%

        \[\leadsto x \cdot \left(\cos \left(\frac{\frac{\mathsf{fma}\left(y, 2, 1\right) \cdot z}{\frac{4}{\sqrt{t}}}}{\color{blue}{\frac{\sqrt{16}}{\sqrt{t}}}}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      9. metadata-eval24.8%

        \[\leadsto x \cdot \left(\cos \left(\frac{\frac{\mathsf{fma}\left(y, 2, 1\right) \cdot z}{\frac{4}{\sqrt{t}}}}{\frac{\color{blue}{4}}{\sqrt{t}}}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Applied egg-rr24.8%

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

    if 2.0000000000000001e142 < (*.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 4.7%

      \[\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. Simplified6.6%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Taylor expanded in t around 0 15.4%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification20.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 2 \cdot 10^{+142}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{\frac{z \cdot \mathsf{fma}\left(y, 2, 1\right)}{\frac{4}{\sqrt{t}}}}{\frac{4}{\sqrt{t}}}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 2: 32.3% accurate, 0.3× speedup?

\[\begin{array}{l} t = |t|\\ \\ \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 2 \cdot 10^{+266}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \left(\frac{\mathsf{fma}\left(2, a, 1\right)}{\frac{\frac{16}{t}}{b}}\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(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)))
      2e+266)
   (*
    x
    (*
     (cos (* (/ (fma y 2.0 1.0) 16.0) (* z t)))
     (log (exp (cos (/ (fma 2.0 a 1.0) (/ (/ 16.0 t) b)))))))
   x))
t = abs(t);
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))) <= 2e+266) {
		tmp = x * (cos(((fma(y, 2.0, 1.0) / 16.0) * (z * t))) * log(exp(cos((fma(2.0, a, 1.0) / ((16.0 / t) / b))))));
	} else {
		tmp = x;
	}
	return tmp;
}
t = abs(t)
function code(x, y, z, t, a, b)
	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))) <= 2e+266)
		tmp = Float64(x * Float64(cos(Float64(Float64(fma(y, 2.0, 1.0) / 16.0) * Float64(z * t))) * log(exp(cos(Float64(fma(2.0, a, 1.0) / Float64(Float64(16.0 / t) / b)))))));
	else
		tmp = x;
	end
	return tmp
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := 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], 2e+266], N[(x * N[(N[Cos[N[(N[(N[(y * 2.0 + 1.0), $MachinePrecision] / 16.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(N[(2.0 * a + 1.0), $MachinePrecision] / N[(N[(16.0 / t), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
t = |t|\\
\\
\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 2 \cdot 10^{+266}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \left(\frac{\mathsf{fma}\left(2, a, 1\right)}{\frac{\frac{16}{t}}{b}}\right)}\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 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e266

    1. Initial program 48.7%

      \[\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. Simplified49.0%

      \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*l/49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \color{blue}{\left(\frac{t \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)}{16}\right)}\right) \]
      2. associate-*r/49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \color{blue}{\left(t \cdot \frac{\mathsf{fma}\left(2, a, 1\right) \cdot b}{16}\right)}\right) \]
      3. *-commutative49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(t \cdot \frac{\color{blue}{b \cdot \mathsf{fma}\left(2, a, 1\right)}}{16}\right)\right) \]
      4. associate-*l/49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(t \cdot \color{blue}{\left(\frac{b}{16} \cdot \mathsf{fma}\left(2, a, 1\right)\right)}\right)\right) \]
      5. add-log-exp49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \color{blue}{\log \left(e^{\cos \left(t \cdot \left(\frac{b}{16} \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)}\right)}\right) \]
      6. div-inv49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \left(t \cdot \left(\color{blue}{\left(b \cdot \frac{1}{16}\right)} \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)}\right)\right) \]
      7. metadata-eval49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \left(t \cdot \left(\left(b \cdot \color{blue}{0.0625}\right) \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)}\right)\right) \]
    4. Applied egg-rr49.0%

      \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \color{blue}{\log \left(e^{\cos \left(t \cdot \left(\left(b \cdot 0.0625\right) \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)}\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \left(t \cdot \left(\color{blue}{\left(0.0625 \cdot b\right)} \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)}\right)\right) \]
      2. associate-*l*49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \left(t \cdot \color{blue}{\left(0.0625 \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)}\right)}\right)\right) \]
      3. *-commutative49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \left(t \cdot \left(0.0625 \cdot \color{blue}{\left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)}\right)\right)}\right)\right) \]
      4. associate-*l*49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \color{blue}{\left(\left(t \cdot 0.0625\right) \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)}}\right)\right) \]
      5. metadata-eval49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \left(\left(t \cdot \color{blue}{\frac{1}{16}}\right) \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)}\right)\right) \]
      6. div-inv49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \left(\color{blue}{\frac{t}{16}} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)}\right)\right) \]
      7. *-commutative49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \color{blue}{\left(\left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right) \cdot \frac{t}{16}\right)}}\right)\right) \]
      8. associate-*r/49.0%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \color{blue}{\left(\frac{\left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right) \cdot t}{16}\right)}}\right)\right) \]
      9. associate-/l*48.8%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \color{blue}{\left(\frac{\mathsf{fma}\left(2, a, 1\right) \cdot b}{\frac{16}{t}}\right)}}\right)\right) \]
      10. associate-/l*49.3%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \color{blue}{\left(\frac{\mathsf{fma}\left(2, a, 1\right)}{\frac{\frac{16}{t}}{b}}\right)}}\right)\right) \]
    6. Applied egg-rr49.3%

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

    if 2.0000000000000001e266 < (*.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 2.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. Simplified4.1%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Taylor expanded in t around 0 14.2%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.3%

    \[\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 2 \cdot 10^{+266}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \log \left(e^{\cos \left(\frac{\mathsf{fma}\left(2, a, 1\right)}{\frac{\frac{16}{t}}{b}}\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 32.2% accurate, 0.3× speedup?

\[\begin{array}{l} t = |t|\\ \\ \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 2 \cdot 10^{+142}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t \cdot b}{\frac{16}{\mathsf{fma}\left(2, a, 1\right)}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(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)))
      2e+142)
   (*
    x
    (*
     (cos (* (/ (fma y 2.0 1.0) 16.0) (* z t)))
     (cos (/ (* t b) (/ 16.0 (fma 2.0 a 1.0))))))
   x))
t = abs(t);
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))) <= 2e+142) {
		tmp = x * (cos(((fma(y, 2.0, 1.0) / 16.0) * (z * t))) * cos(((t * b) / (16.0 / fma(2.0, a, 1.0)))));
	} else {
		tmp = x;
	}
	return tmp;
}
t = abs(t)
function code(x, y, z, t, a, b)
	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))) <= 2e+142)
		tmp = Float64(x * Float64(cos(Float64(Float64(fma(y, 2.0, 1.0) / 16.0) * Float64(z * t))) * cos(Float64(Float64(t * b) / Float64(16.0 / fma(2.0, a, 1.0))))));
	else
		tmp = x;
	end
	return tmp
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := 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], 2e+142], N[(x * N[(N[Cos[N[(N[(N[(y * 2.0 + 1.0), $MachinePrecision] / 16.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t * b), $MachinePrecision] / N[(16.0 / N[(2.0 * a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
t = |t|\\
\\
\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 2 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t \cdot b}{\frac{16}{\mathsf{fma}\left(2, a, 1\right)}}\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 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e142

    1. Initial program 51.2%

      \[\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. Simplified51.4%

      \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutative51.4%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \color{blue}{\left(\left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right) \cdot \frac{t}{16}\right)}\right) \]
      2. associate-*r/51.4%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \color{blue}{\left(\frac{\left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right) \cdot t}{16}\right)}\right) \]
      3. fma-udef51.4%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\left(\color{blue}{\left(2 \cdot a + 1\right)} \cdot b\right) \cdot t}{16}\right)\right) \]
      4. *-commutative51.4%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot b\right) \cdot t}{16}\right)\right) \]
      5. fma-def51.4%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\left(\color{blue}{\mathsf{fma}\left(a, 2, 1\right)} \cdot b\right) \cdot t}{16}\right)\right) \]
      6. associate-*r*51.3%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\color{blue}{\mathsf{fma}\left(a, 2, 1\right) \cdot \left(b \cdot t\right)}}{16}\right)\right) \]
      7. *-commutative51.3%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\color{blue}{\left(b \cdot t\right) \cdot \mathsf{fma}\left(a, 2, 1\right)}}{16}\right)\right) \]
      8. associate-/l*51.5%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \color{blue}{\left(\frac{b \cdot t}{\frac{16}{\mathsf{fma}\left(a, 2, 1\right)}}\right)}\right) \]
      9. *-commutative51.5%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\color{blue}{t \cdot b}}{\frac{16}{\mathsf{fma}\left(a, 2, 1\right)}}\right)\right) \]
      10. fma-def51.5%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t \cdot b}{\frac{16}{\color{blue}{a \cdot 2 + 1}}}\right)\right) \]
      11. *-commutative51.5%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t \cdot b}{\frac{16}{\color{blue}{2 \cdot a} + 1}}\right)\right) \]
      12. fma-udef51.5%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t \cdot b}{\frac{16}{\color{blue}{\mathsf{fma}\left(2, a, 1\right)}}}\right)\right) \]
    4. Applied egg-rr51.5%

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

    if 2.0000000000000001e142 < (*.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 4.7%

      \[\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. Simplified6.6%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Taylor expanded in t around 0 15.4%

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

    \[\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 2 \cdot 10^{+142}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t \cdot b}{\frac{16}{\mathsf{fma}\left(2, a, 1\right)}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 32.2% accurate, 0.3× speedup?

\[\begin{array}{l} t = |t|\\ \\ \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 2 \cdot 10^{+142}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\mathsf{fma}\left(2, a, 1\right)}{\frac{16}{t \cdot b}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(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)))
      2e+142)
   (*
    x
    (*
     (cos (* (/ (fma y 2.0 1.0) 16.0) (* z t)))
     (cos (/ (fma 2.0 a 1.0) (/ 16.0 (* t b))))))
   x))
t = abs(t);
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))) <= 2e+142) {
		tmp = x * (cos(((fma(y, 2.0, 1.0) / 16.0) * (z * t))) * cos((fma(2.0, a, 1.0) / (16.0 / (t * b)))));
	} else {
		tmp = x;
	}
	return tmp;
}
t = abs(t)
function code(x, y, z, t, a, b)
	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))) <= 2e+142)
		tmp = Float64(x * Float64(cos(Float64(Float64(fma(y, 2.0, 1.0) / 16.0) * Float64(z * t))) * cos(Float64(fma(2.0, a, 1.0) / Float64(16.0 / Float64(t * b))))));
	else
		tmp = x;
	end
	return tmp
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := 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], 2e+142], N[(x * N[(N[Cos[N[(N[(N[(y * 2.0 + 1.0), $MachinePrecision] / 16.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(2.0 * a + 1.0), $MachinePrecision] / N[(16.0 / N[(t * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
t = |t|\\
\\
\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 2 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\mathsf{fma}\left(2, a, 1\right)}{\frac{16}{t \cdot b}}\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 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e142

    1. Initial program 51.2%

      \[\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. Simplified51.4%

      \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right)} \]
    3. Step-by-step derivation
      1. *-commutative51.4%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \color{blue}{\left(\left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right) \cdot \frac{t}{16}\right)}\right) \]
      2. associate-*r/51.4%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \color{blue}{\left(\frac{\left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right) \cdot t}{16}\right)}\right) \]
      3. fma-udef51.4%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\left(\color{blue}{\left(2 \cdot a + 1\right)} \cdot b\right) \cdot t}{16}\right)\right) \]
      4. *-commutative51.4%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot b\right) \cdot t}{16}\right)\right) \]
      5. fma-def51.4%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\left(\color{blue}{\mathsf{fma}\left(a, 2, 1\right)} \cdot b\right) \cdot t}{16}\right)\right) \]
      6. associate-*r*51.3%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\color{blue}{\mathsf{fma}\left(a, 2, 1\right) \cdot \left(b \cdot t\right)}}{16}\right)\right) \]
      7. associate-/l*51.5%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \color{blue}{\left(\frac{\mathsf{fma}\left(a, 2, 1\right)}{\frac{16}{b \cdot t}}\right)}\right) \]
      8. fma-def51.5%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\color{blue}{a \cdot 2 + 1}}{\frac{16}{b \cdot t}}\right)\right) \]
      9. *-commutative51.5%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\color{blue}{2 \cdot a} + 1}{\frac{16}{b \cdot t}}\right)\right) \]
      10. fma-udef51.5%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\color{blue}{\mathsf{fma}\left(2, a, 1\right)}}{\frac{16}{b \cdot t}}\right)\right) \]
      11. *-commutative51.5%

        \[\leadsto x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\mathsf{fma}\left(2, a, 1\right)}{\frac{16}{\color{blue}{t \cdot b}}}\right)\right) \]
    4. Applied egg-rr51.5%

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

    if 2.0000000000000001e142 < (*.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 4.7%

      \[\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. Simplified6.6%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Taylor expanded in t around 0 15.4%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.2%

    \[\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 2 \cdot 10^{+142}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{\mathsf{fma}\left(2, a, 1\right)}{\frac{16}{t \cdot b}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 5: 32.3% accurate, 0.4× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} t_1 := \frac{t}{\frac{16}{b}}\\ \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 2 \cdot 10^{+266}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(t_1 + t_1 \cdot \left(2 \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ t (/ 16.0 b))))
   (if (<=
        (*
         (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
         (cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
        2e+266)
     (*
      x
      (*
       (cos (* (/ (fma y 2.0 1.0) 16.0) (* z t)))
       (cos (+ t_1 (* t_1 (* 2.0 a))))))
     x)))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = t / (16.0 / 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))) <= 2e+266) {
		tmp = x * (cos(((fma(y, 2.0, 1.0) / 16.0) * (z * t))) * cos((t_1 + (t_1 * (2.0 * a)))));
	} else {
		tmp = x;
	}
	return tmp;
}
t = abs(t)
function code(x, y, z, t, a, b)
	t_1 = Float64(t / Float64(16.0 / b))
	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))) <= 2e+266)
		tmp = Float64(x * Float64(cos(Float64(Float64(fma(y, 2.0, 1.0) / 16.0) * Float64(z * t))) * cos(Float64(t_1 + Float64(t_1 * Float64(2.0 * a))))));
	else
		tmp = x;
	end
	return tmp
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(16.0 / b), $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], 2e+266], N[(x * N[(N[Cos[N[(N[(N[(y * 2.0 + 1.0), $MachinePrecision] / 16.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 + N[(t$95$1 * N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{16}{b}}\\
\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 2 \cdot 10^{+266}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(t_1 + t_1 \cdot \left(2 \cdot a\right)\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 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e266

    1. Initial program 48.7%

      \[\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. Simplified49.0%

      \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*l/48.2%

        \[\leadsto x \cdot \left(1 \cdot \cos \color{blue}{\left(\frac{t \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)}{16}\right)}\right) \]
      2. associate-*r/48.2%

        \[\leadsto x \cdot \left(1 \cdot \cos \color{blue}{\left(t \cdot \frac{\mathsf{fma}\left(2, a, 1\right) \cdot b}{16}\right)}\right) \]
      3. *-commutative48.2%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(t \cdot \frac{\color{blue}{b \cdot \mathsf{fma}\left(2, a, 1\right)}}{16}\right)\right) \]
      4. associate-*l/48.2%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(t \cdot \color{blue}{\left(\frac{b}{16} \cdot \mathsf{fma}\left(2, a, 1\right)\right)}\right)\right) \]
      5. associate-*r*47.8%

        \[\leadsto x \cdot \left(1 \cdot \cos \color{blue}{\left(\left(t \cdot \frac{b}{16}\right) \cdot \mathsf{fma}\left(2, a, 1\right)\right)}\right) \]
      6. fma-udef47.8%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\left(t \cdot \frac{b}{16}\right) \cdot \color{blue}{\left(2 \cdot a + 1\right)}\right)\right) \]
      7. *-commutative47.8%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\left(t \cdot \frac{b}{16}\right) \cdot \left(\color{blue}{a \cdot 2} + 1\right)\right)\right) \]
      8. +-commutative47.8%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\left(t \cdot \frac{b}{16}\right) \cdot \color{blue}{\left(1 + a \cdot 2\right)}\right)\right) \]
      9. distribute-rgt-in47.8%

        \[\leadsto x \cdot \left(1 \cdot \cos \color{blue}{\left(1 \cdot \left(t \cdot \frac{b}{16}\right) + \left(a \cdot 2\right) \cdot \left(t \cdot \frac{b}{16}\right)\right)}\right) \]
      10. *-un-lft-identity47.8%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\color{blue}{t \cdot \frac{b}{16}} + \left(a \cdot 2\right) \cdot \left(t \cdot \frac{b}{16}\right)\right)\right) \]
      11. clear-num47.9%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(t \cdot \color{blue}{\frac{1}{\frac{16}{b}}} + \left(a \cdot 2\right) \cdot \left(t \cdot \frac{b}{16}\right)\right)\right) \]
      12. un-div-inv47.8%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\color{blue}{\frac{t}{\frac{16}{b}}} + \left(a \cdot 2\right) \cdot \left(t \cdot \frac{b}{16}\right)\right)\right) \]
      13. *-commutative47.8%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\frac{t}{\frac{16}{b}} + \color{blue}{\left(2 \cdot a\right)} \cdot \left(t \cdot \frac{b}{16}\right)\right)\right) \]
      14. clear-num48.0%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\frac{t}{\frac{16}{b}} + \left(2 \cdot a\right) \cdot \left(t \cdot \color{blue}{\frac{1}{\frac{16}{b}}}\right)\right)\right) \]
      15. un-div-inv48.1%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\frac{t}{\frac{16}{b}} + \left(2 \cdot a\right) \cdot \color{blue}{\frac{t}{\frac{16}{b}}}\right)\right) \]
    4. Applied egg-rr48.9%

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

    if 2.0000000000000001e266 < (*.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 2.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. Simplified4.1%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Taylor expanded in t around 0 14.2%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.0%

    \[\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 2 \cdot 10^{+266}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t}{\frac{16}{b}} + \frac{t}{\frac{16}{b}} \cdot \left(2 \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 32.2% accurate, 0.4× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} t_1 := z \cdot \left(t \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 2 \cdot 10^{+142}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{t}{16} \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right) \cdot \cos \left(t_1 + \left(y \cdot 2\right) \cdot t_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (* t 0.0625))))
   (if (<=
        (*
         (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
         (cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))
        2e+142)
     (*
      x
      (*
       (cos (* (/ t 16.0) (* b (fma 2.0 a 1.0))))
       (cos (+ t_1 (* (* y 2.0) t_1)))))
     x)))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (t * 0.0625);
	double tmp;
	if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))) <= 2e+142) {
		tmp = x * (cos(((t / 16.0) * (b * fma(2.0, a, 1.0)))) * cos((t_1 + ((y * 2.0) * t_1))));
	} else {
		tmp = x;
	}
	return tmp;
}
t = abs(t)
function code(x, y, z, t, a, b)
	t_1 = Float64(z * Float64(t * 0.0625))
	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))) <= 2e+142)
		tmp = Float64(x * Float64(cos(Float64(Float64(t / 16.0) * Float64(b * fma(2.0, a, 1.0)))) * cos(Float64(t_1 + Float64(Float64(y * 2.0) * t_1)))));
	else
		tmp = x;
	end
	return tmp
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(t * 0.0625), $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], 2e+142], N[(x * N[(N[Cos[N[(N[(t / 16.0), $MachinePrecision] * N[(b * N[(2.0 * a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 + N[(N[(y * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := z \cdot \left(t \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 2 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(\cos \left(\frac{t}{16} \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right) \cdot \cos \left(t_1 + \left(y \cdot 2\right) \cdot t_1\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 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e142

    1. Initial program 51.2%

      \[\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. Simplified51.4%

      \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{16} \cdot \left(z \cdot t\right)\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-/r/50.9%

        \[\leadsto x \cdot \left(\cos \color{blue}{\left(\frac{\mathsf{fma}\left(y, 2, 1\right)}{\frac{16}{z \cdot t}}\right)} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      2. clear-num51.1%

        \[\leadsto x \cdot \left(\cos \color{blue}{\left(\frac{1}{\frac{\frac{16}{z \cdot t}}{\mathsf{fma}\left(y, 2, 1\right)}}\right)} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      3. associate-/r/51.5%

        \[\leadsto x \cdot \left(\cos \color{blue}{\left(\frac{1}{\frac{16}{z \cdot t}} \cdot \mathsf{fma}\left(y, 2, 1\right)\right)} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      4. clear-num51.4%

        \[\leadsto x \cdot \left(\cos \left(\color{blue}{\frac{z \cdot t}{16}} \cdot \mathsf{fma}\left(y, 2, 1\right)\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      5. associate-*r/51.4%

        \[\leadsto x \cdot \left(\cos \left(\color{blue}{\left(z \cdot \frac{t}{16}\right)} \cdot \mathsf{fma}\left(y, 2, 1\right)\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      6. fma-def51.4%

        \[\leadsto x \cdot \left(\cos \left(\left(z \cdot \frac{t}{16}\right) \cdot \color{blue}{\left(y \cdot 2 + 1\right)}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      7. distribute-rgt-in51.4%

        \[\leadsto x \cdot \left(\cos \color{blue}{\left(\left(y \cdot 2\right) \cdot \left(z \cdot \frac{t}{16}\right) + 1 \cdot \left(z \cdot \frac{t}{16}\right)\right)} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      8. div-inv51.4%

        \[\leadsto x \cdot \left(\cos \left(\left(y \cdot 2\right) \cdot \left(z \cdot \color{blue}{\left(t \cdot \frac{1}{16}\right)}\right) + 1 \cdot \left(z \cdot \frac{t}{16}\right)\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      9. metadata-eval51.4%

        \[\leadsto x \cdot \left(\cos \left(\left(y \cdot 2\right) \cdot \left(z \cdot \left(t \cdot \color{blue}{0.0625}\right)\right) + 1 \cdot \left(z \cdot \frac{t}{16}\right)\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      10. *-un-lft-identity51.4%

        \[\leadsto x \cdot \left(\cos \left(\left(y \cdot 2\right) \cdot \left(z \cdot \left(t \cdot 0.0625\right)\right) + \color{blue}{z \cdot \frac{t}{16}}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      11. div-inv51.4%

        \[\leadsto x \cdot \left(\cos \left(\left(y \cdot 2\right) \cdot \left(z \cdot \left(t \cdot 0.0625\right)\right) + z \cdot \color{blue}{\left(t \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      12. metadata-eval51.4%

        \[\leadsto x \cdot \left(\cos \left(\left(y \cdot 2\right) \cdot \left(z \cdot \left(t \cdot 0.0625\right)\right) + z \cdot \left(t \cdot \color{blue}{0.0625}\right)\right) \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Applied egg-rr51.4%

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

    if 2.0000000000000001e142 < (*.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 4.7%

      \[\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. Simplified6.6%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Taylor expanded in t around 0 15.4%

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

    \[\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 2 \cdot 10^{+142}:\\ \;\;\;\;x \cdot \left(\cos \left(\frac{t}{16} \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right) \cdot \cos \left(z \cdot \left(t \cdot 0.0625\right) + \left(y \cdot 2\right) \cdot \left(z \cdot \left(t \cdot 0.0625\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 7: 32.2% accurate, 0.5× speedup?

\[\begin{array}{l} t = |t|\\ \\ \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 2 \cdot 10^{+142}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1
         (*
          (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
          (cos (/ (* t (* (+ 1.0 (* 2.0 a)) b)) 16.0)))))
   (if (<= t_1 2e+142) t_1 x)))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0));
	double tmp;
	if (t_1 <= 2e+142) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
NOTE: t should be positive before calling this 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) :: tmp
    t_1 = (x * cos((((((y * 2.0d0) + 1.0d0) * z) * t) / 16.0d0))) * cos(((t * ((1.0d0 + (2.0d0 * a)) * b)) / 16.0d0))
    if (t_1 <= 2d+142) then
        tmp = t_1
    else
        tmp = x
    end if
    code = tmp
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x * Math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * Math.cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0));
	double tmp;
	if (t_1 <= 2e+142) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
t = abs(t)
def code(x, y, z, t, a, b):
	t_1 = (x * math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * math.cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0))
	tmp = 0
	if t_1 <= 2e+142:
		tmp = t_1
	else:
		tmp = x
	return tmp
t = abs(t)
function code(x, y, z, t, a, b)
	t_1 = 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)))
	tmp = 0.0
	if (t_1 <= 2e+142)
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(((t * ((1.0 + (2.0 * a)) * b)) / 16.0));
	tmp = 0.0;
	if (t_1 <= 2e+142)
		tmp = t_1;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, 2e+142], t$95$1, x]]
\begin{array}{l}
t = |t|\\
\\
\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 2 \cdot 10^{+142}:\\
\;\;\;\;t_1\\

\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 2) 1) z) t) 16))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a 2) 1) b) t) 16))) < 2.0000000000000001e142

    1. Initial program 51.2%

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

    if 2.0000000000000001e142 < (*.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 4.7%

      \[\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. Simplified6.6%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Taylor expanded in t around 0 15.4%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.0%

    \[\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 2 \cdot 10^{+142}:\\ \;\;\;\;\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{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 8: 30.3% accurate, 1.1× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;b \leq 10^{+113}:\\ \;\;\;\;x \cdot \cos \left(\frac{t}{16} \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b 1e+113) (* x (cos (* (/ t 16.0) (* b (fma 2.0 a 1.0))))) x))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= 1e+113) {
		tmp = x * cos(((t / 16.0) * (b * fma(2.0, a, 1.0))));
	} else {
		tmp = x;
	}
	return tmp;
}
t = abs(t)
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= 1e+113)
		tmp = Float64(x * cos(Float64(Float64(t / 16.0) * Float64(b * fma(2.0, a, 1.0)))));
	else
		tmp = x;
	end
	return tmp
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 1e+113], N[(x * N[Cos[N[(N[(t / 16.0), $MachinePrecision] * N[(b * N[(2.0 * a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 10^{+113}:\\
\;\;\;\;x \cdot \cos \left(\frac{t}{16} \cdot \left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1e113

    1. Initial program 33.4%

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

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

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

    if 1e113 < b

    1. Initial program 18.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. Simplified19.3%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Taylor expanded in t around 0 26.1%

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

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

Alternative 9: 30.4% accurate, 1.1× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} \mathbf{if}\;b \leq 6.5 \cdot 10^{+52}:\\ \;\;\;\;x \cdot \cos \left(\frac{b \cdot \mathsf{fma}\left(2, a, 1\right)}{\frac{16}{t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b 6.5e+52) (* x (cos (/ (* b (fma 2.0 a 1.0)) (/ 16.0 t)))) x))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= 6.5e+52) {
		tmp = x * cos(((b * fma(2.0, a, 1.0)) / (16.0 / t)));
	} else {
		tmp = x;
	}
	return tmp;
}
t = abs(t)
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= 6.5e+52)
		tmp = Float64(x * cos(Float64(Float64(b * fma(2.0, a, 1.0)) / Float64(16.0 / t))));
	else
		tmp = x;
	end
	return tmp
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 6.5e+52], N[(x * N[Cos[N[(N[(b * N[(2.0 * a + 1.0), $MachinePrecision]), $MachinePrecision] / N[(16.0 / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5 \cdot 10^{+52}:\\
\;\;\;\;x \cdot \cos \left(\frac{b \cdot \mathsf{fma}\left(2, a, 1\right)}{\frac{16}{t}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 6.49999999999999996e52

    1. Initial program 34.3%

      \[\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. Simplified35.2%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Step-by-step derivation
      1. clear-num36.6%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\color{blue}{\frac{1}{\frac{16}{t}}} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
      2. associate-*l/36.5%

        \[\leadsto x \cdot \left(1 \cdot \cos \color{blue}{\left(\frac{1 \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)}{\frac{16}{t}}\right)}\right) \]
      3. *-un-lft-identity36.5%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\frac{\color{blue}{\mathsf{fma}\left(2, a, 1\right) \cdot b}}{\frac{16}{t}}\right)\right) \]
      4. *-commutative36.5%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\frac{\color{blue}{b \cdot \mathsf{fma}\left(2, a, 1\right)}}{\frac{16}{t}}\right)\right) \]
    5. Applied egg-rr36.5%

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

    if 6.49999999999999996e52 < b

    1. Initial program 17.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. Simplified17.5%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Taylor expanded in t around 0 22.7%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 6.5 \cdot 10^{+52}:\\ \;\;\;\;x \cdot \cos \left(\frac{b \cdot \mathsf{fma}\left(2, a, 1\right)}{\frac{16}{t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 30.6% accurate, 1.9× speedup?

\[\begin{array}{l} t = |t|\\ \\ \begin{array}{l} t_1 := \frac{t}{\frac{16}{b}}\\ \mathbf{if}\;b \leq 4.8 \cdot 10^{+52}:\\ \;\;\;\;x \cdot \cos \left(t_1 + t_1 \cdot \left(2 \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ t (/ 16.0 b))))
   (if (<= b 4.8e+52) (* x (cos (+ t_1 (* t_1 (* 2.0 a))))) x)))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = t / (16.0 / b);
	double tmp;
	if (b <= 4.8e+52) {
		tmp = x * cos((t_1 + (t_1 * (2.0 * a))));
	} else {
		tmp = x;
	}
	return tmp;
}
NOTE: t should be positive before calling this 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) :: tmp
    t_1 = t / (16.0d0 / b)
    if (b <= 4.8d+52) then
        tmp = x * cos((t_1 + (t_1 * (2.0d0 * a))))
    else
        tmp = x
    end if
    code = tmp
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = t / (16.0 / b);
	double tmp;
	if (b <= 4.8e+52) {
		tmp = x * Math.cos((t_1 + (t_1 * (2.0 * a))));
	} else {
		tmp = x;
	}
	return tmp;
}
t = abs(t)
def code(x, y, z, t, a, b):
	t_1 = t / (16.0 / b)
	tmp = 0
	if b <= 4.8e+52:
		tmp = x * math.cos((t_1 + (t_1 * (2.0 * a))))
	else:
		tmp = x
	return tmp
t = abs(t)
function code(x, y, z, t, a, b)
	t_1 = Float64(t / Float64(16.0 / b))
	tmp = 0.0
	if (b <= 4.8e+52)
		tmp = Float64(x * cos(Float64(t_1 + Float64(t_1 * Float64(2.0 * a)))));
	else
		tmp = x;
	end
	return tmp
end
t = abs(t)
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = t / (16.0 / b);
	tmp = 0.0;
	if (b <= 4.8e+52)
		tmp = x * cos((t_1 + (t_1 * (2.0 * a))));
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(16.0 / b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 4.8e+52], N[(x * N[Cos[N[(t$95$1 + N[(t$95$1 * N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{16}{b}}\\
\mathbf{if}\;b \leq 4.8 \cdot 10^{+52}:\\
\;\;\;\;x \cdot \cos \left(t_1 + t_1 \cdot \left(2 \cdot a\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.8e52

    1. Initial program 34.3%

      \[\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. Simplified35.2%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate-*l/36.5%

        \[\leadsto x \cdot \left(1 \cdot \cos \color{blue}{\left(\frac{t \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)}{16}\right)}\right) \]
      2. associate-*r/36.5%

        \[\leadsto x \cdot \left(1 \cdot \cos \color{blue}{\left(t \cdot \frac{\mathsf{fma}\left(2, a, 1\right) \cdot b}{16}\right)}\right) \]
      3. *-commutative36.5%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(t \cdot \frac{\color{blue}{b \cdot \mathsf{fma}\left(2, a, 1\right)}}{16}\right)\right) \]
      4. associate-*l/36.5%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(t \cdot \color{blue}{\left(\frac{b}{16} \cdot \mathsf{fma}\left(2, a, 1\right)\right)}\right)\right) \]
      5. associate-*r*36.7%

        \[\leadsto x \cdot \left(1 \cdot \cos \color{blue}{\left(\left(t \cdot \frac{b}{16}\right) \cdot \mathsf{fma}\left(2, a, 1\right)\right)}\right) \]
      6. fma-udef36.7%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\left(t \cdot \frac{b}{16}\right) \cdot \color{blue}{\left(2 \cdot a + 1\right)}\right)\right) \]
      7. *-commutative36.7%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\left(t \cdot \frac{b}{16}\right) \cdot \left(\color{blue}{a \cdot 2} + 1\right)\right)\right) \]
      8. +-commutative36.7%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\left(t \cdot \frac{b}{16}\right) \cdot \color{blue}{\left(1 + a \cdot 2\right)}\right)\right) \]
      9. distribute-rgt-in36.6%

        \[\leadsto x \cdot \left(1 \cdot \cos \color{blue}{\left(1 \cdot \left(t \cdot \frac{b}{16}\right) + \left(a \cdot 2\right) \cdot \left(t \cdot \frac{b}{16}\right)\right)}\right) \]
      10. *-un-lft-identity36.6%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\color{blue}{t \cdot \frac{b}{16}} + \left(a \cdot 2\right) \cdot \left(t \cdot \frac{b}{16}\right)\right)\right) \]
      11. clear-num36.7%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(t \cdot \color{blue}{\frac{1}{\frac{16}{b}}} + \left(a \cdot 2\right) \cdot \left(t \cdot \frac{b}{16}\right)\right)\right) \]
      12. un-div-inv36.9%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\color{blue}{\frac{t}{\frac{16}{b}}} + \left(a \cdot 2\right) \cdot \left(t \cdot \frac{b}{16}\right)\right)\right) \]
      13. *-commutative36.9%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\frac{t}{\frac{16}{b}} + \color{blue}{\left(2 \cdot a\right)} \cdot \left(t \cdot \frac{b}{16}\right)\right)\right) \]
      14. clear-num37.0%

        \[\leadsto x \cdot \left(1 \cdot \cos \left(\frac{t}{\frac{16}{b}} + \left(2 \cdot a\right) \cdot \left(t \cdot \color{blue}{\frac{1}{\frac{16}{b}}}\right)\right)\right) \]
      15. un-div-inv36.9%

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

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

    if 4.8e52 < b

    1. Initial program 17.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. Simplified17.5%

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

      \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
    4. Taylor expanded in t around 0 22.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 4.8 \cdot 10^{+52}:\\ \;\;\;\;x \cdot \cos \left(\frac{t}{\frac{16}{b}} + \frac{t}{\frac{16}{b}} \cdot \left(2 \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 30.4% accurate, 2.1× speedup?

\[\begin{array}{l} t = |t|\\ \\ x \cdot \cos \left(\left(t \cdot b\right) \cdot 0.0625\right) \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t a b) :precision binary64 (* x (cos (* (* t b) 0.0625))))
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
	return x * cos(((t * b) * 0.0625));
}
NOTE: t should be positive before calling this 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
    code = x * cos(((t * b) * 0.0625d0))
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.cos(((t * b) * 0.0625));
}
t = abs(t)
def code(x, y, z, t, a, b):
	return x * math.cos(((t * b) * 0.0625))
t = abs(t)
function code(x, y, z, t, a, b)
	return Float64(x * cos(Float64(Float64(t * b) * 0.0625)))
end
t = abs(t)
function tmp = code(x, y, z, t, a, b)
	tmp = x * cos(((t * b) * 0.0625));
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Cos[N[(N[(t * b), $MachinePrecision] * 0.0625), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
x \cdot \cos \left(\left(t \cdot b\right) \cdot 0.0625\right)
\end{array}
Derivation
  1. Initial program 31.4%

    \[\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. Simplified32.3%

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

    \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
  4. Taylor expanded in a around 0 34.0%

    \[\leadsto \color{blue}{x \cdot \cos \left(0.0625 \cdot \left(b \cdot t\right)\right)} \]
  5. Final simplification34.0%

    \[\leadsto x \cdot \cos \left(\left(t \cdot b\right) \cdot 0.0625\right) \]

Alternative 12: 31.4% accurate, 225.0× speedup?

\[\begin{array}{l} t = |t|\\ \\ x \end{array} \]
NOTE: t should be positive before calling this function
(FPCore (x y z t a b) :precision binary64 x)
t = abs(t);
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
NOTE: t should be positive before calling this 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
    code = x
end function
t = Math.abs(t);
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
t = abs(t)
def code(x, y, z, t, a, b):
	return x
t = abs(t)
function code(x, y, z, t, a, b)
	return x
end
t = abs(t)
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
NOTE: t should be positive before calling this function
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
t = |t|\\
\\
x
\end{array}
Derivation
  1. Initial program 31.4%

    \[\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. Simplified32.3%

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

    \[\leadsto x \cdot \left(\color{blue}{1} \cdot \cos \left(\frac{t}{16} \cdot \left(\mathsf{fma}\left(2, a, 1\right) \cdot b\right)\right)\right) \]
  4. Taylor expanded in t around 0 34.0%

    \[\leadsto \color{blue}{x} \]
  5. Final simplification34.0%

    \[\leadsto x \]

Developer target: 31.0% accurate, 1.0× 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 2023301 
(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))))