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

Percentage Accurate: 27.5% → 32.1%
Time: 9.3s
Alternatives: 16
Speedup: 2.4×

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 16 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: 32.1% accurate, 0.4× 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^{+220}:\\ \;\;\;\;\left(x \cdot \sin \left(\left(1 + \frac{-0.0625 \cdot \left(\mathsf{fma}\left(y + y, \left|z\right|, \left|z\right|\right) \cdot \left|t\right|\right)}{0.5 \cdot \pi}\right) \cdot \left(0.5 \cdot \pi\right)\right)\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2}\\ \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+220)
     (*
      (*
       x
       (sin
        (*
         (+
          1.0
          (/
           (* -0.0625 (* (fma (+ y y) (fabs z) (fabs z)) (fabs t)))
           (* 0.5 PI)))
         (* 0.5 PI))))
      t_1)
     (* x (/ (* 2.0 (sin (* 0.5 PI))) 2.0)))))
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+220) {
		tmp = (x * sin(((1.0 + ((-0.0625 * (fma((y + y), fabs(z), fabs(z)) * fabs(t))) / (0.5 * ((double) M_PI)))) * (0.5 * ((double) M_PI))))) * t_1;
	} else {
		tmp = x * ((2.0 * sin((0.5 * ((double) M_PI)))) / 2.0);
	}
	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+220)
		tmp = Float64(Float64(x * sin(Float64(Float64(1.0 + Float64(Float64(-0.0625 * Float64(fma(Float64(y + y), abs(z), abs(z)) * abs(t))) / Float64(0.5 * pi))) * Float64(0.5 * pi)))) * t_1);
	else
		tmp = Float64(x * Float64(Float64(2.0 * sin(Float64(0.5 * pi))) / 2.0));
	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+220], N[(N[(x * N[Sin[N[(N[(1.0 + N[(N[(-0.0625 * N[(N[(N[(y + y), $MachinePrecision] * N[Abs[z], $MachinePrecision] + N[Abs[z], $MachinePrecision]), $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(x * N[(N[(2.0 * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $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^{+220}:\\
\;\;\;\;\left(x \cdot \sin \left(\left(1 + \frac{-0.0625 \cdot \left(\mathsf{fma}\left(y + y, \left|z\right|, \left|z\right|\right) \cdot \left|t\right|\right)}{0.5 \cdot \pi}\right) \cdot \left(0.5 \cdot \pi\right)\right)\right) \cdot t\_1\\

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


\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.0000000000000002e220

    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-cos.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \sin \color{blue}{\left(\left(1 + \frac{\left(t \cdot \left(z \cdot \mathsf{fma}\left(2, y, 1\right)\right)\right) \cdot \frac{-1}{16}}{\pi \cdot \frac{1}{2}}\right) \cdot \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. Applied rewrites27.4%

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

    if 5.0000000000000002e220 < (*.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.3%

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

      \[\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. Applied rewrites26.8%

      \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
    6. Taylor expanded in t around 0

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

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

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

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

        \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
    8. Applied rewrites30.7%

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

Alternative 2: 32.0% accurate, 0.5× speedup?

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

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


\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.0000000000000002e220

    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 \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \color{blue}{\left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)} \]
      2. div-flipN/A

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

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

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

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

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

        \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{1}{\frac{16}{\left(b \cdot \left(\color{blue}{a \cdot 2} + 1\right)\right) \cdot t}}\right) \]
      10. lower-fma.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{1}{\frac{16}{\left(b \cdot \color{blue}{\mathsf{fma}\left(a, 2, 1\right)}\right) \cdot t}}\right) \]
    3. 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 \color{blue}{\left(\frac{1}{\frac{16}{\left(b \cdot \mathsf{fma}\left(a, 2, 1\right)\right) \cdot t}}\right)} \]
    4. Applied rewrites27.4%

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

    if 5.0000000000000002e220 < (*.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.3%

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

      \[\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. Applied rewrites26.8%

      \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
    6. Taylor expanded in t around 0

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

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

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

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

        \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
    8. Applied rewrites30.7%

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

Alternative 3: 32.0% 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^{+220}:\\ \;\;\;\;\left(x \cdot \sin \left(\mathsf{fma}\left(\left|t\right| \cdot \left(\left|z\right| \cdot \mathsf{fma}\left(2, y, 1\right)\right), -0.0625, \pi \cdot 0.5\right)\right)\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2}\\ \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+220)
     (*
      (*
       x
       (sin
        (fma (* (fabs t) (* (fabs z) (fma 2.0 y 1.0))) -0.0625 (* PI 0.5))))
      t_1)
     (* x (/ (* 2.0 (sin (* 0.5 PI))) 2.0)))))
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+220) {
		tmp = (x * sin(fma((fabs(t) * (fabs(z) * fma(2.0, y, 1.0))), -0.0625, (((double) M_PI) * 0.5)))) * t_1;
	} else {
		tmp = x * ((2.0 * sin((0.5 * ((double) M_PI)))) / 2.0);
	}
	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+220)
		tmp = Float64(Float64(x * sin(fma(Float64(abs(t) * Float64(abs(z) * fma(2.0, y, 1.0))), -0.0625, Float64(pi * 0.5)))) * t_1);
	else
		tmp = Float64(x * Float64(Float64(2.0 * sin(Float64(0.5 * pi))) / 2.0));
	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+220], N[(N[(x * N[Sin[N[(N[(N[Abs[t], $MachinePrecision] * N[(N[Abs[z], $MachinePrecision] * N[(2.0 * y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.0625 + N[(Pi * 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(x * N[(N[(2.0 * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $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^{+220}:\\
\;\;\;\;\left(x \cdot \sin \left(\mathsf{fma}\left(\left|t\right| \cdot \left(\left|z\right| \cdot \mathsf{fma}\left(2, y, 1\right)\right), -0.0625, \pi \cdot 0.5\right)\right)\right) \cdot t\_1\\

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


\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.0000000000000002e220

    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-cos.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot \color{blue}{\sin \left(\mathsf{fma}\left(t \cdot \left(z \cdot \mathsf{fma}\left(2, y, 1\right)\right), -0.0625, \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 5.0000000000000002e220 < (*.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.3%

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

      \[\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. Applied rewrites26.8%

      \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
    6. Taylor expanded in t around 0

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

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

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

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

        \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
    8. Applied rewrites30.7%

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

Alternative 4: 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 10^{+277}:\\ \;\;\;\;t\_1 \cdot \cos \left(\frac{\left(\left(a \cdot \left(2 + \frac{1}{a}\right)\right) \cdot b\right) \cdot t}{16}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2}\\ \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))) 1e+277)
     (* t_1 (cos (/ (* (* (* a (+ 2.0 (/ 1.0 a))) b) t) 16.0)))
     (* x (/ (* 2.0 (sin (* 0.5 PI))) 2.0)))))
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))) <= 1e+277) {
		tmp = t_1 * cos(((((a * (2.0 + (1.0 / a))) * b) * t) / 16.0));
	} else {
		tmp = x * ((2.0 * sin((0.5 * ((double) M_PI)))) / 2.0);
	}
	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))) <= 1e+277) {
		tmp = t_1 * Math.cos(((((a * (2.0 + (1.0 / a))) * b) * t) / 16.0));
	} else {
		tmp = x * ((2.0 * Math.sin((0.5 * Math.PI))) / 2.0);
	}
	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))) <= 1e+277:
		tmp = t_1 * math.cos(((((a * (2.0 + (1.0 / a))) * b) * t) / 16.0))
	else:
		tmp = x * ((2.0 * math.sin((0.5 * math.pi))) / 2.0)
	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))) <= 1e+277)
		tmp = Float64(t_1 * cos(Float64(Float64(Float64(Float64(a * Float64(2.0 + Float64(1.0 / a))) * b) * t) / 16.0)));
	else
		tmp = Float64(x * Float64(Float64(2.0 * sin(Float64(0.5 * pi))) / 2.0));
	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))) <= 1e+277)
		tmp = t_1 * cos(((((a * (2.0 + (1.0 / a))) * b) * t) / 16.0));
	else
		tmp = x * ((2.0 * sin((0.5 * pi))) / 2.0);
	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], 1e+277], N[(t$95$1 * N[Cos[N[(N[(N[(N[(a * N[(2.0 + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $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 10^{+277}:\\
\;\;\;\;t\_1 \cdot \cos \left(\frac{\left(\left(a \cdot \left(2 + \frac{1}{a}\right)\right) \cdot b\right) \cdot t}{16}\right)\\

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


\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)))) < 1e277

    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 inf

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

    if 1e277 < (*.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.3%

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

      \[\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. Applied rewrites26.8%

      \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
    6. Taylor expanded in t around 0

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

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

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

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

        \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
    8. Applied rewrites30.7%

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

Alternative 5: 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^{+220}:\\ \;\;\;\;t\_1 \cdot \cos \left(\frac{1}{\frac{\frac{16}{t}}{\mathsf{fma}\left(b, a + a, b\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2}\\ \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+220)
     (* t_1 (cos (/ 1.0 (/ (/ 16.0 t) (fma b (+ a a) b)))))
     (* x (/ (* 2.0 (sin (* 0.5 PI))) 2.0)))))
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+220) {
		tmp = t_1 * cos((1.0 / ((16.0 / t) / fma(b, (a + a), b))));
	} else {
		tmp = x * ((2.0 * sin((0.5 * ((double) M_PI)))) / 2.0);
	}
	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+220)
		tmp = Float64(t_1 * cos(Float64(1.0 / Float64(Float64(16.0 / t) / fma(b, Float64(a + a), b)))));
	else
		tmp = Float64(x * Float64(Float64(2.0 * sin(Float64(0.5 * pi))) / 2.0));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Cos[N[(N[(N[(N[(N[(y * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[Cos[N[(N[(N[(N[(N[(a * 2.0), $MachinePrecision] + 1.0), $MachinePrecision] * b), $MachinePrecision] * t), $MachinePrecision] / 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 5e+220], N[(t$95$1 * N[Cos[N[(1.0 / N[(N[(16.0 / t), $MachinePrecision] / N[(b * N[(a + a), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $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^{+220}:\\
\;\;\;\;t\_1 \cdot \cos \left(\frac{1}{\frac{\frac{16}{t}}{\mathsf{fma}\left(b, a + a, b\right)}}\right)\\

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


\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.0000000000000002e220

    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 \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \color{blue}{\left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right)} \]
      2. div-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \cos \left(\frac{\left(\left(y \cdot 2 + 1\right) \cdot z\right) \cdot t}{16}\right)\right) \cdot \cos \left(\frac{1}{\color{blue}{\frac{\frac{16}{t}}{\left(a \cdot 2 + 1\right) \cdot b}}}\right) \]
      8. 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{1}{\color{blue}{\frac{\frac{16}{t}}{\left(a \cdot 2 + 1\right) \cdot b}}}\right) \]
      9. 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{1}{\frac{\color{blue}{\frac{16}{t}}}{\left(a \cdot 2 + 1\right) \cdot b}}\right) \]
      10. lift-fma.f64N/A

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

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

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

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

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

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

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

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

    if 5.0000000000000002e220 < (*.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.3%

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

      \[\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. Applied rewrites26.8%

      \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
    6. Taylor expanded in t around 0

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

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

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

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

        \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
    8. Applied rewrites30.7%

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

Alternative 6: 31.9% 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 10^{+277}:\\ \;\;\;\;\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\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2}\\ \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)))
      1e+277)
   (*
    (*
     (cos (* (* (* b (fma a 2.0 1.0)) t) -0.0625))
     (cos (* (* t (* z (fma 2.0 y 1.0))) -0.0625)))
    x)
   (* x (/ (* 2.0 (sin (* 0.5 PI))) 2.0))))
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))) <= 1e+277) {
		tmp = (cos((((b * fma(a, 2.0, 1.0)) * t) * -0.0625)) * cos(((t * (z * fma(2.0, y, 1.0))) * -0.0625))) * x;
	} else {
		tmp = x * ((2.0 * sin((0.5 * ((double) M_PI)))) / 2.0);
	}
	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))) <= 1e+277)
		tmp = Float64(Float64(cos(Float64(Float64(Float64(b * fma(a, 2.0, 1.0)) * t) * -0.0625)) * cos(Float64(Float64(t * Float64(z * fma(2.0, y, 1.0))) * -0.0625))) * x);
	else
		tmp = Float64(x * Float64(Float64(2.0 * sin(Float64(0.5 * pi))) / 2.0));
	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], 1e+277], 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[(N[(t * N[(z * N[(2.0 * y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.0625), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(x * N[(N[(2.0 * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $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 10^{+277}:\\
\;\;\;\;\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\\

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


\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)))) < 1e277

    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} \]

    if 1e277 < (*.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.3%

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

      \[\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. Applied rewrites26.8%

      \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
    6. Taylor expanded in t around 0

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

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

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

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

        \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
    8. Applied rewrites30.7%

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

Alternative 7: 31.6% 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^{+220}:\\ \;\;\;\;\left(x \cdot \sin \left(\mathsf{fma}\left(-0.0625, \left|t\right| \cdot \left|z\right|, 0.5 \cdot \pi\right)\right)\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2}\\ \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+220)
     (* (* x (sin (fma -0.0625 (* (fabs t) (fabs z)) (* 0.5 PI)))) t_1)
     (* x (/ (* 2.0 (sin (* 0.5 PI))) 2.0)))))
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+220) {
		tmp = (x * sin(fma(-0.0625, (fabs(t) * fabs(z)), (0.5 * ((double) M_PI))))) * t_1;
	} else {
		tmp = x * ((2.0 * sin((0.5 * ((double) M_PI)))) / 2.0);
	}
	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+220)
		tmp = Float64(Float64(x * sin(fma(-0.0625, Float64(abs(t) * abs(z)), Float64(0.5 * pi)))) * t_1);
	else
		tmp = Float64(x * Float64(Float64(2.0 * sin(Float64(0.5 * pi))) / 2.0));
	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+220], N[(N[(x * N[Sin[N[(-0.0625 * N[(N[Abs[t], $MachinePrecision] * N[Abs[z], $MachinePrecision]), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(x * N[(N[(2.0 * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $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^{+220}:\\
\;\;\;\;\left(x \cdot \sin \left(\mathsf{fma}\left(-0.0625, \left|t\right| \cdot \left|z\right|, 0.5 \cdot \pi\right)\right)\right) \cdot t\_1\\

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


\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.0000000000000002e220

    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-cos.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot \color{blue}{\sin \left(\mathsf{fma}\left(t \cdot \left(z \cdot \mathsf{fma}\left(2, y, 1\right)\right), -0.0625, \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) \]
    4. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \sin \color{blue}{\left(\frac{-1}{16} \cdot \left(t \cdot z\right) + \frac{1}{2} \cdot \pi\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. lower-fma.f64N/A

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

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

        \[\leadsto \left(x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, t \cdot z, \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      4. lower-PI.f6428.2%

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

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

    if 5.0000000000000002e220 < (*.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.3%

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

      \[\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. Applied rewrites26.8%

      \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
    6. Taylor expanded in t around 0

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

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

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

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

        \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
    8. Applied rewrites30.7%

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

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

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


\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)))) < 1.00000000000000005e26

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

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

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

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

    if 1.00000000000000005e26 < (*.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.3%

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

      \[\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. Applied rewrites26.8%

      \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
    6. Taylor expanded in t around 0

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

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

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

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

        \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
    8. Applied rewrites30.7%

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

Alternative 9: 31.5% accurate, 0.5× speedup?

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 x (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 y #s(literal 2 binary64)) #s(literal 1 binary64)) z) t) #s(literal 16 binary64)))) (cos.f64 (/.f64 (*.f64 (*.f64 (+.f64 (*.f64 a #s(literal 2 binary64)) #s(literal 1 binary64)) b) t) #s(literal 16 binary64)))) < 2.0000000000000002e252

    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-cos.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot \color{blue}{\sin \left(\mathsf{fma}\left(t \cdot \left(z \cdot \mathsf{fma}\left(2, y, 1\right)\right), -0.0625, \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) \]
    4. Taylor expanded in y around 0

      \[\leadsto \left(x \cdot \sin \color{blue}{\left(\frac{-1}{16} \cdot \left(t \cdot z\right) + \frac{1}{2} \cdot \pi\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. lower-fma.f64N/A

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

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

        \[\leadsto \left(x \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, t \cdot z, \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \cos \left(\frac{\left(\left(a \cdot 2 + 1\right) \cdot b\right) \cdot t}{16}\right) \]
      4. lower-PI.f6428.2%

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

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

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

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

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

        \[\leadsto \left(x \cdot \sin \left(\mathsf{fma}\left(-0.0625, t \cdot z, 0.5 \cdot \pi\right)\right)\right) \cdot \cos \left(0.125 \cdot \left(a \cdot \left(b \cdot \color{blue}{t}\right)\right)\right) \]
    9. Applied rewrites28.3%

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

    if 2.0000000000000002e252 < (*.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.3%

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

      \[\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. Applied rewrites26.8%

      \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
    6. Taylor expanded in t around 0

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

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

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

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

        \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
    8. Applied rewrites30.7%

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

Alternative 10: 31.3% 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 10^{+26}:\\ \;\;\;\;\left(\cos \left(-0.0625 \cdot \left(b \cdot t\right)\right) \cdot x\right) \cdot \cos \left(-0.0625 \cdot \left(\mathsf{fma}\left(y + y, z, z\right) \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2}\\ \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)))
      1e+26)
   (*
    (* (cos (* -0.0625 (* b t))) x)
    (cos (* -0.0625 (* (fma (+ y y) z z) t))))
   (* x (/ (* 2.0 (sin (* 0.5 PI))) 2.0))))
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))) <= 1e+26) {
		tmp = (cos((-0.0625 * (b * t))) * x) * cos((-0.0625 * (fma((y + y), z, z) * t)));
	} else {
		tmp = x * ((2.0 * sin((0.5 * ((double) M_PI)))) / 2.0);
	}
	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))) <= 1e+26)
		tmp = Float64(Float64(cos(Float64(-0.0625 * Float64(b * t))) * x) * cos(Float64(-0.0625 * Float64(fma(Float64(y + y), z, z) * t))));
	else
		tmp = Float64(x * Float64(Float64(2.0 * sin(Float64(0.5 * pi))) / 2.0));
	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], 1e+26], N[(N[(N[Cos[N[(-0.0625 * N[(b * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] * N[Cos[N[(-0.0625 * N[(N[(N[(y + y), $MachinePrecision] * z + z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(2.0 * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $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 10^{+26}:\\
\;\;\;\;\left(\cos \left(-0.0625 \cdot \left(b \cdot t\right)\right) \cdot x\right) \cdot \cos \left(-0.0625 \cdot \left(\mathsf{fma}\left(y + y, z, z\right) \cdot t\right)\right)\\

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


\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)))) < 1.00000000000000005e26

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

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

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

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

    if 1.00000000000000005e26 < (*.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.3%

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

      \[\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. Applied rewrites26.8%

      \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
    6. Taylor expanded in t around 0

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

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

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

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

        \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
    8. Applied rewrites30.7%

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

Alternative 11: 31.0% accurate, 1.7× speedup?

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 4.0999999999999999e-45

    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 z around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \cos \left(\frac{1}{16} \cdot \left(b \cdot \left(a \cdot \mathsf{fma}\left(2, t, \frac{t}{a}\right)\right)\right)\right) \]
      3. lower-/.f6427.3%

        \[\leadsto x \cdot \cos \left(0.0625 \cdot \left(b \cdot \left(a \cdot \mathsf{fma}\left(2, t, \frac{t}{a}\right)\right)\right)\right) \]
    7. Applied rewrites27.3%

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

    if 4.0999999999999999e-45 < t

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

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

      \[\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. Applied rewrites26.8%

      \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
    6. Taylor expanded in t around 0

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

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

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

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

        \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
    8. Applied rewrites30.7%

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

Alternative 12: 30.7% accurate, 1.1× speedup?

\[x \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \left(\left|b\right| \cdot \left|t\right|\right) \cdot 0.0625\right)\right) \cdot \cos \left(0.0625 \cdot \left(\left|t\right| \cdot z\right)\right)\right) \]
(FPCore (x y z t a b)
 :precision binary64
 (*
  x
  (*
   (sin (fma PI 0.5 (* (* (fabs b) (fabs t)) 0.0625)))
   (cos (* 0.0625 (* (fabs t) z))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * (sin(fma(((double) M_PI), 0.5, ((fabs(b) * fabs(t)) * 0.0625))) * cos((0.0625 * (fabs(t) * z))));
}
function code(x, y, z, t, a, b)
	return Float64(x * Float64(sin(fma(pi, 0.5, Float64(Float64(abs(b) * abs(t)) * 0.0625))) * cos(Float64(0.0625 * Float64(abs(t) * z)))))
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[(N[Sin[N[(Pi * 0.5 + N[(N[(N[Abs[b], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(0.0625 * N[(N[Abs[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \left(\left|b\right| \cdot \left|t\right|\right) \cdot 0.0625\right)\right) \cdot \cos \left(0.0625 \cdot \left(\left|t\right| \cdot z\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 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.3%

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

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

    \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot z\right)\right)\right) \]
  6. Step-by-step derivation
    1. Applied rewrites29.2%

      \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot z\right)\right)\right) \]
    2. Step-by-step derivation
      1. lift-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 z\right)\right)}\right) \]
      2. sin-+PI/2-revN/A

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

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

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

        \[\leadsto x \cdot \left(\sin \left(\frac{\pi}{2} + \frac{1}{16} \cdot \left(b \cdot t\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)\right) \]
      6. mult-flip-revN/A

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

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

        \[\leadsto x \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, 0.0625 \cdot \left(b \cdot t\right)\right)\right) \cdot \cos \left(\color{blue}{0.0625} \cdot \left(t \cdot z\right)\right)\right) \]
      9. lift-*.f64N/A

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

        \[\leadsto x \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \left(b \cdot t\right) \cdot \frac{1}{16}\right)\right) \cdot \cos \left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)\right) \]
      11. lower-*.f6429.2%

        \[\leadsto x \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \left(b \cdot t\right) \cdot 0.0625\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot z\right)\right)\right) \]
    3. Applied rewrites29.2%

      \[\leadsto x \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \left(b \cdot t\right) \cdot 0.0625\right)\right) \cdot \cos \color{blue}{\left(0.0625 \cdot \left(t \cdot z\right)\right)}\right) \]
    4. Add Preprocessing

    Alternative 13: 29.7% accurate, 1.1× speedup?

    \[x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot \left|t\right|\right)\right) \cdot \sin \left(\mathsf{fma}\left(-0.0625, \left|z\right| \cdot \left|t\right|, \pi \cdot 0.5\right)\right)\right) \]
    (FPCore (x y z t a b)
     :precision binary64
     (*
      x
      (*
       (cos (* 0.0625 (* b (fabs t))))
       (sin (fma -0.0625 (* (fabs z) (fabs t)) (* PI 0.5))))))
    double code(double x, double y, double z, double t, double a, double b) {
    	return x * (cos((0.0625 * (b * fabs(t)))) * sin(fma(-0.0625, (fabs(z) * fabs(t)), (((double) M_PI) * 0.5))));
    }
    
    function code(x, y, z, t, a, b)
    	return Float64(x * Float64(cos(Float64(0.0625 * Float64(b * abs(t)))) * sin(fma(-0.0625, Float64(abs(z) * abs(t)), Float64(pi * 0.5)))))
    end
    
    code[x_, y_, z_, t_, a_, b_] := N[(x * N[(N[Cos[N[(0.0625 * N[(b * N[Abs[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(-0.0625 * N[(N[Abs[z], $MachinePrecision] * N[Abs[t], $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot \left|t\right|\right)\right) \cdot \sin \left(\mathsf{fma}\left(-0.0625, \left|z\right| \cdot \left|t\right|, \pi \cdot 0.5\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 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.3%

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

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

      \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot z\right)\right)\right) \]
    6. Step-by-step derivation
      1. Applied rewrites29.2%

        \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot z\right)\right)\right) \]
      2. Step-by-step derivation
        1. lift-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 z\right)\right)\right) \]
        2. cos-neg-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x \cdot \left(\cos \left(\frac{1}{16} \cdot \left(b \cdot t\right)\right) \cdot \sin \left(\mathsf{fma}\left(\frac{-1}{16}, z \cdot t, \pi \cdot \frac{1}{2}\right)\right)\right) \]
        15. lower-*.f6429.1%

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

        \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \sin \left(\mathsf{fma}\left(-0.0625, z \cdot t, \pi \cdot 0.5\right)\right)\right) \]
      4. Add Preprocessing

      Alternative 14: 29.2% accurate, 1.2× speedup?

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

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

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

        \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot z\right)\right)\right) \]
      6. Step-by-step derivation
        1. Applied rewrites29.2%

          \[\leadsto x \cdot \left(\cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \cos \left(0.0625 \cdot \left(t \cdot z\right)\right)\right) \]
        2. Add Preprocessing

        Alternative 15: 29.2% accurate, 2.2× speedup?

        \[x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
        (FPCore (x y z t a b)
         :precision binary64
         (* x (/ (* 2.0 (sin (* 0.5 PI))) 2.0)))
        double code(double x, double y, double z, double t, double a, double b) {
        	return x * ((2.0 * sin((0.5 * ((double) M_PI)))) / 2.0);
        }
        
        public static double code(double x, double y, double z, double t, double a, double b) {
        	return x * ((2.0 * Math.sin((0.5 * Math.PI))) / 2.0);
        }
        
        def code(x, y, z, t, a, b):
        	return x * ((2.0 * math.sin((0.5 * math.pi))) / 2.0)
        
        function code(x, y, z, t, a, b)
        	return Float64(x * Float64(Float64(2.0 * sin(Float64(0.5 * pi))) / 2.0))
        end
        
        function tmp = code(x, y, z, t, a, b)
        	tmp = x * ((2.0 * sin((0.5 * pi))) / 2.0);
        end
        
        code[x_, y_, z_, t_, a_, b_] := N[(x * N[(N[(2.0 * N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]
        
        x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2}
        
        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.3%

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

          \[\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. Applied rewrites26.8%

          \[\leadsto x \cdot \frac{\sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) - \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right) + \sin \left(\mathsf{fma}\left(-0.0625, b \cdot t, 0.5 \cdot \pi\right) + \left(\mathsf{fma}\left(y + y, z, z\right) \cdot 0.0625\right) \cdot t\right)}{\color{blue}{2}} \]
        6. Taylor expanded in t around 0

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

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

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

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

            \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
        8. Applied rewrites30.7%

          \[\leadsto x \cdot \frac{2 \cdot \sin \left(0.5 \cdot \pi\right)}{2} \]
        9. Add Preprocessing

        Alternative 16: 29.2% accurate, 2.4× speedup?

        \[\cos \left(-0.0625 \cdot \left(b \cdot t\right)\right) \cdot x \]
        (FPCore (x y z t a b) :precision binary64 (* (cos (* -0.0625 (* b t))) x))
        double code(double x, double y, double z, double t, double a, double b) {
        	return cos((-0.0625 * (b * t))) * x;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y, z, t, a, b)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8), intent (in) :: a
            real(8), intent (in) :: b
            code = cos(((-0.0625d0) * (b * t))) * x
        end function
        
        public static double code(double x, double y, double z, double t, double a, double b) {
        	return Math.cos((-0.0625 * (b * t))) * x;
        }
        
        def code(x, y, z, t, a, b):
        	return math.cos((-0.0625 * (b * t))) * x
        
        function code(x, y, z, t, a, b)
        	return Float64(cos(Float64(-0.0625 * Float64(b * t))) * x)
        end
        
        function tmp = code(x, y, z, t, a, b)
        	tmp = cos((-0.0625 * (b * t))) * x;
        end
        
        code[x_, y_, z_, t_, a_, b_] := N[(N[Cos[N[(-0.0625 * N[(b * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
        
        \cos \left(-0.0625 \cdot \left(b \cdot t\right)\right) \cdot x
        
        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.3%

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

          \[\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-*.f64N/A

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

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

            \[\leadsto \cos \left(0.0625 \cdot \left(b \cdot t\right)\right) \cdot \color{blue}{x} \]
          4. lift-cos.f64N/A

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

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

            \[\leadsto \cos \left(\mathsf{neg}\left(\frac{1}{16} \cdot \left(b \cdot t\right)\right)\right) \cdot x \]
          7. distribute-lft-neg-inN/A

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

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

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

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

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

        Reproduce

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