Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.7% → 95.1%
Time: 8.2s
Alternatives: 12
Speedup: 0.5×

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 12 alternatives:

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

Initial Program: 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: 95.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 \infty:\\ \;\;\;\;\mathsf{fma}\left(t, a, \mathsf{fma}\left(b \cdot z, a, \mathsf{fma}\left(z, y, x\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)) INFINITY)
   (fma t a (fma (* b z) a (fma z y x)))
   (* (fma b a y) z)))
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)) <= ((double) INFINITY)) {
		tmp = fma(t, a, fma((b * z), a, fma(z, y, x)));
	} else {
		tmp = fma(b, a, y) * z;
	}
	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)) <= Inf)
		tmp = fma(t, a, fma(Float64(b * z), a, fma(z, y, x)));
	else
		tmp = Float64(fma(b, a, y) * z);
	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], Infinity], N[(t * a + N[(N[(b * z), $MachinePrecision] * a + N[(z * y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * a + y), $MachinePrecision] * z), $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 \infty:\\
\;\;\;\;\mathsf{fma}\left(t, a, \mathsf{fma}\left(b \cdot z, a, \mathsf{fma}\left(z, y, x\right)\right)\right)\\

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


\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)) < +inf.0

    1. Initial program 98.1%

      \[\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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
      3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 0.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 z around inf

      \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(y + a \cdot b\right)\right)\right)\right)\right)} \cdot z \]
      4. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{-1 \cdot \left(y + a \cdot b\right)}\right)\right) \cdot z \]
      5. distribute-lft-outN/A

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

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

        \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(-1 \cdot \left(a \cdot b\right)\right)\right) + \left(\mathsf{neg}\left(-1 \cdot y\right)\right)\right)} \cdot z \]
      8. mul-1-negN/A

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

        \[\leadsto \left(\color{blue}{a \cdot b} + \left(\mathsf{neg}\left(-1 \cdot y\right)\right)\right) \cdot z \]
      10. distribute-lft-neg-inN/A

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

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

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

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

        \[\leadsto \left(\color{blue}{b \cdot a} + \left(\mathsf{neg}\left(y\right)\right) \cdot -1\right) \cdot z \]
      15. distribute-lft-neg-inN/A

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

        \[\leadsto \left(b \cdot a + \left(\mathsf{neg}\left(\color{blue}{-1 \cdot y}\right)\right)\right) \cdot z \]
      17. mul-1-negN/A

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

        \[\leadsto \left(b \cdot a + \color{blue}{y}\right) \cdot z \]
      19. lower-fma.f6490.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, y\right) \cdot z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(t, a, \mathsf{fma}\left(b \cdot z, a, \mathsf{fma}\left(z, y, x\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 73.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b, z, t\right) \cdot a\\ \mathbf{if}\;a \leq -1.22 \cdot 10^{+49}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -2 \cdot 10^{-112}:\\ \;\;\;\;\mathsf{fma}\left(t, a, x\right)\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-77}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (fma b z t) a)))
   (if (<= a -1.22e+49)
     t_1
     (if (<= a -2e-112) (fma t a x) (if (<= a 8.5e-77) (fma z y x) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fma(b, z, t) * a;
	double tmp;
	if (a <= -1.22e+49) {
		tmp = t_1;
	} else if (a <= -2e-112) {
		tmp = fma(t, a, x);
	} else if (a <= 8.5e-77) {
		tmp = fma(z, y, x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(fma(b, z, t) * a)
	tmp = 0.0
	if (a <= -1.22e+49)
		tmp = t_1;
	elseif (a <= -2e-112)
		tmp = fma(t, a, x);
	elseif (a <= 8.5e-77)
		tmp = fma(z, y, x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * z + t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -1.22e+49], t$95$1, If[LessEqual[a, -2e-112], N[(t * a + x), $MachinePrecision], If[LessEqual[a, 8.5e-77], N[(z * y + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, z, t\right) \cdot a\\
\mathbf{if}\;a \leq -1.22 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 8.5 \cdot 10^{-77}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.21999999999999988e49 or 8.4999999999999998e-77 < a

    1. Initial program 90.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 inf

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \color{blue}{\left(b \cdot z + t\right)} \cdot a \]
      4. lower-fma.f6476.9

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, z, t\right)} \cdot a \]
    5. Applied rewrites76.9%

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

    if -1.21999999999999988e49 < a < -1.9999999999999999e-112

    1. Initial program 100.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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
      3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{a \cdot t + x} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{t \cdot a} + x \]
      3. lower-fma.f6476.4

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, a, x\right)} \]
    7. Applied rewrites76.4%

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

    if -1.9999999999999999e-112 < a < 8.4999999999999998e-77

    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. 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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
      3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + y \cdot z} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{y \cdot z + x} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{z \cdot y} + x \]
      3. lower-fma.f6488.2

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
    10. Applied rewrites88.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.22 \cdot 10^{+49}:\\ \;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\ \mathbf{elif}\;a \leq -2 \cdot 10^{-112}:\\ \;\;\;\;\mathsf{fma}\left(t, a, x\right)\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-77}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 63.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(t, a, x\right)\\

\mathbf{elif}\;t \leq 6 \cdot 10^{-34}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-7}:\\
\;\;\;\;\left(z \cdot b\right) \cdot a\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, a, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.8999999999999999e-11 or 4.4999999999999998e-7 < t

    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. 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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
      3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{a \cdot t + x} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{t \cdot a} + x \]
      3. lower-fma.f6476.0

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, a, x\right)} \]
    7. Applied rewrites76.0%

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

    if -1.8999999999999999e-11 < t < 6e-34

    1. Initial program 93.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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
      3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + y \cdot z} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{y \cdot z + x} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{z \cdot y} + x \]
      3. lower-fma.f6464.3

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
    10. Applied rewrites64.3%

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

    if 6e-34 < t < 4.4999999999999998e-7

    1. Initial program 99.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 a around inf

      \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \color{blue}{\left(b \cdot z + t\right)} \cdot a \]
      4. lower-fma.f6485.0

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

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

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

        \[\leadsto \left(z \cdot b\right) \cdot \color{blue}{a} \]
    8. Recombined 3 regimes into one program.
    9. Final simplification70.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{-11}:\\ \;\;\;\;\mathsf{fma}\left(t, a, x\right)\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-34}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{-7}:\\ \;\;\;\;\left(z \cdot b\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, a, x\right)\\ \end{array} \]
    10. Add Preprocessing

    Alternative 4: 86.6% accurate, 1.2× speedup?

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

      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 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. distribute-lft-inN/A

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

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

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

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

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

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

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

      if -2.6000000000000001e63 < b < 9.39999999999999979e30

      1. Initial program 94.9%

        \[\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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
        3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 86.2% accurate, 1.2× speedup?

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

      1. Initial program 93.9%

        \[\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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
        3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(t, a, \color{blue}{y \cdot z + x}\right) \]
        7. lower-fma.f6487.4

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

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

      if -6.49999999999999966e-103 < t < 1.5e-10

      1. Initial program 94.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 t around 0

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(y + a \cdot b\right)\right)\right)\right)}, z, x\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{-1 \cdot \left(y + a \cdot b\right)}\right), z, x\right) \]
        9. distribute-lft-outN/A

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(-1 \cdot \left(a \cdot b\right)\right)\right) + \left(\mathsf{neg}\left(-1 \cdot y\right)\right)}, z, x\right) \]
        12. mul-1-negN/A

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{a \cdot b} + \left(\mathsf{neg}\left(-1 \cdot y\right)\right), z, x\right) \]
        14. distribute-lft-neg-inN/A

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

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

          \[\leadsto \mathsf{fma}\left(a \cdot b - \color{blue}{y \cdot -1}, z, x\right) \]
        17. fp-cancel-sub-sign-invN/A

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{b \cdot a} + \left(\mathsf{neg}\left(y\right)\right) \cdot -1, z, x\right) \]
        19. distribute-lft-neg-inN/A

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

          \[\leadsto \mathsf{fma}\left(b \cdot a + \left(\mathsf{neg}\left(\color{blue}{-1 \cdot y}\right)\right), z, x\right) \]
        21. mul-1-negN/A

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

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

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

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

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

    Alternative 6: 83.4% accurate, 1.2× speedup?

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

      1. Initial program 86.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 inf

        \[\leadsto \color{blue}{a \cdot \left(t + b \cdot z\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

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

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

          \[\leadsto \color{blue}{\left(b \cdot z + t\right)} \cdot a \]
        4. lower-fma.f6485.0

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

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

      if -9.19999999999999961e129 < a < 2.7999999999999998e37

      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. 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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
        3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(t, a, \color{blue}{y \cdot z + x}\right) \]
        7. lower-fma.f6488.4

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

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

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

    Alternative 7: 87.1% accurate, 1.2× speedup?

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

      1. Initial program 95.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 x around 0

        \[\leadsto \color{blue}{a \cdot t + \left(a \cdot \left(b \cdot z\right) + y \cdot z\right)} \]
      4. Step-by-step derivation
        1. associate-+r+N/A

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{z \cdot y}\right) \]
        8. lower-*.f6487.8

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

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

      if -1.55000000000000003e48 < a < 12.5

      1. Initial program 99.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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 12.5 < a

      1. Initial program 84.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. distribute-lft-inN/A

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{b \cdot z + t}, a, x\right) \]
        6. lower-fma.f6495.4

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification92.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.55 \cdot 10^{+48}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, z \cdot y\right)\\ \mathbf{elif}\;a \leq 12.5:\\ \;\;\;\;\mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 73.7% accurate, 1.2× speedup?

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

      1. Initial program 87.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 z around inf

        \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

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

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

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(y + a \cdot b\right)\right)\right)\right)\right)} \cdot z \]
        4. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{-1 \cdot \left(y + a \cdot b\right)}\right)\right) \cdot z \]
        5. distribute-lft-outN/A

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

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

          \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(-1 \cdot \left(a \cdot b\right)\right)\right) + \left(\mathsf{neg}\left(-1 \cdot y\right)\right)\right)} \cdot z \]
        8. mul-1-negN/A

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

          \[\leadsto \left(\color{blue}{a \cdot b} + \left(\mathsf{neg}\left(-1 \cdot y\right)\right)\right) \cdot z \]
        10. distribute-lft-neg-inN/A

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

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

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

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

          \[\leadsto \left(\color{blue}{b \cdot a} + \left(\mathsf{neg}\left(y\right)\right) \cdot -1\right) \cdot z \]
        15. distribute-lft-neg-inN/A

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

          \[\leadsto \left(b \cdot a + \left(\mathsf{neg}\left(\color{blue}{-1 \cdot y}\right)\right)\right) \cdot z \]
        17. mul-1-negN/A

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

          \[\leadsto \left(b \cdot a + \color{blue}{y}\right) \cdot z \]
        19. lower-fma.f6478.6

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

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

      if -3.5000000000000001e55 < z < 9.8000000000000006e23

      1. Initial program 98.6%

        \[\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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
        3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + a \cdot t} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{a \cdot t + x} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{t \cdot a} + x \]
        3. lower-fma.f6476.4

          \[\leadsto \color{blue}{\mathsf{fma}\left(t, a, x\right)} \]
      7. Applied rewrites76.4%

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

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

    Alternative 9: 63.9% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{-11} \lor \neg \left(t \leq 8 \cdot 10^{+40}\right):\\ \;\;\;\;\mathsf{fma}\left(t, a, 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.9e-11) (not (<= t 8e+40))) (fma t a x) (fma z y x)))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if ((t <= -1.9e-11) || !(t <= 8e+40)) {
    		tmp = fma(t, a, x);
    	} else {
    		tmp = fma(z, y, x);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if ((t <= -1.9e-11) || !(t <= 8e+40))
    		tmp = fma(t, a, x);
    	else
    		tmp = fma(z, y, x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.9e-11], N[Not[LessEqual[t, 8e+40]], $MachinePrecision]], N[(t * a + x), $MachinePrecision], N[(z * y + x), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;t \leq -1.9 \cdot 10^{-11} \lor \neg \left(t \leq 8 \cdot 10^{+40}\right):\\
    \;\;\;\;\mathsf{fma}\left(t, a, 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.8999999999999999e-11 or 8.00000000000000024e40 < t

      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. 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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
        3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + a \cdot t} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{a \cdot t + x} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{t \cdot a} + x \]
        3. lower-fma.f6477.6

          \[\leadsto \color{blue}{\mathsf{fma}\left(t, a, x\right)} \]
      7. Applied rewrites77.6%

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

      if -1.8999999999999999e-11 < t < 8.00000000000000024e40

      1. Initial program 94.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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
        3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + y \cdot z} \]
      9. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{y \cdot z + x} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{z \cdot y} + x \]
        3. lower-fma.f6461.3

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
      10. Applied rewrites61.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{-11} \lor \neg \left(t \leq 8 \cdot 10^{+40}\right):\\ \;\;\;\;\mathsf{fma}\left(t, a, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, y, x\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 58.5% accurate, 1.6× speedup?

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

      1. Initial program 83.9%

        \[\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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
        3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + y \cdot z} \]
      9. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{y \cdot z + x} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{z \cdot y} + x \]
        3. lower-fma.f6458.6

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
      10. Applied rewrites58.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
      11. Taylor expanded in x around 0

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

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

        if -2.34999999999999999e112 < z < 9.4999999999999995e185

        1. Initial program 97.8%

          \[\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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
          3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{x + a \cdot t} \]
        6. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{a \cdot t + x} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{t \cdot a} + x \]
          3. lower-fma.f6470.2

            \[\leadsto \color{blue}{\mathsf{fma}\left(t, a, x\right)} \]
        7. Applied rewrites70.2%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{+112} \lor \neg \left(z \leq 9.5 \cdot 10^{+185}\right):\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, a, x\right)\\ \end{array} \]
      15. Add Preprocessing

      Alternative 11: 40.0% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{-11} \lor \neg \left(t \leq 8 \cdot 10^{+40}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (or (<= t -1.9e-11) (not (<= t 8e+40))) (* a t) (* z y)))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if ((t <= -1.9e-11) || !(t <= 8e+40)) {
      		tmp = a * t;
      	} else {
      		tmp = z * y;
      	}
      	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 <= (-1.9d-11)) .or. (.not. (t <= 8d+40))) then
              tmp = a * t
          else
              tmp = z * y
          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 <= -1.9e-11) || !(t <= 8e+40)) {
      		tmp = a * t;
      	} else {
      		tmp = z * y;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	tmp = 0
      	if (t <= -1.9e-11) or not (t <= 8e+40):
      		tmp = a * t
      	else:
      		tmp = z * y
      	return tmp
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if ((t <= -1.9e-11) || !(t <= 8e+40))
      		tmp = Float64(a * t);
      	else
      		tmp = Float64(z * y);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	tmp = 0.0;
      	if ((t <= -1.9e-11) || ~((t <= 8e+40)))
      		tmp = a * t;
      	else
      		tmp = z * y;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.9e-11], N[Not[LessEqual[t, 8e+40]], $MachinePrecision]], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq -1.9 \cdot 10^{-11} \lor \neg \left(t \leq 8 \cdot 10^{+40}\right):\\
      \;\;\;\;a \cdot t\\
      
      \mathbf{else}:\\
      \;\;\;\;z \cdot y\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -1.8999999999999999e-11 or 8.00000000000000024e40 < t

        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 t around inf

          \[\leadsto \color{blue}{a \cdot t} \]
        4. Step-by-step derivation
          1. lower-*.f6455.7

            \[\leadsto \color{blue}{a \cdot t} \]
        5. Applied rewrites55.7%

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

        if -1.8999999999999999e-11 < t < 8.00000000000000024e40

        1. Initial program 94.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 \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right)} + \left(a \cdot z\right) \cdot b \]
          3. associate-+l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{x + y \cdot z} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{y \cdot z + x} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{z \cdot y} + x \]
          3. lower-fma.f6461.3

            \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
        10. Applied rewrites61.3%

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
        11. Taylor expanded in x around 0

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

            \[\leadsto z \cdot \color{blue}{y} \]
        13. Recombined 2 regimes into one program.
        14. Final simplification41.7%

          \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{-11} \lor \neg \left(t \leq 8 \cdot 10^{+40}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \]
        15. Add Preprocessing

        Alternative 12: 28.0% accurate, 5.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{x + y \cdot z} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{y \cdot z + x} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{z \cdot y} + x \]
          3. lower-fma.f6450.4

            \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
        10. Applied rewrites50.4%

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, y, x\right)} \]
        11. Taylor expanded in x around 0

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

            \[\leadsto z \cdot \color{blue}{y} \]
          2. Add Preprocessing

          Developer Target 1: 97.4% 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 2024363 
          (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)))