Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.1% → 94.8%
Time: 3.4s
Alternatives: 13
Speedup: 1.3×

Specification

?
\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
(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]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b

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 13 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.1% accurate, 1.0× speedup?

\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
(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]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b

Alternative 1: 94.8% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
    21. sub-flipN/A

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

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

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

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

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

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

Alternative 2: 85.3% accurate, 0.9× speedup?

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

\mathbf{elif}\;b \leq 5.2 \cdot 10^{-65}:\\
\;\;\;\;\mathsf{fma}\left(t, a, \mathsf{fma}\left(z, y, x\right)\right)\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.8499999999999999e101

    1. Initial program 92.1%

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

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

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

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

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

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

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

    if -1.8499999999999999e101 < b < 5.2000000000000002e-65

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
      21. sub-flipN/A

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{t}, a, \mathsf{fma}\left(z, y, x\right)\right) \]
    5. Step-by-step derivation
      1. Applied rewrites76.5%

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

      if 5.2000000000000002e-65 < b

      1. Initial program 92.1%

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

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

          \[\leadsto \left(x + \color{blue}{a \cdot t}\right) + \left(a \cdot z\right) \cdot b \]
        2. lower-*.f6472.2%

          \[\leadsto \left(x + a \cdot \color{blue}{t}\right) + \left(a \cdot z\right) \cdot b \]
      4. Applied rewrites72.2%

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

    Alternative 3: 85.2% accurate, 0.9× speedup?

    \[\begin{array}{l} t_1 := x + \mathsf{fma}\left(a, t, a \cdot \left(b \cdot z\right)\right)\\ \mathbf{if}\;b \leq -1.85 \cdot 10^{+101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{-82}:\\ \;\;\;\;\mathsf{fma}\left(t, a, \mathsf{fma}\left(z, y, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (+ x (fma a t (* a (* b z))))))
       (if (<= b -1.85e+101) t_1 (if (<= b 2.7e-82) (fma t a (fma z y x)) t_1))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = x + fma(a, t, (a * (b * z)));
    	double tmp;
    	if (b <= -1.85e+101) {
    		tmp = t_1;
    	} else if (b <= 2.7e-82) {
    		tmp = fma(t, a, fma(z, y, x));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(x + fma(a, t, Float64(a * Float64(b * z))))
    	tmp = 0.0
    	if (b <= -1.85e+101)
    		tmp = t_1;
    	elseif (b <= 2.7e-82)
    		tmp = fma(t, a, fma(z, y, x));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * t + N[(a * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.85e+101], t$95$1, If[LessEqual[b, 2.7e-82], N[(t * a + N[(z * y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    t_1 := x + \mathsf{fma}\left(a, t, a \cdot \left(b \cdot z\right)\right)\\
    \mathbf{if}\;b \leq -1.85 \cdot 10^{+101}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;b \leq 2.7 \cdot 10^{-82}:\\
    \;\;\;\;\mathsf{fma}\left(t, a, \mathsf{fma}\left(z, y, x\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < -1.8499999999999999e101 or 2.7000000000000001e-82 < b

      1. Initial program 92.1%

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

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

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

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

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

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

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

      if -1.8499999999999999e101 < b < 2.7000000000000001e-82

      1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
        21. sub-flipN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{t}, a, \mathsf{fma}\left(z, y, x\right)\right) \]
      5. Step-by-step derivation
        1. Applied rewrites76.5%

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

      Alternative 4: 80.2% accurate, 1.1× speedup?

      \[\begin{array}{l} \mathbf{if}\;b \leq -1.2 \cdot 10^{+236}:\\ \;\;\;\;\mathsf{fma}\left(z, b, t\right) \cdot a\\ \mathbf{elif}\;b \leq 8.6 \cdot 10^{+189}:\\ \;\;\;\;\mathsf{fma}\left(t, a, \mathsf{fma}\left(z, y, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot b, a, x\right)\\ \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (<= b -1.2e+236)
         (* (fma z b t) a)
         (if (<= b 8.6e+189) (fma t a (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 <= -1.2e+236) {
      		tmp = fma(z, b, t) * a;
      	} else if (b <= 8.6e+189) {
      		tmp = fma(t, a, 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 <= -1.2e+236)
      		tmp = Float64(fma(z, b, t) * a);
      	elseif (b <= 8.6e+189)
      		tmp = fma(t, a, 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, -1.2e+236], N[(N[(z * b + t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[b, 8.6e+189], N[(t * a + N[(z * y + x), $MachinePrecision]), $MachinePrecision], N[(N[(z * b), $MachinePrecision] * a + x), $MachinePrecision]]]
      
      \begin{array}{l}
      \mathbf{if}\;b \leq -1.2 \cdot 10^{+236}:\\
      \;\;\;\;\mathsf{fma}\left(z, b, t\right) \cdot a\\
      
      \mathbf{elif}\;b \leq 8.6 \cdot 10^{+189}:\\
      \;\;\;\;\mathsf{fma}\left(t, a, \mathsf{fma}\left(z, y, x\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(z \cdot b, a, x\right)\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if b < -1.2000000000000001e236

        1. Initial program 92.1%

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

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

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

            \[\leadsto a \cdot \left(t + \color{blue}{b \cdot z}\right) \]
          3. lower-*.f6451.9%

            \[\leadsto a \cdot \left(t + b \cdot \color{blue}{z}\right) \]
        4. Applied rewrites51.9%

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

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

            \[\leadsto \left(t + b \cdot z\right) \cdot \color{blue}{a} \]
          3. lower-*.f6451.9%

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

            \[\leadsto \left(t + b \cdot z\right) \cdot a \]
          5. +-commutativeN/A

            \[\leadsto \left(b \cdot z + t\right) \cdot a \]
          6. lift-*.f64N/A

            \[\leadsto \left(b \cdot z + t\right) \cdot a \]
          7. *-commutativeN/A

            \[\leadsto \left(z \cdot b + t\right) \cdot a \]
          8. lower-fma.f6451.9%

            \[\leadsto \mathsf{fma}\left(z, b, t\right) \cdot a \]
        6. Applied rewrites51.9%

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

        if -1.2000000000000001e236 < b < 8.6e189

        1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
          21. sub-flipN/A

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{t}, a, \mathsf{fma}\left(z, y, x\right)\right) \]
        5. Step-by-step derivation
          1. Applied rewrites76.5%

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

          if 8.6e189 < b

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

              \[\leadsto x + a \cdot \left(b \cdot \color{blue}{z}\right) \]
            3. lower-*.f6450.7%

              \[\leadsto x + a \cdot \left(b \cdot z\right) \]
          7. Applied rewrites50.7%

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

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

              \[\leadsto a \cdot \left(b \cdot z\right) + x \]
            3. lift-*.f64N/A

              \[\leadsto a \cdot \left(b \cdot z\right) + x \]
            4. lift-*.f64N/A

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

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

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

              \[\leadsto \mathsf{fma}\left(z \cdot b, a, x\right) \]
            8. lower-*.f6450.7%

              \[\leadsto \mathsf{fma}\left(z \cdot b, a, x\right) \]
          9. Applied rewrites50.7%

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

        Alternative 5: 66.7% accurate, 1.3× speedup?

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

          1. Initial program 92.1%

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

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

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

              \[\leadsto z \cdot \left(y + \color{blue}{a \cdot b}\right) \]
            3. lower-*.f6450.4%

              \[\leadsto z \cdot \left(y + a \cdot \color{blue}{b}\right) \]
          4. Applied rewrites50.4%

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

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

              \[\leadsto \left(y + a \cdot b\right) \cdot \color{blue}{z} \]
            3. lower-*.f6450.4%

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

              \[\leadsto \left(y + a \cdot b\right) \cdot z \]
            5. +-commutativeN/A

              \[\leadsto \left(a \cdot b + y\right) \cdot z \]
            6. lift-*.f64N/A

              \[\leadsto \left(a \cdot b + y\right) \cdot z \]
            7. lower-fma.f6450.4%

              \[\leadsto \mathsf{fma}\left(a, b, y\right) \cdot z \]
          6. Applied rewrites50.4%

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

          if -1.6500000000000001e-71 < z < 2.1000000000000001e-21

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
            21. sub-flipN/A

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{a \cdot t} \]
            2. lower-*.f6452.2%

              \[\leadsto x + a \cdot \color{blue}{t} \]
          6. Applied rewrites52.2%

            \[\leadsto \color{blue}{x + a \cdot t} \]
          7. Step-by-step derivation
            1. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            2. +-commutative52.2%

              \[\leadsto x + a \cdot t \]
            3. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            4. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            5. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            6. distribute-rgt-inN/A

              \[\leadsto x + a \cdot t \]
            7. *-commutativeN/A

              \[\leadsto x + a \cdot t \]
            8. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            9. associate-*l*52.2%

              \[\leadsto x + a \cdot t \]
            10. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            11. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            12. associate-+r+N/A

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

              \[\leadsto x + a \cdot t \]
            14. +-commutativeN/A

              \[\leadsto \color{blue}{x} + a \cdot t \]
            15. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            16. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            17. lift-+.f64N/A

              \[\leadsto x + \color{blue}{a \cdot t} \]
          8. Applied rewrites52.2%

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

          if 2.1000000000000001e-21 < z

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

              \[\leadsto x + a \cdot \left(b \cdot \color{blue}{z}\right) \]
            3. lower-*.f6450.7%

              \[\leadsto x + a \cdot \left(b \cdot z\right) \]
          7. Applied rewrites50.7%

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

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

              \[\leadsto a \cdot \left(b \cdot z\right) + x \]
            3. lift-*.f64N/A

              \[\leadsto a \cdot \left(b \cdot z\right) + x \]
            4. lift-*.f64N/A

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

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

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

              \[\leadsto \mathsf{fma}\left(z \cdot b, a, x\right) \]
            8. lower-*.f6450.7%

              \[\leadsto \mathsf{fma}\left(z \cdot b, a, x\right) \]
          9. Applied rewrites50.7%

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

        Alternative 6: 62.6% accurate, 1.0× speedup?

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

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
            21. sub-flipN/A

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{a \cdot t} \]
            2. lower-*.f6452.2%

              \[\leadsto x + a \cdot \color{blue}{t} \]
          6. Applied rewrites52.2%

            \[\leadsto \color{blue}{x + a \cdot t} \]
          7. Taylor expanded in a around 0

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

              \[\leadsto x + \color{blue}{y \cdot z} \]
            2. lower-*.f6450.6%

              \[\leadsto x + y \cdot \color{blue}{z} \]
          9. Applied rewrites50.6%

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

          if -6.5999999999999997e-50 < z < -5.5000000000000001e-74 or 2.1000000000000001e-21 < z

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

              \[\leadsto x + a \cdot \left(b \cdot \color{blue}{z}\right) \]
            3. lower-*.f6450.7%

              \[\leadsto x + a \cdot \left(b \cdot z\right) \]
          7. Applied rewrites50.7%

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

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

              \[\leadsto a \cdot \left(b \cdot z\right) + x \]
            3. lift-*.f64N/A

              \[\leadsto a \cdot \left(b \cdot z\right) + x \]
            4. lift-*.f64N/A

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

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

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

              \[\leadsto \mathsf{fma}\left(z \cdot b, a, x\right) \]
            8. lower-*.f6450.7%

              \[\leadsto \mathsf{fma}\left(z \cdot b, a, x\right) \]
          9. Applied rewrites50.7%

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

          if -5.5000000000000001e-74 < z < 2.1000000000000001e-21

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
            21. sub-flipN/A

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{a \cdot t} \]
            2. lower-*.f6452.2%

              \[\leadsto x + a \cdot \color{blue}{t} \]
          6. Applied rewrites52.2%

            \[\leadsto \color{blue}{x + a \cdot t} \]
          7. Step-by-step derivation
            1. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            2. +-commutative52.2%

              \[\leadsto x + a \cdot t \]
            3. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            4. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            5. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            6. distribute-rgt-inN/A

              \[\leadsto x + a \cdot t \]
            7. *-commutativeN/A

              \[\leadsto x + a \cdot t \]
            8. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            9. associate-*l*52.2%

              \[\leadsto x + a \cdot t \]
            10. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            11. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            12. associate-+r+N/A

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

              \[\leadsto x + a \cdot t \]
            14. +-commutativeN/A

              \[\leadsto \color{blue}{x} + a \cdot t \]
            15. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            16. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            17. lift-+.f64N/A

              \[\leadsto x + \color{blue}{a \cdot t} \]
          8. Applied rewrites52.2%

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

        Alternative 7: 61.9% accurate, 1.4× speedup?

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

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
            21. sub-flipN/A

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{a \cdot t} \]
            2. lower-*.f6452.2%

              \[\leadsto x + a \cdot \color{blue}{t} \]
          6. Applied rewrites52.2%

            \[\leadsto \color{blue}{x + a \cdot t} \]
          7. Taylor expanded in a around 0

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

              \[\leadsto x + \color{blue}{y \cdot z} \]
            2. lower-*.f6450.6%

              \[\leadsto x + y \cdot \color{blue}{z} \]
          9. Applied rewrites50.6%

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

          if -7.6999999999999996e-50 < z < 3.9999999999999998e196

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
            21. sub-flipN/A

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{a \cdot t} \]
            2. lower-*.f6452.2%

              \[\leadsto x + a \cdot \color{blue}{t} \]
          6. Applied rewrites52.2%

            \[\leadsto \color{blue}{x + a \cdot t} \]
          7. Step-by-step derivation
            1. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            2. +-commutative52.2%

              \[\leadsto x + a \cdot t \]
            3. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            4. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            5. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            6. distribute-rgt-inN/A

              \[\leadsto x + a \cdot t \]
            7. *-commutativeN/A

              \[\leadsto x + a \cdot t \]
            8. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            9. associate-*l*52.2%

              \[\leadsto x + a \cdot t \]
            10. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            11. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            12. associate-+r+N/A

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

              \[\leadsto x + a \cdot t \]
            14. +-commutativeN/A

              \[\leadsto \color{blue}{x} + a \cdot t \]
            15. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            16. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            17. lift-+.f64N/A

              \[\leadsto x + \color{blue}{a \cdot t} \]
          8. Applied rewrites52.2%

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

          if 3.9999999999999998e196 < z

          1. Initial program 92.1%

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

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

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

              \[\leadsto z \cdot \left(y + \color{blue}{a \cdot b}\right) \]
            3. lower-*.f6450.4%

              \[\leadsto z \cdot \left(y + a \cdot \color{blue}{b}\right) \]
          4. Applied rewrites50.4%

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

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

              \[\leadsto z \cdot \left(a \cdot b\right) \]
          7. Applied rewrites27.6%

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

        Alternative 8: 60.1% accurate, 1.4× speedup?

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

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
            21. sub-flipN/A

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{a \cdot t} \]
            2. lower-*.f6452.2%

              \[\leadsto x + a \cdot \color{blue}{t} \]
          6. Applied rewrites52.2%

            \[\leadsto \color{blue}{x + a \cdot t} \]
          7. Taylor expanded in a around 0

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

              \[\leadsto x + \color{blue}{y \cdot z} \]
            2. lower-*.f6450.6%

              \[\leadsto x + y \cdot \color{blue}{z} \]
          9. Applied rewrites50.6%

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

          if -7.6999999999999996e-50 < z < 3.9999999999999998e196

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
            21. sub-flipN/A

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{a \cdot t} \]
            2. lower-*.f6452.2%

              \[\leadsto x + a \cdot \color{blue}{t} \]
          6. Applied rewrites52.2%

            \[\leadsto \color{blue}{x + a \cdot t} \]
          7. Step-by-step derivation
            1. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            2. +-commutative52.2%

              \[\leadsto x + a \cdot t \]
            3. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            4. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            5. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            6. distribute-rgt-inN/A

              \[\leadsto x + a \cdot t \]
            7. *-commutativeN/A

              \[\leadsto x + a \cdot t \]
            8. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            9. associate-*l*52.2%

              \[\leadsto x + a \cdot t \]
            10. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            11. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            12. associate-+r+N/A

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

              \[\leadsto x + a \cdot t \]
            14. +-commutativeN/A

              \[\leadsto \color{blue}{x} + a \cdot t \]
            15. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            16. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            17. lift-+.f64N/A

              \[\leadsto x + \color{blue}{a \cdot t} \]
          8. Applied rewrites52.2%

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

          if 3.9999999999999998e196 < z

          1. Initial program 92.1%

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

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

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

              \[\leadsto z \cdot \left(y + \color{blue}{a \cdot b}\right) \]
            3. lower-*.f6450.4%

              \[\leadsto z \cdot \left(y + a \cdot \color{blue}{b}\right) \]
          4. Applied rewrites50.4%

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

            \[\leadsto a \cdot \color{blue}{\left(b \cdot z\right)} \]
          6. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto a \cdot \left(b \cdot \color{blue}{z}\right) \]
            2. lower-*.f6427.6%

              \[\leadsto a \cdot \left(b \cdot z\right) \]
          7. Applied rewrites27.6%

            \[\leadsto a \cdot \color{blue}{\left(b \cdot z\right)} \]
          8. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto a \cdot \left(b \cdot z\right) \]
            2. lift-*.f64N/A

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

              \[\leadsto a \cdot \left(z \cdot b\right) \]
            4. associate-*l*N/A

              \[\leadsto \left(a \cdot z\right) \cdot b \]
            5. lower-*.f64N/A

              \[\leadsto \left(a \cdot z\right) \cdot b \]
            6. lower-*.f6428.3%

              \[\leadsto \left(a \cdot z\right) \cdot b \]
          9. Applied rewrites28.3%

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

        Alternative 9: 60.1% accurate, 1.4× speedup?

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

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
            21. sub-flipN/A

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{a \cdot t} \]
            2. lower-*.f6452.2%

              \[\leadsto x + a \cdot \color{blue}{t} \]
          6. Applied rewrites52.2%

            \[\leadsto \color{blue}{x + a \cdot t} \]
          7. Taylor expanded in a around 0

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

              \[\leadsto x + \color{blue}{y \cdot z} \]
            2. lower-*.f6450.6%

              \[\leadsto x + y \cdot \color{blue}{z} \]
          9. Applied rewrites50.6%

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

          if -7.6999999999999996e-50 < z < 3.9999999999999998e196

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
            21. sub-flipN/A

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{a \cdot t} \]
            2. lower-*.f6452.2%

              \[\leadsto x + a \cdot \color{blue}{t} \]
          6. Applied rewrites52.2%

            \[\leadsto \color{blue}{x + a \cdot t} \]
          7. Step-by-step derivation
            1. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            2. +-commutative52.2%

              \[\leadsto x + a \cdot t \]
            3. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            4. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            5. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            6. distribute-rgt-inN/A

              \[\leadsto x + a \cdot t \]
            7. *-commutativeN/A

              \[\leadsto x + a \cdot t \]
            8. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            9. associate-*l*52.2%

              \[\leadsto x + a \cdot t \]
            10. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            11. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            12. associate-+r+N/A

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

              \[\leadsto x + a \cdot t \]
            14. +-commutativeN/A

              \[\leadsto \color{blue}{x} + a \cdot t \]
            15. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            16. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            17. lift-+.f64N/A

              \[\leadsto x + \color{blue}{a \cdot t} \]
          8. Applied rewrites52.2%

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

          if 3.9999999999999998e196 < z

          1. Initial program 92.1%

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

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

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

              \[\leadsto z \cdot \left(y + \color{blue}{a \cdot b}\right) \]
            3. lower-*.f6450.4%

              \[\leadsto z \cdot \left(y + a \cdot \color{blue}{b}\right) \]
          4. Applied rewrites50.4%

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

            \[\leadsto a \cdot \color{blue}{\left(b \cdot z\right)} \]
          6. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto a \cdot \left(b \cdot \color{blue}{z}\right) \]
            2. lower-*.f6427.6%

              \[\leadsto a \cdot \left(b \cdot z\right) \]
          7. Applied rewrites27.6%

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

        Alternative 10: 59.9% accurate, 1.5× speedup?

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

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
            21. sub-flipN/A

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{a \cdot t} \]
            2. lower-*.f6452.2%

              \[\leadsto x + a \cdot \color{blue}{t} \]
          6. Applied rewrites52.2%

            \[\leadsto \color{blue}{x + a \cdot t} \]
          7. Taylor expanded in a around 0

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

              \[\leadsto x + \color{blue}{y \cdot z} \]
            2. lower-*.f6450.6%

              \[\leadsto x + y \cdot \color{blue}{z} \]
          9. Applied rewrites50.6%

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

          if -7.6999999999999996e-50 < z < 2.1e-18

          1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
            21. sub-flipN/A

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{a \cdot t} \]
            2. lower-*.f6452.2%

              \[\leadsto x + a \cdot \color{blue}{t} \]
          6. Applied rewrites52.2%

            \[\leadsto \color{blue}{x + a \cdot t} \]
          7. Step-by-step derivation
            1. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            2. +-commutative52.2%

              \[\leadsto x + a \cdot t \]
            3. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            4. *-commutative52.2%

              \[\leadsto x + a \cdot t \]
            5. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            6. distribute-rgt-inN/A

              \[\leadsto x + a \cdot t \]
            7. *-commutativeN/A

              \[\leadsto x + a \cdot t \]
            8. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            9. associate-*l*52.2%

              \[\leadsto x + a \cdot t \]
            10. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            11. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            12. associate-+r+N/A

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

              \[\leadsto x + a \cdot t \]
            14. +-commutativeN/A

              \[\leadsto \color{blue}{x} + a \cdot t \]
            15. lift-*.f64N/A

              \[\leadsto x + a \cdot t \]
            16. lift-*.f6452.2%

              \[\leadsto x + a \cdot t \]
            17. lift-+.f64N/A

              \[\leadsto x + \color{blue}{a \cdot t} \]
          8. Applied rewrites52.2%

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

        Alternative 11: 55.5% accurate, 2.2× speedup?

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

          1. Initial program 92.1%

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

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

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

              \[\leadsto z \cdot \left(y + \color{blue}{a \cdot b}\right) \]
            3. lower-*.f6450.4%

              \[\leadsto z \cdot \left(y + a \cdot \color{blue}{b}\right) \]
          4. Applied rewrites50.4%

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

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

              \[\leadsto \left(y + a \cdot b\right) \cdot \color{blue}{z} \]
            3. lower-*.f6450.4%

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

              \[\leadsto \left(y + a \cdot b\right) \cdot z \]
            5. +-commutativeN/A

              \[\leadsto \left(a \cdot b + y\right) \cdot z \]
            6. lift-*.f64N/A

              \[\leadsto \left(a \cdot b + y\right) \cdot z \]
            7. lower-fma.f6450.4%

              \[\leadsto \mathsf{fma}\left(a, b, y\right) \cdot z \]
          6. Applied rewrites50.4%

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

            \[\leadsto \left(a \cdot b\right) \cdot z \]
          8. Step-by-step derivation
            1. lower-*.f6427.6%

              \[\leadsto \left(a \cdot b\right) \cdot z \]
          9. Applied rewrites27.6%

            \[\leadsto \left(a \cdot b\right) \cdot z \]
          10. Taylor expanded in y around inf

            \[\leadsto y \cdot z \]
          11. Step-by-step derivation
            1. Applied rewrites27.0%

              \[\leadsto y \cdot z \]

            if -3.5999999999999998e133 < z

            1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, \color{blue}{y \cdot z - \left(\mathsf{neg}\left(x\right)\right)}\right) \]
              21. sub-flipN/A

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

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

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

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

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

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

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

                \[\leadsto x + \color{blue}{a \cdot t} \]
              2. lower-*.f6452.2%

                \[\leadsto x + a \cdot \color{blue}{t} \]
            6. Applied rewrites52.2%

              \[\leadsto \color{blue}{x + a \cdot t} \]
            7. Step-by-step derivation
              1. *-commutative52.2%

                \[\leadsto x + a \cdot t \]
              2. +-commutative52.2%

                \[\leadsto x + a \cdot t \]
              3. *-commutative52.2%

                \[\leadsto x + a \cdot t \]
              4. *-commutative52.2%

                \[\leadsto x + a \cdot t \]
              5. lift-*.f64N/A

                \[\leadsto x + a \cdot t \]
              6. distribute-rgt-inN/A

                \[\leadsto x + a \cdot t \]
              7. *-commutativeN/A

                \[\leadsto x + a \cdot t \]
              8. lift-*.f6452.2%

                \[\leadsto x + a \cdot t \]
              9. associate-*l*52.2%

                \[\leadsto x + a \cdot t \]
              10. lift-*.f64N/A

                \[\leadsto x + a \cdot t \]
              11. lift-*.f64N/A

                \[\leadsto x + a \cdot t \]
              12. associate-+r+N/A

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

                \[\leadsto x + a \cdot t \]
              14. +-commutativeN/A

                \[\leadsto \color{blue}{x} + a \cdot t \]
              15. lift-*.f64N/A

                \[\leadsto x + a \cdot t \]
              16. lift-*.f6452.2%

                \[\leadsto x + a \cdot t \]
              17. lift-+.f64N/A

                \[\leadsto x + \color{blue}{a \cdot t} \]
            8. Applied rewrites52.2%

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

          Alternative 12: 39.0% accurate, 1.8× speedup?

          \[\begin{array}{l} \mathbf{if}\;z \leq -7.7 \cdot 10^{-50}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-10}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
          (FPCore (x y z t a b)
           :precision binary64
           (if (<= z -7.7e-50) (* y z) (if (<= z 2.3e-10) (* a t) (* y z))))
          double code(double x, double y, double z, double t, double a, double b) {
          	double tmp;
          	if (z <= -7.7e-50) {
          		tmp = y * z;
          	} else if (z <= 2.3e-10) {
          		tmp = a * t;
          	} else {
          		tmp = y * z;
          	}
          	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 (z <= (-7.7d-50)) then
                  tmp = y * z
              else if (z <= 2.3d-10) then
                  tmp = a * t
              else
                  tmp = y * z
              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 (z <= -7.7e-50) {
          		tmp = y * z;
          	} else if (z <= 2.3e-10) {
          		tmp = a * t;
          	} else {
          		tmp = y * z;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a, b):
          	tmp = 0
          	if z <= -7.7e-50:
          		tmp = y * z
          	elif z <= 2.3e-10:
          		tmp = a * t
          	else:
          		tmp = y * z
          	return tmp
          
          function code(x, y, z, t, a, b)
          	tmp = 0.0
          	if (z <= -7.7e-50)
          		tmp = Float64(y * z);
          	elseif (z <= 2.3e-10)
          		tmp = Float64(a * t);
          	else
          		tmp = Float64(y * z);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a, b)
          	tmp = 0.0;
          	if (z <= -7.7e-50)
          		tmp = y * z;
          	elseif (z <= 2.3e-10)
          		tmp = a * t;
          	else
          		tmp = y * z;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.7e-50], N[(y * z), $MachinePrecision], If[LessEqual[z, 2.3e-10], N[(a * t), $MachinePrecision], N[(y * z), $MachinePrecision]]]
          
          \begin{array}{l}
          \mathbf{if}\;z \leq -7.7 \cdot 10^{-50}:\\
          \;\;\;\;y \cdot z\\
          
          \mathbf{elif}\;z \leq 2.3 \cdot 10^{-10}:\\
          \;\;\;\;a \cdot t\\
          
          \mathbf{else}:\\
          \;\;\;\;y \cdot z\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -7.6999999999999996e-50 or 2.3000000000000001e-10 < z

            1. Initial program 92.1%

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

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

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

                \[\leadsto z \cdot \left(y + \color{blue}{a \cdot b}\right) \]
              3. lower-*.f6450.4%

                \[\leadsto z \cdot \left(y + a \cdot \color{blue}{b}\right) \]
            4. Applied rewrites50.4%

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

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

                \[\leadsto \left(y + a \cdot b\right) \cdot \color{blue}{z} \]
              3. lower-*.f6450.4%

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

                \[\leadsto \left(y + a \cdot b\right) \cdot z \]
              5. +-commutativeN/A

                \[\leadsto \left(a \cdot b + y\right) \cdot z \]
              6. lift-*.f64N/A

                \[\leadsto \left(a \cdot b + y\right) \cdot z \]
              7. lower-fma.f6450.4%

                \[\leadsto \mathsf{fma}\left(a, b, y\right) \cdot z \]
            6. Applied rewrites50.4%

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

              \[\leadsto \left(a \cdot b\right) \cdot z \]
            8. Step-by-step derivation
              1. lower-*.f6427.6%

                \[\leadsto \left(a \cdot b\right) \cdot z \]
            9. Applied rewrites27.6%

              \[\leadsto \left(a \cdot b\right) \cdot z \]
            10. Taylor expanded in y around inf

              \[\leadsto y \cdot z \]
            11. Step-by-step derivation
              1. Applied rewrites27.0%

                \[\leadsto y \cdot z \]

              if -7.6999999999999996e-50 < z < 2.3000000000000001e-10

              1. Initial program 92.1%

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

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

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

                  \[\leadsto a \cdot \left(t + \color{blue}{b \cdot z}\right) \]
                3. lower-*.f6451.9%

                  \[\leadsto a \cdot \left(t + b \cdot \color{blue}{z}\right) \]
              4. Applied rewrites51.9%

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

                \[\leadsto a \cdot \color{blue}{t} \]
              6. Step-by-step derivation
                1. lower-*.f6428.5%

                  \[\leadsto a \cdot t \]
              7. Applied rewrites28.5%

                \[\leadsto a \cdot \color{blue}{t} \]
            12. Recombined 2 regimes into one program.
            13. Add Preprocessing

            Alternative 13: 28.5% accurate, 5.3× speedup?

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

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

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

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

                \[\leadsto a \cdot \left(t + \color{blue}{b \cdot z}\right) \]
              3. lower-*.f6451.9%

                \[\leadsto a \cdot \left(t + b \cdot \color{blue}{z}\right) \]
            4. Applied rewrites51.9%

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

              \[\leadsto a \cdot \color{blue}{t} \]
            6. Step-by-step derivation
              1. lower-*.f6428.5%

                \[\leadsto a \cdot t \]
            7. Applied rewrites28.5%

              \[\leadsto a \cdot \color{blue}{t} \]
            8. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2025189 
            (FPCore (x y z t a b)
              :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
              :precision binary64
              (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))