Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.6% → 95.5%
Time: 9.8s
Alternatives: 14
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 92.6% 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: 95.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ \mathbf{if}\;b \cdot \left(z \cdot a\right) + \left(t_1 + a \cdot t\right) \leq \infty:\\ \;\;\;\;t_1 + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* y z))))
   (if (<= (+ (* b (* z a)) (+ t_1 (* a t))) INFINITY)
     (+ t_1 (+ (* a (* z b)) (* a t)))
     (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double tmp;
	if (((b * (z * a)) + (t_1 + (a * t))) <= ((double) INFINITY)) {
		tmp = t_1 + ((a * (z * b)) + (a * t));
	} else {
		tmp = a * (t + (z * b));
	}
	return tmp;
}
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 (((b * (z * a)) + (t_1 + (a * t))) <= Double.POSITIVE_INFINITY) {
		tmp = t_1 + ((a * (z * b)) + (a * t));
	} else {
		tmp = a * (t + (z * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * z)
	tmp = 0
	if ((b * (z * a)) + (t_1 + (a * t))) <= math.inf:
		tmp = t_1 + ((a * (z * b)) + (a * t))
	else:
		tmp = a * (t + (z * b))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	tmp = 0.0
	if (Float64(Float64(b * Float64(z * a)) + Float64(t_1 + Float64(a * t))) <= Inf)
		tmp = Float64(t_1 + Float64(Float64(a * Float64(z * b)) + Float64(a * t)));
	else
		tmp = Float64(a * Float64(t + Float64(z * b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (y * z);
	tmp = 0.0;
	if (((b * (z * a)) + (t_1 + (a * t))) <= Inf)
		tmp = t_1 + ((a * (z * b)) + (a * t));
	else
		tmp = a * (t + (z * b));
	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[N[(N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \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 96.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+96.9%

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

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

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

    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. associate-+l+0.0%

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

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

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

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

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

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

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

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

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

Alternative 2: 94.2% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)
\end{array}
Derivation
  1. Initial program 93.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. associate-+l+93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 38.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;a \leq -7.2 \cdot 10^{+241}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{+154}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -6.5 \cdot 10^{+121}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -2500000000:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-230}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 15500:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 2.3 \cdot 10^{+161}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= a -7.2e+241)
     t_1
     (if (<= a -2.3e+154)
       (* a t)
       (if (<= a -6.5e+121)
         t_1
         (if (<= a -2500000000.0)
           (* a t)
           (if (<= a 9.5e-230)
             x
             (if (<= a 15500.0)
               (* y z)
               (if (<= a 2.3e+161) t_1 (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (a <= -7.2e+241) {
		tmp = t_1;
	} else if (a <= -2.3e+154) {
		tmp = a * t;
	} else if (a <= -6.5e+121) {
		tmp = t_1;
	} else if (a <= -2500000000.0) {
		tmp = a * t;
	} else if (a <= 9.5e-230) {
		tmp = x;
	} else if (a <= 15500.0) {
		tmp = y * z;
	} else if (a <= 2.3e+161) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (a <= (-7.2d+241)) then
        tmp = t_1
    else if (a <= (-2.3d+154)) then
        tmp = a * t
    else if (a <= (-6.5d+121)) then
        tmp = t_1
    else if (a <= (-2500000000.0d0)) then
        tmp = a * t
    else if (a <= 9.5d-230) then
        tmp = x
    else if (a <= 15500.0d0) then
        tmp = y * z
    else if (a <= 2.3d+161) then
        tmp = t_1
    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 t_1 = a * (z * b);
	double tmp;
	if (a <= -7.2e+241) {
		tmp = t_1;
	} else if (a <= -2.3e+154) {
		tmp = a * t;
	} else if (a <= -6.5e+121) {
		tmp = t_1;
	} else if (a <= -2500000000.0) {
		tmp = a * t;
	} else if (a <= 9.5e-230) {
		tmp = x;
	} else if (a <= 15500.0) {
		tmp = y * z;
	} else if (a <= 2.3e+161) {
		tmp = t_1;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if a <= -7.2e+241:
		tmp = t_1
	elif a <= -2.3e+154:
		tmp = a * t
	elif a <= -6.5e+121:
		tmp = t_1
	elif a <= -2500000000.0:
		tmp = a * t
	elif a <= 9.5e-230:
		tmp = x
	elif a <= 15500.0:
		tmp = y * z
	elif a <= 2.3e+161:
		tmp = t_1
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (a <= -7.2e+241)
		tmp = t_1;
	elseif (a <= -2.3e+154)
		tmp = Float64(a * t);
	elseif (a <= -6.5e+121)
		tmp = t_1;
	elseif (a <= -2500000000.0)
		tmp = Float64(a * t);
	elseif (a <= 9.5e-230)
		tmp = x;
	elseif (a <= 15500.0)
		tmp = Float64(y * z);
	elseif (a <= 2.3e+161)
		tmp = t_1;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (a <= -7.2e+241)
		tmp = t_1;
	elseif (a <= -2.3e+154)
		tmp = a * t;
	elseif (a <= -6.5e+121)
		tmp = t_1;
	elseif (a <= -2500000000.0)
		tmp = a * t;
	elseif (a <= 9.5e-230)
		tmp = x;
	elseif (a <= 15500.0)
		tmp = y * z;
	elseif (a <= 2.3e+161)
		tmp = t_1;
	else
		tmp = a * t;
	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[a, -7.2e+241], t$95$1, If[LessEqual[a, -2.3e+154], N[(a * t), $MachinePrecision], If[LessEqual[a, -6.5e+121], t$95$1, If[LessEqual[a, -2500000000.0], N[(a * t), $MachinePrecision], If[LessEqual[a, 9.5e-230], x, If[LessEqual[a, 15500.0], N[(y * z), $MachinePrecision], If[LessEqual[a, 2.3e+161], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.3 \cdot 10^{+154}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq -6.5 \cdot 10^{+121}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -2500000000:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-230}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 15500:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 2.3 \cdot 10^{+161}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;a \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -7.19999999999999966e241 or -2.3e154 < a < -6.50000000000000019e121 or 15500 < a < 2.2999999999999999e161

    1. Initial program 83.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+83.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(z \cdot b\right)} \]
    8. Simplified62.9%

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

    if -7.19999999999999966e241 < a < -2.3e154 or -6.50000000000000019e121 < a < -2.5e9 or 2.2999999999999999e161 < a

    1. Initial program 90.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+90.8%

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

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

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

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

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

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

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

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

    if -2.5e9 < a < 9.5000000000000004e-230

    1. Initial program 98.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+98.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*96.4%

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Taylor expanded in x around inf 56.8%

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

    if 9.5000000000000004e-230 < a < 15500

    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. associate-+l+100.0%

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

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Taylor expanded in y around inf 49.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.2 \cdot 10^{+241}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{+154}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -6.5 \cdot 10^{+121}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -2500000000:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-230}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 15500:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 2.3 \cdot 10^{+161}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 4: 38.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;a \leq -1.1 \cdot 10^{+243}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -4.3 \cdot 10^{+154}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -3.8 \cdot 10^{+120}:\\ \;\;\;\;b \cdot \left(z \cdot a\right)\\ \mathbf{elif}\;a \leq -5800000000:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{-226}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 6500:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{+161}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= a -1.1e+243)
     t_1
     (if (<= a -4.3e+154)
       (* a t)
       (if (<= a -3.8e+120)
         (* b (* z a))
         (if (<= a -5800000000.0)
           (* a t)
           (if (<= a 2.6e-226)
             x
             (if (<= a 6500.0) (* y z) (if (<= a 3.6e+161) t_1 (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (a <= -1.1e+243) {
		tmp = t_1;
	} else if (a <= -4.3e+154) {
		tmp = a * t;
	} else if (a <= -3.8e+120) {
		tmp = b * (z * a);
	} else if (a <= -5800000000.0) {
		tmp = a * t;
	} else if (a <= 2.6e-226) {
		tmp = x;
	} else if (a <= 6500.0) {
		tmp = y * z;
	} else if (a <= 3.6e+161) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (a <= (-1.1d+243)) then
        tmp = t_1
    else if (a <= (-4.3d+154)) then
        tmp = a * t
    else if (a <= (-3.8d+120)) then
        tmp = b * (z * a)
    else if (a <= (-5800000000.0d0)) then
        tmp = a * t
    else if (a <= 2.6d-226) then
        tmp = x
    else if (a <= 6500.0d0) then
        tmp = y * z
    else if (a <= 3.6d+161) then
        tmp = t_1
    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 t_1 = a * (z * b);
	double tmp;
	if (a <= -1.1e+243) {
		tmp = t_1;
	} else if (a <= -4.3e+154) {
		tmp = a * t;
	} else if (a <= -3.8e+120) {
		tmp = b * (z * a);
	} else if (a <= -5800000000.0) {
		tmp = a * t;
	} else if (a <= 2.6e-226) {
		tmp = x;
	} else if (a <= 6500.0) {
		tmp = y * z;
	} else if (a <= 3.6e+161) {
		tmp = t_1;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if a <= -1.1e+243:
		tmp = t_1
	elif a <= -4.3e+154:
		tmp = a * t
	elif a <= -3.8e+120:
		tmp = b * (z * a)
	elif a <= -5800000000.0:
		tmp = a * t
	elif a <= 2.6e-226:
		tmp = x
	elif a <= 6500.0:
		tmp = y * z
	elif a <= 3.6e+161:
		tmp = t_1
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (a <= -1.1e+243)
		tmp = t_1;
	elseif (a <= -4.3e+154)
		tmp = Float64(a * t);
	elseif (a <= -3.8e+120)
		tmp = Float64(b * Float64(z * a));
	elseif (a <= -5800000000.0)
		tmp = Float64(a * t);
	elseif (a <= 2.6e-226)
		tmp = x;
	elseif (a <= 6500.0)
		tmp = Float64(y * z);
	elseif (a <= 3.6e+161)
		tmp = t_1;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (a <= -1.1e+243)
		tmp = t_1;
	elseif (a <= -4.3e+154)
		tmp = a * t;
	elseif (a <= -3.8e+120)
		tmp = b * (z * a);
	elseif (a <= -5800000000.0)
		tmp = a * t;
	elseif (a <= 2.6e-226)
		tmp = x;
	elseif (a <= 6500.0)
		tmp = y * z;
	elseif (a <= 3.6e+161)
		tmp = t_1;
	else
		tmp = a * t;
	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[a, -1.1e+243], t$95$1, If[LessEqual[a, -4.3e+154], N[(a * t), $MachinePrecision], If[LessEqual[a, -3.8e+120], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5800000000.0], N[(a * t), $MachinePrecision], If[LessEqual[a, 2.6e-226], x, If[LessEqual[a, 6500.0], N[(y * z), $MachinePrecision], If[LessEqual[a, 3.6e+161], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -4.3 \cdot 10^{+154}:\\
\;\;\;\;a \cdot t\\

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

\mathbf{elif}\;a \leq -5800000000:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq 2.6 \cdot 10^{-226}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 6500:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 3.6 \cdot 10^{+161}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;a \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -1.10000000000000004e243 or 6500 < a < 3.59999999999999984e161

    1. Initial program 82.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+82.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(z \cdot b\right)} \]
    8. Simplified62.0%

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

    if -1.10000000000000004e243 < a < -4.2999999999999998e154 or -3.7999999999999998e120 < a < -5.8e9 or 3.59999999999999984e161 < a

    1. Initial program 90.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+90.8%

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

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

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

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

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

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

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

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

    if -4.2999999999999998e154 < a < -3.7999999999999998e120

    1. Initial program 88.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+88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(b \cdot a\right)} \cdot z \]
      3. associate-*r*67.4%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot z\right)} \]
    8. Simplified67.4%

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

    if -5.8e9 < a < 2.5999999999999998e-226

    1. Initial program 98.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+98.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*96.4%

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Taylor expanded in x around inf 56.8%

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

    if 2.5999999999999998e-226 < a < 6500

    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. associate-+l+100.0%

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

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Taylor expanded in y around inf 49.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.1 \cdot 10^{+243}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -4.3 \cdot 10^{+154}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -3.8 \cdot 10^{+120}:\\ \;\;\;\;b \cdot \left(z \cdot a\right)\\ \mathbf{elif}\;a \leq -5800000000:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{-226}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 6500:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 3.6 \cdot 10^{+161}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 5: 38.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;a \leq -7 \cdot 10^{+243}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -2.7 \cdot 10^{+154}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -2.8 \cdot 10^{+121}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq -64000000000:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-224}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1300:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 6 \cdot 10^{+160}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= a -7e+243)
     t_1
     (if (<= a -2.7e+154)
       (* a t)
       (if (<= a -2.8e+121)
         (* z (* a b))
         (if (<= a -64000000000.0)
           (* a t)
           (if (<= a 3.8e-224)
             x
             (if (<= a 1300.0) (* y z) (if (<= a 6e+160) t_1 (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (a <= -7e+243) {
		tmp = t_1;
	} else if (a <= -2.7e+154) {
		tmp = a * t;
	} else if (a <= -2.8e+121) {
		tmp = z * (a * b);
	} else if (a <= -64000000000.0) {
		tmp = a * t;
	} else if (a <= 3.8e-224) {
		tmp = x;
	} else if (a <= 1300.0) {
		tmp = y * z;
	} else if (a <= 6e+160) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (a <= (-7d+243)) then
        tmp = t_1
    else if (a <= (-2.7d+154)) then
        tmp = a * t
    else if (a <= (-2.8d+121)) then
        tmp = z * (a * b)
    else if (a <= (-64000000000.0d0)) then
        tmp = a * t
    else if (a <= 3.8d-224) then
        tmp = x
    else if (a <= 1300.0d0) then
        tmp = y * z
    else if (a <= 6d+160) then
        tmp = t_1
    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 t_1 = a * (z * b);
	double tmp;
	if (a <= -7e+243) {
		tmp = t_1;
	} else if (a <= -2.7e+154) {
		tmp = a * t;
	} else if (a <= -2.8e+121) {
		tmp = z * (a * b);
	} else if (a <= -64000000000.0) {
		tmp = a * t;
	} else if (a <= 3.8e-224) {
		tmp = x;
	} else if (a <= 1300.0) {
		tmp = y * z;
	} else if (a <= 6e+160) {
		tmp = t_1;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if a <= -7e+243:
		tmp = t_1
	elif a <= -2.7e+154:
		tmp = a * t
	elif a <= -2.8e+121:
		tmp = z * (a * b)
	elif a <= -64000000000.0:
		tmp = a * t
	elif a <= 3.8e-224:
		tmp = x
	elif a <= 1300.0:
		tmp = y * z
	elif a <= 6e+160:
		tmp = t_1
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (a <= -7e+243)
		tmp = t_1;
	elseif (a <= -2.7e+154)
		tmp = Float64(a * t);
	elseif (a <= -2.8e+121)
		tmp = Float64(z * Float64(a * b));
	elseif (a <= -64000000000.0)
		tmp = Float64(a * t);
	elseif (a <= 3.8e-224)
		tmp = x;
	elseif (a <= 1300.0)
		tmp = Float64(y * z);
	elseif (a <= 6e+160)
		tmp = t_1;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (a <= -7e+243)
		tmp = t_1;
	elseif (a <= -2.7e+154)
		tmp = a * t;
	elseif (a <= -2.8e+121)
		tmp = z * (a * b);
	elseif (a <= -64000000000.0)
		tmp = a * t;
	elseif (a <= 3.8e-224)
		tmp = x;
	elseif (a <= 1300.0)
		tmp = y * z;
	elseif (a <= 6e+160)
		tmp = t_1;
	else
		tmp = a * t;
	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[a, -7e+243], t$95$1, If[LessEqual[a, -2.7e+154], N[(a * t), $MachinePrecision], If[LessEqual[a, -2.8e+121], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -64000000000.0], N[(a * t), $MachinePrecision], If[LessEqual[a, 3.8e-224], x, If[LessEqual[a, 1300.0], N[(y * z), $MachinePrecision], If[LessEqual[a, 6e+160], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.7 \cdot 10^{+154}:\\
\;\;\;\;a \cdot t\\

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

\mathbf{elif}\;a \leq -64000000000:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq 3.8 \cdot 10^{-224}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1300:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 6 \cdot 10^{+160}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;a \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -6.99999999999999976e243 or 1300 < a < 5.9999999999999997e160

    1. Initial program 82.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+82.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(z \cdot b\right)} \]
    8. Simplified62.0%

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

    if -6.99999999999999976e243 < a < -2.70000000000000006e154 or -2.80000000000000006e121 < a < -6.4e10 or 5.9999999999999997e160 < a

    1. Initial program 90.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+90.8%

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

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

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

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

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

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

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

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

    if -2.70000000000000006e154 < a < -2.80000000000000006e121

    1. Initial program 88.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+88.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*88.5%

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

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

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

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

    if -6.4e10 < a < 3.80000000000000002e-224

    1. Initial program 98.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+98.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*96.4%

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Taylor expanded in x around inf 56.8%

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

    if 3.80000000000000002e-224 < a < 1300

    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. associate-+l+100.0%

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

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Taylor expanded in y around inf 49.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7 \cdot 10^{+243}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -2.7 \cdot 10^{+154}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -2.8 \cdot 10^{+121}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq -64000000000:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-224}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1300:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 6 \cdot 10^{+160}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 6: 57.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;a \leq -2.5 \cdot 10^{+244}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -4.8 \cdot 10^{+154}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -2.35 \cdot 10^{+117}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq -320000000000:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 9600:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 8 \cdot 10^{+160}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= a -2.5e+244)
     t_1
     (if (<= a -4.8e+154)
       (* a t)
       (if (<= a -2.35e+117)
         (* z (* a b))
         (if (<= a -320000000000.0)
           (* a t)
           (if (<= a 9600.0)
             (+ x (* y z))
             (if (<= a 8e+160) t_1 (* a t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (a <= -2.5e+244) {
		tmp = t_1;
	} else if (a <= -4.8e+154) {
		tmp = a * t;
	} else if (a <= -2.35e+117) {
		tmp = z * (a * b);
	} else if (a <= -320000000000.0) {
		tmp = a * t;
	} else if (a <= 9600.0) {
		tmp = x + (y * z);
	} else if (a <= 8e+160) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (a <= (-2.5d+244)) then
        tmp = t_1
    else if (a <= (-4.8d+154)) then
        tmp = a * t
    else if (a <= (-2.35d+117)) then
        tmp = z * (a * b)
    else if (a <= (-320000000000.0d0)) then
        tmp = a * t
    else if (a <= 9600.0d0) then
        tmp = x + (y * z)
    else if (a <= 8d+160) then
        tmp = t_1
    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 t_1 = a * (z * b);
	double tmp;
	if (a <= -2.5e+244) {
		tmp = t_1;
	} else if (a <= -4.8e+154) {
		tmp = a * t;
	} else if (a <= -2.35e+117) {
		tmp = z * (a * b);
	} else if (a <= -320000000000.0) {
		tmp = a * t;
	} else if (a <= 9600.0) {
		tmp = x + (y * z);
	} else if (a <= 8e+160) {
		tmp = t_1;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if a <= -2.5e+244:
		tmp = t_1
	elif a <= -4.8e+154:
		tmp = a * t
	elif a <= -2.35e+117:
		tmp = z * (a * b)
	elif a <= -320000000000.0:
		tmp = a * t
	elif a <= 9600.0:
		tmp = x + (y * z)
	elif a <= 8e+160:
		tmp = t_1
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (a <= -2.5e+244)
		tmp = t_1;
	elseif (a <= -4.8e+154)
		tmp = Float64(a * t);
	elseif (a <= -2.35e+117)
		tmp = Float64(z * Float64(a * b));
	elseif (a <= -320000000000.0)
		tmp = Float64(a * t);
	elseif (a <= 9600.0)
		tmp = Float64(x + Float64(y * z));
	elseif (a <= 8e+160)
		tmp = t_1;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (a <= -2.5e+244)
		tmp = t_1;
	elseif (a <= -4.8e+154)
		tmp = a * t;
	elseif (a <= -2.35e+117)
		tmp = z * (a * b);
	elseif (a <= -320000000000.0)
		tmp = a * t;
	elseif (a <= 9600.0)
		tmp = x + (y * z);
	elseif (a <= 8e+160)
		tmp = t_1;
	else
		tmp = a * t;
	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[a, -2.5e+244], t$95$1, If[LessEqual[a, -4.8e+154], N[(a * t), $MachinePrecision], If[LessEqual[a, -2.35e+117], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -320000000000.0], N[(a * t), $MachinePrecision], If[LessEqual[a, 9600.0], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8e+160], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -4.8 \cdot 10^{+154}:\\
\;\;\;\;a \cdot t\\

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

\mathbf{elif}\;a \leq -320000000000:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq 9600:\\
\;\;\;\;x + y \cdot z\\

\mathbf{elif}\;a \leq 8 \cdot 10^{+160}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;a \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -2.50000000000000011e244 or 9600 < a < 8.00000000000000005e160

    1. Initial program 82.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+82.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(z \cdot b\right)} \]
    8. Simplified62.0%

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

    if -2.50000000000000011e244 < a < -4.8000000000000003e154 or -2.35000000000000003e117 < a < -3.2e11 or 8.00000000000000005e160 < a

    1. Initial program 90.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+90.8%

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

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

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

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

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

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

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

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

    if -4.8000000000000003e154 < a < -2.35000000000000003e117

    1. Initial program 88.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+88.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*88.5%

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

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

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

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

    if -3.2e11 < a < 9600

    1. Initial program 99.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+99.2%

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

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

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

      \[\leadsto \color{blue}{x + y \cdot z} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification72.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.5 \cdot 10^{+244}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -4.8 \cdot 10^{+154}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -2.35 \cdot 10^{+117}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq -320000000000:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 9600:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 8 \cdot 10^{+160}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 7: 85.7% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.3999999999999998e32

    1. Initial program 90.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+90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.3999999999999998e32 < a < 13500

    1. Initial program 99.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+99.2%

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

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Taylor expanded in t around inf 91.5%

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

    if 13500 < a

    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. associate-+l+83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 82.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-58} \lor \neg \left(a \leq 8.4 \cdot 10^{-70}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.19999999999999975e-58 or 8.4000000000000004e-70 < a

    1. Initial program 89.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. associate-+l+89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.19999999999999975e-58 < a < 8.4000000000000004e-70

    1. Initial program 99.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+99.0%

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

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

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

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

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

Alternative 9: 87.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{+32} \lor \neg \left(a \leq 3.8 \cdot 10^{-6}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.00000000000000005e32 or 3.8e-6 < a

    1. Initial program 87.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+87.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000005e32 < a < 3.8e-6

    1. Initial program 99.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+99.2%

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

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Taylor expanded in t around inf 91.4%

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

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

Alternative 10: 61.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;a \leq -5000000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 9600:\\
\;\;\;\;x + y \cdot z\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5e9 or 2.0000000000000001e161 < a

    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. associate-+l+89.6%

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

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

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

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

        \[\leadsto \color{blue}{a \cdot t + x} \]
    6. Simplified64.3%

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

    if -5e9 < a < 9600

    1. Initial program 99.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+99.2%

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

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

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

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

    if 9600 < a < 2.0000000000000001e161

    1. Initial program 82.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+82.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 74.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -550000000000 \lor \neg \left(a \leq 122\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.5e11 or 122 < a

    1. Initial program 87.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+87.7%

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

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

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

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

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

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

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

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

    if -5.5e11 < a < 122

    1. Initial program 99.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+99.2%

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

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

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

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

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

Alternative 12: 38.3% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2050000000:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq 2.8 \cdot 10^{-223}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.45 \cdot 10^{+79}:\\
\;\;\;\;y \cdot z\\

\mathbf{else}:\\
\;\;\;\;a \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.05e9 or 1.44999999999999996e79 < a

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

    if -2.05e9 < a < 2.80000000000000015e-223

    1. Initial program 98.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+98.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*96.4%

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Taylor expanded in x around inf 56.8%

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

    if 2.80000000000000015e-223 < a < 1.44999999999999996e79

    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. associate-+l+100.0%

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

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Taylor expanded in y around inf 45.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2050000000:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-223}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{+79}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 13: 38.7% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1060000000 \lor \neg \left(a \leq 5.6 \cdot 10^{+53}\right):\\
\;\;\;\;a \cdot t\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.06e9 or 5.6e53 < 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 + \left(y \cdot z + t \cdot a\right)\right)} + \left(a \cdot z\right) \cdot b \]
      2. *-un-lft-identity86.9%

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

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

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

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

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

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

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

    if -1.06e9 < a < 5.6e53

    1. Initial program 99.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+99.2%

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

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Taylor expanded in x around inf 43.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1060000000 \lor \neg \left(a \leq 5.6 \cdot 10^{+53}\right):\\ \;\;\;\;a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 14: 26.8% 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 93.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. associate-+l+93.5%

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

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

    \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
  4. Taylor expanded in x around inf 28.2%

    \[\leadsto \color{blue}{x} \]
  5. Final simplification28.2%

    \[\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 2023322 
(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)))