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

Percentage Accurate: 27.9% → 32.4%
Time: 15.7s
Alternatives: 12
Speedup: 2.4×

Specification

?
\[\begin{array}{l} \\ \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (*
  (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
  (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))))
double code(double x, double y, double z, double t, double a, double b) {
	return (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = (x * cos((((((y * 2.0d0) + 1.0d0) * z) * t) / 16.0d0))) * cos((((((a * 2.0d0) + 1.0d0) * b) * t) / 16.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (x * Math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * Math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0));
}
def code(x, y, z, t, a, b):
	return (x * math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))
function code(x, y, z, t, a, b)
	return Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(Float64(Float64(Float64(a * 2.0) + 1.0) * b) * t) / 16.0)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0));
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(N[(N[(N[(a * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * b), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 27.9% accurate, 1.0× speedup?

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

\\
\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)
\end{array}

Alternative 1: 32.4% accurate, 0.5× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t\_m}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\_m\right) \cdot t\_m}{16}\right) \leq 2 \cdot 10^{+262}:\\ \;\;\;\;\left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t\_m \cdot z\right)}{16}\right)\right) \cdot \sin \left(\frac{\left(b\_m \cdot \mathsf{fma}\left(2, a, 1\right)\right) \cdot t\_m}{-16} + \frac{\mathsf{PI}\left(\right)}{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
t_m = (fabs.f64 t)
(FPCore (x y z t_m a b_m)
 :precision binary64
 (if (<=
      (*
       (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t_m) 16.0)))
       (cos (/ (* (* (+ (* a 2.0) 1.0) b_m) t_m) 16.0)))
      2e+262)
   (*
    (* x (cos (/ (* (fma 2.0 y 1.0) (* t_m z)) 16.0)))
    (sin (+ (/ (* (* b_m (fma 2.0 a 1.0)) t_m) -16.0) (/ (PI) 2.0))))
   (* (sin (* (PI) 0.5)) x)))
\begin{array}{l}
b_m = \left|b\right|
\\
t_m = \left|t\right|

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

\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \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)))) < 2e262

    1. Initial program 49.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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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. lift-*.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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) \]
      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t \cdot z\right)}{16}\right)\right) \cdot \color{blue}{\cos \left(\mathsf{neg}\left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)\right)} \]
      3. sin-+PI/2-revN/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t \cdot z\right)}{16}\right)\right) \cdot \color{blue}{\sin \left(\left(\mathsf{neg}\left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)} \]
      4. lower-sin.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t \cdot z\right)}{16}\right)\right) \cdot \color{blue}{\sin \left(\left(\mathsf{neg}\left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)} \]
      5. lift-PI.f64N/A

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

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

        \[\leadsto \left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t \cdot z\right)}{16}\right)\right) \cdot \sin \color{blue}{\left(\left(\mathsf{neg}\left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)} \]
    6. Applied rewrites49.4%

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

    if 2e262 < (*.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 1.2%

      \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-cos.f64N/A

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

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

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

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

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

        \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \sin \left(\frac{\color{blue}{t \cdot \left(\left(a \cdot 2 + 1\right) \cdot b\right)}}{16} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
      7. associate-/l*N/A

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
      3. lower-sin.f64N/A

        \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot x \]
      4. *-commutativeN/A

        \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
      5. lower-*.f64N/A

        \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
      6. lower-PI.f6412.3

        \[\leadsto \sin \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.5\right) \cdot x \]
    7. Applied rewrites12.3%

      \[\leadsto \color{blue}{\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 32.4% accurate, 0.5× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \begin{array}{l} t_1 := \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\_m\right) \cdot t\_m}{16}\right)\\ \mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t\_m}{16}\right)\right) \cdot t\_1 \leq 2 \cdot 10^{+262}:\\ \;\;\;\;\left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t\_m \cdot z\right)}{16}\right)\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
t_m = (fabs.f64 t)
(FPCore (x y z t_m a b_m)
 :precision binary64
 (let* ((t_1 (cos (/ (* (* (+ (* a 2.0) 1.0) b_m) t_m) 16.0))))
   (if (<= (* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t_m) 16.0))) t_1) 2e+262)
     (* (* x (cos (/ (* (fma 2.0 y 1.0) (* t_m z)) 16.0))) t_1)
     (* (sin (* (PI) 0.5)) x))))
\begin{array}{l}
b_m = \left|b\right|
\\
t_m = \left|t\right|

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

\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \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)))) < 2e262

    1. Initial program 49.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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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. lift-*.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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) \]
      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

    if 2e262 < (*.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 1.2%

      \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-cos.f64N/A

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

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

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

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

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

        \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \sin \left(\frac{\color{blue}{t \cdot \left(\left(a \cdot 2 + 1\right) \cdot b\right)}}{16} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
      7. associate-/l*N/A

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
      3. lower-sin.f64N/A

        \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot x \]
      4. *-commutativeN/A

        \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
      5. lower-*.f64N/A

        \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
      6. lower-PI.f6412.3

        \[\leadsto \sin \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.5\right) \cdot x \]
    7. Applied rewrites12.3%

      \[\leadsto \color{blue}{\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 32.3% accurate, 0.5× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t\_m}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\_m\right) \cdot t\_m}{16}\right) \leq 2 \cdot 10^{+262}:\\ \;\;\;\;\left(\cos \left(\frac{\left(b\_m \cdot \mathsf{fma}\left(2, a, 1\right)\right) \cdot t\_m}{-16}\right) \cdot x\right) \cdot \cos \left(\frac{\left(z \cdot \mathsf{fma}\left(y, 2, 1\right)\right) \cdot t\_m}{-16}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
t_m = (fabs.f64 t)
(FPCore (x y z t_m a b_m)
 :precision binary64
 (if (<=
      (*
       (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t_m) 16.0)))
       (cos (/ (* (* (+ (* a 2.0) 1.0) b_m) t_m) 16.0)))
      2e+262)
   (*
    (* (cos (/ (* (* b_m (fma 2.0 a 1.0)) t_m) -16.0)) x)
    (cos (/ (* (* z (fma y 2.0 1.0)) t_m) -16.0)))
   (* (sin (* (PI) 0.5)) x)))
\begin{array}{l}
b_m = \left|b\right|
\\
t_m = \left|t\right|

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

\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \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)))) < 2e262

    1. Initial program 49.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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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. lift-*.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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) \]
      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

    if 2e262 < (*.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 1.2%

      \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-cos.f64N/A

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

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

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

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

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

        \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \sin \left(\frac{\color{blue}{t \cdot \left(\left(a \cdot 2 + 1\right) \cdot b\right)}}{16} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
      7. associate-/l*N/A

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
      3. lower-sin.f64N/A

        \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot x \]
      4. *-commutativeN/A

        \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
      5. lower-*.f64N/A

        \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
      6. lower-PI.f6412.3

        \[\leadsto \sin \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.5\right) \cdot x \]
    7. Applied rewrites12.3%

      \[\leadsto \color{blue}{\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 32.1% accurate, 0.5× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t\_m}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\_m\right) \cdot t\_m}{16}\right) \leq 2 \cdot 10^{+262}:\\ \;\;\;\;\left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t\_m \cdot z\right)}{16}\right)\right) \cdot \sin \left(\mathsf{fma}\left(b\_m \cdot t\_m, -0.0625, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
t_m = (fabs.f64 t)
(FPCore (x y z t_m a b_m)
 :precision binary64
 (if (<=
      (*
       (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t_m) 16.0)))
       (cos (/ (* (* (+ (* a 2.0) 1.0) b_m) t_m) 16.0)))
      2e+262)
   (*
    (* x (cos (/ (* (fma 2.0 y 1.0) (* t_m z)) 16.0)))
    (sin (fma (* b_m t_m) -0.0625 (/ (PI) 2.0))))
   (* (sin (* (PI) 0.5)) x)))
\begin{array}{l}
b_m = \left|b\right|
\\
t_m = \left|t\right|

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

\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \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)))) < 2e262

    1. Initial program 49.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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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. lift-*.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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) \]
      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t \cdot z\right)}{16}\right)\right) \cdot \color{blue}{\cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right)} \]
    6. Step-by-step derivation
      1. cos-neg-revN/A

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

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

        \[\leadsto \left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t \cdot z\right)}{16}\right)\right) \cdot \cos \left(\mathsf{neg}\left(\color{blue}{\left(b \cdot t\right) \cdot \frac{1}{16}}\right)\right) \]
      4. distribute-rgt-neg-inN/A

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

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

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

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

      \[\leadsto \left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t \cdot z\right)}{16}\right)\right) \cdot \color{blue}{\cos \left(\left(b \cdot t\right) \cdot -0.0625\right)} \]
    8. Step-by-step derivation
      1. Applied rewrites48.5%

        \[\leadsto \left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t \cdot z\right)}{16}\right)\right) \cdot \sin \left(\mathsf{fma}\left(b \cdot t, -0.0625, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]

      if 2e262 < (*.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 1.2%

        \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-cos.f64N/A

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

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

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

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

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

          \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \sin \left(\frac{\color{blue}{t \cdot \left(\left(a \cdot 2 + 1\right) \cdot b\right)}}{16} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
        7. associate-/l*N/A

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
        3. lower-sin.f64N/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot x \]
        4. *-commutativeN/A

          \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
        5. lower-*.f64N/A

          \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
        6. lower-PI.f6412.3

          \[\leadsto \sin \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.5\right) \cdot x \]
      7. Applied rewrites12.3%

        \[\leadsto \color{blue}{\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x} \]
    9. Recombined 2 regimes into one program.
    10. Add Preprocessing

    Alternative 5: 32.1% accurate, 0.5× speedup?

    \[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t\_m}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\_m\right) \cdot t\_m}{16}\right) \leq 2 \cdot 10^{+306}:\\ \;\;\;\;\left(\cos \left(\left(b\_m \cdot t\_m\right) \cdot 0.0625\right) \cdot x\right) \cdot \sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), 0.5, -0.0625 \cdot \left(\left(\mathsf{fma}\left(y, 2, 1\right) \cdot z\right) \cdot t\_m\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x\\ \end{array} \end{array} \]
    b_m = (fabs.f64 b)
    t_m = (fabs.f64 t)
    (FPCore (x y z t_m a b_m)
     :precision binary64
     (if (<=
          (*
           (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t_m) 16.0)))
           (cos (/ (* (* (+ (* a 2.0) 1.0) b_m) t_m) 16.0)))
          2e+306)
       (*
        (* (cos (* (* b_m t_m) 0.0625)) x)
        (sin (fma (PI) 0.5 (* -0.0625 (* (* (fma y 2.0 1.0) z) t_m)))))
       (* (sin (* (PI) 0.5)) x)))
    \begin{array}{l}
    b_m = \left|b\right|
    \\
    t_m = \left|t\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t\_m}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\_m\right) \cdot t\_m}{16}\right) \leq 2 \cdot 10^{+306}:\\
    \;\;\;\;\left(\cos \left(\left(b\_m \cdot t\_m\right) \cdot 0.0625\right) \cdot x\right) \cdot \sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), 0.5, -0.0625 \cdot \left(\left(\mathsf{fma}\left(y, 2, 1\right) \cdot z\right) \cdot t\_m\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \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)))) < 2.00000000000000003e306

      1. Initial program 47.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. Step-by-step derivation
        1. lift-cos.f64N/A

          \[\leadsto \left(x \cdot \color{blue}{\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. cos-neg-revN/A

          \[\leadsto \left(x \cdot \color{blue}{\cos \left(\mathsf{neg}\left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
        3. sin-+PI/2-revN/A

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

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

          \[\leadsto \left(x \cdot \sin \left(\left(\mathsf{neg}\left(\color{blue}{\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}}\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
        6. distribute-neg-frac2N/A

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

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

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

          \[\leadsto \left(x \cdot \sin \left(\frac{t \cdot \color{blue}{\left(\left(y \cdot 2 + 1\right) \cdot z\right)}}{\mathsf{neg}\left(16\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
        10. associate-*r*N/A

          \[\leadsto \left(x \cdot \sin \left(\frac{\color{blue}{\left(t \cdot \left(y \cdot 2 + 1\right)\right) \cdot z}}{\mathsf{neg}\left(16\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
        11. associate-/l*N/A

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

          \[\leadsto \left(x \cdot \sin \color{blue}{\left(\mathsf{fma}\left(t \cdot \left(y \cdot 2 + 1\right), \frac{z}{\mathsf{neg}\left(16\right)}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      4. Applied rewrites46.6%

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

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

          \[\leadsto \color{blue}{\left(x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right)\right) \cdot \sin \left(\frac{-1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \]
        2. metadata-evalN/A

          \[\leadsto \left(x \cdot \cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{16}\right)\right)} \cdot \left(b \cdot t\right)\right)\right) \cdot \sin \left(\frac{-1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
        3. distribute-lft-neg-inN/A

          \[\leadsto \left(x \cdot \cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{16} \cdot \left(b \cdot t\right)\right)\right)}\right) \cdot \sin \left(\frac{-1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
        4. cos-neg-revN/A

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

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

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

          \[\leadsto \color{blue}{\left(\cos \left(\frac{-1}{16} \cdot \left(b \cdot t\right)\right) \cdot x\right)} \cdot \sin \left(\frac{-1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
        8. cos-neg-revN/A

          \[\leadsto \left(\color{blue}{\cos \left(\mathsf{neg}\left(\frac{-1}{16} \cdot \left(b \cdot t\right)\right)\right)} \cdot x\right) \cdot \sin \left(\frac{-1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
        9. distribute-lft-neg-inN/A

          \[\leadsto \left(\cos \color{blue}{\left(\left(\mathsf{neg}\left(\frac{-1}{16}\right)\right) \cdot \left(b \cdot t\right)\right)} \cdot x\right) \cdot \sin \left(\frac{-1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
        10. metadata-evalN/A

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

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

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

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

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

          \[\leadsto \left(\cos \left(\left(b \cdot t\right) \cdot \frac{1}{16}\right) \cdot x\right) \cdot \color{blue}{\sin \left(\frac{-1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \]
      7. Applied rewrites46.9%

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

      if 2.00000000000000003e306 < (*.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. Step-by-step derivation
        1. lift-cos.f64N/A

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

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

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

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

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

          \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \sin \left(\frac{\color{blue}{t \cdot \left(\left(a \cdot 2 + 1\right) \cdot b\right)}}{16} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
        7. associate-/l*N/A

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
        3. lower-sin.f64N/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot x \]
        4. *-commutativeN/A

          \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
        5. lower-*.f64N/A

          \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
        6. lower-PI.f6411.6

          \[\leadsto \sin \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.5\right) \cdot x \]
      7. Applied rewrites11.6%

        \[\leadsto \color{blue}{\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 6: 32.0% accurate, 0.5× speedup?

    \[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t\_m}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\_m\right) \cdot t\_m}{16}\right) \leq 2 \cdot 10^{+262}:\\ \;\;\;\;\left(x \cdot \cos \left(\left(b\_m \cdot t\_m\right) \cdot -0.0625\right)\right) \cdot \cos \left(-0.0625 \cdot \left(\left(\mathsf{fma}\left(2, y, 1\right) \cdot z\right) \cdot t\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x\\ \end{array} \end{array} \]
    b_m = (fabs.f64 b)
    t_m = (fabs.f64 t)
    (FPCore (x y z t_m a b_m)
     :precision binary64
     (if (<=
          (*
           (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t_m) 16.0)))
           (cos (/ (* (* (+ (* a 2.0) 1.0) b_m) t_m) 16.0)))
          2e+262)
       (*
        (* x (cos (* (* b_m t_m) -0.0625)))
        (cos (* -0.0625 (* (* (fma 2.0 y 1.0) z) t_m))))
       (* (sin (* (PI) 0.5)) x)))
    \begin{array}{l}
    b_m = \left|b\right|
    \\
    t_m = \left|t\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t\_m}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\_m\right) \cdot t\_m}{16}\right) \leq 2 \cdot 10^{+262}:\\
    \;\;\;\;\left(x \cdot \cos \left(\left(b\_m \cdot t\_m\right) \cdot -0.0625\right)\right) \cdot \cos \left(-0.0625 \cdot \left(\left(\mathsf{fma}\left(2, y, 1\right) \cdot z\right) \cdot t\_m\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \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)))) < 2e262

      1. Initial program 49.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. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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. lift-*.f64N/A

          \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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) \]
        3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(x \cdot \cos \left(\mathsf{neg}\left(\color{blue}{\left(b \cdot t\right) \cdot \frac{1}{16}}\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right) \]
        7. distribute-rgt-neg-inN/A

          \[\leadsto \left(x \cdot \cos \color{blue}{\left(\left(b \cdot t\right) \cdot \left(\mathsf{neg}\left(\frac{1}{16}\right)\right)\right)}\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right) \]
        8. metadata-evalN/A

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

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

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

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

          \[\leadsto \left(x \cdot \cos \left(\left(b \cdot t\right) \cdot \frac{-1}{16}\right)\right) \cdot \color{blue}{\cos \left(\mathsf{neg}\left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right)} \]
        13. distribute-lft-neg-inN/A

          \[\leadsto \left(x \cdot \cos \left(\left(b \cdot t\right) \cdot \frac{-1}{16}\right)\right) \cdot \cos \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{16}\right)\right) \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)} \]
        14. metadata-evalN/A

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

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

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

          \[\leadsto \left(x \cdot \cos \left(\left(b \cdot t\right) \cdot \frac{-1}{16}\right)\right) \cdot \cos \left(\frac{-1}{16} \cdot \color{blue}{\left(\left(z \cdot \left(1 + 2 \cdot y\right)\right) \cdot t\right)}\right) \]
      7. Applied rewrites48.0%

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

      if 2e262 < (*.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 1.2%

        \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-cos.f64N/A

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

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

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

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

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

          \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \sin \left(\frac{\color{blue}{t \cdot \left(\left(a \cdot 2 + 1\right) \cdot b\right)}}{16} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
        7. associate-/l*N/A

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
        3. lower-sin.f64N/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot x \]
        4. *-commutativeN/A

          \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
        5. lower-*.f64N/A

          \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
        6. lower-PI.f6412.3

          \[\leadsto \sin \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.5\right) \cdot x \]
      7. Applied rewrites12.3%

        \[\leadsto \color{blue}{\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 7: 31.7% accurate, 1.0× speedup?

    \[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \begin{array}{l} \mathbf{if}\;t\_m \leq 2.9 \cdot 10^{-50}:\\ \;\;\;\;\left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t\_m \cdot z\right)}{16}\right)\right) \cdot \sin \left(\mathsf{fma}\left(0.0625, b\_m \cdot t\_m, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x\\ \end{array} \end{array} \]
    b_m = (fabs.f64 b)
    t_m = (fabs.f64 t)
    (FPCore (x y z t_m a b_m)
     :precision binary64
     (if (<= t_m 2.9e-50)
       (*
        (* x (cos (/ (* (fma 2.0 y 1.0) (* t_m z)) 16.0)))
        (sin (fma 0.0625 (* b_m t_m) (/ (PI) 2.0))))
       (* (sin (* (PI) 0.5)) x)))
    \begin{array}{l}
    b_m = \left|b\right|
    \\
    t_m = \left|t\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;t\_m \leq 2.9 \cdot 10^{-50}:\\
    \;\;\;\;\left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t\_m \cdot z\right)}{16}\right)\right) \cdot \sin \left(\mathsf{fma}\left(0.0625, b\_m \cdot t\_m, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < 2.90000000000000008e-50

      1. Initial program 32.7%

        \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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. lift-*.f64N/A

          \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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) \]
        3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t \cdot z\right)}{16}\right)\right) \cdot \color{blue}{\cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right)} \]
      6. Step-by-step derivation
        1. cos-neg-revN/A

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

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

          \[\leadsto \left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t \cdot z\right)}{16}\right)\right) \cdot \cos \left(\mathsf{neg}\left(\color{blue}{\left(b \cdot t\right) \cdot \frac{1}{16}}\right)\right) \]
        4. distribute-rgt-neg-inN/A

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

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

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

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

        \[\leadsto \left(x \cdot \cos \left(\frac{\mathsf{fma}\left(2, y, 1\right) \cdot \left(t \cdot z\right)}{16}\right)\right) \cdot \color{blue}{\cos \left(\left(b \cdot t\right) \cdot -0.0625\right)} \]
      8. Step-by-step derivation
        1. Applied rewrites34.0%

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

        if 2.90000000000000008e-50 < t

        1. Initial program 15.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. Step-by-step derivation
          1. lift-cos.f64N/A

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

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

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

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

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

            \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \sin \left(\frac{\color{blue}{t \cdot \left(\left(a \cdot 2 + 1\right) \cdot b\right)}}{16} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
          7. associate-/l*N/A

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

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

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

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

          \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
          3. lower-sin.f64N/A

            \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot x \]
          4. *-commutativeN/A

            \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
          5. lower-*.f64N/A

            \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
          6. lower-PI.f6421.3

            \[\leadsto \sin \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.5\right) \cdot x \]
        7. Applied rewrites21.3%

          \[\leadsto \color{blue}{\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x} \]
      9. Recombined 2 regimes into one program.
      10. Add Preprocessing

      Alternative 8: 31.1% accurate, 2.4× speedup?

      \[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x \end{array} \]
      b_m = (fabs.f64 b)
      t_m = (fabs.f64 t)
      (FPCore (x y z t_m a b_m) :precision binary64 (* (sin (* (PI) 0.5)) x))
      \begin{array}{l}
      b_m = \left|b\right|
      \\
      t_m = \left|t\right|
      
      \\
      \sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x
      \end{array}
      
      Derivation
      1. Initial program 27.7%

        \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-cos.f64N/A

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

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

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

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

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

          \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \sin \left(\frac{\color{blue}{t \cdot \left(\left(a \cdot 2 + 1\right) \cdot b\right)}}{16} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
        7. associate-/l*N/A

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot x} \]
        3. lower-sin.f64N/A

          \[\leadsto \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)} \cdot x \]
        4. *-commutativeN/A

          \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
        5. lower-*.f64N/A

          \[\leadsto \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)} \cdot x \]
        6. lower-PI.f6430.5

          \[\leadsto \sin \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.5\right) \cdot x \]
      7. Applied rewrites30.5%

        \[\leadsto \color{blue}{\sin \left(\mathsf{PI}\left(\right) \cdot 0.5\right) \cdot x} \]
      8. Add Preprocessing

      Alternative 9: 19.5% accurate, 6.4× speedup?

      \[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \mathsf{fma}\left(\left(t\_m \cdot t\_m\right) \cdot x, -0.001953125 \cdot \left(\left(4 \cdot \left(y \cdot y\right)\right) \cdot \left(z \cdot z\right)\right), x\right) \end{array} \]
      b_m = (fabs.f64 b)
      t_m = (fabs.f64 t)
      (FPCore (x y z t_m a b_m)
       :precision binary64
       (fma (* (* t_m t_m) x) (* -0.001953125 (* (* 4.0 (* y y)) (* z z))) x))
      b_m = fabs(b);
      t_m = fabs(t);
      double code(double x, double y, double z, double t_m, double a, double b_m) {
      	return fma(((t_m * t_m) * x), (-0.001953125 * ((4.0 * (y * y)) * (z * z))), x);
      }
      
      b_m = abs(b)
      t_m = abs(t)
      function code(x, y, z, t_m, a, b_m)
      	return fma(Float64(Float64(t_m * t_m) * x), Float64(-0.001953125 * Float64(Float64(4.0 * Float64(y * y)) * Float64(z * z))), x)
      end
      
      b_m = N[Abs[b], $MachinePrecision]
      t_m = N[Abs[t], $MachinePrecision]
      code[x_, y_, z_, t$95$m_, a_, b$95$m_] := N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * x), $MachinePrecision] * N[(-0.001953125 * N[(N[(4.0 * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
      
      \begin{array}{l}
      b_m = \left|b\right|
      \\
      t_m = \left|t\right|
      
      \\
      \mathsf{fma}\left(\left(t\_m \cdot t\_m\right) \cdot x, -0.001953125 \cdot \left(\left(4 \cdot \left(y \cdot y\right)\right) \cdot \left(z \cdot z\right)\right), x\right)
      \end{array}
      
      Derivation
      1. Initial program 27.7%

        \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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. lift-*.f64N/A

          \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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) \]
        3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + {t}^{2} \cdot \left(x \cdot \left(\frac{-1}{512} \cdot \left({b}^{2} \cdot {\left(1 + 2 \cdot a\right)}^{2}\right) + \frac{-1}{512} \cdot \left({z}^{2} \cdot {\left(1 + 2 \cdot y\right)}^{2}\right)\right)\right)} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left({t}^{2} \cdot x, \frac{-1}{512} \cdot \left({b}^{2} \cdot {\left(1 + 2 \cdot a\right)}^{2}\right) + \frac{-1}{512} \cdot \left({z}^{2} \cdot {\left(1 + 2 \cdot y\right)}^{2}\right), x\right)} \]
      7. Applied rewrites13.9%

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

        \[\leadsto \mathsf{fma}\left(\left(t \cdot t\right) \cdot x, \frac{-1}{512} \cdot \left(4 \cdot \color{blue}{\left({y}^{2} \cdot {z}^{2}\right)}\right), x\right) \]
      9. Step-by-step derivation
        1. Applied rewrites20.5%

          \[\leadsto \mathsf{fma}\left(\left(t \cdot t\right) \cdot x, -0.001953125 \cdot \left(\left(4 \cdot \left(y \cdot y\right)\right) \cdot \color{blue}{\left(z \cdot z\right)}\right), x\right) \]
        2. Add Preprocessing

        Alternative 10: 3.0% accurate, 7.5× speedup?

        \[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \left(\left(\left(\left(\left(a \cdot a\right) \cdot -0.0078125\right) \cdot t\_m\right) \cdot \left(t\_m \cdot x\right)\right) \cdot b\_m\right) \cdot b\_m \end{array} \]
        b_m = (fabs.f64 b)
        t_m = (fabs.f64 t)
        (FPCore (x y z t_m a b_m)
         :precision binary64
         (* (* (* (* (* (* a a) -0.0078125) t_m) (* t_m x)) b_m) b_m))
        b_m = fabs(b);
        t_m = fabs(t);
        double code(double x, double y, double z, double t_m, double a, double b_m) {
        	return (((((a * a) * -0.0078125) * t_m) * (t_m * x)) * b_m) * b_m;
        }
        
        b_m = abs(b)
        t_m = abs(t)
        real(8) function code(x, y, z, t_m, a, b_m)
            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_m
            code = (((((a * a) * (-0.0078125d0)) * t_m) * (t_m * x)) * b_m) * b_m
        end function
        
        b_m = Math.abs(b);
        t_m = Math.abs(t);
        public static double code(double x, double y, double z, double t_m, double a, double b_m) {
        	return (((((a * a) * -0.0078125) * t_m) * (t_m * x)) * b_m) * b_m;
        }
        
        b_m = math.fabs(b)
        t_m = math.fabs(t)
        def code(x, y, z, t_m, a, b_m):
        	return (((((a * a) * -0.0078125) * t_m) * (t_m * x)) * b_m) * b_m
        
        b_m = abs(b)
        t_m = abs(t)
        function code(x, y, z, t_m, a, b_m)
        	return Float64(Float64(Float64(Float64(Float64(Float64(a * a) * -0.0078125) * t_m) * Float64(t_m * x)) * b_m) * b_m)
        end
        
        b_m = abs(b);
        t_m = abs(t);
        function tmp = code(x, y, z, t_m, a, b_m)
        	tmp = (((((a * a) * -0.0078125) * t_m) * (t_m * x)) * b_m) * b_m;
        end
        
        b_m = N[Abs[b], $MachinePrecision]
        t_m = N[Abs[t], $MachinePrecision]
        code[x_, y_, z_, t$95$m_, a_, b$95$m_] := N[(N[(N[(N[(N[(N[(a * a), $MachinePrecision] * -0.0078125), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(t$95$m * x), $MachinePrecision]), $MachinePrecision] * b$95$m), $MachinePrecision] * b$95$m), $MachinePrecision]
        
        \begin{array}{l}
        b_m = \left|b\right|
        \\
        t_m = \left|t\right|
        
        \\
        \left(\left(\left(\left(\left(a \cdot a\right) \cdot -0.0078125\right) \cdot t\_m\right) \cdot \left(t\_m \cdot x\right)\right) \cdot b\_m\right) \cdot b\_m
        \end{array}
        
        Derivation
        1. Initial program 27.7%

          \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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. lift-*.f64N/A

            \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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) \]
          3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{x + {t}^{2} \cdot \left(x \cdot \left(\frac{-1}{512} \cdot \left({b}^{2} \cdot {\left(1 + 2 \cdot a\right)}^{2}\right) + \frac{-1}{512} \cdot \left({z}^{2} \cdot {\left(1 + 2 \cdot y\right)}^{2}\right)\right)\right)} \]
        6. Step-by-step derivation
          1. +-commutativeN/A

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left({t}^{2} \cdot x, \frac{-1}{512} \cdot \left({b}^{2} \cdot {\left(1 + 2 \cdot a\right)}^{2}\right) + \frac{-1}{512} \cdot \left({z}^{2} \cdot {\left(1 + 2 \cdot y\right)}^{2}\right), x\right)} \]
        7. Applied rewrites13.9%

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

          \[\leadsto \frac{-1}{128} \cdot \color{blue}{\left({a}^{2} \cdot \left({b}^{2} \cdot \left({t}^{2} \cdot x\right)\right)\right)} \]
        9. Step-by-step derivation
          1. Applied rewrites2.1%

            \[\leadsto \left(-0.0078125 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(b \cdot b\right)\right)} \]
          2. Step-by-step derivation
            1. Applied rewrites3.0%

              \[\leadsto \left(\left(\left(\left(\left(a \cdot a\right) \cdot -0.0078125\right) \cdot t\right) \cdot \left(t \cdot x\right)\right) \cdot b\right) \cdot b \]
            2. Add Preprocessing

            Alternative 11: 2.7% accurate, 7.5× speedup?

            \[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \left(\left(\left(a \cdot a\right) \cdot -0.0078125\right) \cdot \left(\left(\left(t\_m \cdot t\_m\right) \cdot x\right) \cdot b\_m\right)\right) \cdot b\_m \end{array} \]
            b_m = (fabs.f64 b)
            t_m = (fabs.f64 t)
            (FPCore (x y z t_m a b_m)
             :precision binary64
             (* (* (* (* a a) -0.0078125) (* (* (* t_m t_m) x) b_m)) b_m))
            b_m = fabs(b);
            t_m = fabs(t);
            double code(double x, double y, double z, double t_m, double a, double b_m) {
            	return (((a * a) * -0.0078125) * (((t_m * t_m) * x) * b_m)) * b_m;
            }
            
            b_m = abs(b)
            t_m = abs(t)
            real(8) function code(x, y, z, t_m, a, b_m)
                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_m
                code = (((a * a) * (-0.0078125d0)) * (((t_m * t_m) * x) * b_m)) * b_m
            end function
            
            b_m = Math.abs(b);
            t_m = Math.abs(t);
            public static double code(double x, double y, double z, double t_m, double a, double b_m) {
            	return (((a * a) * -0.0078125) * (((t_m * t_m) * x) * b_m)) * b_m;
            }
            
            b_m = math.fabs(b)
            t_m = math.fabs(t)
            def code(x, y, z, t_m, a, b_m):
            	return (((a * a) * -0.0078125) * (((t_m * t_m) * x) * b_m)) * b_m
            
            b_m = abs(b)
            t_m = abs(t)
            function code(x, y, z, t_m, a, b_m)
            	return Float64(Float64(Float64(Float64(a * a) * -0.0078125) * Float64(Float64(Float64(t_m * t_m) * x) * b_m)) * b_m)
            end
            
            b_m = abs(b);
            t_m = abs(t);
            function tmp = code(x, y, z, t_m, a, b_m)
            	tmp = (((a * a) * -0.0078125) * (((t_m * t_m) * x) * b_m)) * b_m;
            end
            
            b_m = N[Abs[b], $MachinePrecision]
            t_m = N[Abs[t], $MachinePrecision]
            code[x_, y_, z_, t$95$m_, a_, b$95$m_] := N[(N[(N[(N[(a * a), $MachinePrecision] * -0.0078125), $MachinePrecision] * N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * x), $MachinePrecision] * b$95$m), $MachinePrecision]), $MachinePrecision] * b$95$m), $MachinePrecision]
            
            \begin{array}{l}
            b_m = \left|b\right|
            \\
            t_m = \left|t\right|
            
            \\
            \left(\left(\left(a \cdot a\right) \cdot -0.0078125\right) \cdot \left(\left(\left(t\_m \cdot t\_m\right) \cdot x\right) \cdot b\_m\right)\right) \cdot b\_m
            \end{array}
            
            Derivation
            1. Initial program 27.7%

              \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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. lift-*.f64N/A

                \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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) \]
              3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{x + {t}^{2} \cdot \left(x \cdot \left(\frac{-1}{512} \cdot \left({b}^{2} \cdot {\left(1 + 2 \cdot a\right)}^{2}\right) + \frac{-1}{512} \cdot \left({z}^{2} \cdot {\left(1 + 2 \cdot y\right)}^{2}\right)\right)\right)} \]
            6. Step-by-step derivation
              1. +-commutativeN/A

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left({t}^{2} \cdot x, \frac{-1}{512} \cdot \left({b}^{2} \cdot {\left(1 + 2 \cdot a\right)}^{2}\right) + \frac{-1}{512} \cdot \left({z}^{2} \cdot {\left(1 + 2 \cdot y\right)}^{2}\right), x\right)} \]
            7. Applied rewrites13.9%

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

              \[\leadsto \frac{-1}{128} \cdot \color{blue}{\left({a}^{2} \cdot \left({b}^{2} \cdot \left({t}^{2} \cdot x\right)\right)\right)} \]
            9. Step-by-step derivation
              1. Applied rewrites2.1%

                \[\leadsto \left(-0.0078125 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(b \cdot b\right)\right)} \]
              2. Step-by-step derivation
                1. Applied rewrites2.7%

                  \[\leadsto \left(\left(\left(a \cdot a\right) \cdot -0.0078125\right) \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot b\right)\right) \cdot b \]
                2. Add Preprocessing

                Alternative 12: 2.6% accurate, 7.5× speedup?

                \[\begin{array}{l} b_m = \left|b\right| \\ t_m = \left|t\right| \\ \left(-0.0078125 \cdot \left(a \cdot a\right)\right) \cdot \left(t\_m \cdot \left(t\_m \cdot \left(\left(b\_m \cdot b\_m\right) \cdot x\right)\right)\right) \end{array} \]
                b_m = (fabs.f64 b)
                t_m = (fabs.f64 t)
                (FPCore (x y z t_m a b_m)
                 :precision binary64
                 (* (* -0.0078125 (* a a)) (* t_m (* t_m (* (* b_m b_m) x)))))
                b_m = fabs(b);
                t_m = fabs(t);
                double code(double x, double y, double z, double t_m, double a, double b_m) {
                	return (-0.0078125 * (a * a)) * (t_m * (t_m * ((b_m * b_m) * x)));
                }
                
                b_m = abs(b)
                t_m = abs(t)
                real(8) function code(x, y, z, t_m, a, b_m)
                    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_m
                    code = ((-0.0078125d0) * (a * a)) * (t_m * (t_m * ((b_m * b_m) * x)))
                end function
                
                b_m = Math.abs(b);
                t_m = Math.abs(t);
                public static double code(double x, double y, double z, double t_m, double a, double b_m) {
                	return (-0.0078125 * (a * a)) * (t_m * (t_m * ((b_m * b_m) * x)));
                }
                
                b_m = math.fabs(b)
                t_m = math.fabs(t)
                def code(x, y, z, t_m, a, b_m):
                	return (-0.0078125 * (a * a)) * (t_m * (t_m * ((b_m * b_m) * x)))
                
                b_m = abs(b)
                t_m = abs(t)
                function code(x, y, z, t_m, a, b_m)
                	return Float64(Float64(-0.0078125 * Float64(a * a)) * Float64(t_m * Float64(t_m * Float64(Float64(b_m * b_m) * x))))
                end
                
                b_m = abs(b);
                t_m = abs(t);
                function tmp = code(x, y, z, t_m, a, b_m)
                	tmp = (-0.0078125 * (a * a)) * (t_m * (t_m * ((b_m * b_m) * x)));
                end
                
                b_m = N[Abs[b], $MachinePrecision]
                t_m = N[Abs[t], $MachinePrecision]
                code[x_, y_, z_, t$95$m_, a_, b$95$m_] := N[(N[(-0.0078125 * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(t$95$m * N[(t$95$m * N[(N[(b$95$m * b$95$m), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                b_m = \left|b\right|
                \\
                t_m = \left|t\right|
                
                \\
                \left(-0.0078125 \cdot \left(a \cdot a\right)\right) \cdot \left(t\_m \cdot \left(t\_m \cdot \left(\left(b\_m \cdot b\_m\right) \cdot x\right)\right)\right)
                \end{array}
                
                Derivation
                1. Initial program 27.7%

                  \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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. lift-*.f64N/A

                    \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\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) \]
                  3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{x + {t}^{2} \cdot \left(x \cdot \left(\frac{-1}{512} \cdot \left({b}^{2} \cdot {\left(1 + 2 \cdot a\right)}^{2}\right) + \frac{-1}{512} \cdot \left({z}^{2} \cdot {\left(1 + 2 \cdot y\right)}^{2}\right)\right)\right)} \]
                6. Step-by-step derivation
                  1. +-commutativeN/A

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

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left({t}^{2} \cdot x, \frac{-1}{512} \cdot \left({b}^{2} \cdot {\left(1 + 2 \cdot a\right)}^{2}\right) + \frac{-1}{512} \cdot \left({z}^{2} \cdot {\left(1 + 2 \cdot y\right)}^{2}\right), x\right)} \]
                7. Applied rewrites13.9%

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

                  \[\leadsto \frac{-1}{128} \cdot \color{blue}{\left({a}^{2} \cdot \left({b}^{2} \cdot \left({t}^{2} \cdot x\right)\right)\right)} \]
                9. Step-by-step derivation
                  1. Applied rewrites2.1%

                    \[\leadsto \left(-0.0078125 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(b \cdot b\right)\right)} \]
                  2. Step-by-step derivation
                    1. Applied rewrites2.5%

                      \[\leadsto \left(-0.0078125 \cdot \left(a \cdot a\right)\right) \cdot \left(t \cdot \left(t \cdot \color{blue}{\left(\left(b \cdot b\right) \cdot x\right)}\right)\right) \]
                    2. Add Preprocessing

                    Developer Target 1: 30.6% 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 2024319 
                    (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))))