Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.3% → 97.5%
Time: 8.5s
Alternatives: 14
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 92.3% accurate, 1.0× speedup?

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

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

Alternative 1: 97.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\\
\mathbf{if}\;t\_1 \leq 10^{+291}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 99.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing

    if 9.9999999999999996e290 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.6% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.89999999999999972e-12

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.89999999999999972e-12 < z < 1.28000000000000002e-123

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

    if 1.28000000000000002e-123 < z

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 85.9% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.9 \cdot 10^{-12} \lor \neg \left(z \leq 1.28 \cdot 10^{-123}\right):\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, a, y\right), z, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.89999999999999972e-12 or 1.28000000000000002e-123 < z

    1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.89999999999999972e-12 < z < 1.28000000000000002e-123

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 86.0% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-44} \lor \neg \left(z \leq 9.5 \cdot 10^{+117}\right):\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, a, y\right), z, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.09999999999999984e-44 or 9.50000000000000041e117 < z

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.09999999999999984e-44 < z < 9.50000000000000041e117

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 81.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.15 \cdot 10^{+193} \lor \neg \left(a \leq 3.9 \cdot 10^{+75}\right):\\ \;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -2.15e+193) (not (<= a 3.9e+75)))
   (* (fma b z t) a)
   (fma t a (fma y z x))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -2.15e+193) || !(a <= 3.9e+75)) {
		tmp = fma(b, z, t) * a;
	} else {
		tmp = fma(t, a, fma(y, z, x));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -2.15e+193) || !(a <= 3.9e+75))
		tmp = Float64(fma(b, z, t) * a);
	else
		tmp = fma(t, a, fma(y, z, x));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.15e+193], N[Not[LessEqual[a, 3.9e+75]], $MachinePrecision]], N[(N[(b * z + t), $MachinePrecision] * a), $MachinePrecision], N[(t * a + N[(y * z + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.15 \cdot 10^{+193} \lor \neg \left(a \leq 3.9 \cdot 10^{+75}\right):\\
\;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.1500000000000001e193 or 3.90000000000000038e75 < a

    1. Initial program 85.4%

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

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

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

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

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

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

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

    if -2.1500000000000001e193 < a < 3.90000000000000038e75

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 73.5% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5 \cdot 10^{-40} \lor \neg \left(a \leq 1.3 \cdot 10^{-87}\right):\\ \;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, z, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -5e-40) (not (<= a 1.3e-87))) (* (fma b z t) a) (fma y z x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -5e-40) || !(a <= 1.3e-87)) {
		tmp = fma(b, z, t) * a;
	} else {
		tmp = fma(y, z, x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -5e-40) || !(a <= 1.3e-87))
		tmp = Float64(fma(b, z, t) * a);
	else
		tmp = fma(y, z, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -5e-40], N[Not[LessEqual[a, 1.3e-87]], $MachinePrecision]], N[(N[(b * z + t), $MachinePrecision] * a), $MachinePrecision], N[(y * z + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{-40} \lor \neg \left(a \leq 1.3 \cdot 10^{-87}\right):\\
\;\;\;\;\mathsf{fma}\left(b, z, t\right) \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.99999999999999965e-40 or 1.30000000000000001e-87 < a

    1. Initial program 91.1%

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

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

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

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

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

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

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

    if -4.99999999999999965e-40 < a < 1.30000000000000001e-87

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 71.5% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{-45} \lor \neg \left(z \leq 1.05 \cdot 10^{-105}\right):\\ \;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, a, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -3.7e-45) (not (<= z 1.05e-105)))
   (* (fma b a y) z)
   (fma t a x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -3.7e-45) || !(z <= 1.05e-105)) {
		tmp = fma(b, a, y) * z;
	} else {
		tmp = fma(t, a, x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -3.7e-45) || !(z <= 1.05e-105))
		tmp = Float64(fma(b, a, y) * z);
	else
		tmp = fma(t, a, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.7e-45], N[Not[LessEqual[z, 1.05e-105]], $MachinePrecision]], N[(N[(b * a + y), $MachinePrecision] * z), $MachinePrecision], N[(t * a + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-45} \lor \neg \left(z \leq 1.05 \cdot 10^{-105}\right):\\
\;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.7e-45 or 1.05e-105 < z

    1. Initial program 90.9%

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

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

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

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

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

        \[\leadsto \left(\color{blue}{b \cdot a} + y\right) \cdot z \]
      5. lower-fma.f6474.4

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

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

    if -3.7e-45 < z < 1.05e-105

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 60.9% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;a \leq 3.6 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.2000000000000003e-40

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2000000000000003e-40 < a < 3.6e75

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6e75 < a

    1. Initial program 87.1%

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

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

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

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

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

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

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

      \[\leadsto \left(b \cdot z\right) \cdot a \]
    7. Step-by-step derivation
      1. Applied rewrites71.0%

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

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

    Alternative 9: 60.7% accurate, 1.3× speedup?

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

      1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -5.2000000000000003e-40 < a < 3.90000000000000038e75

      1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.90000000000000038e75 < a

      1. Initial program 87.1%

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

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

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

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

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

          \[\leadsto \left(\color{blue}{b \cdot a} + y\right) \cdot z \]
        5. lower-fma.f6465.3

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

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

        \[\leadsto \left(a \cdot b\right) \cdot z \]
      7. Step-by-step derivation
        1. Applied rewrites58.9%

          \[\leadsto \left(b \cdot a\right) \cdot z \]
      8. Recombined 3 regimes into one program.
      9. Final simplification68.3%

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

      Alternative 10: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 11: 63.0% accurate, 1.6× speedup?

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

        1. Initial program 92.8%

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

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

            \[\leadsto \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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -2.59999999999999995e-20 < t < 2.05e86

        1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 12: 58.4% accurate, 1.6× speedup?

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

        1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -7.5e116 < y < 6.9999999999999999e159

        1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 13: 39.0% accurate, 1.7× speedup?

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

        1. Initial program 92.8%

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

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

            \[\leadsto \color{blue}{a \cdot t} \]
        5. Applied rewrites49.4%

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

        if -2.59999999999999995e-20 < t < 2.05e86

        1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{y \cdot z} \]
        7. Applied rewrites31.6%

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

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

      Alternative 14: 28.2% accurate, 5.0× speedup?

      \[\begin{array}{l} \\ y \cdot z \end{array} \]
      (FPCore (x y z t a b) :precision binary64 (* y z))
      double code(double x, double y, double z, double t, double a, double b) {
      	return y * z;
      }
      
      real(8) function code(x, y, z, t, a, b)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          code = y * z
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	return y * z;
      }
      
      def code(x, y, z, t, a, b):
      	return y * z
      
      function code(x, y, z, t, a, b)
      	return Float64(y * z)
      end
      
      function tmp = code(x, y, z, t, a, b)
      	tmp = y * z;
      end
      
      code[x_, y_, z_, t_, a_, b_] := N[(y * z), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      y \cdot z
      \end{array}
      
      Derivation
      1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \mathbf{if}\;z < -11820553527347888000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\ \;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
         (if (< z -11820553527347888000.0)
           t_1
           (if (< z 4.7589743188364287e-122)
             (+ (* (+ (* b z) t) a) (+ (* z y) x))
             t_1))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = (z * ((b * a) + y)) + (x + (t * a));
      	double tmp;
      	if (z < -11820553527347888000.0) {
      		tmp = t_1;
      	} else if (z < 4.7589743188364287e-122) {
      		tmp = (((b * z) + t) * a) + ((z * y) + x);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a, b)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8) :: t_1
          real(8) :: tmp
          t_1 = (z * ((b * a) + y)) + (x + (t * a))
          if (z < (-11820553527347888000.0d0)) then
              tmp = t_1
          else if (z < 4.7589743188364287d-122) then
              tmp = (((b * z) + t) * a) + ((z * y) + x)
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = (z * ((b * a) + y)) + (x + (t * a));
      	double tmp;
      	if (z < -11820553527347888000.0) {
      		tmp = t_1;
      	} else if (z < 4.7589743188364287e-122) {
      		tmp = (((b * z) + t) * a) + ((z * y) + x);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	t_1 = (z * ((b * a) + y)) + (x + (t * a))
      	tmp = 0
      	if z < -11820553527347888000.0:
      		tmp = t_1
      	elif z < 4.7589743188364287e-122:
      		tmp = (((b * z) + t) * a) + ((z * y) + x)
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a)))
      	tmp = 0.0
      	if (z < -11820553527347888000.0)
      		tmp = t_1;
      	elseif (z < 4.7589743188364287e-122)
      		tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	t_1 = (z * ((b * a) + y)) + (x + (t * a));
      	tmp = 0.0;
      	if (z < -11820553527347888000.0)
      		tmp = t_1;
      	elseif (z < 4.7589743188364287e-122)
      		tmp = (((b * z) + t) * a) + ((z * y) + x);
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
      \mathbf{if}\;z < -11820553527347888000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
      \;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      

      Reproduce

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