Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.7% → 98.8%
Time: 9.4s
Alternatives: 18
Speedup: 0.9×

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

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

Initial Program: 92.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
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.8% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{-12} \lor \neg \left(a \leq 2.5 \cdot 10^{+46}\right):\\
\;\;\;\;\mathsf{fma}\left(y, z, x + a \cdot \left(t + z \cdot b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9.9999999999999998e-13 or 2.5000000000000001e46 < a

    1. Initial program 86.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+86.9%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. +-commutative86.9%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, \left(a \cdot t + \color{blue}{a \cdot \left(z \cdot b\right)}\right) + x\right) \]
      8. distribute-lft-out99.1%

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

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

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

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

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

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

    if -9.9999999999999998e-13 < a < 2.5000000000000001e46

    1. Initial program 97.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+97.7%

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified92.0%

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

        \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + t \cdot a\right) + a \cdot \left(z \cdot b\right)} \]
      2. +-commutative92.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot a, b, \mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\right)} \]
    6. Step-by-step derivation
      1. fma-udef100.0%

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

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

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

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

Alternative 2: 95.2% accurate, 0.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 9.99999999999999989e-160

    1. Initial program 97.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.2%

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

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+97.2%

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

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative98.5%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out98.5%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def99.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, a \cdot b + y, x + t \cdot a\right)} \]
      10. fma-def99.2%

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

        \[\leadsto \mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \color{blue}{t \cdot a + x}\right) \]
      12. fma-def99.2%

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

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

    if 9.99999999999999989e-160 < y

    1. Initial program 86.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+86.8%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. +-commutative86.8%

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

        \[\leadsto \color{blue}{y \cdot z + \left(x + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)\right)} \]
      4. fma-def89.5%

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, \left(a \cdot t + \color{blue}{a \cdot \left(z \cdot b\right)}\right) + x\right) \]
      8. distribute-lft-out96.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 10^{-159}:\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, z, x + a \cdot \left(t + z \cdot b\right)\right)\\ \end{array} \]

Alternative 3: 96.4% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 98.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]

    if 5.00000000000000049e198 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 80.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+80.2%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, \left(a \cdot t + \color{blue}{a \cdot \left(z \cdot b\right)}\right) + x\right) \]
      8. distribute-lft-out95.3%

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

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

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

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

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

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

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

Alternative 4: 96.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot t + \left(x + y \cdot z\right)\right) + b \cdot \left(z \cdot a\right)\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (+ (* a t) (+ x (* y z))) (* b (* z a)))))
   (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((a * t) + (x + (y * z))) + (b * (z * a));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = z * (y + (a * b));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((a * t) + (x + (y * z))) + (b * (z * a));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = z * (y + (a * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((a * t) + (x + (y * z))) + (b * (z * a))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = z * (y + (a * b))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(a * t) + Float64(x + Float64(y * z))) + Float64(b * Float64(z * a)))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(y + Float64(a * b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = ((a * t) + (x + (y * z))) + (b * (z * a));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = z * (y + (a * b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 97.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]

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

    1. Initial program 0.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative0.0%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative0.0%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+0.0%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative0.0%

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out50.0%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def64.3%

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

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

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

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

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

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

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

Alternative 5: 37.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;z \leq -5.4 \cdot 10^{+221}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{+77}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1.36 \cdot 10^{-187}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-83}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+49}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+166}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+214}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= z -5.4e+221)
     t_1
     (if (<= z -1.85e+77)
       (* y z)
       (if (<= z -1.36e-187)
         x
         (if (<= z 4.3e-83)
           (* a t)
           (if (<= z 1.85e+49)
             t_1
             (if (<= z 1.08e+88)
               (* a t)
               (if (<= z 1.2e+166)
                 (* y z)
                 (if (<= z 6.5e+214) t_1 (* y z)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (z <= -5.4e+221) {
		tmp = t_1;
	} else if (z <= -1.85e+77) {
		tmp = y * z;
	} else if (z <= -1.36e-187) {
		tmp = x;
	} else if (z <= 4.3e-83) {
		tmp = a * t;
	} else if (z <= 1.85e+49) {
		tmp = t_1;
	} else if (z <= 1.08e+88) {
		tmp = a * t;
	} else if (z <= 1.2e+166) {
		tmp = y * z;
	} else if (z <= 6.5e+214) {
		tmp = t_1;
	} else {
		tmp = y * z;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (z <= (-5.4d+221)) then
        tmp = t_1
    else if (z <= (-1.85d+77)) then
        tmp = y * z
    else if (z <= (-1.36d-187)) then
        tmp = x
    else if (z <= 4.3d-83) then
        tmp = a * t
    else if (z <= 1.85d+49) then
        tmp = t_1
    else if (z <= 1.08d+88) then
        tmp = a * t
    else if (z <= 1.2d+166) then
        tmp = y * z
    else if (z <= 6.5d+214) then
        tmp = t_1
    else
        tmp = y * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (z <= -5.4e+221) {
		tmp = t_1;
	} else if (z <= -1.85e+77) {
		tmp = y * z;
	} else if (z <= -1.36e-187) {
		tmp = x;
	} else if (z <= 4.3e-83) {
		tmp = a * t;
	} else if (z <= 1.85e+49) {
		tmp = t_1;
	} else if (z <= 1.08e+88) {
		tmp = a * t;
	} else if (z <= 1.2e+166) {
		tmp = y * z;
	} else if (z <= 6.5e+214) {
		tmp = t_1;
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if z <= -5.4e+221:
		tmp = t_1
	elif z <= -1.85e+77:
		tmp = y * z
	elif z <= -1.36e-187:
		tmp = x
	elif z <= 4.3e-83:
		tmp = a * t
	elif z <= 1.85e+49:
		tmp = t_1
	elif z <= 1.08e+88:
		tmp = a * t
	elif z <= 1.2e+166:
		tmp = y * z
	elif z <= 6.5e+214:
		tmp = t_1
	else:
		tmp = y * z
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (z <= -5.4e+221)
		tmp = t_1;
	elseif (z <= -1.85e+77)
		tmp = Float64(y * z);
	elseif (z <= -1.36e-187)
		tmp = x;
	elseif (z <= 4.3e-83)
		tmp = Float64(a * t);
	elseif (z <= 1.85e+49)
		tmp = t_1;
	elseif (z <= 1.08e+88)
		tmp = Float64(a * t);
	elseif (z <= 1.2e+166)
		tmp = Float64(y * z);
	elseif (z <= 6.5e+214)
		tmp = t_1;
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (z <= -5.4e+221)
		tmp = t_1;
	elseif (z <= -1.85e+77)
		tmp = y * z;
	elseif (z <= -1.36e-187)
		tmp = x;
	elseif (z <= 4.3e-83)
		tmp = a * t;
	elseif (z <= 1.85e+49)
		tmp = t_1;
	elseif (z <= 1.08e+88)
		tmp = a * t;
	elseif (z <= 1.2e+166)
		tmp = y * z;
	elseif (z <= 6.5e+214)
		tmp = t_1;
	else
		tmp = y * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.4e+221], t$95$1, If[LessEqual[z, -1.85e+77], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.36e-187], x, If[LessEqual[z, 4.3e-83], N[(a * t), $MachinePrecision], If[LessEqual[z, 1.85e+49], t$95$1, If[LessEqual[z, 1.08e+88], N[(a * t), $MachinePrecision], If[LessEqual[z, 1.2e+166], N[(y * z), $MachinePrecision], If[LessEqual[z, 6.5e+214], t$95$1, N[(y * z), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{+221}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.85 \cdot 10^{+77}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;z \leq -1.36 \cdot 10^{-187}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 4.3 \cdot 10^{-83}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;z \leq 1.85 \cdot 10^{+49}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+166}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;z \leq 6.5 \cdot 10^{+214}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;y \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.3999999999999999e221 or 4.30000000000000033e-83 < z < 1.85000000000000009e49 or 1.19999999999999996e166 < z < 6.5000000000000001e214

    1. Initial program 81.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative81.2%

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

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+81.2%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out94.3%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def94.3%

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(z \cdot b\right)} \]
    6. Simplified63.1%

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

    if -5.3999999999999999e221 < z < -1.84999999999999997e77 or 1.08000000000000003e88 < z < 1.19999999999999996e166 or 6.5000000000000001e214 < z

    1. Initial program 92.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative92.1%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative92.1%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+92.1%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative92.1%

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out98.6%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def98.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified55.6%

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

    if -1.84999999999999997e77 < z < -1.36000000000000011e-187

    1. Initial program 98.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative98.1%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative98.1%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+98.1%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative98.1%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative93.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out93.0%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def93.0%

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

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

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

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

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

      \[\leadsto \color{blue}{x} \]

    if -1.36000000000000011e-187 < z < 4.30000000000000033e-83 or 1.85000000000000009e49 < z < 1.08000000000000003e88

    1. Initial program 97.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.2%

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

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+97.2%

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

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative91.9%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out91.9%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def94.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.4 \cdot 10^{+221}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{+77}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1.36 \cdot 10^{-187}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{-83}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+49}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+166}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+214}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 6: 70.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ t_2 := x + a \cdot t\\ t_3 := z \cdot \left(y + a \cdot b\right)\\ \mathbf{if}\;z \leq -2.25 \cdot 10^{+140}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{+34}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-51}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-170}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-96} \lor \neg \left(z \leq 1.4 \cdot 10^{+66}\right) \land z \leq 1.5 \cdot 10^{+87}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* y z))) (t_2 (+ x (* a t))) (t_3 (* z (+ y (* a b)))))
   (if (<= z -2.25e+140)
     t_3
     (if (<= z -1.95e+34)
       t_1
       (if (<= z -7e-51)
         t_2
         (if (<= z -3.4e-170)
           t_1
           (if (or (<= z 6.2e-96) (and (not (<= z 1.4e+66)) (<= z 1.5e+87)))
             t_2
             t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double t_2 = x + (a * t);
	double t_3 = z * (y + (a * b));
	double tmp;
	if (z <= -2.25e+140) {
		tmp = t_3;
	} else if (z <= -1.95e+34) {
		tmp = t_1;
	} else if (z <= -7e-51) {
		tmp = t_2;
	} else if (z <= -3.4e-170) {
		tmp = t_1;
	} else if ((z <= 6.2e-96) || (!(z <= 1.4e+66) && (z <= 1.5e+87))) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x + (y * z)
    t_2 = x + (a * t)
    t_3 = z * (y + (a * b))
    if (z <= (-2.25d+140)) then
        tmp = t_3
    else if (z <= (-1.95d+34)) then
        tmp = t_1
    else if (z <= (-7d-51)) then
        tmp = t_2
    else if (z <= (-3.4d-170)) then
        tmp = t_1
    else if ((z <= 6.2d-96) .or. (.not. (z <= 1.4d+66)) .and. (z <= 1.5d+87)) then
        tmp = t_2
    else
        tmp = t_3
    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 = x + (y * z);
	double t_2 = x + (a * t);
	double t_3 = z * (y + (a * b));
	double tmp;
	if (z <= -2.25e+140) {
		tmp = t_3;
	} else if (z <= -1.95e+34) {
		tmp = t_1;
	} else if (z <= -7e-51) {
		tmp = t_2;
	} else if (z <= -3.4e-170) {
		tmp = t_1;
	} else if ((z <= 6.2e-96) || (!(z <= 1.4e+66) && (z <= 1.5e+87))) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * z)
	t_2 = x + (a * t)
	t_3 = z * (y + (a * b))
	tmp = 0
	if z <= -2.25e+140:
		tmp = t_3
	elif z <= -1.95e+34:
		tmp = t_1
	elif z <= -7e-51:
		tmp = t_2
	elif z <= -3.4e-170:
		tmp = t_1
	elif (z <= 6.2e-96) or (not (z <= 1.4e+66) and (z <= 1.5e+87)):
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	t_2 = Float64(x + Float64(a * t))
	t_3 = Float64(z * Float64(y + Float64(a * b)))
	tmp = 0.0
	if (z <= -2.25e+140)
		tmp = t_3;
	elseif (z <= -1.95e+34)
		tmp = t_1;
	elseif (z <= -7e-51)
		tmp = t_2;
	elseif (z <= -3.4e-170)
		tmp = t_1;
	elseif ((z <= 6.2e-96) || (!(z <= 1.4e+66) && (z <= 1.5e+87)))
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (y * z);
	t_2 = x + (a * t);
	t_3 = z * (y + (a * b));
	tmp = 0.0;
	if (z <= -2.25e+140)
		tmp = t_3;
	elseif (z <= -1.95e+34)
		tmp = t_1;
	elseif (z <= -7e-51)
		tmp = t_2;
	elseif (z <= -3.4e-170)
		tmp = t_1;
	elseif ((z <= 6.2e-96) || (~((z <= 1.4e+66)) && (z <= 1.5e+87)))
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.25e+140], t$95$3, If[LessEqual[z, -1.95e+34], t$95$1, If[LessEqual[z, -7e-51], t$95$2, If[LessEqual[z, -3.4e-170], t$95$1, If[Or[LessEqual[z, 6.2e-96], And[N[Not[LessEqual[z, 1.4e+66]], $MachinePrecision], LessEqual[z, 1.5e+87]]], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot z\\
t_2 := x + a \cdot t\\
t_3 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{+140}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq -1.95 \cdot 10^{+34}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -7 \cdot 10^{-51}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-170}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{-96} \lor \neg \left(z \leq 1.4 \cdot 10^{+66}\right) \land z \leq 1.5 \cdot 10^{+87}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.2500000000000001e140 or 6.1999999999999998e-96 < z < 1.4e66 or 1.4999999999999999e87 < z

    1. Initial program 87.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative87.8%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative87.8%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+87.8%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out96.6%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def96.7%

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

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

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

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

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

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

    if -2.2500000000000001e140 < z < -1.9500000000000001e34 or -6.9999999999999995e-51 < z < -3.40000000000000013e-170

    1. Initial program 97.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.6%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative97.6%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+97.6%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out93.7%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def93.7%

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

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

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

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

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

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

    if -1.9500000000000001e34 < z < -6.9999999999999995e-51 or -3.40000000000000013e-170 < z < 6.1999999999999998e-96 or 1.4e66 < z < 1.4999999999999999e87

    1. Initial program 96.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative96.6%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative96.6%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+96.6%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out92.2%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def94.5%

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot t + x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+140}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{+34}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-51}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-170}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-96} \lor \neg \left(z \leq 1.4 \cdot 10^{+66}\right) \land z \leq 1.5 \cdot 10^{+87}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \end{array} \]

Alternative 7: 39.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(a \cdot b\right)\\ \mathbf{if}\;y \leq -2.7 \cdot 10^{+17}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-62}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-285}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-207}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-171}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-55}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;y \leq 900000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 118000000000:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (* a b))))
   (if (<= y -2.7e+17)
     (* y z)
     (if (<= y -5.5e-62)
       (* a t)
       (if (<= y 1.15e-285)
         t_1
         (if (<= y 9.2e-207)
           x
           (if (<= y 1.5e-171)
             t_1
             (if (<= y 1.9e-55)
               (* a t)
               (if (<= y 900000000.0)
                 t_1
                 (if (<= y 118000000000.0) (* a t) (* y z)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (a * b);
	double tmp;
	if (y <= -2.7e+17) {
		tmp = y * z;
	} else if (y <= -5.5e-62) {
		tmp = a * t;
	} else if (y <= 1.15e-285) {
		tmp = t_1;
	} else if (y <= 9.2e-207) {
		tmp = x;
	} else if (y <= 1.5e-171) {
		tmp = t_1;
	} else if (y <= 1.9e-55) {
		tmp = a * t;
	} else if (y <= 900000000.0) {
		tmp = t_1;
	} else if (y <= 118000000000.0) {
		tmp = a * t;
	} else {
		tmp = y * z;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * (a * b)
    if (y <= (-2.7d+17)) then
        tmp = y * z
    else if (y <= (-5.5d-62)) then
        tmp = a * t
    else if (y <= 1.15d-285) then
        tmp = t_1
    else if (y <= 9.2d-207) then
        tmp = x
    else if (y <= 1.5d-171) then
        tmp = t_1
    else if (y <= 1.9d-55) then
        tmp = a * t
    else if (y <= 900000000.0d0) then
        tmp = t_1
    else if (y <= 118000000000.0d0) then
        tmp = a * t
    else
        tmp = y * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (a * b);
	double tmp;
	if (y <= -2.7e+17) {
		tmp = y * z;
	} else if (y <= -5.5e-62) {
		tmp = a * t;
	} else if (y <= 1.15e-285) {
		tmp = t_1;
	} else if (y <= 9.2e-207) {
		tmp = x;
	} else if (y <= 1.5e-171) {
		tmp = t_1;
	} else if (y <= 1.9e-55) {
		tmp = a * t;
	} else if (y <= 900000000.0) {
		tmp = t_1;
	} else if (y <= 118000000000.0) {
		tmp = a * t;
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = z * (a * b)
	tmp = 0
	if y <= -2.7e+17:
		tmp = y * z
	elif y <= -5.5e-62:
		tmp = a * t
	elif y <= 1.15e-285:
		tmp = t_1
	elif y <= 9.2e-207:
		tmp = x
	elif y <= 1.5e-171:
		tmp = t_1
	elif y <= 1.9e-55:
		tmp = a * t
	elif y <= 900000000.0:
		tmp = t_1
	elif y <= 118000000000.0:
		tmp = a * t
	else:
		tmp = y * z
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(z * Float64(a * b))
	tmp = 0.0
	if (y <= -2.7e+17)
		tmp = Float64(y * z);
	elseif (y <= -5.5e-62)
		tmp = Float64(a * t);
	elseif (y <= 1.15e-285)
		tmp = t_1;
	elseif (y <= 9.2e-207)
		tmp = x;
	elseif (y <= 1.5e-171)
		tmp = t_1;
	elseif (y <= 1.9e-55)
		tmp = Float64(a * t);
	elseif (y <= 900000000.0)
		tmp = t_1;
	elseif (y <= 118000000000.0)
		tmp = Float64(a * t);
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = z * (a * b);
	tmp = 0.0;
	if (y <= -2.7e+17)
		tmp = y * z;
	elseif (y <= -5.5e-62)
		tmp = a * t;
	elseif (y <= 1.15e-285)
		tmp = t_1;
	elseif (y <= 9.2e-207)
		tmp = x;
	elseif (y <= 1.5e-171)
		tmp = t_1;
	elseif (y <= 1.9e-55)
		tmp = a * t;
	elseif (y <= 900000000.0)
		tmp = t_1;
	elseif (y <= 118000000000.0)
		tmp = a * t;
	else
		tmp = y * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e+17], N[(y * z), $MachinePrecision], If[LessEqual[y, -5.5e-62], N[(a * t), $MachinePrecision], If[LessEqual[y, 1.15e-285], t$95$1, If[LessEqual[y, 9.2e-207], x, If[LessEqual[y, 1.5e-171], t$95$1, If[LessEqual[y, 1.9e-55], N[(a * t), $MachinePrecision], If[LessEqual[y, 900000000.0], t$95$1, If[LessEqual[y, 118000000000.0], N[(a * t), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{+17}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;y \leq -5.5 \cdot 10^{-62}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{-285}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 9.2 \cdot 10^{-207}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{-171}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.9 \cdot 10^{-55}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;y \leq 900000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 118000000000:\\
\;\;\;\;a \cdot t\\

\mathbf{else}:\\
\;\;\;\;y \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.7e17 or 1.18e11 < y

    1. Initial program 88.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative88.5%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative88.5%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+88.5%

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

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative88.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out92.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot z} \]
    5. Step-by-step derivation
      1. *-commutative55.7%

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

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

    if -2.7e17 < y < -5.50000000000000022e-62 or 1.5e-171 < y < 1.8999999999999998e-55 or 9e8 < y < 1.18e11

    1. Initial program 95.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative95.1%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative95.1%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+95.1%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative95.1%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative97.4%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out97.4%

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

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

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

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

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

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

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

    if -5.50000000000000022e-62 < y < 1.14999999999999998e-285 or 9.2000000000000002e-207 < y < 1.5e-171 or 1.8999999999999998e-55 < y < 9e8

    1. Initial program 97.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.4%

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

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+97.4%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative97.4%

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out97.3%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def97.3%

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    5. Step-by-step derivation
      1. associate-*r*58.1%

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

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b\right)} \]
    6. Simplified58.1%

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

    if 1.14999999999999998e-285 < y < 9.2000000000000002e-207

    1. Initial program 94.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative94.4%

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

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+94.4%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative94.4%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative94.4%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out94.4%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification55.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{+17}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-62}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-285}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-207}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-171}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-55}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;y \leq 900000000:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq 118000000000:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 8: 70.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(y + a \cdot b\right)\\ \mathbf{if}\;z \leq -5.6 \cdot 10^{+137}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{+25}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-155}:\\ \;\;\;\;x + a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-96} \lor \neg \left(z \leq 5.1 \cdot 10^{+66}\right) \land z \leq 1.15 \cdot 10^{+87}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (+ y (* a b)))))
   (if (<= z -5.6e+137)
     t_1
     (if (<= z -7.2e+25)
       (+ x (* y z))
       (if (<= z -8.5e-155)
         (+ x (* a (* z b)))
         (if (or (<= z 6.2e-96) (and (not (<= z 5.1e+66)) (<= z 1.15e+87)))
           (+ x (* a t))
           t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (y + (a * b));
	double tmp;
	if (z <= -5.6e+137) {
		tmp = t_1;
	} else if (z <= -7.2e+25) {
		tmp = x + (y * z);
	} else if (z <= -8.5e-155) {
		tmp = x + (a * (z * b));
	} else if ((z <= 6.2e-96) || (!(z <= 5.1e+66) && (z <= 1.15e+87))) {
		tmp = x + (a * t);
	} 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 * (y + (a * b))
    if (z <= (-5.6d+137)) then
        tmp = t_1
    else if (z <= (-7.2d+25)) then
        tmp = x + (y * z)
    else if (z <= (-8.5d-155)) then
        tmp = x + (a * (z * b))
    else if ((z <= 6.2d-96) .or. (.not. (z <= 5.1d+66)) .and. (z <= 1.15d+87)) then
        tmp = x + (a * t)
    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 * (y + (a * b));
	double tmp;
	if (z <= -5.6e+137) {
		tmp = t_1;
	} else if (z <= -7.2e+25) {
		tmp = x + (y * z);
	} else if (z <= -8.5e-155) {
		tmp = x + (a * (z * b));
	} else if ((z <= 6.2e-96) || (!(z <= 5.1e+66) && (z <= 1.15e+87))) {
		tmp = x + (a * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = z * (y + (a * b))
	tmp = 0
	if z <= -5.6e+137:
		tmp = t_1
	elif z <= -7.2e+25:
		tmp = x + (y * z)
	elif z <= -8.5e-155:
		tmp = x + (a * (z * b))
	elif (z <= 6.2e-96) or (not (z <= 5.1e+66) and (z <= 1.15e+87)):
		tmp = x + (a * t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(z * Float64(y + Float64(a * b)))
	tmp = 0.0
	if (z <= -5.6e+137)
		tmp = t_1;
	elseif (z <= -7.2e+25)
		tmp = Float64(x + Float64(y * z));
	elseif (z <= -8.5e-155)
		tmp = Float64(x + Float64(a * Float64(z * b)));
	elseif ((z <= 6.2e-96) || (!(z <= 5.1e+66) && (z <= 1.15e+87)))
		tmp = Float64(x + Float64(a * t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = z * (y + (a * b));
	tmp = 0.0;
	if (z <= -5.6e+137)
		tmp = t_1;
	elseif (z <= -7.2e+25)
		tmp = x + (y * z);
	elseif (z <= -8.5e-155)
		tmp = x + (a * (z * b));
	elseif ((z <= 6.2e-96) || (~((z <= 5.1e+66)) && (z <= 1.15e+87)))
		tmp = x + (a * t);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.6e+137], t$95$1, If[LessEqual[z, -7.2e+25], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.5e-155], N[(x + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 6.2e-96], And[N[Not[LessEqual[z, 5.1e+66]], $MachinePrecision], LessEqual[z, 1.15e+87]]], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{+137}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -7.2 \cdot 10^{+25}:\\
\;\;\;\;x + y \cdot z\\

\mathbf{elif}\;z \leq -8.5 \cdot 10^{-155}:\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{-96} \lor \neg \left(z \leq 5.1 \cdot 10^{+66}\right) \land z \leq 1.15 \cdot 10^{+87}:\\
\;\;\;\;x + a \cdot t\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.60000000000000002e137 or 6.1999999999999998e-96 < z < 5.10000000000000008e66 or 1.1500000000000001e87 < z

    1. Initial program 87.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative87.8%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative87.8%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+87.8%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out96.6%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def96.7%

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

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

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

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

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

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

    if -5.60000000000000002e137 < z < -7.20000000000000031e25

    1. Initial program 94.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative94.7%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative94.7%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+94.7%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative94.7%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative100.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out100.0%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def100.0%

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

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

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

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

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

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

    if -7.20000000000000031e25 < z < -8.4999999999999996e-155

    1. Initial program 97.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+97.1%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. +-commutative97.1%

        \[\leadsto \color{blue}{\left(t \cdot a + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right)} \]
      3. *-commutative97.1%

        \[\leadsto \left(\color{blue}{a \cdot t} + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right) \]
      4. associate-*l*97.1%

        \[\leadsto \left(a \cdot t + \color{blue}{a \cdot \left(z \cdot b\right)}\right) + \left(x + y \cdot z\right) \]
      5. distribute-lft-out99.9%

        \[\leadsto \color{blue}{a \cdot \left(t + z \cdot b\right)} + \left(x + y \cdot z\right) \]
      6. fma-def99.9%

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

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

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

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

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

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

    if -8.4999999999999996e-155 < z < 6.1999999999999998e-96 or 5.10000000000000008e66 < z < 1.1500000000000001e87

    1. Initial program 97.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.4%

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

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+97.4%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative97.4%

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out91.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot t + x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.6 \cdot 10^{+137}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{+25}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-155}:\\ \;\;\;\;x + a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-96} \lor \neg \left(z \leq 5.1 \cdot 10^{+66}\right) \land z \leq 1.15 \cdot 10^{+87}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \end{array} \]

Alternative 9: 68.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(y + a \cdot b\right)\\ \mathbf{if}\;z \leq -1.2 \cdot 10^{+136}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+26}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-154}:\\ \;\;\;\;x + a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-96}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+49} \lor \neg \left(z \leq 4 \cdot 10^{+161}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot t + y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (+ y (* a b)))))
   (if (<= z -1.2e+136)
     t_1
     (if (<= z -1.1e+26)
       (+ x (* y z))
       (if (<= z -1.2e-154)
         (+ x (* a (* z b)))
         (if (<= z 6.2e-96)
           (+ x (* a t))
           (if (or (<= z 1.9e+49) (not (<= z 4e+161)))
             t_1
             (+ (* a t) (* y z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (y + (a * b));
	double tmp;
	if (z <= -1.2e+136) {
		tmp = t_1;
	} else if (z <= -1.1e+26) {
		tmp = x + (y * z);
	} else if (z <= -1.2e-154) {
		tmp = x + (a * (z * b));
	} else if (z <= 6.2e-96) {
		tmp = x + (a * t);
	} else if ((z <= 1.9e+49) || !(z <= 4e+161)) {
		tmp = t_1;
	} else {
		tmp = (a * t) + (y * z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * (y + (a * b))
    if (z <= (-1.2d+136)) then
        tmp = t_1
    else if (z <= (-1.1d+26)) then
        tmp = x + (y * z)
    else if (z <= (-1.2d-154)) then
        tmp = x + (a * (z * b))
    else if (z <= 6.2d-96) then
        tmp = x + (a * t)
    else if ((z <= 1.9d+49) .or. (.not. (z <= 4d+161))) then
        tmp = t_1
    else
        tmp = (a * t) + (y * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (y + (a * b));
	double tmp;
	if (z <= -1.2e+136) {
		tmp = t_1;
	} else if (z <= -1.1e+26) {
		tmp = x + (y * z);
	} else if (z <= -1.2e-154) {
		tmp = x + (a * (z * b));
	} else if (z <= 6.2e-96) {
		tmp = x + (a * t);
	} else if ((z <= 1.9e+49) || !(z <= 4e+161)) {
		tmp = t_1;
	} else {
		tmp = (a * t) + (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = z * (y + (a * b))
	tmp = 0
	if z <= -1.2e+136:
		tmp = t_1
	elif z <= -1.1e+26:
		tmp = x + (y * z)
	elif z <= -1.2e-154:
		tmp = x + (a * (z * b))
	elif z <= 6.2e-96:
		tmp = x + (a * t)
	elif (z <= 1.9e+49) or not (z <= 4e+161):
		tmp = t_1
	else:
		tmp = (a * t) + (y * z)
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(z * Float64(y + Float64(a * b)))
	tmp = 0.0
	if (z <= -1.2e+136)
		tmp = t_1;
	elseif (z <= -1.1e+26)
		tmp = Float64(x + Float64(y * z));
	elseif (z <= -1.2e-154)
		tmp = Float64(x + Float64(a * Float64(z * b)));
	elseif (z <= 6.2e-96)
		tmp = Float64(x + Float64(a * t));
	elseif ((z <= 1.9e+49) || !(z <= 4e+161))
		tmp = t_1;
	else
		tmp = Float64(Float64(a * t) + Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = z * (y + (a * b));
	tmp = 0.0;
	if (z <= -1.2e+136)
		tmp = t_1;
	elseif (z <= -1.1e+26)
		tmp = x + (y * z);
	elseif (z <= -1.2e-154)
		tmp = x + (a * (z * b));
	elseif (z <= 6.2e-96)
		tmp = x + (a * t);
	elseif ((z <= 1.9e+49) || ~((z <= 4e+161)))
		tmp = t_1;
	else
		tmp = (a * t) + (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+136], t$95$1, If[LessEqual[z, -1.1e+26], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.2e-154], N[(x + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e-96], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.9e+49], N[Not[LessEqual[z, 4e+161]], $MachinePrecision]], t$95$1, N[(N[(a * t), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+136}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.1 \cdot 10^{+26}:\\
\;\;\;\;x + y \cdot z\\

\mathbf{elif}\;z \leq -1.2 \cdot 10^{-154}:\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{-96}:\\
\;\;\;\;x + a \cdot t\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+49} \lor \neg \left(z \leq 4 \cdot 10^{+161}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;a \cdot t + y \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.2e136 or 6.1999999999999998e-96 < z < 1.8999999999999999e49 or 4.0000000000000002e161 < z

    1. Initial program 85.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative85.6%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative85.6%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+85.6%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out96.0%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def96.0%

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

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

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

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

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

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

    if -1.2e136 < z < -1.10000000000000004e26

    1. Initial program 94.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative94.7%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative94.7%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+94.7%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative94.7%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative100.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out100.0%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def100.0%

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

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

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

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

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

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

    if -1.10000000000000004e26 < z < -1.19999999999999993e-154

    1. Initial program 97.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+97.1%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. +-commutative97.1%

        \[\leadsto \color{blue}{\left(t \cdot a + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right)} \]
      3. *-commutative97.1%

        \[\leadsto \left(\color{blue}{a \cdot t} + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right) \]
      4. associate-*l*97.1%

        \[\leadsto \left(a \cdot t + \color{blue}{a \cdot \left(z \cdot b\right)}\right) + \left(x + y \cdot z\right) \]
      5. distribute-lft-out99.9%

        \[\leadsto \color{blue}{a \cdot \left(t + z \cdot b\right)} + \left(x + y \cdot z\right) \]
      6. fma-def99.9%

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

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

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

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

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

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

    if -1.19999999999999993e-154 < z < 6.1999999999999998e-96

    1. Initial program 100.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative100.0%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+100.0%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative100.0%

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out93.3%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def93.3%

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

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

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

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

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

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

    if 1.8999999999999999e49 < z < 4.0000000000000002e161

    1. Initial program 92.2%

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

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

      \[\leadsto \color{blue}{y \cdot z + a \cdot t} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification81.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+136}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+26}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-154}:\\ \;\;\;\;x + a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-96}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+49} \lor \neg \left(z \leq 4 \cdot 10^{+161}\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t + y \cdot z\\ \end{array} \]

Alternative 10: 93.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+213}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot t + a \cdot \left(z \cdot b\right)\right) + \left(x + y \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -4.2e+213)
   (* z (+ y (* a b)))
   (+ (+ (* a t) (* a (* z b))) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.2e+213) {
		tmp = z * (y + (a * b));
	} else {
		tmp = ((a * t) + (a * (z * b))) + (x + (y * z));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (z <= (-4.2d+213)) then
        tmp = z * (y + (a * b))
    else
        tmp = ((a * t) + (a * (z * b))) + (x + (y * z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.2e+213) {
		tmp = z * (y + (a * b));
	} else {
		tmp = ((a * t) + (a * (z * b))) + (x + (y * z));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -4.2e+213:
		tmp = z * (y + (a * b))
	else:
		tmp = ((a * t) + (a * (z * b))) + (x + (y * z))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -4.2e+213)
		tmp = Float64(z * Float64(y + Float64(a * b)));
	else
		tmp = Float64(Float64(Float64(a * t) + Float64(a * Float64(z * b))) + Float64(x + Float64(y * z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -4.2e+213)
		tmp = z * (y + (a * b));
	else
		tmp = ((a * t) + (a * (z * b))) + (x + (y * z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.2e+213], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.2000000000000001e213

    1. Initial program 74.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative74.9%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative74.9%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+74.9%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative74.9%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative78.4%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out92.7%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def92.7%

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

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

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

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

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

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

    if -4.2000000000000001e213 < z

    1. Initial program 94.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+94.7%

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified94.8%

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+213}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot t + a \cdot \left(z \cdot b\right)\right) + \left(x + y \cdot z\right)\\ \end{array} \]

Alternative 11: 60.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ \mathbf{if}\;z \leq -1.25 \cdot 10^{+224}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{+58}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-38}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+49}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* y z))))
   (if (<= z -1.25e+224)
     (* a (* z b))
     (if (<= z -2.15e+58)
       t_1
       (if (<= z 5.6e-38)
         (+ x (* a t))
         (if (<= z 1.95e+49)
           (* z (* a b))
           (if (<= z 1.08e+88) (* a t) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double tmp;
	if (z <= -1.25e+224) {
		tmp = a * (z * b);
	} else if (z <= -2.15e+58) {
		tmp = t_1;
	} else if (z <= 5.6e-38) {
		tmp = x + (a * t);
	} else if (z <= 1.95e+49) {
		tmp = z * (a * b);
	} else if (z <= 1.08e+88) {
		tmp = a * t;
	} 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 = x + (y * z)
    if (z <= (-1.25d+224)) then
        tmp = a * (z * b)
    else if (z <= (-2.15d+58)) then
        tmp = t_1
    else if (z <= 5.6d-38) then
        tmp = x + (a * t)
    else if (z <= 1.95d+49) then
        tmp = z * (a * b)
    else if (z <= 1.08d+88) then
        tmp = a * t
    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 = x + (y * z);
	double tmp;
	if (z <= -1.25e+224) {
		tmp = a * (z * b);
	} else if (z <= -2.15e+58) {
		tmp = t_1;
	} else if (z <= 5.6e-38) {
		tmp = x + (a * t);
	} else if (z <= 1.95e+49) {
		tmp = z * (a * b);
	} else if (z <= 1.08e+88) {
		tmp = a * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * z)
	tmp = 0
	if z <= -1.25e+224:
		tmp = a * (z * b)
	elif z <= -2.15e+58:
		tmp = t_1
	elif z <= 5.6e-38:
		tmp = x + (a * t)
	elif z <= 1.95e+49:
		tmp = z * (a * b)
	elif z <= 1.08e+88:
		tmp = a * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	tmp = 0.0
	if (z <= -1.25e+224)
		tmp = Float64(a * Float64(z * b));
	elseif (z <= -2.15e+58)
		tmp = t_1;
	elseif (z <= 5.6e-38)
		tmp = Float64(x + Float64(a * t));
	elseif (z <= 1.95e+49)
		tmp = Float64(z * Float64(a * b));
	elseif (z <= 1.08e+88)
		tmp = Float64(a * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (y * z);
	tmp = 0.0;
	if (z <= -1.25e+224)
		tmp = a * (z * b);
	elseif (z <= -2.15e+58)
		tmp = t_1;
	elseif (z <= 5.6e-38)
		tmp = x + (a * t);
	elseif (z <= 1.95e+49)
		tmp = z * (a * b);
	elseif (z <= 1.08e+88)
		tmp = a * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+224], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.15e+58], t$95$1, If[LessEqual[z, 5.6e-38], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+49], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.08e+88], N[(a * t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.15 \cdot 10^{+58}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 5.6 \cdot 10^{-38}:\\
\;\;\;\;x + a \cdot t\\

\mathbf{elif}\;z \leq 1.95 \cdot 10^{+49}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\
\;\;\;\;a \cdot t\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.24999999999999991e224

    1. Initial program 74.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative74.9%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative74.9%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+74.9%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative74.9%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative79.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out91.5%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def91.5%

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(z \cdot b\right)} \]
    6. Simplified75.5%

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

    if -1.24999999999999991e224 < z < -2.14999999999999996e58 or 1.08000000000000003e88 < z

    1. Initial program 89.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative89.6%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative89.6%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+89.6%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out97.8%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def97.8%

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

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

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

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

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

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

    if -2.14999999999999996e58 < z < 5.6e-38

    1. Initial program 99.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative99.1%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative99.1%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+99.1%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative99.1%

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out93.6%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def93.6%

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

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

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

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

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

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

    if 5.6e-38 < z < 1.95e49

    1. Initial program 99.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative99.8%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative99.8%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+99.8%

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

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative100.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out100.0%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    5. Step-by-step derivation
      1. associate-*r*72.7%

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

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b\right)} \]
    6. Simplified72.7%

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

    if 1.95e49 < z < 1.08000000000000003e88

    1. Initial program 79.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative79.8%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative79.8%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+79.8%

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

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative80.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out80.0%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+224}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{+58}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-38}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+49}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]

Alternative 12: 83.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5.8 \cdot 10^{+145}:\\ \;\;\;\;b \cdot \left(z \cdot a\right) + \left(a \cdot t + y \cdot z\right)\\ \mathbf{elif}\;b \leq 9 \cdot 10^{+150}:\\ \;\;\;\;\left(x + a \cdot t\right) + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -5.8e+145)
   (+ (* b (* z a)) (+ (* a t) (* y z)))
   (if (<= b 9e+150) (+ (+ x (* a t)) (* y z)) (+ x (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -5.8e+145) {
		tmp = (b * (z * a)) + ((a * t) + (y * z));
	} else if (b <= 9e+150) {
		tmp = (x + (a * t)) + (y * z);
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	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 (b <= (-5.8d+145)) then
        tmp = (b * (z * a)) + ((a * t) + (y * z))
    else if (b <= 9d+150) then
        tmp = (x + (a * t)) + (y * z)
    else
        tmp = x + (a * (t + (z * b)))
    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 (b <= -5.8e+145) {
		tmp = (b * (z * a)) + ((a * t) + (y * z));
	} else if (b <= 9e+150) {
		tmp = (x + (a * t)) + (y * z);
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -5.8e+145:
		tmp = (b * (z * a)) + ((a * t) + (y * z))
	elif b <= 9e+150:
		tmp = (x + (a * t)) + (y * z)
	else:
		tmp = x + (a * (t + (z * b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -5.8e+145)
		tmp = Float64(Float64(b * Float64(z * a)) + Float64(Float64(a * t) + Float64(y * z)));
	elseif (b <= 9e+150)
		tmp = Float64(Float64(x + Float64(a * t)) + Float64(y * z));
	else
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -5.8e+145)
		tmp = (b * (z * a)) + ((a * t) + (y * z));
	elseif (b <= 9e+150)
		tmp = (x + (a * t)) + (y * z);
	else
		tmp = x + (a * (t + (z * b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5.8e+145], N[(N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9e+150], N[(N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 9 \cdot 10^{+150}:\\
\;\;\;\;\left(x + a \cdot t\right) + y \cdot z\\

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


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

    1. Initial program 94.0%

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

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

    if -5.8000000000000001e145 < b < 9.00000000000000001e150

    1. Initial program 94.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative94.6%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative94.6%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+94.6%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out98.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot z + \left(a \cdot t + x\right)} \]

    if 9.00000000000000001e150 < b

    1. Initial program 82.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+82.0%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. +-commutative82.0%

        \[\leadsto \color{blue}{\left(t \cdot a + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right)} \]
      3. *-commutative82.0%

        \[\leadsto \left(\color{blue}{a \cdot t} + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right) \]
      4. associate-*l*77.2%

        \[\leadsto \left(a \cdot t + \color{blue}{a \cdot \left(z \cdot b\right)}\right) + \left(x + y \cdot z\right) \]
      5. distribute-lft-out84.9%

        \[\leadsto \color{blue}{a \cdot \left(t + z \cdot b\right)} + \left(x + y \cdot z\right) \]
      6. fma-def84.9%

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot \left(z \cdot b + t\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.8 \cdot 10^{+145}:\\ \;\;\;\;b \cdot \left(z \cdot a\right) + \left(a \cdot t + y \cdot z\right)\\ \mathbf{elif}\;b \leq 9 \cdot 10^{+150}:\\ \;\;\;\;\left(x + a \cdot t\right) + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 13: 38.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+77}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-203}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-134}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -3.1e+77)
   (* y z)
   (if (<= z -1.25e-203)
     x
     (if (<= z 3.8e-134)
       (* a t)
       (if (<= z 4.4e-58) x (if (<= z 1.08e+88) (* a t) (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -3.1e+77) {
		tmp = y * z;
	} else if (z <= -1.25e-203) {
		tmp = x;
	} else if (z <= 3.8e-134) {
		tmp = a * t;
	} else if (z <= 4.4e-58) {
		tmp = x;
	} else if (z <= 1.08e+88) {
		tmp = a * t;
	} else {
		tmp = y * z;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (z <= (-3.1d+77)) then
        tmp = y * z
    else if (z <= (-1.25d-203)) then
        tmp = x
    else if (z <= 3.8d-134) then
        tmp = a * t
    else if (z <= 4.4d-58) then
        tmp = x
    else if (z <= 1.08d+88) then
        tmp = a * t
    else
        tmp = y * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -3.1e+77) {
		tmp = y * z;
	} else if (z <= -1.25e-203) {
		tmp = x;
	} else if (z <= 3.8e-134) {
		tmp = a * t;
	} else if (z <= 4.4e-58) {
		tmp = x;
	} else if (z <= 1.08e+88) {
		tmp = a * t;
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -3.1e+77:
		tmp = y * z
	elif z <= -1.25e-203:
		tmp = x
	elif z <= 3.8e-134:
		tmp = a * t
	elif z <= 4.4e-58:
		tmp = x
	elif z <= 1.08e+88:
		tmp = a * t
	else:
		tmp = y * z
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -3.1e+77)
		tmp = Float64(y * z);
	elseif (z <= -1.25e-203)
		tmp = x;
	elseif (z <= 3.8e-134)
		tmp = Float64(a * t);
	elseif (z <= 4.4e-58)
		tmp = x;
	elseif (z <= 1.08e+88)
		tmp = Float64(a * t);
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -3.1e+77)
		tmp = y * z;
	elseif (z <= -1.25e-203)
		tmp = x;
	elseif (z <= 3.8e-134)
		tmp = a * t;
	elseif (z <= 4.4e-58)
		tmp = x;
	elseif (z <= 1.08e+88)
		tmp = a * t;
	else
		tmp = y * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.1e+77], N[(y * z), $MachinePrecision], If[LessEqual[z, -1.25e-203], x, If[LessEqual[z, 3.8e-134], N[(a * t), $MachinePrecision], If[LessEqual[z, 4.4e-58], x, If[LessEqual[z, 1.08e+88], N[(a * t), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+77}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;z \leq -1.25 \cdot 10^{-203}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{-134}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;z \leq 4.4 \cdot 10^{-58}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\
\;\;\;\;a \cdot t\\

\mathbf{else}:\\
\;\;\;\;y \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.09999999999999999e77 or 1.08000000000000003e88 < z

    1. Initial program 86.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative86.0%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative86.0%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+86.0%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative86.0%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative92.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out96.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot z} \]
    5. Step-by-step derivation
      1. *-commutative47.3%

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified47.3%

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

    if -3.09999999999999999e77 < z < -1.25e-203 or 3.80000000000000003e-134 < z < 4.40000000000000011e-58

    1. Initial program 98.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative98.5%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative98.5%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+98.5%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out94.6%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def94.6%

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

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

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

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

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

      \[\leadsto \color{blue}{x} \]

    if -1.25e-203 < z < 3.80000000000000003e-134 or 4.40000000000000011e-58 < z < 1.08000000000000003e88

    1. Initial program 97.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative97.2%

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

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+97.2%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out91.8%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def94.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+77}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-203}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-134}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 14: 81.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+77} \lor \neg \left(z \leq 7.2 \cdot 10^{+87}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.8000000000000001e77 or 7.19999999999999988e87 < z

    1. Initial program 86.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative86.1%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative86.1%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+86.1%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative86.1%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative92.1%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out96.4%

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

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

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

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

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

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

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

    if -3.8000000000000001e77 < z < 7.19999999999999988e87

    1. Initial program 97.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+97.8%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. +-commutative97.8%

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

        \[\leadsto \left(\color{blue}{a \cdot t} + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right) \]
      4. associate-*l*97.8%

        \[\leadsto \left(a \cdot t + \color{blue}{a \cdot \left(z \cdot b\right)}\right) + \left(x + y \cdot z\right) \]
      5. distribute-lft-out99.2%

        \[\leadsto \color{blue}{a \cdot \left(t + z \cdot b\right)} + \left(x + y \cdot z\right) \]
      6. fma-def99.2%

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot \left(z \cdot b + t\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+77} \lor \neg \left(z \leq 7.2 \cdot 10^{+87}\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 15: 85.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{+91} \lor \neg \left(b \leq 9.5 \cdot 10^{+150}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + a \cdot t\right) + y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= b -4e+91) (not (<= b 9.5e+150)))
   (+ x (* a (+ t (* z b))))
   (+ (+ x (* a t)) (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((b <= -4e+91) || !(b <= 9.5e+150)) {
		tmp = x + (a * (t + (z * b)));
	} else {
		tmp = (x + (a * t)) + (y * z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((b <= (-4d+91)) .or. (.not. (b <= 9.5d+150))) then
        tmp = x + (a * (t + (z * b)))
    else
        tmp = (x + (a * t)) + (y * z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((b <= -4e+91) || !(b <= 9.5e+150)) {
		tmp = x + (a * (t + (z * b)));
	} else {
		tmp = (x + (a * t)) + (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (b <= -4e+91) or not (b <= 9.5e+150):
		tmp = x + (a * (t + (z * b)))
	else:
		tmp = (x + (a * t)) + (y * z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((b <= -4e+91) || !(b <= 9.5e+150))
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	else
		tmp = Float64(Float64(x + Float64(a * t)) + Float64(y * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((b <= -4e+91) || ~((b <= 9.5e+150)))
		tmp = x + (a * (t + (z * b)));
	else
		tmp = (x + (a * t)) + (y * z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4e+91], N[Not[LessEqual[b, 9.5e+150]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+91} \lor \neg \left(b \leq 9.5 \cdot 10^{+150}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.00000000000000032e91 or 9.5000000000000001e150 < b

    1. Initial program 87.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+87.8%

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. +-commutative87.8%

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

        \[\leadsto \left(\color{blue}{a \cdot t} + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right) \]
      4. associate-*l*83.7%

        \[\leadsto \left(a \cdot t + \color{blue}{a \cdot \left(z \cdot b\right)}\right) + \left(x + y \cdot z\right) \]
      5. distribute-lft-out88.1%

        \[\leadsto \color{blue}{a \cdot \left(t + z \cdot b\right)} + \left(x + y \cdot z\right) \]
      6. fma-def88.1%

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

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

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

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

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

    if -4.00000000000000032e91 < b < 9.5000000000000001e150

    1. Initial program 95.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative95.2%

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

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+95.2%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out99.3%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def99.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{+91} \lor \neg \left(b \leq 9.5 \cdot 10^{+150}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + a \cdot t\right) + y \cdot z\\ \end{array} \]

Alternative 16: 56.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.7 \cdot 10^{+135}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-38}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+49}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -5.7e+135)
   (* a (* z b))
   (if (<= z 5.6e-38)
     (+ x (* a t))
     (if (<= z 1.95e+49) (* z (* a b)) (if (<= z 1.08e+88) (* a t) (* y z))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -5.7e+135) {
		tmp = a * (z * b);
	} else if (z <= 5.6e-38) {
		tmp = x + (a * t);
	} else if (z <= 1.95e+49) {
		tmp = z * (a * b);
	} else if (z <= 1.08e+88) {
		tmp = a * t;
	} else {
		tmp = y * z;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (z <= (-5.7d+135)) then
        tmp = a * (z * b)
    else if (z <= 5.6d-38) then
        tmp = x + (a * t)
    else if (z <= 1.95d+49) then
        tmp = z * (a * b)
    else if (z <= 1.08d+88) then
        tmp = a * t
    else
        tmp = y * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -5.7e+135) {
		tmp = a * (z * b);
	} else if (z <= 5.6e-38) {
		tmp = x + (a * t);
	} else if (z <= 1.95e+49) {
		tmp = z * (a * b);
	} else if (z <= 1.08e+88) {
		tmp = a * t;
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -5.7e+135:
		tmp = a * (z * b)
	elif z <= 5.6e-38:
		tmp = x + (a * t)
	elif z <= 1.95e+49:
		tmp = z * (a * b)
	elif z <= 1.08e+88:
		tmp = a * t
	else:
		tmp = y * z
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -5.7e+135)
		tmp = Float64(a * Float64(z * b));
	elseif (z <= 5.6e-38)
		tmp = Float64(x + Float64(a * t));
	elseif (z <= 1.95e+49)
		tmp = Float64(z * Float64(a * b));
	elseif (z <= 1.08e+88)
		tmp = Float64(a * t);
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -5.7e+135)
		tmp = a * (z * b);
	elseif (z <= 5.6e-38)
		tmp = x + (a * t);
	elseif (z <= 1.95e+49)
		tmp = z * (a * b);
	elseif (z <= 1.08e+88)
		tmp = a * t;
	else
		tmp = y * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.7e+135], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e-38], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.95e+49], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.08e+88], N[(a * t), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.7 \cdot 10^{+135}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;z \leq 5.6 \cdot 10^{-38}:\\
\;\;\;\;x + a \cdot t\\

\mathbf{elif}\;z \leq 1.95 \cdot 10^{+49}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\
\;\;\;\;a \cdot t\\

\mathbf{else}:\\
\;\;\;\;y \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -5.7000000000000002e135

    1. Initial program 83.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative83.7%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative83.7%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+83.7%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative83.7%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative85.9%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out95.2%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def95.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, a \cdot b + y, x + t \cdot a\right)} \]
      10. fma-def95.2%

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

        \[\leadsto \mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \color{blue}{t \cdot a + x}\right) \]
      12. fma-def95.2%

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

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

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

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

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

    if -5.7000000000000002e135 < z < 5.6e-38

    1. Initial program 98.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative98.5%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative98.5%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+98.5%

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

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

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

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out94.3%

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

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

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

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

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

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

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

    if 5.6e-38 < z < 1.95e49

    1. Initial program 99.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative99.8%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative99.8%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+99.8%

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

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative100.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out100.0%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot z\right)} \]
    5. Step-by-step derivation
      1. associate-*r*72.7%

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

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b\right)} \]
    6. Simplified72.7%

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

    if 1.95e49 < z < 1.08000000000000003e88

    1. Initial program 79.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative79.8%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative79.8%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+79.8%

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

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative80.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out80.0%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def100.0%

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

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

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

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

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

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

    if 1.08000000000000003e88 < z

    1. Initial program 86.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative86.8%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative86.8%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+86.8%

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

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative94.9%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out96.6%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def96.6%

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot z} \]
    5. Step-by-step derivation
      1. *-commutative51.9%

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified51.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.7 \cdot 10^{+135}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-38}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+49}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 1.08 \cdot 10^{+88}:\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 17: 39.9% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.2 \cdot 10^{+16}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -2.2e+16) (* a t) (if (<= t 2.5e+101) x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -2.2e+16) {
		tmp = a * t;
	} else if (t <= 2.5e+101) {
		tmp = x;
	} 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 (t <= (-2.2d+16)) then
        tmp = a * t
    else if (t <= 2.5d+101) then
        tmp = x
    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 (t <= -2.2e+16) {
		tmp = a * t;
	} else if (t <= 2.5e+101) {
		tmp = x;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -2.2e+16:
		tmp = a * t
	elif t <= 2.5e+101:
		tmp = x
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -2.2e+16)
		tmp = Float64(a * t);
	elseif (t <= 2.5e+101)
		tmp = x;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -2.2e+16)
		tmp = a * t;
	elseif (t <= 2.5e+101)
		tmp = x;
	else
		tmp = a * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.2e+16], N[(a * t), $MachinePrecision], If[LessEqual[t, 2.5e+101], x, N[(a * t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+16}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;t \leq 2.5 \cdot 10^{+101}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;a \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.2e16 or 2.49999999999999994e101 < t

    1. Initial program 89.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative89.1%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative89.1%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+89.1%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative89.1%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative89.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out92.0%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def94.0%

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

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

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

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

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

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

    if -2.2e16 < t < 2.49999999999999994e101

    1. Initial program 94.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. +-commutative94.9%

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
      2. +-commutative94.9%

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

        \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
      4. associate-+r+94.9%

        \[\leadsto \color{blue}{\left(\left(a \cdot z\right) \cdot b + y \cdot z\right) + \left(x + t \cdot a\right)} \]
      5. *-commutative94.9%

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

        \[\leadsto \left(\color{blue}{z \cdot \left(a \cdot b\right)} + y \cdot z\right) + \left(x + t \cdot a\right) \]
      7. *-commutative95.0%

        \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
      8. distribute-lft-out96.3%

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b + y\right)} + \left(x + t \cdot a\right) \]
      9. fma-def96.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.2 \cdot 10^{+16}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+101}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 18: 27.1% accurate, 15.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 92.6%

    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
  2. Step-by-step derivation
    1. +-commutative92.6%

      \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b + \left(\left(x + y \cdot z\right) + t \cdot a\right)} \]
    2. +-commutative92.6%

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

      \[\leadsto \left(a \cdot z\right) \cdot b + \color{blue}{\left(y \cdot z + \left(x + t \cdot a\right)\right)} \]
    4. associate-+r+92.6%

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

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

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

      \[\leadsto \left(z \cdot \left(a \cdot b\right) + \color{blue}{z \cdot y}\right) + \left(x + t \cdot a\right) \]
    8. distribute-lft-out94.6%

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification22.9%

    \[\leadsto x \]

Developer target: 97.5% accurate, 0.9× 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 2023172 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :herbie-target
  (if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

  (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))