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

Percentage Accurate: 27.2% → 29.9%
Time: 13.7s
Alternatives: 7
Speedup: 44.8×

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 7 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.2% 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: 29.9% accurate, 1.1× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;t\_m \leq 2.9 \cdot 10^{+51}:\\ \;\;\;\;\cos \left(\left(-0.0625 \cdot t\_m\right) \cdot z\right) \cdot \left(\cos \left(0.0625 \cdot \left(\left(\mathsf{fma}\left(a, 2, 1\right) \cdot t\_m\right) \cdot b\right)\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t\_m}, \frac{a}{b}, \frac{-32}{b \cdot t\_m}\right), a, \frac{16}{b \cdot t\_m}\right)}\right) \cdot \left(1 \cdot x\right)\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
(FPCore (x y z t_m a b)
 :precision binary64
 (if (<= t_m 2.9e+51)
   (*
    (cos (* (* -0.0625 t_m) z))
    (* (cos (* 0.0625 (* (* (fma a 2.0 1.0) t_m) b))) x))
   (*
    (cos
     (/
      1.0
      (fma
       (fma (/ 64.0 t_m) (/ a b) (/ -32.0 (* b t_m)))
       a
       (/ 16.0 (* b t_m)))))
    (* 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 <= 2.9e+51) {
		tmp = cos(((-0.0625 * t_m) * z)) * (cos((0.0625 * ((fma(a, 2.0, 1.0) * t_m) * b))) * x);
	} else {
		tmp = cos((1.0 / fma(fma((64.0 / t_m), (a / b), (-32.0 / (b * t_m))), a, (16.0 / (b * t_m))))) * (1.0 * x);
	}
	return tmp;
}
t_m = abs(t)
function code(x, y, z, t_m, a, b)
	tmp = 0.0
	if (t_m <= 2.9e+51)
		tmp = Float64(cos(Float64(Float64(-0.0625 * t_m) * z)) * Float64(cos(Float64(0.0625 * Float64(Float64(fma(a, 2.0, 1.0) * t_m) * b))) * x));
	else
		tmp = Float64(cos(Float64(1.0 / fma(fma(Float64(64.0 / t_m), Float64(a / b), Float64(-32.0 / Float64(b * t_m))), a, Float64(16.0 / Float64(b * t_m))))) * Float64(1.0 * 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, 2.9e+51], N[(N[Cos[N[(N[(-0.0625 * t$95$m), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] * N[(N[Cos[N[(0.0625 * N[(N[(N[(a * 2.0 + 1.0), $MachinePrecision] * t$95$m), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(1.0 / N[(N[(N[(64.0 / t$95$m), $MachinePrecision] * N[(a / b), $MachinePrecision] + N[(-32.0 / N[(b * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + N[(16.0 / N[(b * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|

\\
\begin{array}{l}
\mathbf{if}\;t\_m \leq 2.9 \cdot 10^{+51}:\\
\;\;\;\;\cos \left(\left(-0.0625 \cdot t\_m\right) \cdot z\right) \cdot \left(\cos \left(0.0625 \cdot \left(\left(\mathsf{fma}\left(a, 2, 1\right) \cdot t\_m\right) \cdot b\right)\right) \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t\_m}, \frac{a}{b}, \frac{-32}{b \cdot t\_m}\right), a, \frac{16}{b \cdot t\_m}\right)}\right) \cdot \left(1 \cdot x\right)\\


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

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

      \[\leadsto \left(x \cdot \cos \color{blue}{\left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      3. *-commutativeN/A

        \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot \frac{1}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      4. lower-*.f6434.3

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

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

      \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
      3. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      4. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      5. lower-cos.f64N/A

        \[\leadsto \left(\color{blue}{\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      9. lower-*.f64N/A

        \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      12. +-commutativeN/A

        \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\left(2 \cdot a + 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \left(\cos \left(\left(\left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      14. lower-fma.f64N/A

        \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\mathsf{fma}\left(a, 2, 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
      15. metadata-evalN/A

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

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

    if 2.8999999999999998e51 < t

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

      \[\leadsto \left(x \cdot \color{blue}{1}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
    4. Step-by-step derivation
      1. Applied rewrites12.4%

        \[\leadsto \left(x \cdot \color{blue}{1}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)} \]
        2. clear-numN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(\frac{1}{\frac{16}{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\frac{16}{\color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right)} \cdot t}}\right) \]
        4. lift-+.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\frac{16}{\left(\color{blue}{\left(a \cdot 2 + 1\right)} \cdot b\right) \cdot t}}\right) \]
        5. lift-*.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\frac{16}{\left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot b\right) \cdot t}}\right) \]
        6. lift-fma.f64N/A

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

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\frac{16}{\color{blue}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right)} \cdot t}}\right) \]
        8. lift-*.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\frac{16}{\color{blue}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right)} \cdot t}}\right) \]
        9. lift-/.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\color{blue}{\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}}}\right) \]
        10. inv-powN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left({\left(\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}\right)}^{-1}\right)} \]
        11. exp-to-powN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(e^{\log \left(\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}\right) \cdot -1}\right)} \]
        12. lift-log.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(e^{\color{blue}{\log \left(\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}\right)} \cdot -1}\right) \]
        13. *-commutativeN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(e^{\color{blue}{-1 \cdot \log \left(\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}\right)}}\right) \]
        14. exp-prodN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left({\left(e^{-1}\right)}^{\log \left(\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}\right)}\right)} \]
        15. lower-pow.f64N/A

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

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

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

        \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(\frac{1}{{\left(e^{-1}\right)}^{\log \left(\left(\left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right) \cdot t\right) \cdot 0.0625\right)}}\right)} \]
      5. Taylor expanded in a around 0

        \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\color{blue}{a \cdot \left(64 \cdot \frac{a}{b \cdot t} - 32 \cdot \frac{1}{b \cdot t}\right) + 16 \cdot \frac{1}{b \cdot t}}}\right) \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\color{blue}{\left(64 \cdot \frac{a}{b \cdot t} - 32 \cdot \frac{1}{b \cdot t}\right) \cdot a} + 16 \cdot \frac{1}{b \cdot t}}\right) \]
        2. lower-fma.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\color{blue}{\mathsf{fma}\left(64 \cdot \frac{a}{b \cdot t} - 32 \cdot \frac{1}{b \cdot t}, a, 16 \cdot \frac{1}{b \cdot t}\right)}}\right) \]
        3. sub-negN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\color{blue}{64 \cdot \frac{a}{b \cdot t} + \left(\mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right)}, a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        4. associate-*r/N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\color{blue}{\frac{64 \cdot a}{b \cdot t}} + \left(\mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        5. *-commutativeN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\frac{64 \cdot a}{\color{blue}{t \cdot b}} + \left(\mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        6. times-fracN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\color{blue}{\frac{64}{t} \cdot \frac{a}{b}} + \left(\mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        7. lower-fma.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right)}, a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        8. lower-/.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\frac{64}{t}}, \frac{a}{b}, \mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        9. lower-/.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \color{blue}{\frac{a}{b}}, \mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        10. associate-*r/N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \mathsf{neg}\left(\color{blue}{\frac{32 \cdot 1}{b \cdot t}}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        11. metadata-evalN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \mathsf{neg}\left(\frac{\color{blue}{32}}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        12. distribute-neg-fracN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \color{blue}{\frac{\mathsf{neg}\left(32\right)}{b \cdot t}}\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        13. metadata-evalN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{\color{blue}{-32}}{b \cdot t}\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        14. lower-/.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \color{blue}{\frac{-32}{b \cdot t}}\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        15. *-commutativeN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{\color{blue}{t \cdot b}}\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        16. lower-*.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{\color{blue}{t \cdot b}}\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
        17. associate-*r/N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{t \cdot b}\right), a, \color{blue}{\frac{16 \cdot 1}{b \cdot t}}\right)}\right) \]
        18. metadata-evalN/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{t \cdot b}\right), a, \frac{\color{blue}{16}}{b \cdot t}\right)}\right) \]
        19. lower-/.f64N/A

          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{t \cdot b}\right), a, \color{blue}{\frac{16}{b \cdot t}}\right)}\right) \]
      7. Applied rewrites13.9%

        \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{t \cdot b}\right), a, \frac{16}{t \cdot b}\right)}}\right) \]
    5. Recombined 2 regimes into one program.
    6. Final simplification30.6%

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

    Alternative 2: 31.1% accurate, 0.6× speedup?

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

      1. Initial program 45.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 t around 0

        \[\leadsto \left(x \cdot \color{blue}{1}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      4. Step-by-step derivation
        1. Applied rewrites44.2%

          \[\leadsto \left(x \cdot \color{blue}{1}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
        2. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)} \]
          2. lift-*.f64N/A

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{\color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}}{16}\right) \]
          3. *-commutativeN/A

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{\color{blue}{t \cdot \left(\left(a \cdot 2 + 1\right) \cdot b\right)}}{16}\right) \]
          4. lift-*.f64N/A

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{t \cdot \color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right)}}{16}\right) \]
          5. lift-+.f64N/A

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{t \cdot \left(\color{blue}{\left(a \cdot 2 + 1\right)} \cdot b\right)}{16}\right) \]
          6. lift-*.f64N/A

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{t \cdot \left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot b\right)}{16}\right) \]
          7. lift-fma.f64N/A

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

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{t \cdot \color{blue}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right)}}{16}\right) \]
          9. lift-*.f64N/A

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

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(t \cdot \frac{b \cdot \mathsf{fma}\left(a, 2, 1\right)}{16}\right)} \]
          11. clear-numN/A

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(t \cdot \color{blue}{\frac{1}{\frac{16}{b \cdot \mathsf{fma}\left(a, 2, 1\right)}}}\right) \]
          12. div-invN/A

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(\frac{t}{\frac{16}{b \cdot \mathsf{fma}\left(a, 2, 1\right)}}\right)} \]
          13. lower-/.f64N/A

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(\frac{t}{\frac{16}{b \cdot \mathsf{fma}\left(a, 2, 1\right)}}\right)} \]
          14. lower-/.f6444.4

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{t}{\color{blue}{\frac{16}{b \cdot \mathsf{fma}\left(a, 2, 1\right)}}}\right) \]
          15. lift-*.f64N/A

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

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

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{t}{\frac{16}{\color{blue}{\mathsf{fma}\left(a, 2, 1\right) \cdot b}}}\right) \]
          18. lift-fma.f64N/A

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{t}{\frac{16}{\color{blue}{\left(a \cdot 2 + 1\right)} \cdot b}}\right) \]
          19. *-commutativeN/A

            \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{t}{\frac{16}{\left(\color{blue}{2 \cdot a} + 1\right) \cdot b}}\right) \]
          20. lower-fma.f6444.4

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

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

        if 5.00000000000000009e305 < (*.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 0.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. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \left(x \cdot \cos \color{blue}{\left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
          2. lower-*.f64N/A

            \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
          3. *-commutativeN/A

            \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot \frac{1}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
          4. lower-*.f644.5

            \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot 0.0625\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
        5. Applied rewrites4.5%

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

          \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)\right)} \]
        7. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
          3. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          4. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          5. lower-cos.f64N/A

            \[\leadsto \left(\color{blue}{\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          6. *-commutativeN/A

            \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          7. lower-*.f64N/A

            \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          8. *-commutativeN/A

            \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          9. lower-*.f64N/A

            \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          10. *-commutativeN/A

            \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          11. lower-*.f64N/A

            \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          12. +-commutativeN/A

            \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\left(2 \cdot a + 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \left(\cos \left(\left(\left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          14. lower-fma.f64N/A

            \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\mathsf{fma}\left(a, 2, 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
          15. metadata-evalN/A

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

          \[\leadsto \color{blue}{\left(\cos \left(\left(\left(\mathsf{fma}\left(a, 2, 1\right) \cdot t\right) \cdot b\right) \cdot 0.0625\right) \cdot x\right) \cdot \cos \left(\left(-0.0625 \cdot t\right) \cdot z\right)} \]
        9. Taylor expanded in b around 0

          \[\leadsto x \cdot \color{blue}{\cos \left(\frac{-1}{16} \cdot \left(t \cdot z\right)\right)} \]
        10. Step-by-step derivation
          1. Applied rewrites8.8%

            \[\leadsto \cos \left(\left(z \cdot t\right) \cdot -0.0625\right) \cdot \color{blue}{x} \]
          2. Taylor expanded in t around 0

            \[\leadsto 1 \cdot x \]
          3. Step-by-step derivation
            1. Applied rewrites9.8%

              \[\leadsto 1 \cdot x \]
          4. Recombined 2 regimes into one program.
          5. Final simplification30.3%

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

          Alternative 3: 31.1% accurate, 0.7× speedup?

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

            1. Initial program 45.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 t around 0

              \[\leadsto \left(x \cdot \color{blue}{1}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
            4. Step-by-step derivation
              1. Applied rewrites44.2%

                \[\leadsto \left(x \cdot \color{blue}{1}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

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

                  \[\leadsto \color{blue}{\cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \cdot \left(x \cdot 1\right)} \]
                3. lift-*.f64N/A

                  \[\leadsto \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \cdot \color{blue}{\left(x \cdot 1\right)} \]
                4. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \cdot x\right) \cdot 1} \]
                5. lower-*.f64N/A

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

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

              if 5.00000000000000009e305 < (*.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 0.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. Add Preprocessing
              3. Taylor expanded in y around 0

                \[\leadsto \left(x \cdot \cos \color{blue}{\left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                2. lower-*.f64N/A

                  \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                3. *-commutativeN/A

                  \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot \frac{1}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                4. lower-*.f644.5

                  \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot 0.0625\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
              5. Applied rewrites4.5%

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

                \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)\right)} \]
              7. Step-by-step derivation
                1. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
                3. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                4. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                5. lower-cos.f64N/A

                  \[\leadsto \left(\color{blue}{\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                6. *-commutativeN/A

                  \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                7. lower-*.f64N/A

                  \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                8. *-commutativeN/A

                  \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                9. lower-*.f64N/A

                  \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                10. *-commutativeN/A

                  \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                11. lower-*.f64N/A

                  \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                12. +-commutativeN/A

                  \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\left(2 \cdot a + 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                13. *-commutativeN/A

                  \[\leadsto \left(\cos \left(\left(\left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                14. lower-fma.f64N/A

                  \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\mathsf{fma}\left(a, 2, 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                15. metadata-evalN/A

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

                \[\leadsto \color{blue}{\left(\cos \left(\left(\left(\mathsf{fma}\left(a, 2, 1\right) \cdot t\right) \cdot b\right) \cdot 0.0625\right) \cdot x\right) \cdot \cos \left(\left(-0.0625 \cdot t\right) \cdot z\right)} \]
              9. Taylor expanded in b around 0

                \[\leadsto x \cdot \color{blue}{\cos \left(\frac{-1}{16} \cdot \left(t \cdot z\right)\right)} \]
              10. Step-by-step derivation
                1. Applied rewrites8.8%

                  \[\leadsto \cos \left(\left(z \cdot t\right) \cdot -0.0625\right) \cdot \color{blue}{x} \]
                2. Taylor expanded in t around 0

                  \[\leadsto 1 \cdot x \]
                3. Step-by-step derivation
                  1. Applied rewrites9.8%

                    \[\leadsto 1 \cdot x \]
                4. Recombined 2 regimes into one program.
                5. Final simplification30.2%

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

                Alternative 4: 29.8% accurate, 1.1× speedup?

                \[\begin{array}{l} t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;t\_m \leq 9.8 \cdot 10^{+27}:\\ \;\;\;\;\left(\cos \left(0.125 \cdot \left(\left(b \cdot t\_m\right) \cdot a\right)\right) \cdot x\right) \cdot \cos \left(\left(-0.0625 \cdot t\_m\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t\_m}, \frac{a}{b}, \frac{-32}{b \cdot t\_m}\right), a, \frac{16}{b \cdot t\_m}\right)}\right) \cdot \left(1 \cdot x\right)\\ \end{array} \end{array} \]
                t_m = (fabs.f64 t)
                (FPCore (x y z t_m a b)
                 :precision binary64
                 (if (<= t_m 9.8e+27)
                   (* (* (cos (* 0.125 (* (* b t_m) a))) x) (cos (* (* -0.0625 t_m) z)))
                   (*
                    (cos
                     (/
                      1.0
                      (fma
                       (fma (/ 64.0 t_m) (/ a b) (/ -32.0 (* b t_m)))
                       a
                       (/ 16.0 (* b t_m)))))
                    (* 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+27) {
                		tmp = (cos((0.125 * ((b * t_m) * a))) * x) * cos(((-0.0625 * t_m) * z));
                	} else {
                		tmp = cos((1.0 / fma(fma((64.0 / t_m), (a / b), (-32.0 / (b * t_m))), a, (16.0 / (b * t_m))))) * (1.0 * x);
                	}
                	return tmp;
                }
                
                t_m = abs(t)
                function code(x, y, z, t_m, a, b)
                	tmp = 0.0
                	if (t_m <= 9.8e+27)
                		tmp = Float64(Float64(cos(Float64(0.125 * Float64(Float64(b * t_m) * a))) * x) * cos(Float64(Float64(-0.0625 * t_m) * z)));
                	else
                		tmp = Float64(cos(Float64(1.0 / fma(fma(Float64(64.0 / t_m), Float64(a / b), Float64(-32.0 / Float64(b * t_m))), a, Float64(16.0 / Float64(b * t_m))))) * Float64(1.0 * 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+27], N[(N[(N[Cos[N[(0.125 * N[(N[(b * t$95$m), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] * N[Cos[N[(N[(-0.0625 * t$95$m), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(1.0 / N[(N[(N[(64.0 / t$95$m), $MachinePrecision] * N[(a / b), $MachinePrecision] + N[(-32.0 / N[(b * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + N[(16.0 / N[(b * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 * x), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                t_m = \left|t\right|
                
                \\
                \begin{array}{l}
                \mathbf{if}\;t\_m \leq 9.8 \cdot 10^{+27}:\\
                \;\;\;\;\left(\cos \left(0.125 \cdot \left(\left(b \cdot t\_m\right) \cdot a\right)\right) \cdot x\right) \cdot \cos \left(\left(-0.0625 \cdot t\_m\right) \cdot z\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;\cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t\_m}, \frac{a}{b}, \frac{-32}{b \cdot t\_m}\right), a, \frac{16}{b \cdot t\_m}\right)}\right) \cdot \left(1 \cdot x\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if t < 9.8000000000000003e27

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

                    \[\leadsto \left(x \cdot \cos \color{blue}{\left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                    2. lower-*.f64N/A

                      \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                    3. *-commutativeN/A

                      \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot \frac{1}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                    4. lower-*.f6434.3

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

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

                    \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)\right)} \]
                  7. Step-by-step derivation
                    1. associate-*r*N/A

                      \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
                    2. lower-*.f64N/A

                      \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
                    3. *-commutativeN/A

                      \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    4. lower-*.f64N/A

                      \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    5. lower-cos.f64N/A

                      \[\leadsto \left(\color{blue}{\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    7. lower-*.f64N/A

                      \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    8. *-commutativeN/A

                      \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    9. lower-*.f64N/A

                      \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    10. *-commutativeN/A

                      \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    11. lower-*.f64N/A

                      \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    12. +-commutativeN/A

                      \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\left(2 \cdot a + 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    13. *-commutativeN/A

                      \[\leadsto \left(\cos \left(\left(\left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    14. lower-fma.f64N/A

                      \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\mathsf{fma}\left(a, 2, 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                    15. metadata-evalN/A

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

                    \[\leadsto \color{blue}{\left(\cos \left(\left(\left(\mathsf{fma}\left(a, 2, 1\right) \cdot t\right) \cdot b\right) \cdot 0.0625\right) \cdot x\right) \cdot \cos \left(\left(-0.0625 \cdot t\right) \cdot z\right)} \]
                  9. Taylor expanded in a around inf

                    \[\leadsto \left(\cos \left(\frac{1}{8} \cdot \left(a \cdot \left(b \cdot t\right)\right)\right) \cdot x\right) \cdot \cos \left(\left(\color{blue}{\frac{-1}{16}} \cdot t\right) \cdot z\right) \]
                  10. Step-by-step derivation
                    1. Applied rewrites33.8%

                      \[\leadsto \left(\cos \left(\left(\left(t \cdot b\right) \cdot a\right) \cdot 0.125\right) \cdot x\right) \cdot \cos \left(\left(\color{blue}{-0.0625} \cdot t\right) \cdot z\right) \]

                    if 9.8000000000000003e27 < t

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

                      \[\leadsto \left(x \cdot \color{blue}{1}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                    4. Step-by-step derivation
                      1. Applied rewrites14.5%

                        \[\leadsto \left(x \cdot \color{blue}{1}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                      2. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)} \]
                        2. clear-numN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(\frac{1}{\frac{16}{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}}\right)} \]
                        3. lift-*.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\frac{16}{\color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right)} \cdot t}}\right) \]
                        4. lift-+.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\frac{16}{\left(\color{blue}{\left(a \cdot 2 + 1\right)} \cdot b\right) \cdot t}}\right) \]
                        5. lift-*.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\frac{16}{\left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot b\right) \cdot t}}\right) \]
                        6. lift-fma.f64N/A

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

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\frac{16}{\color{blue}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right)} \cdot t}}\right) \]
                        8. lift-*.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\frac{16}{\color{blue}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right)} \cdot t}}\right) \]
                        9. lift-/.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\color{blue}{\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}}}\right) \]
                        10. inv-powN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left({\left(\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}\right)}^{-1}\right)} \]
                        11. exp-to-powN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(e^{\log \left(\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}\right) \cdot -1}\right)} \]
                        12. lift-log.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(e^{\color{blue}{\log \left(\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}\right)} \cdot -1}\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(e^{\color{blue}{-1 \cdot \log \left(\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}\right)}}\right) \]
                        14. exp-prodN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left({\left(e^{-1}\right)}^{\log \left(\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}\right)}\right)} \]
                        15. lower-pow.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left({\left(e^{-1}\right)}^{\log \left(\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}\right)}\right)} \]
                        16. lower-exp.f643.7

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

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

                        \[\leadsto \left(x \cdot 1\right) \cdot \cos \color{blue}{\left(\frac{1}{{\left(e^{-1}\right)}^{\log \left(\left(\left(b \cdot \mathsf{fma}\left(2, a, 1\right)\right) \cdot t\right) \cdot 0.0625\right)}}\right)} \]
                      5. Taylor expanded in a around 0

                        \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\color{blue}{a \cdot \left(64 \cdot \frac{a}{b \cdot t} - 32 \cdot \frac{1}{b \cdot t}\right) + 16 \cdot \frac{1}{b \cdot t}}}\right) \]
                      6. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\color{blue}{\left(64 \cdot \frac{a}{b \cdot t} - 32 \cdot \frac{1}{b \cdot t}\right) \cdot a} + 16 \cdot \frac{1}{b \cdot t}}\right) \]
                        2. lower-fma.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\color{blue}{\mathsf{fma}\left(64 \cdot \frac{a}{b \cdot t} - 32 \cdot \frac{1}{b \cdot t}, a, 16 \cdot \frac{1}{b \cdot t}\right)}}\right) \]
                        3. sub-negN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\color{blue}{64 \cdot \frac{a}{b \cdot t} + \left(\mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right)}, a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        4. associate-*r/N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\color{blue}{\frac{64 \cdot a}{b \cdot t}} + \left(\mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        5. *-commutativeN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\frac{64 \cdot a}{\color{blue}{t \cdot b}} + \left(\mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        6. times-fracN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\color{blue}{\frac{64}{t} \cdot \frac{a}{b}} + \left(\mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        7. lower-fma.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right)}, a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        8. lower-/.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\frac{64}{t}}, \frac{a}{b}, \mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        9. lower-/.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \color{blue}{\frac{a}{b}}, \mathsf{neg}\left(32 \cdot \frac{1}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        10. associate-*r/N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \mathsf{neg}\left(\color{blue}{\frac{32 \cdot 1}{b \cdot t}}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        11. metadata-evalN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \mathsf{neg}\left(\frac{\color{blue}{32}}{b \cdot t}\right)\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        12. distribute-neg-fracN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \color{blue}{\frac{\mathsf{neg}\left(32\right)}{b \cdot t}}\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        13. metadata-evalN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{\color{blue}{-32}}{b \cdot t}\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        14. lower-/.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \color{blue}{\frac{-32}{b \cdot t}}\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        15. *-commutativeN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{\color{blue}{t \cdot b}}\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        16. lower-*.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{\color{blue}{t \cdot b}}\right), a, 16 \cdot \frac{1}{b \cdot t}\right)}\right) \]
                        17. associate-*r/N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{t \cdot b}\right), a, \color{blue}{\frac{16 \cdot 1}{b \cdot t}}\right)}\right) \]
                        18. metadata-evalN/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{t \cdot b}\right), a, \frac{\color{blue}{16}}{b \cdot t}\right)}\right) \]
                        19. lower-/.f64N/A

                          \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{t \cdot b}\right), a, \color{blue}{\frac{16}{b \cdot t}}\right)}\right) \]
                      7. Applied rewrites16.0%

                        \[\leadsto \left(x \cdot 1\right) \cdot \cos \left(\frac{1}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{t \cdot b}\right), a, \frac{16}{t \cdot b}\right)}}\right) \]
                    5. Recombined 2 regimes into one program.
                    6. Final simplification29.7%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9.8 \cdot 10^{+27}:\\ \;\;\;\;\left(\cos \left(0.125 \cdot \left(\left(b \cdot t\right) \cdot a\right)\right) \cdot x\right) \cdot \cos \left(\left(-0.0625 \cdot t\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{64}{t}, \frac{a}{b}, \frac{-32}{b \cdot t}\right), a, \frac{16}{b \cdot t}\right)}\right) \cdot \left(1 \cdot x\right)\\ \end{array} \]
                    7. Add Preprocessing

                    Alternative 5: 28.3% accurate, 2.1× speedup?

                    \[\begin{array}{l} t_m = \left|t\right| \\ \cos \left(0.0625 \cdot \left(\left(\mathsf{fma}\left(a, 2, 1\right) \cdot t\_m\right) \cdot b\right)\right) \cdot x \end{array} \]
                    t_m = (fabs.f64 t)
                    (FPCore (x y z t_m a b)
                     :precision binary64
                     (* (cos (* 0.0625 (* (* (fma a 2.0 1.0) t_m) b))) x))
                    t_m = fabs(t);
                    double code(double x, double y, double z, double t_m, double a, double b) {
                    	return cos((0.0625 * ((fma(a, 2.0, 1.0) * t_m) * b))) * x;
                    }
                    
                    t_m = abs(t)
                    function code(x, y, z, t_m, a, b)
                    	return Float64(cos(Float64(0.0625 * Float64(Float64(fma(a, 2.0, 1.0) * t_m) * b))) * x)
                    end
                    
                    t_m = N[Abs[t], $MachinePrecision]
                    code[x_, y_, z_, t$95$m_, a_, b_] := N[(N[Cos[N[(0.0625 * N[(N[(N[(a * 2.0 + 1.0), $MachinePrecision] * t$95$m), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
                    
                    \begin{array}{l}
                    t_m = \left|t\right|
                    
                    \\
                    \cos \left(0.0625 \cdot \left(\left(\mathsf{fma}\left(a, 2, 1\right) \cdot t\_m\right) \cdot b\right)\right) \cdot x
                    \end{array}
                    
                    Derivation
                    1. Initial program 27.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. Add Preprocessing
                    3. Taylor expanded in y around 0

                      \[\leadsto \left(x \cdot \cos \color{blue}{\left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                      3. *-commutativeN/A

                        \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot \frac{1}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                      4. lower-*.f6428.8

                        \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot 0.0625\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                    5. Applied rewrites28.8%

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

                      \[\leadsto \color{blue}{x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)} \]
                    7. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \color{blue}{\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x} \]
                      3. lower-cos.f64N/A

                        \[\leadsto \color{blue}{\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)} \cdot x \]
                      4. *-commutativeN/A

                        \[\leadsto \cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x \]
                      5. lower-*.f64N/A

                        \[\leadsto \cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x \]
                      6. *-commutativeN/A

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

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

                        \[\leadsto \cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x \]
                      9. lower-*.f64N/A

                        \[\leadsto \cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x \]
                      10. +-commutativeN/A

                        \[\leadsto \cos \left(\left(\left(\color{blue}{\left(2 \cdot a + 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x \]
                      11. *-commutativeN/A

                        \[\leadsto \cos \left(\left(\left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x \]
                      12. lower-fma.f6428.5

                        \[\leadsto \cos \left(\left(\left(\color{blue}{\mathsf{fma}\left(a, 2, 1\right)} \cdot t\right) \cdot b\right) \cdot 0.0625\right) \cdot x \]
                    8. Applied rewrites28.5%

                      \[\leadsto \color{blue}{\cos \left(\left(\left(\mathsf{fma}\left(a, 2, 1\right) \cdot t\right) \cdot b\right) \cdot 0.0625\right) \cdot x} \]
                    9. Final simplification28.5%

                      \[\leadsto \cos \left(0.0625 \cdot \left(\left(\mathsf{fma}\left(a, 2, 1\right) \cdot t\right) \cdot b\right)\right) \cdot x \]
                    10. Add Preprocessing

                    Alternative 6: 29.4% accurate, 2.3× speedup?

                    \[\begin{array}{l} t_m = \left|t\right| \\ \cos \left(\left(z \cdot t\_m\right) \cdot -0.0625\right) \cdot x \end{array} \]
                    t_m = (fabs.f64 t)
                    (FPCore (x y z t_m a b) :precision binary64 (* (cos (* (* z t_m) -0.0625)) x))
                    t_m = fabs(t);
                    double code(double x, double y, double z, double t_m, double a, double b) {
                    	return cos(((z * t_m) * -0.0625)) * 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 = cos(((z * t_m) * (-0.0625d0))) * 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 Math.cos(((z * t_m) * -0.0625)) * x;
                    }
                    
                    t_m = math.fabs(t)
                    def code(x, y, z, t_m, a, b):
                    	return math.cos(((z * t_m) * -0.0625)) * x
                    
                    t_m = abs(t)
                    function code(x, y, z, t_m, a, b)
                    	return Float64(cos(Float64(Float64(z * t_m) * -0.0625)) * x)
                    end
                    
                    t_m = abs(t);
                    function tmp = code(x, y, z, t_m, a, b)
                    	tmp = cos(((z * t_m) * -0.0625)) * x;
                    end
                    
                    t_m = N[Abs[t], $MachinePrecision]
                    code[x_, y_, z_, t$95$m_, a_, b_] := N[(N[Cos[N[(N[(z * t$95$m), $MachinePrecision] * -0.0625), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
                    
                    \begin{array}{l}
                    t_m = \left|t\right|
                    
                    \\
                    \cos \left(\left(z \cdot t\_m\right) \cdot -0.0625\right) \cdot x
                    \end{array}
                    
                    Derivation
                    1. Initial program 27.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. Add Preprocessing
                    3. Taylor expanded in y around 0

                      \[\leadsto \left(x \cdot \cos \color{blue}{\left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                      2. lower-*.f64N/A

                        \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                      3. *-commutativeN/A

                        \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot \frac{1}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                      4. lower-*.f6428.8

                        \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot 0.0625\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                    5. Applied rewrites28.8%

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

                      \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)\right)} \]
                    7. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
                      3. *-commutativeN/A

                        \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      5. lower-cos.f64N/A

                        \[\leadsto \left(\color{blue}{\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      7. lower-*.f64N/A

                        \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      9. lower-*.f64N/A

                        \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      10. *-commutativeN/A

                        \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      11. lower-*.f64N/A

                        \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      12. +-commutativeN/A

                        \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\left(2 \cdot a + 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      13. *-commutativeN/A

                        \[\leadsto \left(\cos \left(\left(\left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      14. lower-fma.f64N/A

                        \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\mathsf{fma}\left(a, 2, 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                      15. metadata-evalN/A

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

                      \[\leadsto \color{blue}{\left(\cos \left(\left(\left(\mathsf{fma}\left(a, 2, 1\right) \cdot t\right) \cdot b\right) \cdot 0.0625\right) \cdot x\right) \cdot \cos \left(\left(-0.0625 \cdot t\right) \cdot z\right)} \]
                    9. Taylor expanded in b around 0

                      \[\leadsto x \cdot \color{blue}{\cos \left(\frac{-1}{16} \cdot \left(t \cdot z\right)\right)} \]
                    10. Step-by-step derivation
                      1. Applied rewrites28.5%

                        \[\leadsto \cos \left(\left(z \cdot t\right) \cdot -0.0625\right) \cdot \color{blue}{x} \]
                      2. Add Preprocessing

                      Alternative 7: 30.4% accurate, 44.8× speedup?

                      \[\begin{array}{l} t_m = \left|t\right| \\ 1 \cdot x \end{array} \]
                      t_m = (fabs.f64 t)
                      (FPCore (x y z t_m a b) :precision binary64 (* 1.0 x))
                      t_m = fabs(t);
                      double code(double x, double y, double z, double t_m, double a, double b) {
                      	return 1.0 * 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 = 1.0d0 * 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 1.0 * x;
                      }
                      
                      t_m = math.fabs(t)
                      def code(x, y, z, t_m, a, b):
                      	return 1.0 * x
                      
                      t_m = abs(t)
                      function code(x, y, z, t_m, a, b)
                      	return Float64(1.0 * x)
                      end
                      
                      t_m = abs(t);
                      function tmp = code(x, y, z, t_m, a, b)
                      	tmp = 1.0 * x;
                      end
                      
                      t_m = N[Abs[t], $MachinePrecision]
                      code[x_, y_, z_, t$95$m_, a_, b_] := N[(1.0 * x), $MachinePrecision]
                      
                      \begin{array}{l}
                      t_m = \left|t\right|
                      
                      \\
                      1 \cdot x
                      \end{array}
                      
                      Derivation
                      1. Initial program 27.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. Add Preprocessing
                      3. Taylor expanded in y around 0

                        \[\leadsto \left(x \cdot \cos \color{blue}{\left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                        2. lower-*.f64N/A

                          \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(t \cdot z\right) \cdot \frac{1}{16}\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                        3. *-commutativeN/A

                          \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot \frac{1}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                        4. lower-*.f6428.8

                          \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(z \cdot t\right)} \cdot 0.0625\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                      5. Applied rewrites28.8%

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

                        \[\leadsto \color{blue}{x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)\right)} \]
                      7. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
                        2. lower-*.f64N/A

                          \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)} \]
                        3. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        4. lower-*.f64N/A

                          \[\leadsto \color{blue}{\left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right) \cdot x\right)} \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        5. lower-cos.f64N/A

                          \[\leadsto \left(\color{blue}{\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right)\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        7. lower-*.f64N/A

                          \[\leadsto \left(\cos \color{blue}{\left(\left(b \cdot \left(t \cdot \left(1 + 2 \cdot a\right)\right)\right) \cdot \frac{1}{16}\right)} \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        9. lower-*.f64N/A

                          \[\leadsto \left(\cos \left(\color{blue}{\left(\left(t \cdot \left(1 + 2 \cdot a\right)\right) \cdot b\right)} \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        10. *-commutativeN/A

                          \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        11. lower-*.f64N/A

                          \[\leadsto \left(\cos \left(\left(\color{blue}{\left(\left(1 + 2 \cdot a\right) \cdot t\right)} \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        12. +-commutativeN/A

                          \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\left(2 \cdot a + 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \left(\cos \left(\left(\left(\left(\color{blue}{a \cdot 2} + 1\right) \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        14. lower-fma.f64N/A

                          \[\leadsto \left(\cos \left(\left(\left(\color{blue}{\mathsf{fma}\left(a, 2, 1\right)} \cdot t\right) \cdot b\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                        15. metadata-evalN/A

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

                        \[\leadsto \color{blue}{\left(\cos \left(\left(\left(\mathsf{fma}\left(a, 2, 1\right) \cdot t\right) \cdot b\right) \cdot 0.0625\right) \cdot x\right) \cdot \cos \left(\left(-0.0625 \cdot t\right) \cdot z\right)} \]
                      9. Taylor expanded in b around 0

                        \[\leadsto x \cdot \color{blue}{\cos \left(\frac{-1}{16} \cdot \left(t \cdot z\right)\right)} \]
                      10. Step-by-step derivation
                        1. Applied rewrites28.5%

                          \[\leadsto \cos \left(\left(z \cdot t\right) \cdot -0.0625\right) \cdot \color{blue}{x} \]
                        2. Taylor expanded in t around 0

                          \[\leadsto 1 \cdot x \]
                        3. Step-by-step derivation
                          1. Applied rewrites27.6%

                            \[\leadsto 1 \cdot 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 2024244 
                          (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))))