Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.7% → 97.1%
Time: 9.4s
Alternatives: 14
Speedup: 1.4×

Specification

?
\[\begin{array}{l} \\ \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
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 + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b):
	return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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: 92.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
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 + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b):
	return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}

Alternative 1: 97.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \leq 2 \cdot 10^{+262}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot z, b, \mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x + a \cdot \mathsf{fma}\left(b, z, t\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)) 2e+262)
   (fma (* a z) b (fma a t (fma z y x)))
   (fma z y (+ x (* a (fma b z t))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((((x + (y * z)) + (t * a)) + ((a * z) * b)) <= 2e+262) {
		tmp = fma((a * z), b, fma(a, t, fma(z, y, x)));
	} else {
		tmp = fma(z, y, (x + (a * fma(b, z, t))));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) <= 2e+262)
		tmp = fma(Float64(a * z), b, fma(a, t, fma(z, y, x)));
	else
		tmp = fma(z, y, Float64(x + Float64(a * fma(b, z, t))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], 2e+262], N[(N[(a * z), $MachinePrecision] * b + N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * y + N[(x + N[(a * N[(b * z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x + a \cdot \mathsf{fma}\left(b, z, t\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 2e262

    1. Initial program 98.2%

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

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

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

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b} + \left(\left(x + y \cdot z\right) + t \cdot a\right) \]
      4. lower-fma.f6498.2

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot z, b, \color{blue}{a \cdot t} + \left(x + y \cdot z\right)\right) \]
      9. lower-fma.f6498.2

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot z, b, \mathsf{fma}\left(a, t, \color{blue}{z \cdot y} + x\right)\right) \]
      14. lower-fma.f6498.2

        \[\leadsto \mathsf{fma}\left(a \cdot z, b, \mathsf{fma}\left(a, t, \color{blue}{\mathsf{fma}\left(z, y, x\right)}\right)\right) \]
    4. Applied rewrites98.2%

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

    if 2e262 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 77.3%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b} \]
      3. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) - \left(\mathsf{neg}\left(a \cdot z\right)\right) \cdot b} \]
      4. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(x + y \cdot z\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
      7. +-commutativeN/A

        \[\leadsto \left(\color{blue}{\left(y \cdot z + x\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
      8. associate-+l+N/A

        \[\leadsto \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
      9. associate-+l+N/A

        \[\leadsto \color{blue}{y \cdot z + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right)} \]
      10. lift-*.f64N/A

        \[\leadsto \color{blue}{y \cdot z} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
      11. *-commutativeN/A

        \[\leadsto \color{blue}{z \cdot y} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
      12. remove-double-negN/A

        \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right)} \cdot b\right) \]
      13. lift-*.f64N/A

        \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b}\right) \]
      14. associate-+r+N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, y, x + \left(\color{blue}{\left(a \cdot z\right)} \cdot b + t \cdot a\right)\right) \]
      20. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(z, y, x + \left(\color{blue}{a \cdot \left(z \cdot b\right)} + t \cdot a\right)\right) \]
    4. Applied rewrites95.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x + a \cdot \mathsf{fma}\left(b, z, t\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 54.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-37}:\\ \;\;\;\;\left(b \cdot z\right) \cdot a\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{-167}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{elif}\;b \leq 6.4 \cdot 10^{-16}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{+93}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -1.45e-37)
   (* (* b z) a)
   (if (<= b 2.9e-167)
     (fma a t x)
     (if (<= b 6.4e-16)
       (fma z y x)
       (if (<= b 3.6e+93) (fma a t x) (* (* z a) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.45e-37) {
		tmp = (b * z) * a;
	} else if (b <= 2.9e-167) {
		tmp = fma(a, t, x);
	} else if (b <= 6.4e-16) {
		tmp = fma(z, y, x);
	} else if (b <= 3.6e+93) {
		tmp = fma(a, t, x);
	} else {
		tmp = (z * a) * b;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -1.45e-37)
		tmp = Float64(Float64(b * z) * a);
	elseif (b <= 2.9e-167)
		tmp = fma(a, t, x);
	elseif (b <= 6.4e-16)
		tmp = fma(z, y, x);
	elseif (b <= 3.6e+93)
		tmp = fma(a, t, x);
	else
		tmp = Float64(Float64(z * a) * b);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.45e-37], N[(N[(b * z), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[b, 2.9e-167], N[(a * t + x), $MachinePrecision], If[LessEqual[b, 6.4e-16], N[(z * y + x), $MachinePrecision], If[LessEqual[b, 3.6e+93], N[(a * t + x), $MachinePrecision], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.45 \cdot 10^{-37}:\\
\;\;\;\;\left(b \cdot z\right) \cdot a\\

\mathbf{elif}\;b \leq 2.9 \cdot 10^{-167}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\

\mathbf{elif}\;b \leq 6.4 \cdot 10^{-16}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\

\mathbf{elif}\;b \leq 3.6 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\

\mathbf{else}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.45000000000000002e-37

    1. Initial program 93.0%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b} \]
      3. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) - \left(\mathsf{neg}\left(a \cdot z\right)\right) \cdot b} \]
      4. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
      6. lift-+.f64N/A

        \[\leadsto \left(\color{blue}{\left(x + y \cdot z\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
      7. +-commutativeN/A

        \[\leadsto \left(\color{blue}{\left(y \cdot z + x\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
      8. associate-+l+N/A

        \[\leadsto \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
      9. associate-+l+N/A

        \[\leadsto \color{blue}{y \cdot z + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right)} \]
      10. lift-*.f64N/A

        \[\leadsto \color{blue}{y \cdot z} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
      11. *-commutativeN/A

        \[\leadsto \color{blue}{z \cdot y} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
      12. remove-double-negN/A

        \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right)} \cdot b\right) \]
      13. lift-*.f64N/A

        \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b}\right) \]
      14. associate-+r+N/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, y, x + \left(\color{blue}{\left(a \cdot z\right)} \cdot b + t \cdot a\right)\right) \]
      20. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(z, y, x + \left(\color{blue}{a \cdot \left(z \cdot b\right)} + t \cdot a\right)\right) \]
    4. Applied rewrites95.4%

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites62.8%

        \[\leadsto \color{blue}{\left(b \cdot z\right) \cdot a} \]

      if -1.45000000000000002e-37 < b < 2.90000000000000003e-167 or 6.40000000000000046e-16 < b < 3.5999999999999999e93

      1. Initial program 92.9%

        \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
      2. Add Preprocessing
      3. Taylor expanded in z around 0

        \[\leadsto \color{blue}{x + a \cdot t} \]
      4. Step-by-step derivation
        1. Applied rewrites72.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, x\right)} \]

        if 2.90000000000000003e-167 < b < 6.40000000000000046e-16

        1. Initial program 94.2%

          \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
        2. Add Preprocessing
        3. Taylor expanded in a around 0

          \[\leadsto \color{blue}{x + y \cdot z} \]
        4. Step-by-step derivation
          1. Applied rewrites71.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]

          if 3.5999999999999999e93 < b

          1. Initial program 90.0%

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

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

              \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b} \]
            3. fp-cancel-sign-sub-invN/A

              \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) - \left(\mathsf{neg}\left(a \cdot z\right)\right) \cdot b} \]
            4. fp-cancel-sub-sign-invN/A

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

              \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
            6. lift-+.f64N/A

              \[\leadsto \left(\color{blue}{\left(x + y \cdot z\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
            7. +-commutativeN/A

              \[\leadsto \left(\color{blue}{\left(y \cdot z + x\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
            8. associate-+l+N/A

              \[\leadsto \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
            9. associate-+l+N/A

              \[\leadsto \color{blue}{y \cdot z + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right)} \]
            10. lift-*.f64N/A

              \[\leadsto \color{blue}{y \cdot z} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
            11. *-commutativeN/A

              \[\leadsto \color{blue}{z \cdot y} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
            12. remove-double-negN/A

              \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right)} \cdot b\right) \]
            13. lift-*.f64N/A

              \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b}\right) \]
            14. associate-+r+N/A

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(z, y, x + \left(\color{blue}{\left(a \cdot z\right)} \cdot b + t \cdot a\right)\right) \]
            20. associate-*l*N/A

              \[\leadsto \mathsf{fma}\left(z, y, x + \left(\color{blue}{a \cdot \left(z \cdot b\right)} + t \cdot a\right)\right) \]
          4. Applied rewrites86.9%

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

            \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites59.6%

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

                \[\leadsto \left(z \cdot a\right) \cdot \color{blue}{b} \]
            3. Recombined 4 regimes into one program.
            4. Add Preprocessing

            Alternative 3: 53.8% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-37}:\\ \;\;\;\;\left(b \cdot z\right) \cdot a\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{-167}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{elif}\;b \leq 6.4 \cdot 10^{-16}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{+93}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot a\right) \cdot z\\ \end{array} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (if (<= b -1.45e-37)
               (* (* b z) a)
               (if (<= b 2.9e-167)
                 (fma a t x)
                 (if (<= b 6.4e-16)
                   (fma z y x)
                   (if (<= b 3.6e+93) (fma a t x) (* (* b a) z))))))
            double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if (b <= -1.45e-37) {
            		tmp = (b * z) * a;
            	} else if (b <= 2.9e-167) {
            		tmp = fma(a, t, x);
            	} else if (b <= 6.4e-16) {
            		tmp = fma(z, y, x);
            	} else if (b <= 3.6e+93) {
            		tmp = fma(a, t, x);
            	} else {
            		tmp = (b * a) * z;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a, b)
            	tmp = 0.0
            	if (b <= -1.45e-37)
            		tmp = Float64(Float64(b * z) * a);
            	elseif (b <= 2.9e-167)
            		tmp = fma(a, t, x);
            	elseif (b <= 6.4e-16)
            		tmp = fma(z, y, x);
            	elseif (b <= 3.6e+93)
            		tmp = fma(a, t, x);
            	else
            		tmp = Float64(Float64(b * a) * z);
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.45e-37], N[(N[(b * z), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[b, 2.9e-167], N[(a * t + x), $MachinePrecision], If[LessEqual[b, 6.4e-16], N[(z * y + x), $MachinePrecision], If[LessEqual[b, 3.6e+93], N[(a * t + x), $MachinePrecision], N[(N[(b * a), $MachinePrecision] * z), $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;b \leq -1.45 \cdot 10^{-37}:\\
            \;\;\;\;\left(b \cdot z\right) \cdot a\\
            
            \mathbf{elif}\;b \leq 2.9 \cdot 10^{-167}:\\
            \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
            
            \mathbf{elif}\;b \leq 6.4 \cdot 10^{-16}:\\
            \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
            
            \mathbf{elif}\;b \leq 3.6 \cdot 10^{+93}:\\
            \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(b \cdot a\right) \cdot z\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if b < -1.45000000000000002e-37

              1. Initial program 93.0%

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

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

                  \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b} \]
                3. fp-cancel-sign-sub-invN/A

                  \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) - \left(\mathsf{neg}\left(a \cdot z\right)\right) \cdot b} \]
                4. fp-cancel-sub-sign-invN/A

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

                  \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                6. lift-+.f64N/A

                  \[\leadsto \left(\color{blue}{\left(x + y \cdot z\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                7. +-commutativeN/A

                  \[\leadsto \left(\color{blue}{\left(y \cdot z + x\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                8. associate-+l+N/A

                  \[\leadsto \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                9. associate-+l+N/A

                  \[\leadsto \color{blue}{y \cdot z + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right)} \]
                10. lift-*.f64N/A

                  \[\leadsto \color{blue}{y \cdot z} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
                11. *-commutativeN/A

                  \[\leadsto \color{blue}{z \cdot y} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
                12. remove-double-negN/A

                  \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right)} \cdot b\right) \]
                13. lift-*.f64N/A

                  \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b}\right) \]
                14. associate-+r+N/A

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(z, y, x + \left(\color{blue}{\left(a \cdot z\right)} \cdot b + t \cdot a\right)\right) \]
                20. associate-*l*N/A

                  \[\leadsto \mathsf{fma}\left(z, y, x + \left(\color{blue}{a \cdot \left(z \cdot b\right)} + t \cdot a\right)\right) \]
              4. Applied rewrites95.4%

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

                \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
              6. Step-by-step derivation
                1. Applied rewrites62.8%

                  \[\leadsto \color{blue}{\left(b \cdot z\right) \cdot a} \]

                if -1.45000000000000002e-37 < b < 2.90000000000000003e-167 or 6.40000000000000046e-16 < b < 3.5999999999999999e93

                1. Initial program 92.9%

                  \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                2. Add Preprocessing
                3. Taylor expanded in z around 0

                  \[\leadsto \color{blue}{x + a \cdot t} \]
                4. Step-by-step derivation
                  1. Applied rewrites72.8%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, x\right)} \]

                  if 2.90000000000000003e-167 < b < 6.40000000000000046e-16

                  1. Initial program 94.2%

                    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                  2. Add Preprocessing
                  3. Taylor expanded in a around 0

                    \[\leadsto \color{blue}{x + y \cdot z} \]
                  4. Step-by-step derivation
                    1. Applied rewrites71.0%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]

                    if 3.5999999999999999e93 < b

                    1. Initial program 90.0%

                      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                    2. Add Preprocessing
                    3. Taylor expanded in b around inf

                      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
                    4. Step-by-step derivation
                      1. Applied rewrites61.5%

                        \[\leadsto \color{blue}{\left(b \cdot a\right) \cdot z} \]
                    5. Recombined 4 regimes into one program.
                    6. Add Preprocessing

                    Alternative 4: 53.7% accurate, 0.9× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b \cdot a\right) \cdot z\\ \mathbf{if}\;b \leq -1.45 \cdot 10^{-37}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{-167}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{elif}\;b \leq 6.4 \cdot 10^{-16}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{+93}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                    (FPCore (x y z t a b)
                     :precision binary64
                     (let* ((t_1 (* (* b a) z)))
                       (if (<= b -1.45e-37)
                         t_1
                         (if (<= b 2.9e-167)
                           (fma a t x)
                           (if (<= b 6.4e-16) (fma z y x) (if (<= b 3.6e+93) (fma a t x) t_1))))))
                    double code(double x, double y, double z, double t, double a, double b) {
                    	double t_1 = (b * a) * z;
                    	double tmp;
                    	if (b <= -1.45e-37) {
                    		tmp = t_1;
                    	} else if (b <= 2.9e-167) {
                    		tmp = fma(a, t, x);
                    	} else if (b <= 6.4e-16) {
                    		tmp = fma(z, y, x);
                    	} else if (b <= 3.6e+93) {
                    		tmp = fma(a, t, x);
                    	} else {
                    		tmp = t_1;
                    	}
                    	return tmp;
                    }
                    
                    function code(x, y, z, t, a, b)
                    	t_1 = Float64(Float64(b * a) * z)
                    	tmp = 0.0
                    	if (b <= -1.45e-37)
                    		tmp = t_1;
                    	elseif (b <= 2.9e-167)
                    		tmp = fma(a, t, x);
                    	elseif (b <= 6.4e-16)
                    		tmp = fma(z, y, x);
                    	elseif (b <= 3.6e+93)
                    		tmp = fma(a, t, x);
                    	else
                    		tmp = t_1;
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[b, -1.45e-37], t$95$1, If[LessEqual[b, 2.9e-167], N[(a * t + x), $MachinePrecision], If[LessEqual[b, 6.4e-16], N[(z * y + x), $MachinePrecision], If[LessEqual[b, 3.6e+93], N[(a * t + x), $MachinePrecision], t$95$1]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \left(b \cdot a\right) \cdot z\\
                    \mathbf{if}\;b \leq -1.45 \cdot 10^{-37}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;b \leq 2.9 \cdot 10^{-167}:\\
                    \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
                    
                    \mathbf{elif}\;b \leq 6.4 \cdot 10^{-16}:\\
                    \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
                    
                    \mathbf{elif}\;b \leq 3.6 \cdot 10^{+93}:\\
                    \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_1\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if b < -1.45000000000000002e-37 or 3.5999999999999999e93 < b

                      1. Initial program 91.6%

                        \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                      2. Add Preprocessing
                      3. Taylor expanded in b around inf

                        \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
                      4. Step-by-step derivation
                        1. Applied rewrites60.5%

                          \[\leadsto \color{blue}{\left(b \cdot a\right) \cdot z} \]

                        if -1.45000000000000002e-37 < b < 2.90000000000000003e-167 or 6.40000000000000046e-16 < b < 3.5999999999999999e93

                        1. Initial program 92.9%

                          \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                        2. Add Preprocessing
                        3. Taylor expanded in z around 0

                          \[\leadsto \color{blue}{x + a \cdot t} \]
                        4. Step-by-step derivation
                          1. Applied rewrites72.8%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, x\right)} \]

                          if 2.90000000000000003e-167 < b < 6.40000000000000046e-16

                          1. Initial program 94.2%

                            \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                          2. Add Preprocessing
                          3. Taylor expanded in a around 0

                            \[\leadsto \color{blue}{x + y \cdot z} \]
                          4. Step-by-step derivation
                            1. Applied rewrites71.0%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
                          5. Recombined 3 regimes into one program.
                          6. Add Preprocessing

                          Alternative 5: 39.7% accurate, 1.0× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{+59}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-216}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-54}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+15}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
                          (FPCore (x y z t a b)
                           :precision binary64
                           (if (<= t -4e+59)
                             (* a t)
                             (if (<= t 3.7e-216)
                               x
                               (if (<= t 4e-54) (* z y) (if (<= t 2.1e+15) x (* a t))))))
                          double code(double x, double y, double z, double t, double a, double b) {
                          	double tmp;
                          	if (t <= -4e+59) {
                          		tmp = a * t;
                          	} else if (t <= 3.7e-216) {
                          		tmp = x;
                          	} else if (t <= 4e-54) {
                          		tmp = z * y;
                          	} else if (t <= 2.1e+15) {
                          		tmp = x;
                          	} else {
                          		tmp = a * t;
                          	}
                          	return tmp;
                          }
                          
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(x, y, z, t, a, b)
                          use fmin_fmax_functions
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8), intent (in) :: t
                              real(8), intent (in) :: a
                              real(8), intent (in) :: b
                              real(8) :: tmp
                              if (t <= (-4d+59)) then
                                  tmp = a * t
                              else if (t <= 3.7d-216) then
                                  tmp = x
                              else if (t <= 4d-54) then
                                  tmp = z * y
                              else if (t <= 2.1d+15) then
                                  tmp = x
                              else
                                  tmp = a * t
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z, double t, double a, double b) {
                          	double tmp;
                          	if (t <= -4e+59) {
                          		tmp = a * t;
                          	} else if (t <= 3.7e-216) {
                          		tmp = x;
                          	} else if (t <= 4e-54) {
                          		tmp = z * y;
                          	} else if (t <= 2.1e+15) {
                          		tmp = x;
                          	} else {
                          		tmp = a * t;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t, a, b):
                          	tmp = 0
                          	if t <= -4e+59:
                          		tmp = a * t
                          	elif t <= 3.7e-216:
                          		tmp = x
                          	elif t <= 4e-54:
                          		tmp = z * y
                          	elif t <= 2.1e+15:
                          		tmp = x
                          	else:
                          		tmp = a * t
                          	return tmp
                          
                          function code(x, y, z, t, a, b)
                          	tmp = 0.0
                          	if (t <= -4e+59)
                          		tmp = Float64(a * t);
                          	elseif (t <= 3.7e-216)
                          		tmp = x;
                          	elseif (t <= 4e-54)
                          		tmp = Float64(z * y);
                          	elseif (t <= 2.1e+15)
                          		tmp = x;
                          	else
                          		tmp = Float64(a * t);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t, a, b)
                          	tmp = 0.0;
                          	if (t <= -4e+59)
                          		tmp = a * t;
                          	elseif (t <= 3.7e-216)
                          		tmp = x;
                          	elseif (t <= 4e-54)
                          		tmp = z * y;
                          	elseif (t <= 2.1e+15)
                          		tmp = x;
                          	else
                          		tmp = a * t;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4e+59], N[(a * t), $MachinePrecision], If[LessEqual[t, 3.7e-216], x, If[LessEqual[t, 4e-54], N[(z * y), $MachinePrecision], If[LessEqual[t, 2.1e+15], x, N[(a * t), $MachinePrecision]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;t \leq -4 \cdot 10^{+59}:\\
                          \;\;\;\;a \cdot t\\
                          
                          \mathbf{elif}\;t \leq 3.7 \cdot 10^{-216}:\\
                          \;\;\;\;x\\
                          
                          \mathbf{elif}\;t \leq 4 \cdot 10^{-54}:\\
                          \;\;\;\;z \cdot y\\
                          
                          \mathbf{elif}\;t \leq 2.1 \cdot 10^{+15}:\\
                          \;\;\;\;x\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;a \cdot t\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if t < -3.99999999999999989e59 or 2.1e15 < t

                            1. Initial program 91.7%

                              \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                            2. Add Preprocessing
                            3. Taylor expanded in t around inf

                              \[\leadsto \color{blue}{a \cdot t} \]
                            4. Step-by-step derivation
                              1. Applied rewrites56.9%

                                \[\leadsto \color{blue}{a \cdot t} \]

                              if -3.99999999999999989e59 < t < 3.69999999999999996e-216 or 4.0000000000000001e-54 < t < 2.1e15

                              1. Initial program 93.7%

                                \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                              2. Add Preprocessing
                              3. Taylor expanded in x around inf

                                \[\leadsto \color{blue}{x} \]
                              4. Step-by-step derivation
                                1. Applied rewrites32.0%

                                  \[\leadsto \color{blue}{x} \]

                                if 3.69999999999999996e-216 < t < 4.0000000000000001e-54

                                1. Initial program 91.3%

                                  \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                2. Add Preprocessing
                                3. Taylor expanded in y around inf

                                  \[\leadsto \color{blue}{y \cdot z} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites55.4%

                                    \[\leadsto \color{blue}{z \cdot y} \]
                                5. Recombined 3 regimes into one program.
                                6. Add Preprocessing

                                Alternative 6: 85.9% accurate, 1.2× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5.8 \cdot 10^{-38} \lor \neg \left(b \leq 3.5 \cdot 10^{-14}\right):\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\\ \end{array} \end{array} \]
                                (FPCore (x y z t a b)
                                 :precision binary64
                                 (if (or (<= b -5.8e-38) (not (<= b 3.5e-14)))
                                   (fma (fma b z t) a x)
                                   (fma a t (fma z y x))))
                                double code(double x, double y, double z, double t, double a, double b) {
                                	double tmp;
                                	if ((b <= -5.8e-38) || !(b <= 3.5e-14)) {
                                		tmp = fma(fma(b, z, t), a, x);
                                	} else {
                                		tmp = fma(a, t, fma(z, y, x));
                                	}
                                	return tmp;
                                }
                                
                                function code(x, y, z, t, a, b)
                                	tmp = 0.0
                                	if ((b <= -5.8e-38) || !(b <= 3.5e-14))
                                		tmp = fma(fma(b, z, t), a, x);
                                	else
                                		tmp = fma(a, t, fma(z, y, x));
                                	end
                                	return tmp
                                end
                                
                                code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.8e-38], N[Not[LessEqual[b, 3.5e-14]], $MachinePrecision]], N[(N[(b * z + t), $MachinePrecision] * a + x), $MachinePrecision], N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;b \leq -5.8 \cdot 10^{-38} \lor \neg \left(b \leq 3.5 \cdot 10^{-14}\right):\\
                                \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if b < -5.79999999999999988e-38 or 3.5000000000000002e-14 < b

                                  1. Initial program 93.1%

                                    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in y around 0

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

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\right)} \]

                                    if -5.79999999999999988e-38 < b < 3.5000000000000002e-14

                                    1. Initial program 91.8%

                                      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in b around 0

                                      \[\leadsto \color{blue}{x + \left(a \cdot t + y \cdot z\right)} \]
                                    4. Step-by-step derivation
                                      1. Applied rewrites94.2%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)} \]
                                    5. Recombined 2 regimes into one program.
                                    6. Final simplification89.5%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.8 \cdot 10^{-38} \lor \neg \left(b \leq 3.5 \cdot 10^{-14}\right):\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\\ \end{array} \]
                                    7. Add Preprocessing

                                    Alternative 7: 78.3% accurate, 1.2× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-37}:\\ \;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\ \mathbf{elif}\;b \leq 4 \cdot 10^{+93}:\\ \;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot z, b, x\right)\\ \end{array} \end{array} \]
                                    (FPCore (x y z t a b)
                                     :precision binary64
                                     (if (<= b -1.45e-37)
                                       (* (fma b z t) a)
                                       (if (<= b 4e+93) (fma a t (fma z y x)) (fma (* a z) b x))))
                                    double code(double x, double y, double z, double t, double a, double b) {
                                    	double tmp;
                                    	if (b <= -1.45e-37) {
                                    		tmp = fma(b, z, t) * a;
                                    	} else if (b <= 4e+93) {
                                    		tmp = fma(a, t, fma(z, y, x));
                                    	} else {
                                    		tmp = fma((a * z), b, x);
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(x, y, z, t, a, b)
                                    	tmp = 0.0
                                    	if (b <= -1.45e-37)
                                    		tmp = Float64(fma(b, z, t) * a);
                                    	elseif (b <= 4e+93)
                                    		tmp = fma(a, t, fma(z, y, x));
                                    	else
                                    		tmp = fma(Float64(a * z), b, x);
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.45e-37], N[(N[(b * z + t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[b, 4e+93], N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision], N[(N[(a * z), $MachinePrecision] * b + x), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;b \leq -1.45 \cdot 10^{-37}:\\
                                    \;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\
                                    
                                    \mathbf{elif}\;b \leq 4 \cdot 10^{+93}:\\
                                    \;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\mathsf{fma}\left(a \cdot z, b, x\right)\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if b < -1.45000000000000002e-37

                                      1. Initial program 93.0%

                                        \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in a around inf

                                        \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
                                      4. Step-by-step derivation
                                        1. Applied rewrites77.1%

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(b, z, t\right) \cdot a} \]

                                        if -1.45000000000000002e-37 < b < 4.00000000000000017e93

                                        1. Initial program 93.2%

                                          \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in b around 0

                                          \[\leadsto \color{blue}{x + \left(a \cdot t + y \cdot z\right)} \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites92.4%

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)} \]

                                          if 4.00000000000000017e93 < b

                                          1. Initial program 90.0%

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

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

                                              \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b} \]
                                            3. fp-cancel-sign-sub-invN/A

                                              \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) - \left(\mathsf{neg}\left(a \cdot z\right)\right) \cdot b} \]
                                            4. fp-cancel-sub-sign-invN/A

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

                                              \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                                            6. lift-+.f64N/A

                                              \[\leadsto \left(\color{blue}{\left(x + y \cdot z\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                                            7. +-commutativeN/A

                                              \[\leadsto \left(\color{blue}{\left(y \cdot z + x\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                                            8. associate-+l+N/A

                                              \[\leadsto \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                                            9. associate-+l+N/A

                                              \[\leadsto \color{blue}{y \cdot z + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right)} \]
                                            10. lift-*.f64N/A

                                              \[\leadsto \color{blue}{y \cdot z} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
                                            11. *-commutativeN/A

                                              \[\leadsto \color{blue}{z \cdot y} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
                                            12. remove-double-negN/A

                                              \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right)} \cdot b\right) \]
                                            13. lift-*.f64N/A

                                              \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b}\right) \]
                                            14. associate-+r+N/A

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

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

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

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

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

                                              \[\leadsto \mathsf{fma}\left(z, y, x + \left(\color{blue}{\left(a \cdot z\right)} \cdot b + t \cdot a\right)\right) \]
                                            20. associate-*l*N/A

                                              \[\leadsto \mathsf{fma}\left(z, y, x + \left(\color{blue}{a \cdot \left(z \cdot b\right)} + t \cdot a\right)\right) \]
                                          4. Applied rewrites86.9%

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

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

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

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

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

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

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

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

                                              \[\leadsto a \cdot \color{blue}{\left(b \cdot z + t\right)} + \left(x + y \cdot z\right) \]
                                            9. distribute-lft-inN/A

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

                                              \[\leadsto \left(a \cdot \color{blue}{\left(z \cdot b\right)} + a \cdot t\right) + \left(x + y \cdot z\right) \]
                                            11. associate-*l*N/A

                                              \[\leadsto \left(\color{blue}{\left(a \cdot z\right) \cdot b} + a \cdot t\right) + \left(x + y \cdot z\right) \]
                                            12. *-commutativeN/A

                                              \[\leadsto \left(\left(a \cdot z\right) \cdot b + \color{blue}{t \cdot a}\right) + \left(x + y \cdot z\right) \]
                                            13. associate-+r+N/A

                                              \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(t \cdot a + \left(x + y \cdot z\right)\right)} \]
                                            14. +-commutativeN/A

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

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

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

                                              \[\leadsto \mathsf{fma}\left(a \cdot z, b, \color{blue}{t \cdot a + \left(x + y \cdot z\right)}\right) \]
                                            18. lower-fma.f64N/A

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

                                              \[\leadsto \mathsf{fma}\left(a \cdot z, b, \mathsf{fma}\left(t, a, \color{blue}{y \cdot z + x}\right)\right) \]
                                            20. lower-fma.f6492.0

                                              \[\leadsto \mathsf{fma}\left(a \cdot z, b, \mathsf{fma}\left(t, a, \color{blue}{\mathsf{fma}\left(y, z, x\right)}\right)\right) \]
                                          6. Applied rewrites92.0%

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

                                            \[\leadsto \mathsf{fma}\left(a \cdot z, b, \color{blue}{x}\right) \]
                                          8. Step-by-step derivation
                                            1. Applied rewrites80.2%

                                              \[\leadsto \mathsf{fma}\left(a \cdot z, b, \color{blue}{x}\right) \]
                                          9. Recombined 3 regimes into one program.
                                          10. Add Preprocessing

                                          Alternative 8: 73.2% accurate, 1.2× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.36 \cdot 10^{-21} \lor \neg \left(a \leq 2.6 \cdot 10^{-74}\right):\\ \;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \end{array} \end{array} \]
                                          (FPCore (x y z t a b)
                                           :precision binary64
                                           (if (or (<= a -1.36e-21) (not (<= a 2.6e-74))) (* (fma b z t) a) (fma z y x)))
                                          double code(double x, double y, double z, double t, double a, double b) {
                                          	double tmp;
                                          	if ((a <= -1.36e-21) || !(a <= 2.6e-74)) {
                                          		tmp = fma(b, z, t) * a;
                                          	} else {
                                          		tmp = fma(z, y, x);
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(x, y, z, t, a, b)
                                          	tmp = 0.0
                                          	if ((a <= -1.36e-21) || !(a <= 2.6e-74))
                                          		tmp = Float64(fma(b, z, t) * a);
                                          	else
                                          		tmp = fma(z, y, x);
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.36e-21], N[Not[LessEqual[a, 2.6e-74]], $MachinePrecision]], N[(N[(b * z + t), $MachinePrecision] * a), $MachinePrecision], N[(z * y + x), $MachinePrecision]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;a \leq -1.36 \cdot 10^{-21} \lor \neg \left(a \leq 2.6 \cdot 10^{-74}\right):\\
                                          \;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if a < -1.3599999999999999e-21 or 2.6000000000000001e-74 < a

                                            1. Initial program 88.5%

                                              \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in a around inf

                                              \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
                                            4. Step-by-step derivation
                                              1. Applied rewrites80.9%

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(b, z, t\right) \cdot a} \]

                                              if -1.3599999999999999e-21 < a < 2.6000000000000001e-74

                                              1. Initial program 98.7%

                                                \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                              2. Add Preprocessing
                                              3. Taylor expanded in a around 0

                                                \[\leadsto \color{blue}{x + y \cdot z} \]
                                              4. Step-by-step derivation
                                                1. Applied rewrites76.8%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
                                              5. Recombined 2 regimes into one program.
                                              6. Final simplification79.3%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.36 \cdot 10^{-21} \lor \neg \left(a \leq 2.6 \cdot 10^{-74}\right):\\ \;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \end{array} \]
                                              7. Add Preprocessing

                                              Alternative 9: 74.3% accurate, 1.2× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -820000000 \lor \neg \left(z \leq 3.7 \cdot 10^{+22}\right):\\ \;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \end{array} \end{array} \]
                                              (FPCore (x y z t a b)
                                               :precision binary64
                                               (if (or (<= z -820000000.0) (not (<= z 3.7e+22)))
                                                 (* (fma b a y) z)
                                                 (fma a t x)))
                                              double code(double x, double y, double z, double t, double a, double b) {
                                              	double tmp;
                                              	if ((z <= -820000000.0) || !(z <= 3.7e+22)) {
                                              		tmp = fma(b, a, y) * z;
                                              	} else {
                                              		tmp = fma(a, t, x);
                                              	}
                                              	return tmp;
                                              }
                                              
                                              function code(x, y, z, t, a, b)
                                              	tmp = 0.0
                                              	if ((z <= -820000000.0) || !(z <= 3.7e+22))
                                              		tmp = Float64(fma(b, a, y) * z);
                                              	else
                                              		tmp = fma(a, t, x);
                                              	end
                                              	return tmp
                                              end
                                              
                                              code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -820000000.0], N[Not[LessEqual[z, 3.7e+22]], $MachinePrecision]], N[(N[(b * a + y), $MachinePrecision] * z), $MachinePrecision], N[(a * t + x), $MachinePrecision]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;z \leq -820000000 \lor \neg \left(z \leq 3.7 \cdot 10^{+22}\right):\\
                                              \;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if z < -8.2e8 or 3.6999999999999998e22 < z

                                                1. Initial program 86.6%

                                                  \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in z around inf

                                                  \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} \]
                                                4. Step-by-step derivation
                                                  1. Applied rewrites74.7%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, y\right) \cdot z} \]

                                                  if -8.2e8 < z < 3.6999999999999998e22

                                                  1. Initial program 98.2%

                                                    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in z around 0

                                                    \[\leadsto \color{blue}{x + a \cdot t} \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites67.9%

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, x\right)} \]
                                                  5. Recombined 2 regimes into one program.
                                                  6. Final simplification71.2%

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -820000000 \lor \neg \left(z \leq 3.7 \cdot 10^{+22}\right):\\ \;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \end{array} \]
                                                  7. Add Preprocessing

                                                  Alternative 10: 95.6% accurate, 1.4× speedup?

                                                  \[\begin{array}{l} \\ \mathsf{fma}\left(z, y, x + a \cdot \mathsf{fma}\left(b, z, t\right)\right) \end{array} \]
                                                  (FPCore (x y z t a b) :precision binary64 (fma z y (+ x (* a (fma b z t)))))
                                                  double code(double x, double y, double z, double t, double a, double b) {
                                                  	return fma(z, y, (x + (a * fma(b, z, t))));
                                                  }
                                                  
                                                  function code(x, y, z, t, a, b)
                                                  	return fma(z, y, Float64(x + Float64(a * fma(b, z, t))))
                                                  end
                                                  
                                                  code[x_, y_, z_, t_, a_, b_] := N[(z * y + N[(x + N[(a * N[(b * z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \mathsf{fma}\left(z, y, x + a \cdot \mathsf{fma}\left(b, z, t\right)\right)
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Initial program 92.5%

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

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

                                                      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b} \]
                                                    3. fp-cancel-sign-sub-invN/A

                                                      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) - \left(\mathsf{neg}\left(a \cdot z\right)\right) \cdot b} \]
                                                    4. fp-cancel-sub-sign-invN/A

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

                                                      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                                                    6. lift-+.f64N/A

                                                      \[\leadsto \left(\color{blue}{\left(x + y \cdot z\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                                                    7. +-commutativeN/A

                                                      \[\leadsto \left(\color{blue}{\left(y \cdot z + x\right)} + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                                                    8. associate-+l+N/A

                                                      \[\leadsto \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b \]
                                                    9. associate-+l+N/A

                                                      \[\leadsto \color{blue}{y \cdot z + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right)} \]
                                                    10. lift-*.f64N/A

                                                      \[\leadsto \color{blue}{y \cdot z} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
                                                    11. *-commutativeN/A

                                                      \[\leadsto \color{blue}{z \cdot y} + \left(\left(x + t \cdot a\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(a \cdot z\right)\right)\right)\right) \cdot b\right) \]
                                                    12. remove-double-negN/A

                                                      \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right)} \cdot b\right) \]
                                                    13. lift-*.f64N/A

                                                      \[\leadsto z \cdot y + \left(\left(x + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b}\right) \]
                                                    14. associate-+r+N/A

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

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

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

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

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

                                                      \[\leadsto \mathsf{fma}\left(z, y, x + \left(\color{blue}{\left(a \cdot z\right)} \cdot b + t \cdot a\right)\right) \]
                                                    20. associate-*l*N/A

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

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x + a \cdot \mathsf{fma}\left(b, z, t\right)\right)} \]
                                                  5. Add Preprocessing

                                                  Alternative 11: 63.2% accurate, 1.6× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{+105} \lor \neg \left(t \leq 4.3 \cdot 10^{-54}\right):\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \end{array} \end{array} \]
                                                  (FPCore (x y z t a b)
                                                   :precision binary64
                                                   (if (or (<= t -1.3e+105) (not (<= t 4.3e-54))) (fma a t x) (fma z y x)))
                                                  double code(double x, double y, double z, double t, double a, double b) {
                                                  	double tmp;
                                                  	if ((t <= -1.3e+105) || !(t <= 4.3e-54)) {
                                                  		tmp = fma(a, t, x);
                                                  	} else {
                                                  		tmp = fma(z, y, x);
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(x, y, z, t, a, b)
                                                  	tmp = 0.0
                                                  	if ((t <= -1.3e+105) || !(t <= 4.3e-54))
                                                  		tmp = fma(a, t, x);
                                                  	else
                                                  		tmp = fma(z, y, x);
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.3e+105], N[Not[LessEqual[t, 4.3e-54]], $MachinePrecision]], N[(a * t + x), $MachinePrecision], N[(z * y + x), $MachinePrecision]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;t \leq -1.3 \cdot 10^{+105} \lor \neg \left(t \leq 4.3 \cdot 10^{-54}\right):\\
                                                  \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 2 regimes
                                                  2. if t < -1.3000000000000001e105 or 4.3e-54 < t

                                                    1. Initial program 92.6%

                                                      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in z around 0

                                                      \[\leadsto \color{blue}{x + a \cdot t} \]
                                                    4. Step-by-step derivation
                                                      1. Applied rewrites71.4%

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, x\right)} \]

                                                      if -1.3000000000000001e105 < t < 4.3e-54

                                                      1. Initial program 92.4%

                                                        \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in a around 0

                                                        \[\leadsto \color{blue}{x + y \cdot z} \]
                                                      4. Step-by-step derivation
                                                        1. Applied rewrites53.1%

                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
                                                      5. Recombined 2 regimes into one program.
                                                      6. Final simplification61.8%

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{+105} \lor \neg \left(t \leq 4.3 \cdot 10^{-54}\right):\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \end{array} \]
                                                      7. Add Preprocessing

                                                      Alternative 12: 39.4% accurate, 1.7× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.65 \cdot 10^{+15} \lor \neg \left(a \leq 8.8 \cdot 10^{-61}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                                                      (FPCore (x y z t a b)
                                                       :precision binary64
                                                       (if (or (<= a -1.65e+15) (not (<= a 8.8e-61))) (* a t) x))
                                                      double code(double x, double y, double z, double t, double a, double b) {
                                                      	double tmp;
                                                      	if ((a <= -1.65e+15) || !(a <= 8.8e-61)) {
                                                      		tmp = a * t;
                                                      	} else {
                                                      		tmp = x;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      module fmin_fmax_functions
                                                          implicit none
                                                          private
                                                          public fmax
                                                          public fmin
                                                      
                                                          interface fmax
                                                              module procedure fmax88
                                                              module procedure fmax44
                                                              module procedure fmax84
                                                              module procedure fmax48
                                                          end interface
                                                          interface fmin
                                                              module procedure fmin88
                                                              module procedure fmin44
                                                              module procedure fmin84
                                                              module procedure fmin48
                                                          end interface
                                                      contains
                                                          real(8) function fmax88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmax44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmin44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                          end function
                                                      end module
                                                      
                                                      real(8) function code(x, y, z, t, a, b)
                                                      use fmin_fmax_functions
                                                          real(8), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          real(8), intent (in) :: z
                                                          real(8), intent (in) :: t
                                                          real(8), intent (in) :: a
                                                          real(8), intent (in) :: b
                                                          real(8) :: tmp
                                                          if ((a <= (-1.65d+15)) .or. (.not. (a <= 8.8d-61))) then
                                                              tmp = a * t
                                                          else
                                                              tmp = x
                                                          end if
                                                          code = tmp
                                                      end function
                                                      
                                                      public static double code(double x, double y, double z, double t, double a, double b) {
                                                      	double tmp;
                                                      	if ((a <= -1.65e+15) || !(a <= 8.8e-61)) {
                                                      		tmp = a * t;
                                                      	} else {
                                                      		tmp = x;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(x, y, z, t, a, b):
                                                      	tmp = 0
                                                      	if (a <= -1.65e+15) or not (a <= 8.8e-61):
                                                      		tmp = a * t
                                                      	else:
                                                      		tmp = x
                                                      	return tmp
                                                      
                                                      function code(x, y, z, t, a, b)
                                                      	tmp = 0.0
                                                      	if ((a <= -1.65e+15) || !(a <= 8.8e-61))
                                                      		tmp = Float64(a * t);
                                                      	else
                                                      		tmp = x;
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(x, y, z, t, a, b)
                                                      	tmp = 0.0;
                                                      	if ((a <= -1.65e+15) || ~((a <= 8.8e-61)))
                                                      		tmp = a * t;
                                                      	else
                                                      		tmp = x;
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.65e+15], N[Not[LessEqual[a, 8.8e-61]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \begin{array}{l}
                                                      \mathbf{if}\;a \leq -1.65 \cdot 10^{+15} \lor \neg \left(a \leq 8.8 \cdot 10^{-61}\right):\\
                                                      \;\;\;\;a \cdot t\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;x\\
                                                      
                                                      
                                                      \end{array}
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 2 regimes
                                                      2. if a < -1.65e15 or 8.80000000000000035e-61 < a

                                                        1. Initial program 87.9%

                                                          \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in t around inf

                                                          \[\leadsto \color{blue}{a \cdot t} \]
                                                        4. Step-by-step derivation
                                                          1. Applied rewrites44.7%

                                                            \[\leadsto \color{blue}{a \cdot t} \]

                                                          if -1.65e15 < a < 8.80000000000000035e-61

                                                          1. Initial program 98.8%

                                                            \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in x around inf

                                                            \[\leadsto \color{blue}{x} \]
                                                          4. Step-by-step derivation
                                                            1. Applied rewrites40.4%

                                                              \[\leadsto \color{blue}{x} \]
                                                          5. Recombined 2 regimes into one program.
                                                          6. Final simplification42.9%

                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.65 \cdot 10^{+15} \lor \neg \left(a \leq 8.8 \cdot 10^{-61}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                                                          7. Add Preprocessing

                                                          Alternative 13: 55.8% accurate, 2.3× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9.2 \cdot 10^{+79}:\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\ \end{array} \end{array} \]
                                                          (FPCore (x y z t a b)
                                                           :precision binary64
                                                           (if (<= y -9.2e+79) (* z y) (fma a t x)))
                                                          double code(double x, double y, double z, double t, double a, double b) {
                                                          	double tmp;
                                                          	if (y <= -9.2e+79) {
                                                          		tmp = z * y;
                                                          	} else {
                                                          		tmp = fma(a, t, x);
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          function code(x, y, z, t, a, b)
                                                          	tmp = 0.0
                                                          	if (y <= -9.2e+79)
                                                          		tmp = Float64(z * y);
                                                          	else
                                                          		tmp = fma(a, t, x);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9.2e+79], N[(z * y), $MachinePrecision], N[(a * t + x), $MachinePrecision]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;y \leq -9.2 \cdot 10^{+79}:\\
                                                          \;\;\;\;z \cdot y\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 2 regimes
                                                          2. if y < -9.2000000000000002e79

                                                            1. Initial program 94.5%

                                                              \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                                            2. Add Preprocessing
                                                            3. Taylor expanded in y around inf

                                                              \[\leadsto \color{blue}{y \cdot z} \]
                                                            4. Step-by-step derivation
                                                              1. Applied rewrites62.1%

                                                                \[\leadsto \color{blue}{z \cdot y} \]

                                                              if -9.2000000000000002e79 < y

                                                              1. Initial program 92.2%

                                                                \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in z around 0

                                                                \[\leadsto \color{blue}{x + a \cdot t} \]
                                                              4. Step-by-step derivation
                                                                1. Applied rewrites53.5%

                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(a, t, x\right)} \]
                                                              5. Recombined 2 regimes into one program.
                                                              6. Add Preprocessing

                                                              Alternative 14: 26.3% accurate, 30.0× speedup?

                                                              \[\begin{array}{l} \\ x \end{array} \]
                                                              (FPCore (x y z t a b) :precision binary64 x)
                                                              double code(double x, double y, double z, double t, double a, double b) {
                                                              	return x;
                                                              }
                                                              
                                                              module fmin_fmax_functions
                                                                  implicit none
                                                                  private
                                                                  public fmax
                                                                  public fmin
                                                              
                                                                  interface fmax
                                                                      module procedure fmax88
                                                                      module procedure fmax44
                                                                      module procedure fmax84
                                                                      module procedure fmax48
                                                                  end interface
                                                                  interface fmin
                                                                      module procedure fmin88
                                                                      module procedure fmin44
                                                                      module procedure fmin84
                                                                      module procedure fmin48
                                                                  end interface
                                                              contains
                                                                  real(8) function fmax88(x, y) result (res)
                                                                      real(8), intent (in) :: x
                                                                      real(8), intent (in) :: y
                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                  end function
                                                                  real(4) function fmax44(x, y) result (res)
                                                                      real(4), intent (in) :: x
                                                                      real(4), intent (in) :: y
                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                  end function
                                                                  real(8) function fmax84(x, y) result(res)
                                                                      real(8), intent (in) :: x
                                                                      real(4), intent (in) :: y
                                                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                  end function
                                                                  real(8) function fmax48(x, y) result(res)
                                                                      real(4), intent (in) :: x
                                                                      real(8), intent (in) :: y
                                                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                  end function
                                                                  real(8) function fmin88(x, y) result (res)
                                                                      real(8), intent (in) :: x
                                                                      real(8), intent (in) :: y
                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                  end function
                                                                  real(4) function fmin44(x, y) result (res)
                                                                      real(4), intent (in) :: x
                                                                      real(4), intent (in) :: y
                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                  end function
                                                                  real(8) function fmin84(x, y) result(res)
                                                                      real(8), intent (in) :: x
                                                                      real(4), intent (in) :: y
                                                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                  end function
                                                                  real(8) function fmin48(x, y) result(res)
                                                                      real(4), intent (in) :: x
                                                                      real(8), intent (in) :: y
                                                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                  end function
                                                              end module
                                                              
                                                              real(8) function code(x, y, z, t, a, b)
                                                              use fmin_fmax_functions
                                                                  real(8), intent (in) :: x
                                                                  real(8), intent (in) :: y
                                                                  real(8), intent (in) :: z
                                                                  real(8), intent (in) :: t
                                                                  real(8), intent (in) :: a
                                                                  real(8), intent (in) :: b
                                                                  code = x
                                                              end function
                                                              
                                                              public static double code(double x, double y, double z, double t, double a, double b) {
                                                              	return x;
                                                              }
                                                              
                                                              def code(x, y, z, t, a, b):
                                                              	return x
                                                              
                                                              function code(x, y, z, t, a, b)
                                                              	return x
                                                              end
                                                              
                                                              function tmp = code(x, y, z, t, a, b)
                                                              	tmp = x;
                                                              end
                                                              
                                                              code[x_, y_, z_, t_, a_, b_] := x
                                                              
                                                              \begin{array}{l}
                                                              
                                                              \\
                                                              x
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Initial program 92.5%

                                                                \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in x around inf

                                                                \[\leadsto \color{blue}{x} \]
                                                              4. Step-by-step derivation
                                                                1. Applied rewrites22.6%

                                                                  \[\leadsto \color{blue}{x} \]
                                                                2. Add Preprocessing

                                                                Developer Target 1: 97.3% accurate, 0.8× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \mathbf{if}\;z < -11820553527347888000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\ \;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                                (FPCore (x y z t a b)
                                                                 :precision binary64
                                                                 (let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
                                                                   (if (< z -11820553527347888000.0)
                                                                     t_1
                                                                     (if (< z 4.7589743188364287e-122)
                                                                       (+ (* (+ (* b z) t) a) (+ (* z y) x))
                                                                       t_1))))
                                                                double code(double x, double y, double z, double t, double a, double b) {
                                                                	double t_1 = (z * ((b * a) + y)) + (x + (t * a));
                                                                	double tmp;
                                                                	if (z < -11820553527347888000.0) {
                                                                		tmp = t_1;
                                                                	} else if (z < 4.7589743188364287e-122) {
                                                                		tmp = (((b * z) + t) * a) + ((z * y) + x);
                                                                	} else {
                                                                		tmp = t_1;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                module fmin_fmax_functions
                                                                    implicit none
                                                                    private
                                                                    public fmax
                                                                    public fmin
                                                                
                                                                    interface fmax
                                                                        module procedure fmax88
                                                                        module procedure fmax44
                                                                        module procedure fmax84
                                                                        module procedure fmax48
                                                                    end interface
                                                                    interface fmin
                                                                        module procedure fmin88
                                                                        module procedure fmin44
                                                                        module procedure fmin84
                                                                        module procedure fmin48
                                                                    end interface
                                                                contains
                                                                    real(8) function fmax88(x, y) result (res)
                                                                        real(8), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(4) function fmax44(x, y) result (res)
                                                                        real(4), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmax84(x, y) result(res)
                                                                        real(8), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmax48(x, y) result(res)
                                                                        real(4), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmin88(x, y) result (res)
                                                                        real(8), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(4) function fmin44(x, y) result (res)
                                                                        real(4), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmin84(x, y) result(res)
                                                                        real(8), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmin48(x, y) result(res)
                                                                        real(4), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                    end function
                                                                end module
                                                                
                                                                real(8) function code(x, y, z, t, a, b)
                                                                use fmin_fmax_functions
                                                                    real(8), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    real(8), intent (in) :: z
                                                                    real(8), intent (in) :: t
                                                                    real(8), intent (in) :: a
                                                                    real(8), intent (in) :: b
                                                                    real(8) :: t_1
                                                                    real(8) :: tmp
                                                                    t_1 = (z * ((b * a) + y)) + (x + (t * a))
                                                                    if (z < (-11820553527347888000.0d0)) then
                                                                        tmp = t_1
                                                                    else if (z < 4.7589743188364287d-122) then
                                                                        tmp = (((b * z) + t) * a) + ((z * y) + x)
                                                                    else
                                                                        tmp = t_1
                                                                    end if
                                                                    code = tmp
                                                                end function
                                                                
                                                                public static double code(double x, double y, double z, double t, double a, double b) {
                                                                	double t_1 = (z * ((b * a) + y)) + (x + (t * a));
                                                                	double tmp;
                                                                	if (z < -11820553527347888000.0) {
                                                                		tmp = t_1;
                                                                	} else if (z < 4.7589743188364287e-122) {
                                                                		tmp = (((b * z) + t) * a) + ((z * y) + x);
                                                                	} else {
                                                                		tmp = t_1;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                def code(x, y, z, t, a, b):
                                                                	t_1 = (z * ((b * a) + y)) + (x + (t * a))
                                                                	tmp = 0
                                                                	if z < -11820553527347888000.0:
                                                                		tmp = t_1
                                                                	elif z < 4.7589743188364287e-122:
                                                                		tmp = (((b * z) + t) * a) + ((z * y) + x)
                                                                	else:
                                                                		tmp = t_1
                                                                	return tmp
                                                                
                                                                function code(x, y, z, t, a, b)
                                                                	t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a)))
                                                                	tmp = 0.0
                                                                	if (z < -11820553527347888000.0)
                                                                		tmp = t_1;
                                                                	elseif (z < 4.7589743188364287e-122)
                                                                		tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x));
                                                                	else
                                                                		tmp = t_1;
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                function tmp_2 = code(x, y, z, t, a, b)
                                                                	t_1 = (z * ((b * a) + y)) + (x + (t * a));
                                                                	tmp = 0.0;
                                                                	if (z < -11820553527347888000.0)
                                                                		tmp = t_1;
                                                                	elseif (z < 4.7589743188364287e-122)
                                                                		tmp = (((b * z) + t) * a) + ((z * y) + x);
                                                                	else
                                                                		tmp = t_1;
                                                                	end
                                                                	tmp_2 = tmp;
                                                                end
                                                                
                                                                code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
                                                                \mathbf{if}\;z < -11820553527347888000:\\
                                                                \;\;\;\;t\_1\\
                                                                
                                                                \mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
                                                                \;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;t\_1\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                

                                                                Reproduce

                                                                ?
                                                                herbie shell --seed 2025018 
                                                                (FPCore (x y z t a b)
                                                                  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
                                                                  :precision binary64
                                                                
                                                                  :alt
                                                                  (! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))
                                                                
                                                                  (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))