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

Percentage Accurate: 29.0% → 33.4%
Time: 7.9s
Alternatives: 7
Speedup: 100.6×

Specification

?
\[\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) \]
(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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    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]
\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)

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 alternatives:

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

Initial Program: 29.0% accurate, 1.0× speedup?

\[\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) \]
(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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    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]
\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)

Alternative 1: 33.4% accurate, 0.5× speedup?

\[\begin{array}{l} \mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot \left|z\right|\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \leq 5 \cdot 10^{+290}:\\ \;\;\;\;\left(\cos \left(\left(\left(b \cdot \left(a + \left(a - -1\right)\right)\right) \cdot t\right) \cdot -0.0625\right) \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, \left(\mathsf{fma}\left(y + y, \left|z\right|, \left|z\right|\right) \cdot t\right) \cdot 0.0625\right)\right)\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<=
      (*
       (* x (cos (/ (* (* (+ (* y 2.0) 1.0) (fabs z)) t) 16.0)))
       (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0)))
      5e+290)
   (*
    (*
     (cos (* (* (* b (+ a (- a -1.0))) t) -0.0625))
     (sin (fma 0.5 PI (* (* (fma (+ y y) (fabs z) (fabs z)) t) 0.0625))))
    x)
   x))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (((x * cos((((((y * 2.0) + 1.0) * fabs(z)) * t) / 16.0))) * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+290) {
		tmp = (cos((((b * (a + (a - -1.0))) * t) * -0.0625)) * sin(fma(0.5, ((double) M_PI), ((fma((y + y), fabs(z), fabs(z)) * t) * 0.0625)))) * x;
	} else {
		tmp = x;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * abs(z)) * t) / 16.0))) * cos(Float64(Float64(Float64(Float64(Float64(a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+290)
		tmp = Float64(Float64(cos(Float64(Float64(Float64(b * Float64(a + Float64(a - -1.0))) * t) * -0.0625)) * sin(fma(0.5, pi, Float64(Float64(fma(Float64(y + y), abs(z), abs(z)) * t) * 0.0625)))) * x);
	else
		tmp = x;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[z], $MachinePrecision]), $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], 5e+290], N[(N[(N[Cos[N[(N[(N[(b * N[(a + N[(a - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * -0.0625), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.5 * Pi + N[(N[(N[(N[(y + y), $MachinePrecision] * N[Abs[z], $MachinePrecision] + N[Abs[z], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], x]
\begin{array}{l}
\mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot \left|z\right|\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \leq 5 \cdot 10^{+290}:\\
\;\;\;\;\left(\cos \left(\left(\left(b \cdot \left(a + \left(a - -1\right)\right)\right) \cdot t\right) \cdot -0.0625\right) \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, \left(\mathsf{fma}\left(y + y, \left|z\right|, \left|z\right|\right) \cdot t\right) \cdot 0.0625\right)\right)\right) \cdot x\\

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


\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)))) < 4.9999999999999998e290

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

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\cos \left(\left(\left(b \cdot \left(a + \color{blue}{\left(a - -1\right)}\right)\right) \cdot t\right) \cdot -0.0625\right) \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, \left(\mathsf{fma}\left(y + y, z, z\right) \cdot t\right) \cdot 0.0625\right)\right)\right) \cdot x \]
    7. Applied rewrites29.0%

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

    if 4.9999999999999998e290 < (*.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 29.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. 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. mult-flipN/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}{\left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right) \cdot \frac{1}{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(\color{blue}{\frac{1}{16} \cdot \left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
      7. 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{1}{16}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \]
      8. metadata-evalN/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(\mathsf{fma}\left(\color{blue}{\frac{1}{16}}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      9. 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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      10. *-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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      11. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      12. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\left(a \cdot 2 + 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      13. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \left(\color{blue}{a \cdot 2} + 1\right)\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      14. 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 \left(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\mathsf{fma}\left(a, 2, 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      15. mult-flipN/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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
      16. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
      17. lower-PI.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\pi} \cdot \frac{1}{2}\right)\right) \]
      18. metadata-eval29.0%

        \[\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(\mathsf{fma}\left(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot \color{blue}{0.5}\right)\right) \]
    3. Applied rewrites29.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(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot 0.5\right)\right)} \]
    4. Taylor expanded in t around 0

      \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \pi\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
      4. lower-PI.f6432.1%

        \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
    6. Applied rewrites32.1%

      \[\leadsto \color{blue}{x \cdot \sin \left(0.5 \cdot \pi\right)} \]
    7. Evaluated real constant32.1%

      \[\leadsto x \cdot 1 \]
    8. Taylor expanded in x around 0

      \[\leadsto x \]
    9. Step-by-step derivation
      1. Applied rewrites32.1%

        \[\leadsto x \]
    10. Recombined 2 regimes into one program.
    11. Add Preprocessing

    Alternative 2: 33.3% accurate, 0.5× speedup?

    \[\begin{array}{l} t_1 := x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\\ \mathbf{if}\;t\_1 \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \leq 5 \cdot 10^{+279}:\\ \;\;\;\;t\_1 \cdot \cos \left(\frac{1}{\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))))
       (if (<= (* t_1 (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))) 5e+279)
         (* t_1 (cos (/ 1.0 (/ 16.0 (* (* b (fma a 2.0 1.0)) t)))))
         x)))
    double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0));
    	double tmp;
    	if ((t_1 * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+279) {
    		tmp = t_1 * cos((1.0 / (16.0 / ((b * fma(a, 2.0, 1.0)) * t))));
    	} else {
    		tmp = x;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0)))
    	tmp = 0.0
    	if (Float64(t_1 * cos(Float64(Float64(Float64(Float64(Float64(a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+279)
    		tmp = Float64(t_1 * cos(Float64(1.0 / Float64(16.0 / Float64(Float64(b * fma(a, 2.0, 1.0)) * t)))));
    	else
    		tmp = x;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[LessEqual[N[(t$95$1 * N[Cos[N[(N[(N[(N[(N[(a * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * b), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 5e+279], N[(t$95$1 * N[Cos[N[(1.0 / N[(16.0 / N[(N[(b * N[(a * 2.0 + 1.0), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], x]]
    
    \begin{array}{l}
    t_1 := x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\\
    \mathbf{if}\;t\_1 \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \leq 5 \cdot 10^{+279}:\\
    \;\;\;\;t\_1 \cdot \cos \left(\frac{1}{\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y #s(literal 2 binary64)) #s(literal 1 binary64)) z) t) #s(literal 16 binary64)))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a #s(literal 2 binary64)) #s(literal 1 binary64)) b) t) #s(literal 16 binary64)))) < 5.0000000000000002e279

      1. Initial program 29.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. Step-by-step derivation
        1. 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 \cos \color{blue}{\left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)} \]
        2. div-flipN/A

          \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \color{blue}{\left(\frac{1}{\frac{16}{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}}\right)} \]
        3. lower-unsound-/.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 \cos \color{blue}{\left(\frac{1}{\frac{16}{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}}\right)} \]
        4. lower-unsound-/.f6428.9%

          \[\leadsto \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{1}{\color{blue}{\frac{16}{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}}}\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 \cos \left(\frac{1}{\frac{16}{\color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right)} \cdot t}}\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 \cos \left(\frac{1}{\frac{16}{\color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t}}\right) \]
        7. lower-*.f6428.9%

          \[\leadsto \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{1}{\frac{16}{\color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t}}\right) \]
        8. 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 \cos \left(\frac{1}{\frac{16}{\left(b \cdot \color{blue}{\left(a \cdot 2 + 1\right)}\right) \cdot t}}\right) \]
        9. 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 \cos \left(\frac{1}{\frac{16}{\left(b \cdot \left(\color{blue}{a \cdot 2} + 1\right)\right) \cdot t}}\right) \]
        10. lower-fma.f6428.9%

          \[\leadsto \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{1}{\frac{16}{\left(b \cdot \color{blue}{\mathsf{fma}\left(a, 2, 1\right)}\right) \cdot t}}\right) \]
      3. Applied rewrites28.9%

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

      if 5.0000000000000002e279 < (*.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 29.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. 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. mult-flipN/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}{\left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right) \cdot \frac{1}{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(\color{blue}{\frac{1}{16} \cdot \left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
        7. 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{1}{16}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \]
        8. metadata-evalN/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(\mathsf{fma}\left(\color{blue}{\frac{1}{16}}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
        9. 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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
        10. *-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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
        11. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
        12. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\left(a \cdot 2 + 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
        13. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \left(\color{blue}{a \cdot 2} + 1\right)\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
        14. 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 \left(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\mathsf{fma}\left(a, 2, 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
        15. mult-flipN/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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
        16. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
        17. lower-PI.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\pi} \cdot \frac{1}{2}\right)\right) \]
        18. metadata-eval29.0%

          \[\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(\mathsf{fma}\left(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot \color{blue}{0.5}\right)\right) \]
      3. Applied rewrites29.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(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot 0.5\right)\right)} \]
      4. Taylor expanded in t around 0

        \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \pi\right)} \]
      5. Step-by-step derivation
        1. lower-*.f64N/A

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

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

          \[\leadsto x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
        4. lower-PI.f6432.1%

          \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
      6. Applied rewrites32.1%

        \[\leadsto \color{blue}{x \cdot \sin \left(0.5 \cdot \pi\right)} \]
      7. Evaluated real constant32.1%

        \[\leadsto x \cdot 1 \]
      8. Taylor expanded in x around 0

        \[\leadsto x \]
      9. Step-by-step derivation
        1. Applied rewrites32.1%

          \[\leadsto x \]
      10. Recombined 2 regimes into one program.
      11. Add Preprocessing

      Alternative 3: 33.2% accurate, 0.5× speedup?

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

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

            \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\cos \left(\left(\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t\right) \cdot -0.0625\right) \cdot \color{blue}{\sin \left(\mathsf{fma}\left(0.5, \pi, \left(\mathsf{fma}\left(y + y, z, z\right) \cdot t\right) \cdot 0.0625\right)\right)}\right) \cdot x \]
        6. Applied rewrites29.2%

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

        if 5.0000000000000002e279 < (*.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 29.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. 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. mult-flipN/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}{\left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right) \cdot \frac{1}{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(\color{blue}{\frac{1}{16} \cdot \left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
          7. 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{1}{16}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \]
          8. metadata-evalN/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(\mathsf{fma}\left(\color{blue}{\frac{1}{16}}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
          9. 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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
          10. *-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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
          11. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
          12. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\left(a \cdot 2 + 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
          13. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \left(\color{blue}{a \cdot 2} + 1\right)\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
          14. 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 \left(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\mathsf{fma}\left(a, 2, 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
          15. mult-flipN/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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
          16. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
          17. lower-PI.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\pi} \cdot \frac{1}{2}\right)\right) \]
          18. metadata-eval29.0%

            \[\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(\mathsf{fma}\left(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot \color{blue}{0.5}\right)\right) \]
        3. Applied rewrites29.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(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot 0.5\right)\right)} \]
        4. Taylor expanded in t around 0

          \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \pi\right)} \]
        5. Step-by-step derivation
          1. lower-*.f64N/A

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

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

            \[\leadsto x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
          4. lower-PI.f6432.1%

            \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
        6. Applied rewrites32.1%

          \[\leadsto \color{blue}{x \cdot \sin \left(0.5 \cdot \pi\right)} \]
        7. Evaluated real constant32.1%

          \[\leadsto x \cdot 1 \]
        8. Taylor expanded in x around 0

          \[\leadsto x \]
        9. Step-by-step derivation
          1. Applied rewrites32.1%

            \[\leadsto x \]
        10. Recombined 2 regimes into one program.
        11. Add Preprocessing

        Alternative 4: 33.1% accurate, 0.5× speedup?

        \[\begin{array}{l} \mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \leq 5 \cdot 10^{+279}:\\ \;\;\;\;x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot \left(t \cdot \left(1 - -2 \cdot a\right)\right)\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
        (FPCore (x y z t a b)
         :precision binary64
         (if (<=
              (*
               (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0)))
               (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0)))
              5e+279)
           (*
            x
            (*
             (cos (* 0.0625 (* b (* t (- 1.0 (* -2.0 a))))))
             (cos (* 0.0625 (* t (* z (+ 1.0 (* 2.0 y))))))))
           x))
        double code(double x, double y, double z, double t, double a, double b) {
        	double tmp;
        	if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+279) {
        		tmp = x * (cos((0.0625 * (b * (t * (1.0 - (-2.0 * a)))))) * cos((0.0625 * (t * (z * (1.0 + (2.0 * y)))))));
        	} else {
        		tmp = x;
        	}
        	return tmp;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y, z, t, a, b)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8), intent (in) :: a
            real(8), intent (in) :: b
            real(8) :: tmp
            if (((x * cos((((((y * 2.0d0) + 1.0d0) * z) * t) / 16.0d0))) * cos((((((a * 2.0d0) + 1.0d0) * b) * t) / 16.0d0))) <= 5d+279) then
                tmp = x * (cos((0.0625d0 * (b * (t * (1.0d0 - ((-2.0d0) * a)))))) * cos((0.0625d0 * (t * (z * (1.0d0 + (2.0d0 * y)))))))
            else
                tmp = x
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t, double a, double b) {
        	double tmp;
        	if (((x * Math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * Math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+279) {
        		tmp = x * (Math.cos((0.0625 * (b * (t * (1.0 - (-2.0 * a)))))) * Math.cos((0.0625 * (t * (z * (1.0 + (2.0 * y)))))));
        	} else {
        		tmp = x;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b):
        	tmp = 0
        	if ((x * math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+279:
        		tmp = x * (math.cos((0.0625 * (b * (t * (1.0 - (-2.0 * a)))))) * math.cos((0.0625 * (t * (z * (1.0 + (2.0 * y)))))))
        	else:
        		tmp = x
        	return tmp
        
        function code(x, y, z, t, a, b)
        	tmp = 0.0
        	if (Float64(Float64(x * cos(Float64(Float64(Float64(Float64(Float64(y * 2.0) + 1.0) * z) * t) / 16.0))) * cos(Float64(Float64(Float64(Float64(Float64(a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+279)
        		tmp = Float64(x * Float64(cos(Float64(0.0625 * Float64(b * Float64(t * Float64(1.0 - Float64(-2.0 * a)))))) * cos(Float64(0.0625 * Float64(t * Float64(z * Float64(1.0 + Float64(2.0 * y))))))));
        	else
        		tmp = x;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b)
        	tmp = 0.0;
        	if (((x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))) * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+279)
        		tmp = x * (cos((0.0625 * (b * (t * (1.0 - (-2.0 * a)))))) * cos((0.0625 * (t * (z * (1.0 + (2.0 * y)))))));
        	else
        		tmp = x;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(N[(N[(N[(a * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * b), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 5e+279], N[(x * N[(N[Cos[N[(0.0625 * N[(b * N[(t * N[(1.0 - N[(-2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(0.0625 * N[(t * N[(z * N[(1.0 + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
        
        \begin{array}{l}
        \mathbf{if}\;\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \leq 5 \cdot 10^{+279}:\\
        \;\;\;\;x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot \left(t \cdot \left(1 - -2 \cdot a\right)\right)\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;x\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y #s(literal 2 binary64)) #s(literal 1 binary64)) z) t) #s(literal 16 binary64)))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a #s(literal 2 binary64)) #s(literal 1 binary64)) b) t) #s(literal 16 binary64)))) < 5.0000000000000002e279

          1. Initial program 29.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. Taylor expanded in a around -inf

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

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

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

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

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

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

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

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

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

              \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot \left(t \cdot \left(1 - -2 \cdot a\right)\right)\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
          4. Applied rewrites29.2%

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

          if 5.0000000000000002e279 < (*.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 29.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. 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. mult-flipN/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}{\left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right) \cdot \frac{1}{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(\color{blue}{\frac{1}{16} \cdot \left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
            7. 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{1}{16}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \]
            8. metadata-evalN/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(\mathsf{fma}\left(\color{blue}{\frac{1}{16}}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
            9. 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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
            10. *-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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
            11. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
            12. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\left(a \cdot 2 + 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
            13. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \left(\color{blue}{a \cdot 2} + 1\right)\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
            14. 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 \left(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\mathsf{fma}\left(a, 2, 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
            15. mult-flipN/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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
            16. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
            17. lower-PI.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\pi} \cdot \frac{1}{2}\right)\right) \]
            18. metadata-eval29.0%

              \[\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(\mathsf{fma}\left(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot \color{blue}{0.5}\right)\right) \]
          3. Applied rewrites29.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(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot 0.5\right)\right)} \]
          4. Taylor expanded in t around 0

            \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \pi\right)} \]
          5. Step-by-step derivation
            1. lower-*.f64N/A

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

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

              \[\leadsto x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
            4. lower-PI.f6432.1%

              \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
          6. Applied rewrites32.1%

            \[\leadsto \color{blue}{x \cdot \sin \left(0.5 \cdot \pi\right)} \]
          7. Evaluated real constant32.1%

            \[\leadsto x \cdot 1 \]
          8. Taylor expanded in x around 0

            \[\leadsto x \]
          9. Step-by-step derivation
            1. Applied rewrites32.1%

              \[\leadsto x \]
          10. Recombined 2 regimes into one program.
          11. Add Preprocessing

          Alternative 5: 33.1% accurate, 0.5× speedup?

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

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

                \[\leadsto \color{blue}{\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. *-commutativeN/A

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

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

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

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

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

            if 5.0000000000000002e279 < (*.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 29.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. 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. mult-flipN/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}{\left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right) \cdot \frac{1}{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(\color{blue}{\frac{1}{16} \cdot \left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
              7. 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{1}{16}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \]
              8. metadata-evalN/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(\mathsf{fma}\left(\color{blue}{\frac{1}{16}}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
              9. 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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
              10. *-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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
              11. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
              12. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\left(a \cdot 2 + 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
              13. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \left(\color{blue}{a \cdot 2} + 1\right)\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
              14. 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 \left(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\mathsf{fma}\left(a, 2, 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
              15. mult-flipN/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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
              16. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
              17. lower-PI.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\pi} \cdot \frac{1}{2}\right)\right) \]
              18. metadata-eval29.0%

                \[\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(\mathsf{fma}\left(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot \color{blue}{0.5}\right)\right) \]
            3. Applied rewrites29.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(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot 0.5\right)\right)} \]
            4. Taylor expanded in t around 0

              \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \pi\right)} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

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

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

                \[\leadsto x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
              4. lower-PI.f6432.1%

                \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
            6. Applied rewrites32.1%

              \[\leadsto \color{blue}{x \cdot \sin \left(0.5 \cdot \pi\right)} \]
            7. Evaluated real constant32.1%

              \[\leadsto x \cdot 1 \]
            8. Taylor expanded in x around 0

              \[\leadsto x \]
            9. Step-by-step derivation
              1. Applied rewrites32.1%

                \[\leadsto x \]
            10. Recombined 2 regimes into one program.
            11. Add Preprocessing

            Alternative 6: 33.0% accurate, 0.5× speedup?

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

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

                  \[\leadsto \color{blue}{\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. lift-*.f64N/A

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

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

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

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

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

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

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

                if 5.0000000000000002e279 < (*.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 29.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. 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. mult-flipN/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}{\left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right) \cdot \frac{1}{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(\color{blue}{\frac{1}{16} \cdot \left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
                  7. 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{1}{16}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \]
                  8. metadata-evalN/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(\mathsf{fma}\left(\color{blue}{\frac{1}{16}}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  9. 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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  10. *-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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  11. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  12. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\left(a \cdot 2 + 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  13. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \left(\color{blue}{a \cdot 2} + 1\right)\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  14. 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 \left(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\mathsf{fma}\left(a, 2, 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  15. mult-flipN/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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
                  16. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
                  17. lower-PI.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\pi} \cdot \frac{1}{2}\right)\right) \]
                  18. metadata-eval29.0%

                    \[\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(\mathsf{fma}\left(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot \color{blue}{0.5}\right)\right) \]
                3. Applied rewrites29.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(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot 0.5\right)\right)} \]
                4. Taylor expanded in t around 0

                  \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \pi\right)} \]
                5. Step-by-step derivation
                  1. lower-*.f64N/A

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

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

                    \[\leadsto x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
                  4. lower-PI.f6432.1%

                    \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
                6. Applied rewrites32.1%

                  \[\leadsto \color{blue}{x \cdot \sin \left(0.5 \cdot \pi\right)} \]
                7. Evaluated real constant32.1%

                  \[\leadsto x \cdot 1 \]
                8. Taylor expanded in x around 0

                  \[\leadsto x \]
                9. Step-by-step derivation
                  1. Applied rewrites32.1%

                    \[\leadsto x \]
                10. Recombined 2 regimes into one program.
                11. Add Preprocessing

                Alternative 7: 32.1% accurate, 100.6× speedup?

                \[x \]
                (FPCore (x y z t a b) :precision binary64 x)
                double code(double x, double y, double z, double t, double a, double b) {
                	return x;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(x, y, z, t, a, b)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    real(8), intent (in) :: a
                    real(8), intent (in) :: b
                    code = x
                end function
                
                public static double code(double x, double y, double z, double t, double a, double b) {
                	return x;
                }
                
                def code(x, y, z, t, a, b):
                	return x
                
                function code(x, y, z, t, a, b)
                	return x
                end
                
                function tmp = code(x, y, z, t, a, b)
                	tmp = x;
                end
                
                code[x_, y_, z_, t_, a_, b_] := x
                
                x
                
                Derivation
                1. Initial program 29.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. 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. mult-flipN/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}{\left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right) \cdot \frac{1}{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(\color{blue}{\frac{1}{16} \cdot \left(\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t\right)} + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
                  7. 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{1}{16}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \]
                  8. metadata-evalN/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(\mathsf{fma}\left(\color{blue}{\frac{1}{16}}, \left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  9. 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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(\left(a \cdot 2 + 1\right) \cdot b\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  10. *-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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  11. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(b \cdot \left(a \cdot 2 + 1\right)\right)} \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  12. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\left(a \cdot 2 + 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  13. 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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \left(\color{blue}{a \cdot 2} + 1\right)\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  14. 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 \left(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \color{blue}{\mathsf{fma}\left(a, 2, 1\right)}\right) \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
                  15. mult-flipN/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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
                  16. lower-*.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}\right)\right) \]
                  17. lower-PI.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(\mathsf{fma}\left(\frac{1}{16}, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \color{blue}{\pi} \cdot \frac{1}{2}\right)\right) \]
                  18. metadata-eval29.0%

                    \[\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(\mathsf{fma}\left(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot \color{blue}{0.5}\right)\right) \]
                3. Applied rewrites29.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(0.0625, \left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t, \pi \cdot 0.5\right)\right)} \]
                4. Taylor expanded in t around 0

                  \[\leadsto \color{blue}{x \cdot \sin \left(\frac{1}{2} \cdot \pi\right)} \]
                5. Step-by-step derivation
                  1. lower-*.f64N/A

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

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

                    \[\leadsto x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \]
                  4. lower-PI.f6432.1%

                    \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
                6. Applied rewrites32.1%

                  \[\leadsto \color{blue}{x \cdot \sin \left(0.5 \cdot \pi\right)} \]
                7. Evaluated real constant32.1%

                  \[\leadsto x \cdot 1 \]
                8. Taylor expanded in x around 0

                  \[\leadsto x \]
                9. Step-by-step derivation
                  1. Applied rewrites32.1%

                    \[\leadsto x \]
                  2. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2025188 
                  (FPCore (x y z t a b)
                    :name "Codec.Picture.Jpg.FastDct:referenceDct from JuicyPixels-3.2.6.1"
                    :precision binary64
                    (* (* x (cos (/ (* (* (+ (* y 2.0) 1.0) z) t) 16.0))) (cos (/ (* (* (+ (* a 2.0) 1.0) b) t) 16.0))))