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

Percentage Accurate: 27.5% → 31.9%
Time: 10.4s
Alternatives: 8
Speedup: 2.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 8 alternatives:

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

Initial Program: 27.5% 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: 31.9% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;x \cdot \sin \left(0.5 \cdot \pi\right)\\


\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)))) < 5e103

    1. Initial program 27.5%

      \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
    2. Taylor expanded in y around inf

      \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\left(y \cdot \left(2 \cdot z + \frac{z}{y}\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) \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\left(y \cdot \color{blue}{\left(2 \cdot z + \frac{z}{y}\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) \]
      2. lower-fma.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\left(y \cdot \mathsf{fma}\left(2, \color{blue}{z}, \frac{z}{y}\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) \]
      3. lower-/.f6425.2%

        \[\leadsto \left(x \cdot \cos \left(\frac{\left(y \cdot \mathsf{fma}\left(2, z, \frac{z}{y}\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) \]
    4. Applied rewrites25.2%

      \[\leadsto \left(x \cdot \cos \left(\frac{\color{blue}{\left(y \cdot \mathsf{fma}\left(2, z, \frac{z}{y}\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) \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\left(y \cdot \color{blue}{\mathsf{fma}\left(2, z, \frac{z}{y}\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) \]
      2. *-commutativeN/A

        \[\leadsto \left(x \cdot \cos \left(\frac{\left(\mathsf{fma}\left(2, z, \frac{z}{y}\right) \cdot \color{blue}{y}\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. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e103 < (*.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 27.5%

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

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

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

        \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot t\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 t\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 t\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 t\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
      6. lower-cos.f64N/A

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

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

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

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

        \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
      11. lower-*.f6428.1%

        \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
    4. Applied rewrites28.1%

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

      \[\leadsto x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \]
    6. Step-by-step derivation
      1. lower-cos.f64N/A

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

        \[\leadsto x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \]
      3. lower-*.f6429.7%

        \[\leadsto x \cdot \cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \]
    7. Applied rewrites29.7%

      \[\leadsto x \cdot \cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \]
    8. Step-by-step derivation
      1. lift-cos.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \sin \left(\frac{1}{\mathsf{neg}\left(16\right)} \cdot \left(b \cdot t\right) + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
      10. lower-fma.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{1}{\mathsf{neg}\left(16\right)}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{1}{-16}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      13. mult-flipN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)\right) \]
      14. lower-*.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)\right) \]
      15. lower-PI.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \pi \cdot \frac{1}{2}\right)\right) \]
      16. metadata-eval29.7%

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, \pi \cdot 0.5\right)\right) \]
    9. Applied rewrites29.7%

      \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, \pi \cdot 0.5\right)\right) \]
    10. Taylor expanded in t around 0

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

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

        \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
    12. Applied rewrites30.4%

      \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 31.9% 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^{+294}:\\ \;\;\;\;t\_1 \cdot \cos \left(\frac{\left(b + 2 \cdot \left(a \cdot b\right)\right) \cdot t}{16}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \sin \left(0.5 \cdot \pi\right)\\ \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+294)
     (* t_1 (cos (/ (* (+ b (* 2.0 (* a b))) t) 16.0)))
     (* x (sin (* 0.5 PI))))))
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+294) {
		tmp = t_1 * cos((((b + (2.0 * (a * b))) * t) / 16.0));
	} else {
		tmp = x * sin((0.5 * ((double) M_PI)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * Math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0));
	double tmp;
	if ((t_1 * Math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+294) {
		tmp = t_1 * Math.cos((((b + (2.0 * (a * b))) * t) / 16.0));
	} else {
		tmp = x * Math.sin((0.5 * Math.PI));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.cos((((((y * 2.0) + 1.0) * z) * t) / 16.0))
	tmp = 0
	if (t_1 * math.cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+294:
		tmp = t_1 * math.cos((((b + (2.0 * (a * b))) * t) / 16.0))
	else:
		tmp = x * math.sin((0.5 * math.pi))
	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+294)
		tmp = Float64(t_1 * cos(Float64(Float64(Float64(b + Float64(2.0 * Float64(a * b))) * t) / 16.0)));
	else
		tmp = Float64(x * sin(Float64(0.5 * pi)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * cos((((((y * 2.0) + 1.0) * z) * t) / 16.0));
	tmp = 0.0;
	if ((t_1 * cos((((((a * 2.0) + 1.0) * b) * t) / 16.0))) <= 5e+294)
		tmp = t_1 * cos((((b + (2.0 * (a * b))) * t) / 16.0));
	else
		tmp = x * sin((0.5 * pi));
	end
	tmp_2 = 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+294], N[(t$95$1 * N[Cos[N[(N[(N[(b + N[(2.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\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^{+294}:\\
\;\;\;\;t\_1 \cdot \cos \left(\frac{\left(b + 2 \cdot \left(a \cdot b\right)\right) \cdot t}{16}\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \sin \left(0.5 \cdot \pi\right)\\


\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.9999999999999999e294

    1. Initial program 27.5%

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

      \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\color{blue}{\left(b + 2 \cdot \left(a \cdot b\right)\right)} \cdot t}{16}\right) \]
    3. Step-by-step derivation
      1. 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 \cos \left(\frac{\left(b + \color{blue}{2 \cdot \left(a \cdot b\right)}\right) \cdot t}{16}\right) \]
      2. 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 \cos \left(\frac{\left(b + 2 \cdot \color{blue}{\left(a \cdot b\right)}\right) \cdot t}{16}\right) \]
      3. lower-*.f6427.5%

        \[\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{\left(b + 2 \cdot \left(a \cdot \color{blue}{b}\right)\right) \cdot t}{16}\right) \]
    4. Applied rewrites27.5%

      \[\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{\color{blue}{\left(b + 2 \cdot \left(a \cdot b\right)\right)} \cdot t}{16}\right) \]

    if 4.9999999999999999e294 < (*.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 27.5%

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

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

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

        \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot t\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 t\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 t\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 t\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
      6. lower-cos.f64N/A

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

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

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

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

        \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
      11. lower-*.f6428.1%

        \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
    4. Applied rewrites28.1%

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

      \[\leadsto x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \]
    6. Step-by-step derivation
      1. lower-cos.f64N/A

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

        \[\leadsto x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \]
      3. lower-*.f6429.7%

        \[\leadsto x \cdot \cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \]
    7. Applied rewrites29.7%

      \[\leadsto x \cdot \cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \]
    8. Step-by-step derivation
      1. lift-cos.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \sin \left(\frac{1}{\mathsf{neg}\left(16\right)} \cdot \left(b \cdot t\right) + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
      10. lower-fma.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{1}{\mathsf{neg}\left(16\right)}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{1}{-16}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      13. mult-flipN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)\right) \]
      14. lower-*.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)\right) \]
      15. lower-PI.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \pi \cdot \frac{1}{2}\right)\right) \]
      16. metadata-eval29.7%

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, \pi \cdot 0.5\right)\right) \]
    9. Applied rewrites29.7%

      \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, \pi \cdot 0.5\right)\right) \]
    10. Taylor expanded in t around 0

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

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

        \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
    12. Applied rewrites30.4%

      \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 31.6% 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^{+294}:\\ \;\;\;\;\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 \cdot \sin \left(0.5 \cdot \pi\right)\\ \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+294)
   (*
    (* (cos (* (* (* b (fma a 2.0 1.0)) t) -0.0625)) x)
    (cos (* (* t (* z (fma 2.0 y 1.0))) -0.0625)))
   (* x (sin (* 0.5 PI)))))
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+294) {
		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 * sin((0.5 * ((double) M_PI)));
	}
	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+294)
		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 = Float64(x * sin(Float64(0.5 * pi)));
	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+294], 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], N[(x * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\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^{+294}:\\
\;\;\;\;\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 \cdot \sin \left(0.5 \cdot \pi\right)\\


\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.9999999999999999e294

    1. Initial program 27.5%

      \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
    2. 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 rewrites27.5%

      \[\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 4.9999999999999999e294 < (*.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 27.5%

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

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

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

        \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot t\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 t\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 t\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 t\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
      6. lower-cos.f64N/A

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

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

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

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

        \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
      11. lower-*.f6428.1%

        \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
    4. Applied rewrites28.1%

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

      \[\leadsto x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \]
    6. Step-by-step derivation
      1. lower-cos.f64N/A

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

        \[\leadsto x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \]
      3. lower-*.f6429.7%

        \[\leadsto x \cdot \cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \]
    7. Applied rewrites29.7%

      \[\leadsto x \cdot \cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \]
    8. Step-by-step derivation
      1. lift-cos.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \sin \left(\frac{1}{\mathsf{neg}\left(16\right)} \cdot \left(b \cdot t\right) + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
      10. lower-fma.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{1}{\mathsf{neg}\left(16\right)}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{1}{-16}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      13. mult-flipN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)\right) \]
      14. lower-*.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)\right) \]
      15. lower-PI.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \pi \cdot \frac{1}{2}\right)\right) \]
      16. metadata-eval29.7%

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, \pi \cdot 0.5\right)\right) \]
    9. Applied rewrites29.7%

      \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, \pi \cdot 0.5\right)\right) \]
    10. Taylor expanded in t around 0

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

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

        \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
    12. Applied rewrites30.4%

      \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 31.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^{+84}:\\ \;\;\;\;\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(-0.125 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \sin \left(0.5 \cdot \pi\right)\\ \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+84)
   (*
    (*
     (cos (* (* (* b (fma a 2.0 1.0)) t) -0.0625))
     (cos (* -0.125 (* t (* y z)))))
    x)
   (* x (sin (* 0.5 PI)))))
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+84) {
		tmp = (cos((((b * fma(a, 2.0, 1.0)) * t) * -0.0625)) * cos((-0.125 * (t * (y * z))))) * x;
	} else {
		tmp = x * sin((0.5 * ((double) M_PI)));
	}
	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+84)
		tmp = Float64(Float64(cos(Float64(Float64(Float64(b * fma(a, 2.0, 1.0)) * t) * -0.0625)) * cos(Float64(-0.125 * Float64(t * Float64(y * z))))) * x);
	else
		tmp = Float64(x * sin(Float64(0.5 * pi)));
	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+84], N[(N[(N[Cos[N[(N[(N[(b * N[(a * 2.0 + 1.0), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * -0.0625), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(-0.125 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(x * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\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^{+84}:\\
\;\;\;\;\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(-0.125 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\right) \cdot x\\

\mathbf{else}:\\
\;\;\;\;x \cdot \sin \left(0.5 \cdot \pi\right)\\


\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.0000000000000001e84

    1. Initial program 27.5%

      \[\left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
    2. 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 rewrites27.5%

      \[\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 y around inf

      \[\leadsto \left(\cos \left(\left(\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t\right) \cdot -0.0625\right) \cdot \cos \color{blue}{\left(\frac{-1}{8} \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)}\right) \cdot x \]
    5. Step-by-step derivation
      1. lower-*.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 \cos \left(\frac{-1}{8} \cdot \color{blue}{\left(t \cdot \left(y \cdot z\right)\right)}\right)\right) \cdot x \]
      2. lower-*.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 \cos \left(\frac{-1}{8} \cdot \left(t \cdot \color{blue}{\left(y \cdot z\right)}\right)\right)\right) \cdot x \]
      3. lower-*.f6427.2%

        \[\leadsto \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(-0.125 \cdot \left(t \cdot \left(y \cdot \color{blue}{z}\right)\right)\right)\right) \cdot x \]
    6. Applied rewrites27.2%

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

    if 5.0000000000000001e84 < (*.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 27.5%

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

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

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

        \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot t\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 t\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 t\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 t\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
      6. lower-cos.f64N/A

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

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

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

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

        \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
      11. lower-*.f6428.1%

        \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
    4. Applied rewrites28.1%

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

      \[\leadsto x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \]
    6. Step-by-step derivation
      1. lower-cos.f64N/A

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

        \[\leadsto x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \]
      3. lower-*.f6429.7%

        \[\leadsto x \cdot \cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \]
    7. Applied rewrites29.7%

      \[\leadsto x \cdot \cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \]
    8. Step-by-step derivation
      1. lift-cos.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \sin \left(\frac{1}{\mathsf{neg}\left(16\right)} \cdot \left(b \cdot t\right) + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
      10. lower-fma.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{1}{\mathsf{neg}\left(16\right)}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{1}{-16}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
      13. mult-flipN/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)\right) \]
      14. lower-*.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)\right) \]
      15. lower-PI.f64N/A

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \pi \cdot \frac{1}{2}\right)\right) \]
      16. metadata-eval29.7%

        \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, \pi \cdot 0.5\right)\right) \]
    9. Applied rewrites29.7%

      \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, \pi \cdot 0.5\right)\right) \]
    10. Taylor expanded in t around 0

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

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

        \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
    12. Applied rewrites30.4%

      \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 30.4% accurate, 2.6× speedup?

\[x \cdot \sin \left(0.5 \cdot \pi\right) \]
(FPCore (x y z t a b) :precision binary64 (* x (sin (* 0.5 PI))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * sin((0.5 * ((double) M_PI)));
}
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.sin((0.5 * Math.PI));
}
def code(x, y, z, t, a, b):
	return x * math.sin((0.5 * math.pi))
function code(x, y, z, t, a, b)
	return Float64(x * sin(Float64(0.5 * pi)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * sin((0.5 * pi));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
x \cdot \sin \left(0.5 \cdot \pi\right)
Derivation
  1. Initial program 27.5%

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

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

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

      \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot t\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 t\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 t\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 t\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
    6. lower-cos.f64N/A

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

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

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

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

      \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
    11. lower-*.f6428.1%

      \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot \left(z \cdot \left(1 + 2 \cdot y\right)\right)\right)\right)\right) \]
  4. Applied rewrites28.1%

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

    \[\leadsto x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \]
  6. Step-by-step derivation
    1. lower-cos.f64N/A

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

      \[\leadsto x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \]
    3. lower-*.f6429.7%

      \[\leadsto x \cdot \cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \]
  7. Applied rewrites29.7%

    \[\leadsto x \cdot \cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \]
  8. Step-by-step derivation
    1. lift-cos.f64N/A

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \sin \left(\frac{1}{\mathsf{neg}\left(16\right)} \cdot \left(b \cdot t\right) + \frac{\mathsf{PI}\left(\right)}{2}\right) \]
    10. lower-fma.f64N/A

      \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{1}{\mathsf{neg}\left(16\right)}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{1}{-16}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
    12. metadata-evalN/A

      \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \]
    13. mult-flipN/A

      \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)\right) \]
    14. lower-*.f64N/A

      \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \mathsf{PI}\left(\right) \cdot \frac{1}{2}\right)\right) \]
    15. lower-PI.f64N/A

      \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, b \cdot t, \pi \cdot \frac{1}{2}\right)\right) \]
    16. metadata-eval29.7%

      \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, \pi \cdot 0.5\right)\right) \]
  9. Applied rewrites29.7%

    \[\leadsto x \cdot \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, \pi \cdot 0.5\right)\right) \]
  10. Taylor expanded in t around 0

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

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

      \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
  12. Applied rewrites30.4%

    \[\leadsto x \cdot \sin \left(0.5 \cdot \pi\right) \]
  13. Add Preprocessing

Alternative 6: 3.3% accurate, 4.8× speedup?

\[\left(\left(\left(-0.0078125 \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot z\right)\right) \cdot z\right) \cdot y\right) \cdot y \]
(FPCore (x y z t a b)
 :precision binary64
 (* (* (* (* -0.0078125 (* (* (* t t) x) z)) z) y) y))
double code(double x, double y, double z, double t, double a, double b) {
	return (((-0.0078125 * (((t * t) * x) * z)) * z) * y) * y;
}
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 = ((((-0.0078125d0) * (((t * t) * x) * z)) * z) * y) * y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (((-0.0078125 * (((t * t) * x) * z)) * z) * y) * y;
}
def code(x, y, z, t, a, b):
	return (((-0.0078125 * (((t * t) * x) * z)) * z) * y) * y
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(-0.0078125 * Float64(Float64(Float64(t * t) * x) * z)) * z) * y) * y)
end
function tmp = code(x, y, z, t, a, b)
	tmp = (((-0.0078125 * (((t * t) * x) * z)) * z) * y) * y;
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(-0.0078125 * N[(N[(N[(t * t), $MachinePrecision] * x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision]
\left(\left(\left(-0.0078125 \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot z\right)\right) \cdot z\right) \cdot y\right) \cdot y
Derivation
  1. Initial program 27.5%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{-1}{128} \cdot \color{blue}{\left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right)} \]
  6. Step-by-step derivation
    1. lower-*.f64N/A

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

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

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

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

      \[\leadsto \frac{-1}{128} \cdot \left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{\color{blue}{2}}\right)\right)\right) \]
    6. lower-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right) \]
    7. lower-pow.f642.2%

      \[\leadsto -0.0078125 \cdot \left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right) \]
  7. Applied rewrites2.2%

    \[\leadsto -0.0078125 \cdot \color{blue}{\left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right)} \]
  8. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left({t}^{2} \cdot \left(x \cdot \color{blue}{\left({y}^{2} \cdot {z}^{2}\right)}\right)\right) \]
    2. lift-*.f64N/A

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

      \[\leadsto \frac{-1}{128} \cdot \left(\left({t}^{2} \cdot x\right) \cdot \left({y}^{2} \cdot \color{blue}{{z}^{2}}\right)\right) \]
    4. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left({t}^{2} \cdot x\right) \cdot \left({y}^{2} \cdot {z}^{\color{blue}{2}}\right)\right) \]
    5. *-commutativeN/A

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

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left({t}^{2} \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{\color{blue}{2}}\right) \]
    7. lower-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left({t}^{2} \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{\color{blue}{2}}\right) \]
    8. lower-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left({t}^{2} \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    9. lower-*.f642.2%

      \[\leadsto -0.0078125 \cdot \left(\left(\left({t}^{2} \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    10. lift-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left({t}^{2} \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    11. unpow2N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    12. lower-*.f642.2%

      \[\leadsto -0.0078125 \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    13. lift-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    14. unpow2N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot {y}^{2}\right) \]
    15. lower-*.f642.2%

      \[\leadsto -0.0078125 \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot {y}^{2}\right) \]
    16. lift-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot {y}^{2}\right) \]
    17. unpow2N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot \left(y \cdot y\right)\right) \]
    18. lower-*.f642.2%

      \[\leadsto -0.0078125 \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot \left(y \cdot y\right)\right) \]
  9. Applied rewrites2.2%

    \[\leadsto -0.0078125 \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
  10. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot \color{blue}{\left(y \cdot y\right)}\right) \]
    2. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
    3. associate-*r*N/A

      \[\leadsto \left(\frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right)\right) \cdot \left(y \cdot \color{blue}{y}\right) \]
    4. lift-*.f64N/A

      \[\leadsto \left(\frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right)\right) \cdot \left(y \cdot y\right) \]
    5. associate-*r*N/A

      \[\leadsto \left(\left(\frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right)\right) \cdot y\right) \cdot y \]
    6. lower-*.f64N/A

      \[\leadsto \left(\left(\frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right)\right) \cdot y\right) \cdot y \]
    7. lower-*.f64N/A

      \[\leadsto \left(\left(\frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right)\right) \cdot y\right) \cdot y \]
    8. lift-*.f64N/A

      \[\leadsto \left(\left(\frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right)\right) \cdot y\right) \cdot y \]
    9. lift-*.f64N/A

      \[\leadsto \left(\left(\frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right)\right) \cdot y\right) \cdot y \]
    10. associate-*r*N/A

      \[\leadsto \left(\left(\frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot z\right) \cdot z\right)\right) \cdot y\right) \cdot y \]
    11. associate-*r*N/A

      \[\leadsto \left(\left(\left(\frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot z\right)\right) \cdot z\right) \cdot y\right) \cdot y \]
    12. lower-*.f64N/A

      \[\leadsto \left(\left(\left(\frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot z\right)\right) \cdot z\right) \cdot y\right) \cdot y \]
    13. lower-*.f64N/A

      \[\leadsto \left(\left(\left(\frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot z\right)\right) \cdot z\right) \cdot y\right) \cdot y \]
    14. lower-*.f643.3%

      \[\leadsto \left(\left(\left(-0.0078125 \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot z\right)\right) \cdot z\right) \cdot y\right) \cdot y \]
  11. Applied rewrites3.3%

    \[\leadsto \left(\left(\left(-0.0078125 \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot z\right)\right) \cdot z\right) \cdot y\right) \cdot y \]
  12. Add Preprocessing

Alternative 7: 3.2% accurate, 4.8× speedup?

\[-0.0078125 \cdot \left(\left(\left(\left(\left(\left(y \cdot y\right) \cdot x\right) \cdot z\right) \cdot z\right) \cdot t\right) \cdot t\right) \]
(FPCore (x y z t a b)
 :precision binary64
 (* -0.0078125 (* (* (* (* (* (* y y) x) z) z) t) t)))
double code(double x, double y, double z, double t, double a, double b) {
	return -0.0078125 * ((((((y * y) * x) * z) * z) * t) * t);
}
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 = (-0.0078125d0) * ((((((y * y) * x) * z) * z) * t) * t)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return -0.0078125 * ((((((y * y) * x) * z) * z) * t) * t);
}
def code(x, y, z, t, a, b):
	return -0.0078125 * ((((((y * y) * x) * z) * z) * t) * t)
function code(x, y, z, t, a, b)
	return Float64(-0.0078125 * Float64(Float64(Float64(Float64(Float64(Float64(y * y) * x) * z) * z) * t) * t))
end
function tmp = code(x, y, z, t, a, b)
	tmp = -0.0078125 * ((((((y * y) * x) * z) * z) * t) * t);
end
code[x_, y_, z_, t_, a_, b_] := N[(-0.0078125 * N[(N[(N[(N[(N[(N[(y * y), $MachinePrecision] * x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
-0.0078125 \cdot \left(\left(\left(\left(\left(\left(y \cdot y\right) \cdot x\right) \cdot z\right) \cdot z\right) \cdot t\right) \cdot t\right)
Derivation
  1. Initial program 27.5%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{-1}{128} \cdot \color{blue}{\left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right)} \]
  6. Step-by-step derivation
    1. lower-*.f64N/A

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

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

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

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

      \[\leadsto \frac{-1}{128} \cdot \left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{\color{blue}{2}}\right)\right)\right) \]
    6. lower-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right) \]
    7. lower-pow.f642.2%

      \[\leadsto -0.0078125 \cdot \left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right) \]
  7. Applied rewrites2.2%

    \[\leadsto -0.0078125 \cdot \color{blue}{\left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right)} \]
  8. Step-by-step derivation
    1. lift-*.f64N/A

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

      \[\leadsto \frac{-1}{128} \cdot \left(\left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right) \cdot {t}^{\color{blue}{2}}\right) \]
    3. lift-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right) \cdot {t}^{2}\right) \]
    4. unpow2N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right) \cdot \left(t \cdot t\right)\right) \]
    5. associate-*r*N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right) \cdot t\right) \cdot t\right) \]
    6. lower-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right) \cdot t\right) \cdot t\right) \]
    7. lower-*.f642.7%

      \[\leadsto -0.0078125 \cdot \left(\left(\left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right) \cdot t\right) \cdot t\right) \]
    8. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right) \cdot t\right) \cdot t\right) \]
    9. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right) \cdot t\right) \cdot t\right) \]
    10. associate-*r*N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(x \cdot {y}^{2}\right) \cdot {z}^{2}\right) \cdot t\right) \cdot t\right) \]
    11. lift-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(x \cdot {y}^{2}\right) \cdot {z}^{2}\right) \cdot t\right) \cdot t\right) \]
    12. unpow2N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(x \cdot {y}^{2}\right) \cdot \left(z \cdot z\right)\right) \cdot t\right) \cdot t\right) \]
    13. associate-*r*N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(\left(x \cdot {y}^{2}\right) \cdot z\right) \cdot z\right) \cdot t\right) \cdot t\right) \]
    14. lower-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(\left(x \cdot {y}^{2}\right) \cdot z\right) \cdot z\right) \cdot t\right) \cdot t\right) \]
    15. lower-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(\left(x \cdot {y}^{2}\right) \cdot z\right) \cdot z\right) \cdot t\right) \cdot t\right) \]
    16. *-commutativeN/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(\left({y}^{2} \cdot x\right) \cdot z\right) \cdot z\right) \cdot t\right) \cdot t\right) \]
    17. lower-*.f643.2%

      \[\leadsto -0.0078125 \cdot \left(\left(\left(\left(\left({y}^{2} \cdot x\right) \cdot z\right) \cdot z\right) \cdot t\right) \cdot t\right) \]
    18. lift-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(\left({y}^{2} \cdot x\right) \cdot z\right) \cdot z\right) \cdot t\right) \cdot t\right) \]
    19. unpow2N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(\left(\left(y \cdot y\right) \cdot x\right) \cdot z\right) \cdot z\right) \cdot t\right) \cdot t\right) \]
    20. lower-*.f643.2%

      \[\leadsto -0.0078125 \cdot \left(\left(\left(\left(\left(\left(y \cdot y\right) \cdot x\right) \cdot z\right) \cdot z\right) \cdot t\right) \cdot t\right) \]
  9. Applied rewrites3.2%

    \[\leadsto -0.0078125 \cdot \left(\left(\left(\left(\left(\left(y \cdot y\right) \cdot x\right) \cdot z\right) \cdot z\right) \cdot t\right) \cdot t\right) \]
  10. Add Preprocessing

Alternative 8: 2.9% accurate, 4.8× speedup?

\[-0.0078125 \cdot \left(t \cdot \left(\left(t \cdot x\right) \cdot \left(\left(\left(z \cdot z\right) \cdot y\right) \cdot y\right)\right)\right) \]
(FPCore (x y z t a b)
 :precision binary64
 (* -0.0078125 (* t (* (* t x) (* (* (* z z) y) y)))))
double code(double x, double y, double z, double t, double a, double b) {
	return -0.0078125 * (t * ((t * x) * (((z * z) * y) * y)));
}
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 = (-0.0078125d0) * (t * ((t * x) * (((z * z) * y) * y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return -0.0078125 * (t * ((t * x) * (((z * z) * y) * y)));
}
def code(x, y, z, t, a, b):
	return -0.0078125 * (t * ((t * x) * (((z * z) * y) * y)))
function code(x, y, z, t, a, b)
	return Float64(-0.0078125 * Float64(t * Float64(Float64(t * x) * Float64(Float64(Float64(z * z) * y) * y))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = -0.0078125 * (t * ((t * x) * (((z * z) * y) * y)));
end
code[x_, y_, z_, t_, a_, b_] := N[(-0.0078125 * N[(t * N[(N[(t * x), $MachinePrecision] * N[(N[(N[(z * z), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
-0.0078125 \cdot \left(t \cdot \left(\left(t \cdot x\right) \cdot \left(\left(\left(z \cdot z\right) \cdot y\right) \cdot y\right)\right)\right)
Derivation
  1. Initial program 27.5%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{-1}{128} \cdot \color{blue}{\left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right)} \]
  6. Step-by-step derivation
    1. lower-*.f64N/A

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

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

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

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

      \[\leadsto \frac{-1}{128} \cdot \left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{\color{blue}{2}}\right)\right)\right) \]
    6. lower-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right) \]
    7. lower-pow.f642.2%

      \[\leadsto -0.0078125 \cdot \left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right) \]
  7. Applied rewrites2.2%

    \[\leadsto -0.0078125 \cdot \color{blue}{\left({t}^{2} \cdot \left(x \cdot \left({y}^{2} \cdot {z}^{2}\right)\right)\right)} \]
  8. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left({t}^{2} \cdot \left(x \cdot \color{blue}{\left({y}^{2} \cdot {z}^{2}\right)}\right)\right) \]
    2. lift-*.f64N/A

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

      \[\leadsto \frac{-1}{128} \cdot \left(\left({t}^{2} \cdot x\right) \cdot \left({y}^{2} \cdot \color{blue}{{z}^{2}}\right)\right) \]
    4. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left({t}^{2} \cdot x\right) \cdot \left({y}^{2} \cdot {z}^{\color{blue}{2}}\right)\right) \]
    5. *-commutativeN/A

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

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left({t}^{2} \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{\color{blue}{2}}\right) \]
    7. lower-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left({t}^{2} \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{\color{blue}{2}}\right) \]
    8. lower-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left({t}^{2} \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    9. lower-*.f642.2%

      \[\leadsto -0.0078125 \cdot \left(\left(\left({t}^{2} \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    10. lift-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left({t}^{2} \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    11. unpow2N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    12. lower-*.f642.2%

      \[\leadsto -0.0078125 \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    13. lift-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot {z}^{2}\right) \cdot {y}^{2}\right) \]
    14. unpow2N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot {y}^{2}\right) \]
    15. lower-*.f642.2%

      \[\leadsto -0.0078125 \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot {y}^{2}\right) \]
    16. lift-pow.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot {y}^{2}\right) \]
    17. unpow2N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot \left(y \cdot y\right)\right) \]
    18. lower-*.f642.2%

      \[\leadsto -0.0078125 \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot \left(y \cdot y\right)\right) \]
  9. Applied rewrites2.2%

    \[\leadsto -0.0078125 \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
  10. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
    2. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(z \cdot z\right)\right) \cdot \left(y \cdot y\right)\right) \]
    3. associate-*l*N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(\left(z \cdot z\right) \cdot \color{blue}{\left(y \cdot y\right)}\right)\right) \]
    4. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(\left(z \cdot z\right) \cdot \left(\color{blue}{y} \cdot y\right)\right)\right) \]
    5. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(\left(t \cdot t\right) \cdot x\right) \cdot \left(\left(z \cdot z\right) \cdot \left(y \cdot y\right)\right)\right) \]
    6. associate-*l*N/A

      \[\leadsto \frac{-1}{128} \cdot \left(\left(t \cdot \left(t \cdot x\right)\right) \cdot \left(\left(z \cdot z\right) \cdot \left(\color{blue}{y} \cdot y\right)\right)\right) \]
    7. associate-*l*N/A

      \[\leadsto \frac{-1}{128} \cdot \left(t \cdot \left(\left(t \cdot x\right) \cdot \color{blue}{\left(\left(z \cdot z\right) \cdot \left(y \cdot y\right)\right)}\right)\right) \]
    8. lower-*.f64N/A

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

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

      \[\leadsto \frac{-1}{128} \cdot \left(t \cdot \left(\left(t \cdot x\right) \cdot \left(\left(z \cdot z\right) \cdot \left(\color{blue}{y} \cdot y\right)\right)\right)\right) \]
    11. lift-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(t \cdot \left(\left(t \cdot x\right) \cdot \left(\left(z \cdot z\right) \cdot \left(y \cdot y\right)\right)\right)\right) \]
    12. associate-*r*N/A

      \[\leadsto \frac{-1}{128} \cdot \left(t \cdot \left(\left(t \cdot x\right) \cdot \left(\left(\left(z \cdot z\right) \cdot y\right) \cdot y\right)\right)\right) \]
    13. lower-*.f64N/A

      \[\leadsto \frac{-1}{128} \cdot \left(t \cdot \left(\left(t \cdot x\right) \cdot \left(\left(\left(z \cdot z\right) \cdot y\right) \cdot y\right)\right)\right) \]
    14. lower-*.f642.9%

      \[\leadsto -0.0078125 \cdot \left(t \cdot \left(\left(t \cdot x\right) \cdot \left(\left(\left(z \cdot z\right) \cdot y\right) \cdot y\right)\right)\right) \]
  11. Applied rewrites2.9%

    \[\leadsto -0.0078125 \cdot \left(t \cdot \left(\left(t \cdot x\right) \cdot \color{blue}{\left(\left(\left(z \cdot z\right) \cdot y\right) \cdot y\right)}\right)\right) \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2025202 
(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))))