Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 91.8% → 98.0%
Time: 8.7s
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: 91.8% 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: 98.0% accurate, 0.4× 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 2 \cdot 10^{+307}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(z, \frac{y}{a} + b, \frac{x}{a}\right) + t\right) \cdot a\\ \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 2e+307) t_1 (* (+ (fma z (+ (/ y a) b) (/ x a)) t) a))))
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 <= 2e+307) {
		tmp = t_1;
	} else {
		tmp = (fma(z, ((y / a) + b), (x / a)) + t) * a;
	}
	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 <= 2e+307)
		tmp = t_1;
	else
		tmp = Float64(Float64(fma(z, Float64(Float64(y / a) + b), Float64(x / a)) + t) * a);
	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, 2e+307], t$95$1, N[(N[(N[(z * N[(N[(y / a), $MachinePrecision] + b), $MachinePrecision] + N[(x / a), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] * a), $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 2 \cdot 10^{+307}:\\
\;\;\;\;t\_1\\

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


\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)) < 1.99999999999999997e307

    1. Initial program 98.0%

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

    if 1.99999999999999997e307 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 82.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 x around inf

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

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

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

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

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

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

        \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \color{blue}{\frac{a \cdot t}{1} \cdot \frac{x}{x}} \]
      7. /-rgt-identityN/A

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

        \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \left(a \cdot t\right) \cdot \color{blue}{1} \]
      9. *-rgt-identityN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.75 \cdot 10^{-89}:\\
\;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\\

\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 a < 2.75000000000000006e-89

    1. Initial program 96.3%

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

    if 2.75000000000000006e-89 < a

    1. Initial program 91.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. 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)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 87.4% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.2 \cdot 10^{+33} \lor \neg \left(a \leq 260\right):\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.1999999999999999e33 or 260 < a

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

    if -8.1999999999999999e33 < a < 260

    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. 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.6

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

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

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

Alternative 4: 87.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-25} \lor \neg \left(z \leq 1.75 \cdot 10^{-23}\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 -1.45e-25) (not (<= z 1.75e-23)))
   (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 <= -1.45e-25) || !(z <= 1.75e-23)) {
		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 <= -1.45e-25) || !(z <= 1.75e-23))
		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, -1.45e-25], N[Not[LessEqual[z, 1.75e-23]], $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 -1.45 \cdot 10^{-25} \lor \neg \left(z \leq 1.75 \cdot 10^{-23}\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 < -1.45e-25 or 1.74999999999999997e-23 < 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 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.f6490.4

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

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

    if -1.45e-25 < z < 1.74999999999999997e-23

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

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

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

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

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

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

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

        \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \color{blue}{\frac{a \cdot t}{1} \cdot \frac{x}{x}} \]
      7. /-rgt-identityN/A

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

        \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \left(a \cdot t\right) \cdot \color{blue}{1} \]
      9. *-rgt-identityN/A

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-25} \lor \neg \left(z \leq 1.75 \cdot 10^{-23}\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.9% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+22} \lor \neg \left(z \leq 5.8 \cdot 10^{+171}\right):\\
\;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\

\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 < -1.1e22 or 5.79999999999999969e171 < z

    1. Initial program 86.4%

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

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

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

    if -1.1e22 < z < 5.79999999999999969e171

    1. Initial program 98.8%

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

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

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

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

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

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

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

        \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \color{blue}{\frac{a \cdot t}{1} \cdot \frac{x}{x}} \]
      7. /-rgt-identityN/A

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

        \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \left(a \cdot t\right) \cdot \color{blue}{1} \]
      9. *-rgt-identityN/A

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

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

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

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

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

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

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

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

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

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

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

      \[\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 simplification88.1%

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

Alternative 6: 86.5% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.2 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(z, y, \mathsf{fma}\left(z, b, t\right) \cdot a\right)\\ \mathbf{elif}\;a \leq 260:\\ \;\;\;\;\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 (<= a -2.2e+37)
   (fma z y (* (fma z b t) a))
   (if (<= a 260.0) (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 (a <= -2.2e+37) {
		tmp = fma(z, y, (fma(z, b, t) * a));
	} else if (a <= 260.0) {
		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 (a <= -2.2e+37)
		tmp = fma(z, y, Float64(fma(z, b, t) * a));
	elseif (a <= 260.0)
		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[LessEqual[a, -2.2e+37], N[(z * y + N[(N[(z * b + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 260.0], 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}\;a \leq -2.2 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(z, y, \mathsf{fma}\left(z, b, t\right) \cdot a\right)\\

\mathbf{elif}\;a \leq 260:\\
\;\;\;\;\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 3 regimes
  2. if a < -2.2000000000000001e37

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

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

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

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

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

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

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

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

    if -2.2000000000000001e37 < a < 260

    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. 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.6

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

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

    if 260 < a

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.2 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(z, y, \mathsf{fma}\left(z, b, t\right) \cdot a\right)\\ \mathbf{elif}\;a \leq 260:\\ \;\;\;\;\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 7: 86.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.4 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, z \cdot y\right)\\ \mathbf{elif}\;a \leq 260:\\ \;\;\;\;\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 (<= a -2.4e+37)
   (fma (fma b z t) a (* z y))
   (if (<= a 260.0) (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 (a <= -2.4e+37) {
		tmp = fma(fma(b, z, t), a, (z * y));
	} else if (a <= 260.0) {
		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 (a <= -2.4e+37)
		tmp = fma(fma(b, z, t), a, Float64(z * y));
	elseif (a <= 260.0)
		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[LessEqual[a, -2.4e+37], N[(N[(b * z + t), $MachinePrecision] * a + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 260.0], 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}\;a \leq -2.4 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, z \cdot y\right)\\

\mathbf{elif}\;a \leq 260:\\
\;\;\;\;\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 3 regimes
  2. if a < -2.4e37

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

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

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

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

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

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

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

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

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

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

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

    if -2.4e37 < a < 260

    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. 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.6

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

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

    if 260 < a

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.4 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(b, z, t\right), a, z \cdot y\right)\\ \mathbf{elif}\;a \leq 260:\\ \;\;\;\;\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 8: 74.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+30} \lor \neg \left(a \leq 3400\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 < -2e30 or 3400 < a

    1. Initial program 91.3%

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

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

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

    if -2e30 < a < 3400

    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. Taylor expanded in x around inf

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

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

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

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

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

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

        \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \color{blue}{\frac{a \cdot t}{1} \cdot \frac{x}{x}} \]
      7. /-rgt-identityN/A

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

        \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \left(a \cdot t\right) \cdot \color{blue}{1} \]
      9. *-rgt-identityN/A

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{+30} \lor \neg \left(a \leq 3400\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 9: 74.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{-37} \lor \neg \left(z \leq 5 \cdot 10^{-20}\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 -2.1e-37) (not (<= z 5e-20))) (* (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 <= -2.1e-37) || !(z <= 5e-20)) {
		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 <= -2.1e-37) || !(z <= 5e-20))
		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, -2.1e-37], N[Not[LessEqual[z, 5e-20]], $MachinePrecision]], N[(N[(b * a + y), $MachinePrecision] * z), $MachinePrecision], N[(t * a + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-37} \lor \neg \left(z \leq 5 \cdot 10^{-20}\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 < -2.1000000000000001e-37 or 4.9999999999999999e-20 < 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 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.f6478.5

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

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

    if -2.1000000000000001e-37 < z < 4.9999999999999999e-20

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

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

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

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

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

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

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

        \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \color{blue}{\frac{a \cdot t}{1} \cdot \frac{x}{x}} \]
      7. /-rgt-identityN/A

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

        \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \left(a \cdot t\right) \cdot \color{blue}{1} \]
      9. *-rgt-identityN/A

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{-37} \lor \neg \left(z \leq 5 \cdot 10^{-20}\right):\\ \;\;\;\;\mathsf{fma}\left(b, a, y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, a, x\right)\\ \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.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.f6495.7

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

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

    Alternative 11: 62.9% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.32 \cdot 10^{+39} \lor \neg \left(y \leq 7 \cdot 10^{+71}\right):\\ \;\;\;\;\mathsf{fma}\left(y, z, x\right)\\ \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 -1.32e+39) (not (<= y 7e+71))) (fma y z x) (fma t a x)))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if ((y <= -1.32e+39) || !(y <= 7e+71)) {
    		tmp = fma(y, z, x);
    	} else {
    		tmp = fma(t, a, x);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if ((y <= -1.32e+39) || !(y <= 7e+71))
    		tmp = fma(y, z, x);
    	else
    		tmp = fma(t, a, x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.32e+39], N[Not[LessEqual[y, 7e+71]], $MachinePrecision]], N[(y * z + x), $MachinePrecision], N[(t * a + x), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq -1.32 \cdot 10^{+39} \lor \neg \left(y \leq 7 \cdot 10^{+71}\right):\\
    \;\;\;\;\mathsf{fma}\left(y, z, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(t, a, x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < -1.32e39 or 6.9999999999999998e71 < y

      1. Initial program 93.3%

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

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

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

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

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

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

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

          \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \color{blue}{\frac{a \cdot t}{1} \cdot \frac{x}{x}} \]
        7. /-rgt-identityN/A

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

          \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \left(a \cdot t\right) \cdot \color{blue}{1} \]
        9. *-rgt-identityN/A

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

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

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

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

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

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

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

      if -1.32e39 < y < 6.9999999999999998e71

      1. Initial program 95.5%

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

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

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

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

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

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

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

          \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \color{blue}{\frac{a \cdot t}{1} \cdot \frac{x}{x}} \]
        7. /-rgt-identityN/A

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

          \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \left(a \cdot t\right) \cdot \color{blue}{1} \]
        9. *-rgt-identityN/A

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

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

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

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

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

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

      Alternative 12: 57.7% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{+157} \lor \neg \left(y \leq 5.5 \cdot 10^{+72}\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.8e+157) (not (<= y 5.5e+72))) (* 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.8e+157) || !(y <= 5.5e+72)) {
      		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.8e+157) || !(y <= 5.5e+72))
      		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.8e+157], N[Not[LessEqual[y, 5.5e+72]], $MachinePrecision]], N[(y * z), $MachinePrecision], N[(t * a + x), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -7.8 \cdot 10^{+157} \lor \neg \left(y \leq 5.5 \cdot 10^{+72}\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.79999999999999941e157 or 5.5e72 < y

        1. Initial program 91.4%

          \[\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.f6493.8

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

          \[\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-*.f6468.1

            \[\leadsto \color{blue}{y \cdot z} \]
        7. Applied rewrites68.1%

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

        if -7.79999999999999941e157 < y < 5.5e72

        1. Initial program 96.1%

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

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

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

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

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

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

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

            \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \color{blue}{\frac{a \cdot t}{1} \cdot \frac{x}{x}} \]
          7. /-rgt-identityN/A

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

            \[\leadsto \left(1 + \left(\frac{a \cdot \left(b \cdot z\right)}{x} + \frac{y \cdot z}{x}\right)\right) \cdot x + \left(a \cdot t\right) \cdot \color{blue}{1} \]
          9. *-rgt-identityN/A

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

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

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

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

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

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

        Alternative 13: 39.1% accurate, 1.7× speedup?

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

          1. Initial program 93.0%

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

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

              \[\leadsto \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.f6493.1

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

            \[\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-*.f6461.7

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

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

          if -2.9999999999999998e60 < y < 9.99999999999999944e71

          1. Initial program 95.7%

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

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

              \[\leadsto \color{blue}{a \cdot t} \]
          5. Applied rewrites34.2%

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

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

        Alternative 14: 27.9% 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.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.f6495.7

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

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

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

            \[\leadsto \color{blue}{y \cdot z} \]
        7. Applied rewrites29.9%

          \[\leadsto \color{blue}{y \cdot z} \]
        8. Final simplification29.9%

          \[\leadsto y \cdot z \]
        9. Add Preprocessing

        Developer Target 1: 97.1% 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 2024299 
        (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)))