Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.3% → 95.6%
Time: 7.4s
Alternatives: 11
Speedup: 1.4×

Specification

?
\[\begin{array}{l} \\ \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b):
	return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 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.3% 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.6% accurate, 1.4× speedup?

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

\\
\mathsf{fma}\left(z, y, x + a \cdot \mathsf{fma}\left(b, z, t\right)\right)
\end{array}
Derivation
  1. Initial program 92.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 \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b} \]
    3. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 83.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+92}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, a, y\right), z, x\right)\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-56}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, z \cdot y\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 (<= x -4.5e+92)
   (fma (fma b a y) z x)
   (if (<= x 2.8e-56) (fma (fma b z t) a (* z y)) (fma (fma b z t) a x))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -4.5e+92) {
		tmp = fma(fma(b, a, y), z, x);
	} else if (x <= 2.8e-56) {
		tmp = fma(fma(b, z, t), a, (z * y));
	} else {
		tmp = fma(fma(b, z, t), a, x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -4.5e+92)
		tmp = fma(fma(b, a, y), z, x);
	elseif (x <= 2.8e-56)
		tmp = fma(fma(b, z, t), a, Float64(z * y));
	else
		tmp = fma(fma(b, z, t), a, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.5e+92], N[(N[(b * a + y), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[x, 2.8e-56], N[(N[(b * z + t), $MachinePrecision] * a + N[(z * y), $MachinePrecision]), $MachinePrecision], N[(N[(b * z + t), $MachinePrecision] * a + x), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 2.8 \cdot 10^{-56}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, z \cdot y\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 x < -4.4999999999999999e92

    1. Initial program 86.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in 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.2

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

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

    if -4.4999999999999999e92 < x < 2.79999999999999993e-56

    1. Initial program 91.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in 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-*.f6492.2

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

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

    if 2.79999999999999993e-56 < x

    1. Initial program 98.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in 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.f6490.7

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

      \[\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}\;x \leq -4.5 \cdot 10^{+92}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, a, y\right), z, x\right)\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-56}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 86.4% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+33} \lor \neg \left(a \leq 6 \cdot 10^{+39}\right):\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\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 a < -3.20000000000000017e33 or 5.9999999999999999e39 < a

    1. Initial program 85.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 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.8

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

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

    if -3.20000000000000017e33 < a < 5.9999999999999999e39

    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. 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.f6492.0

        \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(b, a, y\right)}, z, x\right) \]
    5. Applied rewrites92.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 simplification91.9%

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

Alternative 4: 85.8% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2 \cdot 10^{+142} \lor \neg \left(t \leq 4.2 \cdot 10^{+46}\right):\\ \;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, 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 -2e+142) (not (<= t 4.2e+46)))
   (fma a t (fma z y 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 <= -2e+142) || !(t <= 4.2e+46)) {
		tmp = fma(a, t, fma(z, y, 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 <= -2e+142) || !(t <= 4.2e+46))
		tmp = fma(a, t, fma(z, y, 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, -2e+142], N[Not[LessEqual[t, 4.2e+46]], $MachinePrecision]], N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision], N[(N[(b * a + y), $MachinePrecision] * z + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+142} \lor \neg \left(t \leq 4.2 \cdot 10^{+46}\right):\\
\;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, 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 < -2.0000000000000001e142 or 4.2e46 < t

    1. Initial program 88.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in 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.f6474.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(a, t, z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(-1\right)\right) \cdot y\right)} + x\right) \]
        25. metadata-evalN/A

          \[\leadsto \mathsf{fma}\left(a, t, z \cdot \left(\color{blue}{1} \cdot y\right) + x\right) \]
        26. *-lft-identityN/A

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

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

      if -2.0000000000000001e142 < t < 4.2e46

      1. Initial program 95.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 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.f6488.2

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

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

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

    Alternative 5: 62.2% accurate, 1.2× speedup?

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

      1. Initial program 93.1%

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

        \[\leadsto \color{blue}{x + \left(a \cdot t + a \cdot \left(b \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. 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.f6462.9

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

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

        \[\leadsto \mathsf{fma}\left(b \cdot z, a, x\right) \]
      7. Step-by-step derivation
        1. Applied rewrites51.0%

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

          \[\leadsto \color{blue}{x + y \cdot z} \]
        3. 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. *-lft-identityN/A

            \[\leadsto z \cdot \color{blue}{\left(1 \cdot y\right)} + x \]
          4. metadata-evalN/A

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) \cdot \left(y \cdot z\right)} + x \]
          12. metadata-evalN/A

            \[\leadsto \color{blue}{1} \cdot \left(y \cdot z\right) + x \]
          13. metadata-evalN/A

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

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

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

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

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

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

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

            \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(-1\right)\right) \cdot y\right)} + x \]
          21. metadata-evalN/A

            \[\leadsto z \cdot \left(\color{blue}{1} \cdot y\right) + x \]
          22. *-lft-identityN/A

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

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

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

        if -3.79999999999999995e61 < y < -3.7999999999999996e-74

        1. Initial program 95.5%

          \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
        2. Add Preprocessing
        3. Taylor expanded in 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.f6473.4

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

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

        if -3.7999999999999996e-74 < y < 1.7500000000000002e-64

        1. Initial program 92.2%

          \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
        2. Add Preprocessing
        3. Taylor expanded in 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.3

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

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

          \[\leadsto \mathsf{fma}\left(b \cdot z, a, x\right) \]
        7. Step-by-step derivation
          1. Applied rewrites63.5%

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

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

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

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

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

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

        Alternative 6: 81.8% accurate, 1.2× speedup?

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

          1. Initial program 96.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 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.f6488.9

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

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

            \[\leadsto \mathsf{fma}\left(a \cdot b, z, x\right) \]
          7. Step-by-step derivation
            1. Applied rewrites85.1%

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

            if -4.6000000000000003e141 < b < 1.1500000000000001e201

            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. 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.f6473.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(a, t, z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(-1\right)\right) \cdot y\right)} + x\right) \]
                25. metadata-evalN/A

                  \[\leadsto \mathsf{fma}\left(a, t, z \cdot \left(\color{blue}{1} \cdot y\right) + x\right) \]
                26. *-lft-identityN/A

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

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

              if 1.1500000000000001e201 < b

              1. Initial program 84.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.f6495.0

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

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

                \[\leadsto \mathsf{fma}\left(b \cdot z, a, x\right) \]
              7. Step-by-step derivation
                1. Applied rewrites88.7%

                  \[\leadsto \mathsf{fma}\left(z \cdot b, a, x\right) \]
              8. Recombined 3 regimes into one program.
              9. Final simplification86.5%

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

              Alternative 7: 73.4% accurate, 1.2× speedup?

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

                1. Initial program 85.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 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.f6479.1

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

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

                if -8.1999999999999997e76 < a < 2.05000000000000002e39

                1. Initial program 97.5%

                  \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                2. Add Preprocessing
                3. Taylor expanded in y around 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.f6466.9

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

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

                  \[\leadsto \mathsf{fma}\left(b \cdot z, a, x\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites57.5%

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

                    \[\leadsto \color{blue}{x + y \cdot z} \]
                  3. 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. *-lft-identityN/A

                      \[\leadsto z \cdot \color{blue}{\left(1 \cdot y\right)} + x \]
                    4. metadata-evalN/A

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) \cdot \left(y \cdot z\right)} + x \]
                    12. metadata-evalN/A

                      \[\leadsto \color{blue}{1} \cdot \left(y \cdot z\right) + x \]
                    13. metadata-evalN/A

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

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

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

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

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

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

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

                      \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(-1\right)\right) \cdot y\right)} + x \]
                    21. metadata-evalN/A

                      \[\leadsto z \cdot \left(\color{blue}{1} \cdot y\right) + x \]
                    22. *-lft-identityN/A

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

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

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

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

                Alternative 8: 62.6% accurate, 1.6× speedup?

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

                  1. Initial program 92.6%

                    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
                  2. Add Preprocessing
                  3. Taylor expanded in 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.f6460.1

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

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

                    \[\leadsto \mathsf{fma}\left(b \cdot z, a, x\right) \]
                  7. Step-by-step derivation
                    1. Applied rewrites48.9%

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

                      \[\leadsto \color{blue}{x + y \cdot z} \]
                    3. 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. *-lft-identityN/A

                        \[\leadsto z \cdot \color{blue}{\left(1 \cdot y\right)} + x \]
                      4. metadata-evalN/A

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) \cdot \left(y \cdot z\right)} + x \]
                      12. metadata-evalN/A

                        \[\leadsto \color{blue}{1} \cdot \left(y \cdot z\right) + x \]
                      13. metadata-evalN/A

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

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

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

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

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

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

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

                        \[\leadsto z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(-1\right)\right) \cdot y\right)} + x \]
                      21. metadata-evalN/A

                        \[\leadsto z \cdot \left(\color{blue}{1} \cdot y\right) + x \]
                      22. *-lft-identityN/A

                        \[\leadsto z \cdot \color{blue}{y} + x \]
                      23. lower-fma.f6476.7

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

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

                    if -1.3e97 < y < 1.7500000000000002e-64

                    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. 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)} \]
                    6. Taylor expanded in z around inf

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

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

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

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

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

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

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

                    Alternative 9: 58.4% accurate, 1.6× speedup?

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

                      1. Initial program 86.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 \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b} \]
                        3. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{y \cdot z} \]
                      6. Step-by-step derivation
                        1. lower-*.f6465.8

                          \[\leadsto \color{blue}{y \cdot z} \]
                      7. Applied rewrites65.8%

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

                      if -7.1999999999999999e140 < y < 8.9999999999999998e167

                      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. 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.f6485.5

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

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

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

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

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

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

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

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

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

                      Alternative 10: 39.1% accurate, 1.7× speedup?

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

                        1. Initial program 92.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 \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(a \cdot z\right) \cdot b} \]
                          3. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{y \cdot z} \]
                        6. Step-by-step derivation
                          1. lower-*.f6445.2

                            \[\leadsto \color{blue}{y \cdot z} \]
                        7. Applied rewrites45.2%

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

                        if -3.8e81 < y < 1.7500000000000002e-64

                        1. Initial program 93.1%

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

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

                            \[\leadsto \color{blue}{a \cdot t} \]
                        5. Applied rewrites33.0%

                          \[\leadsto \color{blue}{a \cdot t} \]
                      3. Recombined 2 regimes into one program.
                      4. Final simplification39.0%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{+81} \lor \neg \left(y \leq 1.75 \cdot 10^{-64}\right):\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 11: 28.1% accurate, 5.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{y \cdot z} \]
                      6. Step-by-step derivation
                        1. lower-*.f6426.2

                          \[\leadsto \color{blue}{y \cdot z} \]
                      7. Applied rewrites26.2%

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

                      Developer Target 1: 97.2% 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 2024350 
                      (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)))