Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 93.2% → 96.7%
Time: 13.1s
Alternatives: 16
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 16 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: 93.2% 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: 96.7% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 97.2%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

Alternative 2: 94.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 72.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{+38} \lor \neg \left(a \leq 1.2 \cdot 10^{-164} \lor \neg \left(a \leq 3.7 \cdot 10^{-147}\right) \land \left(a \leq 6.5 \cdot 10^{-53} \lor \neg \left(a \leq 1.9 \cdot 10^{+14}\right) \land a \leq 1.26 \cdot 10^{+54}\right)\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.8e38 or 1.19999999999999992e-164 < a < 3.7000000000000002e-147 or 6.4999999999999997e-53 < a < 1.9e14 or 1.25999999999999995e54 < a

    1. Initial program 86.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. *-commutative86.7%

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

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

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

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

    if -2.8e38 < a < 1.19999999999999992e-164 or 3.7000000000000002e-147 < a < 6.4999999999999997e-53 or 1.9e14 < a < 1.25999999999999995e54

    1. Initial program 99.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.8 \cdot 10^{+38} \lor \neg \left(a \leq 1.2 \cdot 10^{-164} \lor \neg \left(a \leq 3.7 \cdot 10^{-147}\right) \land \left(a \leq 6.5 \cdot 10^{-53} \lor \neg \left(a \leq 1.9 \cdot 10^{+14}\right) \land a \leq 1.26 \cdot 10^{+54}\right)\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]

Alternative 4: 57.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + a \cdot t\\ \mathbf{if}\;y \leq -2 \cdot 10^{+236}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{+226}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{+109}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{+43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+89}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+209}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* a t))))
   (if (<= y -2e+236)
     (* z y)
     (if (<= y -2.4e+226)
       t_1
       (if (<= y -1.5e+109)
         (* z y)
         (if (<= y 8.8e+43)
           t_1
           (if (<= y 3.2e+89)
             (* a (* z b))
             (if (<= y 5e+209) t_1 (* z y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (a * t);
	double tmp;
	if (y <= -2e+236) {
		tmp = z * y;
	} else if (y <= -2.4e+226) {
		tmp = t_1;
	} else if (y <= -1.5e+109) {
		tmp = z * y;
	} else if (y <= 8.8e+43) {
		tmp = t_1;
	} else if (y <= 3.2e+89) {
		tmp = a * (z * b);
	} else if (y <= 5e+209) {
		tmp = t_1;
	} else {
		tmp = z * y;
	}
	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 (y <= (-2d+236)) then
        tmp = z * y
    else if (y <= (-2.4d+226)) then
        tmp = t_1
    else if (y <= (-1.5d+109)) then
        tmp = z * y
    else if (y <= 8.8d+43) then
        tmp = t_1
    else if (y <= 3.2d+89) then
        tmp = a * (z * b)
    else if (y <= 5d+209) then
        tmp = t_1
    else
        tmp = z * y
    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 (y <= -2e+236) {
		tmp = z * y;
	} else if (y <= -2.4e+226) {
		tmp = t_1;
	} else if (y <= -1.5e+109) {
		tmp = z * y;
	} else if (y <= 8.8e+43) {
		tmp = t_1;
	} else if (y <= 3.2e+89) {
		tmp = a * (z * b);
	} else if (y <= 5e+209) {
		tmp = t_1;
	} else {
		tmp = z * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (a * t)
	tmp = 0
	if y <= -2e+236:
		tmp = z * y
	elif y <= -2.4e+226:
		tmp = t_1
	elif y <= -1.5e+109:
		tmp = z * y
	elif y <= 8.8e+43:
		tmp = t_1
	elif y <= 3.2e+89:
		tmp = a * (z * b)
	elif y <= 5e+209:
		tmp = t_1
	else:
		tmp = z * y
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(a * t))
	tmp = 0.0
	if (y <= -2e+236)
		tmp = Float64(z * y);
	elseif (y <= -2.4e+226)
		tmp = t_1;
	elseif (y <= -1.5e+109)
		tmp = Float64(z * y);
	elseif (y <= 8.8e+43)
		tmp = t_1;
	elseif (y <= 3.2e+89)
		tmp = Float64(a * Float64(z * b));
	elseif (y <= 5e+209)
		tmp = t_1;
	else
		tmp = Float64(z * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (a * t);
	tmp = 0.0;
	if (y <= -2e+236)
		tmp = z * y;
	elseif (y <= -2.4e+226)
		tmp = t_1;
	elseif (y <= -1.5e+109)
		tmp = z * y;
	elseif (y <= 8.8e+43)
		tmp = t_1;
	elseif (y <= 3.2e+89)
		tmp = a * (z * b);
	elseif (y <= 5e+209)
		tmp = t_1;
	else
		tmp = z * y;
	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[y, -2e+236], N[(z * y), $MachinePrecision], If[LessEqual[y, -2.4e+226], t$95$1, If[LessEqual[y, -1.5e+109], N[(z * y), $MachinePrecision], If[LessEqual[y, 8.8e+43], t$95$1, If[LessEqual[y, 3.2e+89], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+209], t$95$1, N[(z * y), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;y \leq -2 \cdot 10^{+236}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;y \leq -2.4 \cdot 10^{+226}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.5 \cdot 10^{+109}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;y \leq 8.8 \cdot 10^{+43}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{+89}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;y \leq 5 \cdot 10^{+209}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.00000000000000011e236 or -2.4e226 < y < -1.50000000000000008e109 or 4.99999999999999964e209 < y

    1. Initial program 92.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. *-commutative92.9%

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

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

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

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

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

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

    if -2.00000000000000011e236 < y < -2.4e226 or -1.50000000000000008e109 < y < 8.80000000000000002e43 or 3.19999999999999987e89 < y < 4.99999999999999964e209

    1. Initial program 92.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. *-commutative92.2%

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

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

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

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

    if 8.80000000000000002e43 < y < 3.19999999999999987e89

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+236}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{+226}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{+109}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{+43}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+89}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+209}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \]

Alternative 5: 60.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + a \cdot t\\ t_2 := x + z \cdot y\\ \mathbf{if}\;y \leq -1.8 \cdot 10^{+107}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.12 \cdot 10^{+47}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -54000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{+43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.4 \cdot 10^{+89}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+206}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* a t))) (t_2 (+ x (* z y))))
   (if (<= y -1.8e+107)
     t_2
     (if (<= y -1.12e+47)
       t_1
       (if (<= y -54000.0)
         t_2
         (if (<= y 8.8e+43)
           t_1
           (if (<= y 9.4e+89) (* a (* z b)) (if (<= y 7.8e+206) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (a * t);
	double t_2 = x + (z * y);
	double tmp;
	if (y <= -1.8e+107) {
		tmp = t_2;
	} else if (y <= -1.12e+47) {
		tmp = t_1;
	} else if (y <= -54000.0) {
		tmp = t_2;
	} else if (y <= 8.8e+43) {
		tmp = t_1;
	} else if (y <= 9.4e+89) {
		tmp = a * (z * b);
	} else if (y <= 7.8e+206) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (a * t)
    t_2 = x + (z * y)
    if (y <= (-1.8d+107)) then
        tmp = t_2
    else if (y <= (-1.12d+47)) then
        tmp = t_1
    else if (y <= (-54000.0d0)) then
        tmp = t_2
    else if (y <= 8.8d+43) then
        tmp = t_1
    else if (y <= 9.4d+89) then
        tmp = a * (z * b)
    else if (y <= 7.8d+206) then
        tmp = t_1
    else
        tmp = t_2
    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 t_2 = x + (z * y);
	double tmp;
	if (y <= -1.8e+107) {
		tmp = t_2;
	} else if (y <= -1.12e+47) {
		tmp = t_1;
	} else if (y <= -54000.0) {
		tmp = t_2;
	} else if (y <= 8.8e+43) {
		tmp = t_1;
	} else if (y <= 9.4e+89) {
		tmp = a * (z * b);
	} else if (y <= 7.8e+206) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (a * t)
	t_2 = x + (z * y)
	tmp = 0
	if y <= -1.8e+107:
		tmp = t_2
	elif y <= -1.12e+47:
		tmp = t_1
	elif y <= -54000.0:
		tmp = t_2
	elif y <= 8.8e+43:
		tmp = t_1
	elif y <= 9.4e+89:
		tmp = a * (z * b)
	elif y <= 7.8e+206:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(a * t))
	t_2 = Float64(x + Float64(z * y))
	tmp = 0.0
	if (y <= -1.8e+107)
		tmp = t_2;
	elseif (y <= -1.12e+47)
		tmp = t_1;
	elseif (y <= -54000.0)
		tmp = t_2;
	elseif (y <= 8.8e+43)
		tmp = t_1;
	elseif (y <= 9.4e+89)
		tmp = Float64(a * Float64(z * b));
	elseif (y <= 7.8e+206)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (a * t);
	t_2 = x + (z * y);
	tmp = 0.0;
	if (y <= -1.8e+107)
		tmp = t_2;
	elseif (y <= -1.12e+47)
		tmp = t_1;
	elseif (y <= -54000.0)
		tmp = t_2;
	elseif (y <= 8.8e+43)
		tmp = t_1;
	elseif (y <= 9.4e+89)
		tmp = a * (z * b);
	elseif (y <= 7.8e+206)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+107], t$95$2, If[LessEqual[y, -1.12e+47], t$95$1, If[LessEqual[y, -54000.0], t$95$2, If[LessEqual[y, 8.8e+43], t$95$1, If[LessEqual[y, 9.4e+89], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e+206], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + a \cdot t\\
t_2 := x + z \cdot y\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+107}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -1.12 \cdot 10^{+47}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -54000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 8.8 \cdot 10^{+43}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 9.4 \cdot 10^{+89}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;y \leq 7.8 \cdot 10^{+206}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.7999999999999999e107 or -1.12000000000000007e47 < y < -54000 or 7.8e206 < y

    1. Initial program 93.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. *-commutative93.1%

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

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

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

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

    if -1.7999999999999999e107 < y < -1.12000000000000007e47 or -54000 < y < 8.80000000000000002e43 or 9.40000000000000043e89 < y < 7.8e206

    1. Initial program 92.1%

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

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

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

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

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

    if 8.80000000000000002e43 < y < 9.40000000000000043e89

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+107}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;y \leq -1.12 \cdot 10^{+47}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;y \leq -54000:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{+43}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;y \leq 9.4 \cdot 10^{+89}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+206}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]

Alternative 6: 72.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(t + z \cdot b\right)\\ t_2 := z \cdot \left(y + a \cdot b\right)\\ \mathbf{if}\;a \leq -1.28 \cdot 10^{+39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-165}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{-96}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{-15}:\\ \;\;\;\;x + b \cdot \left(a \cdot z\right)\\ \mathbf{elif}\;a \leq 1.26 \cdot 10^{+54}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (+ t (* z b)))) (t_2 (* z (+ y (* a b)))))
   (if (<= a -1.28e+39)
     t_1
     (if (<= a 1.4e-165)
       (+ x (* z y))
       (if (<= a 5.7e-96)
         t_2
         (if (<= a 1.5e-15)
           (+ x (* b (* a z)))
           (if (<= a 1.26e+54) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (t + (z * b));
	double t_2 = z * (y + (a * b));
	double tmp;
	if (a <= -1.28e+39) {
		tmp = t_1;
	} else if (a <= 1.4e-165) {
		tmp = x + (z * y);
	} else if (a <= 5.7e-96) {
		tmp = t_2;
	} else if (a <= 1.5e-15) {
		tmp = x + (b * (a * z));
	} else if (a <= 1.26e+54) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = a * (t + (z * b))
    t_2 = z * (y + (a * b))
    if (a <= (-1.28d+39)) then
        tmp = t_1
    else if (a <= 1.4d-165) then
        tmp = x + (z * y)
    else if (a <= 5.7d-96) then
        tmp = t_2
    else if (a <= 1.5d-15) then
        tmp = x + (b * (a * z))
    else if (a <= 1.26d+54) then
        tmp = t_2
    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 = a * (t + (z * b));
	double t_2 = z * (y + (a * b));
	double tmp;
	if (a <= -1.28e+39) {
		tmp = t_1;
	} else if (a <= 1.4e-165) {
		tmp = x + (z * y);
	} else if (a <= 5.7e-96) {
		tmp = t_2;
	} else if (a <= 1.5e-15) {
		tmp = x + (b * (a * z));
	} else if (a <= 1.26e+54) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (t + (z * b))
	t_2 = z * (y + (a * b))
	tmp = 0
	if a <= -1.28e+39:
		tmp = t_1
	elif a <= 1.4e-165:
		tmp = x + (z * y)
	elif a <= 5.7e-96:
		tmp = t_2
	elif a <= 1.5e-15:
		tmp = x + (b * (a * z))
	elif a <= 1.26e+54:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(t + Float64(z * b)))
	t_2 = Float64(z * Float64(y + Float64(a * b)))
	tmp = 0.0
	if (a <= -1.28e+39)
		tmp = t_1;
	elseif (a <= 1.4e-165)
		tmp = Float64(x + Float64(z * y));
	elseif (a <= 5.7e-96)
		tmp = t_2;
	elseif (a <= 1.5e-15)
		tmp = Float64(x + Float64(b * Float64(a * z)));
	elseif (a <= 1.26e+54)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (t + (z * b));
	t_2 = z * (y + (a * b));
	tmp = 0.0;
	if (a <= -1.28e+39)
		tmp = t_1;
	elseif (a <= 1.4e-165)
		tmp = x + (z * y);
	elseif (a <= 5.7e-96)
		tmp = t_2;
	elseif (a <= 1.5e-15)
		tmp = x + (b * (a * z));
	elseif (a <= 1.26e+54)
		tmp = t_2;
	else
		tmp = t_1;
	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]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.28e+39], t$95$1, If[LessEqual[a, 1.4e-165], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.7e-96], t$95$2, If[LessEqual[a, 1.5e-15], N[(x + N[(b * N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.26e+54], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 1.4 \cdot 10^{-165}:\\
\;\;\;\;x + z \cdot y\\

\mathbf{elif}\;a \leq 5.7 \cdot 10^{-96}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;a \leq 1.26 \cdot 10^{+54}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.27999999999999994e39 or 1.25999999999999995e54 < a

    1. Initial program 85.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. *-commutative85.0%

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

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

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

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

    if -1.27999999999999994e39 < a < 1.4e-165

    1. Initial program 99.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. *-commutative99.9%

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

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

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

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

    if 1.4e-165 < a < 5.70000000000000009e-96 or 1.5e-15 < a < 1.25999999999999995e54

    1. Initial program 94.6%

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

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

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

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

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

    if 5.70000000000000009e-96 < a < 1.5e-15

    1. Initial program 99.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. *-commutative99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \left(a \cdot z\right)} + x \]
    10. Simplified77.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.28 \cdot 10^{+39}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-165}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{-96}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{-15}:\\ \;\;\;\;x + b \cdot \left(a \cdot z\right)\\ \mathbf{elif}\;a \leq 1.26 \cdot 10^{+54}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 7: 72.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(t + z \cdot b\right)\\ t_2 := z \cdot \left(y + a \cdot b\right)\\ \mathbf{if}\;a \leq -9.8 \cdot 10^{+33}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-165}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;a \leq 1.38 \cdot 10^{-95}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 15500:\\ \;\;\;\;x + z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 1.26 \cdot 10^{+54}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (+ t (* z b)))) (t_2 (* z (+ y (* a b)))))
   (if (<= a -9.8e+33)
     t_1
     (if (<= a 1.55e-165)
       (+ x (* z y))
       (if (<= a 1.38e-95)
         t_2
         (if (<= a 15500.0)
           (+ x (* z (* a b)))
           (if (<= a 1.26e+54) t_2 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (t + (z * b));
	double t_2 = z * (y + (a * b));
	double tmp;
	if (a <= -9.8e+33) {
		tmp = t_1;
	} else if (a <= 1.55e-165) {
		tmp = x + (z * y);
	} else if (a <= 1.38e-95) {
		tmp = t_2;
	} else if (a <= 15500.0) {
		tmp = x + (z * (a * b));
	} else if (a <= 1.26e+54) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = a * (t + (z * b))
    t_2 = z * (y + (a * b))
    if (a <= (-9.8d+33)) then
        tmp = t_1
    else if (a <= 1.55d-165) then
        tmp = x + (z * y)
    else if (a <= 1.38d-95) then
        tmp = t_2
    else if (a <= 15500.0d0) then
        tmp = x + (z * (a * b))
    else if (a <= 1.26d+54) then
        tmp = t_2
    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 = a * (t + (z * b));
	double t_2 = z * (y + (a * b));
	double tmp;
	if (a <= -9.8e+33) {
		tmp = t_1;
	} else if (a <= 1.55e-165) {
		tmp = x + (z * y);
	} else if (a <= 1.38e-95) {
		tmp = t_2;
	} else if (a <= 15500.0) {
		tmp = x + (z * (a * b));
	} else if (a <= 1.26e+54) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (t + (z * b))
	t_2 = z * (y + (a * b))
	tmp = 0
	if a <= -9.8e+33:
		tmp = t_1
	elif a <= 1.55e-165:
		tmp = x + (z * y)
	elif a <= 1.38e-95:
		tmp = t_2
	elif a <= 15500.0:
		tmp = x + (z * (a * b))
	elif a <= 1.26e+54:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(t + Float64(z * b)))
	t_2 = Float64(z * Float64(y + Float64(a * b)))
	tmp = 0.0
	if (a <= -9.8e+33)
		tmp = t_1;
	elseif (a <= 1.55e-165)
		tmp = Float64(x + Float64(z * y));
	elseif (a <= 1.38e-95)
		tmp = t_2;
	elseif (a <= 15500.0)
		tmp = Float64(x + Float64(z * Float64(a * b)));
	elseif (a <= 1.26e+54)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (t + (z * b));
	t_2 = z * (y + (a * b));
	tmp = 0.0;
	if (a <= -9.8e+33)
		tmp = t_1;
	elseif (a <= 1.55e-165)
		tmp = x + (z * y);
	elseif (a <= 1.38e-95)
		tmp = t_2;
	elseif (a <= 15500.0)
		tmp = x + (z * (a * b));
	elseif (a <= 1.26e+54)
		tmp = t_2;
	else
		tmp = t_1;
	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]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.8e+33], t$95$1, If[LessEqual[a, 1.55e-165], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.38e-95], t$95$2, If[LessEqual[a, 15500.0], N[(x + N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.26e+54], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 1.55 \cdot 10^{-165}:\\
\;\;\;\;x + z \cdot y\\

\mathbf{elif}\;a \leq 1.38 \cdot 10^{-95}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 15500:\\
\;\;\;\;x + z \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;a \leq 1.26 \cdot 10^{+54}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -9.80000000000000027e33 or 1.25999999999999995e54 < a

    1. Initial program 85.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. *-commutative85.0%

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

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

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

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

    if -9.80000000000000027e33 < a < 1.54999999999999998e-165

    1. Initial program 99.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. *-commutative99.9%

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

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

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

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

    if 1.54999999999999998e-165 < a < 1.38e-95 or 15500 < a < 1.25999999999999995e54

    1. Initial program 93.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. *-commutative93.9%

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

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

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

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

    if 1.38e-95 < a < 15500

    1. Initial program 99.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. *-commutative99.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.8 \cdot 10^{+33}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-165}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;a \leq 1.38 \cdot 10^{-95}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 15500:\\ \;\;\;\;x + z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 1.26 \cdot 10^{+54}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 8: 72.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(t + z \cdot b\right)\\ t_2 := z \cdot \left(a \cdot b\right)\\ \mathbf{if}\;a \leq -3 \cdot 10^{+36}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-165}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{-97}:\\ \;\;\;\;t_2 + z \cdot y\\ \mathbf{elif}\;a \leq 290000:\\ \;\;\;\;x + t_2\\ \mathbf{elif}\;a \leq 1.26 \cdot 10^{+54}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (+ t (* z b)))) (t_2 (* z (* a b))))
   (if (<= a -3e+36)
     t_1
     (if (<= a 1.55e-165)
       (+ x (* z y))
       (if (<= a 2.4e-97)
         (+ t_2 (* z y))
         (if (<= a 290000.0)
           (+ x t_2)
           (if (<= a 1.26e+54) (* z (+ y (* a b))) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (t + (z * b));
	double t_2 = z * (a * b);
	double tmp;
	if (a <= -3e+36) {
		tmp = t_1;
	} else if (a <= 1.55e-165) {
		tmp = x + (z * y);
	} else if (a <= 2.4e-97) {
		tmp = t_2 + (z * y);
	} else if (a <= 290000.0) {
		tmp = x + t_2;
	} else if (a <= 1.26e+54) {
		tmp = z * (y + (a * 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) :: t_2
    real(8) :: tmp
    t_1 = a * (t + (z * b))
    t_2 = z * (a * b)
    if (a <= (-3d+36)) then
        tmp = t_1
    else if (a <= 1.55d-165) then
        tmp = x + (z * y)
    else if (a <= 2.4d-97) then
        tmp = t_2 + (z * y)
    else if (a <= 290000.0d0) then
        tmp = x + t_2
    else if (a <= 1.26d+54) then
        tmp = z * (y + (a * 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 = a * (t + (z * b));
	double t_2 = z * (a * b);
	double tmp;
	if (a <= -3e+36) {
		tmp = t_1;
	} else if (a <= 1.55e-165) {
		tmp = x + (z * y);
	} else if (a <= 2.4e-97) {
		tmp = t_2 + (z * y);
	} else if (a <= 290000.0) {
		tmp = x + t_2;
	} else if (a <= 1.26e+54) {
		tmp = z * (y + (a * b));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (t + (z * b))
	t_2 = z * (a * b)
	tmp = 0
	if a <= -3e+36:
		tmp = t_1
	elif a <= 1.55e-165:
		tmp = x + (z * y)
	elif a <= 2.4e-97:
		tmp = t_2 + (z * y)
	elif a <= 290000.0:
		tmp = x + t_2
	elif a <= 1.26e+54:
		tmp = z * (y + (a * b))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(t + Float64(z * b)))
	t_2 = Float64(z * Float64(a * b))
	tmp = 0.0
	if (a <= -3e+36)
		tmp = t_1;
	elseif (a <= 1.55e-165)
		tmp = Float64(x + Float64(z * y));
	elseif (a <= 2.4e-97)
		tmp = Float64(t_2 + Float64(z * y));
	elseif (a <= 290000.0)
		tmp = Float64(x + t_2);
	elseif (a <= 1.26e+54)
		tmp = Float64(z * Float64(y + Float64(a * b)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (t + (z * b));
	t_2 = z * (a * b);
	tmp = 0.0;
	if (a <= -3e+36)
		tmp = t_1;
	elseif (a <= 1.55e-165)
		tmp = x + (z * y);
	elseif (a <= 2.4e-97)
		tmp = t_2 + (z * y);
	elseif (a <= 290000.0)
		tmp = x + t_2;
	elseif (a <= 1.26e+54)
		tmp = z * (y + (a * b));
	else
		tmp = t_1;
	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]}, Block[{t$95$2 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3e+36], t$95$1, If[LessEqual[a, 1.55e-165], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.4e-97], N[(t$95$2 + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 290000.0], N[(x + t$95$2), $MachinePrecision], If[LessEqual[a, 1.26e+54], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 1.55 \cdot 10^{-165}:\\
\;\;\;\;x + z \cdot y\\

\mathbf{elif}\;a \leq 2.4 \cdot 10^{-97}:\\
\;\;\;\;t_2 + z \cdot y\\

\mathbf{elif}\;a \leq 290000:\\
\;\;\;\;x + t_2\\

\mathbf{elif}\;a \leq 1.26 \cdot 10^{+54}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -3e36 or 1.25999999999999995e54 < a

    1. Initial program 85.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. *-commutative85.0%

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

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

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

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

    if -3e36 < a < 1.54999999999999998e-165

    1. Initial program 99.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. *-commutative99.9%

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

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

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

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

    if 1.54999999999999998e-165 < a < 2.4e-97

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \left(a \cdot b\right) + z \cdot y} \]
    6. Applied egg-rr80.2%

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

    if 2.4e-97 < a < 2.9e5

    1. Initial program 99.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. *-commutative99.9%

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

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

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

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

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

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

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

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

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

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

    if 2.9e5 < a < 1.25999999999999995e54

    1. Initial program 87.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. *-commutative87.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3 \cdot 10^{+36}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-165}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;a \leq 2.4 \cdot 10^{-97}:\\ \;\;\;\;z \cdot \left(a \cdot b\right) + z \cdot y\\ \mathbf{elif}\;a \leq 290000:\\ \;\;\;\;x + z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 1.26 \cdot 10^{+54}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 9: 80.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + z \cdot \left(y + a \cdot b\right)\\ t_2 := x + a \cdot t\\ \mathbf{if}\;t \leq -7.2 \cdot 10^{+170}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{+79}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{+171}:\\ \;\;\;\;t_1\\ \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 (* z (+ y (* a b))))) (t_2 (+ x (* a t))))
   (if (<= t -7.2e+170)
     t_2
     (if (<= t 1.9e+79)
       t_1
       (if (<= t 2.1e+154)
         t_2
         (if (<= t 1.55e+171) t_1 (* a (+ t (* z b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (z * (y + (a * b)));
	double t_2 = x + (a * t);
	double tmp;
	if (t <= -7.2e+170) {
		tmp = t_2;
	} else if (t <= 1.9e+79) {
		tmp = t_1;
	} else if (t <= 2.1e+154) {
		tmp = t_2;
	} else if (t <= 1.55e+171) {
		tmp = t_1;
	} else {
		tmp = a * (t + (z * b));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (z * (y + (a * b)))
    t_2 = x + (a * t)
    if (t <= (-7.2d+170)) then
        tmp = t_2
    else if (t <= 1.9d+79) then
        tmp = t_1
    else if (t <= 2.1d+154) then
        tmp = t_2
    else if (t <= 1.55d+171) then
        tmp = t_1
    else
        tmp = a * (t + (z * b))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (z * (y + (a * b)));
	double t_2 = x + (a * t);
	double tmp;
	if (t <= -7.2e+170) {
		tmp = t_2;
	} else if (t <= 1.9e+79) {
		tmp = t_1;
	} else if (t <= 2.1e+154) {
		tmp = t_2;
	} else if (t <= 1.55e+171) {
		tmp = t_1;
	} else {
		tmp = a * (t + (z * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (z * (y + (a * b)))
	t_2 = x + (a * t)
	tmp = 0
	if t <= -7.2e+170:
		tmp = t_2
	elif t <= 1.9e+79:
		tmp = t_1
	elif t <= 2.1e+154:
		tmp = t_2
	elif t <= 1.55e+171:
		tmp = t_1
	else:
		tmp = a * (t + (z * b))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(z * Float64(y + Float64(a * b))))
	t_2 = Float64(x + Float64(a * t))
	tmp = 0.0
	if (t <= -7.2e+170)
		tmp = t_2;
	elseif (t <= 1.9e+79)
		tmp = t_1;
	elseif (t <= 2.1e+154)
		tmp = t_2;
	elseif (t <= 1.55e+171)
		tmp = t_1;
	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 + (z * (y + (a * b)));
	t_2 = x + (a * t);
	tmp = 0.0;
	if (t <= -7.2e+170)
		tmp = t_2;
	elseif (t <= 1.9e+79)
		tmp = t_1;
	elseif (t <= 2.1e+154)
		tmp = t_2;
	elseif (t <= 1.55e+171)
		tmp = t_1;
	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[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.2e+170], t$95$2, If[LessEqual[t, 1.9e+79], t$95$1, If[LessEqual[t, 2.1e+154], t$95$2, If[LessEqual[t, 1.55e+171], t$95$1, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 1.9 \cdot 10^{+79}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 2.1 \cdot 10^{+154}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 1.55 \cdot 10^{+171}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.1999999999999999e170 or 1.9000000000000001e79 < t < 2.09999999999999994e154

    1. Initial program 93.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. *-commutative93.1%

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

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

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

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

    if -7.1999999999999999e170 < t < 1.9000000000000001e79 or 2.09999999999999994e154 < t < 1.5499999999999999e171

    1. Initial program 94.6%

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

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

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

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

      \[\leadsto \color{blue}{x + \left(a \cdot \left(b \cdot z\right) + y \cdot z\right)} \]
    5. Step-by-step derivation
      1. +-commutative85.6%

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

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

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

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

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

    if 1.5499999999999999e171 < t

    1. Initial program 78.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. *-commutative78.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.2 \cdot 10^{+170}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{+79}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+154}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{+171}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 10: 93.1% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.35e129

    1. Initial program 80.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+80.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e129 < a

    1. Initial program 94.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. *-commutative94.5%

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

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

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

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

Alternative 11: 82.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+175}:\\
\;\;\;\;x + a \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.8e175

    1. Initial program 96.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. *-commutative96.2%

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

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

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

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

    if -4.8e175 < t < 1.35000000000000009e63

    1. Initial program 94.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. *-commutative94.2%

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

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

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

      \[\leadsto \color{blue}{x + \left(a \cdot \left(b \cdot z\right) + y \cdot z\right)} \]
    5. Step-by-step derivation
      1. +-commutative84.8%

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

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

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

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

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

    if 1.35000000000000009e63 < t

    1. Initial program 85.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+85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 39.3% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -54000:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;y \leq 3.6 \cdot 10^{-280}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;y \leq 4 \cdot 10^{+77}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -54000 or 3.99999999999999993e77 < y

    1. Initial program 92.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. *-commutative92.0%

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

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

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

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

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

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

    if -54000 < y < 3.59999999999999994e-280

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

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

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

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

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

    if 3.59999999999999994e-280 < y < 3.99999999999999993e77

    1. Initial program 98.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. +-commutative98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -54000:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{-280}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+77}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \]

Alternative 13: 39.9% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -50000:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;y \leq 3.1 \cdot 10^{-280}:\\
\;\;\;\;a \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5e4 or 8.4999999999999996e71 < y

    1. Initial program 92.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. *-commutative92.0%

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

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

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

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

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

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

    if -5e4 < y < 3.10000000000000021e-280

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

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

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

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

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

    if 3.10000000000000021e-280 < y < 8.4999999999999996e71

    1. Initial program 98.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. +-commutative98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot \left(z \cdot b\right)} \]
    9. Taylor expanded in a around 0 40.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -50000:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-280}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+71}:\\ \;\;\;\;b \cdot \left(a \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \]

Alternative 14: 39.6% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -52000:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;y \leq 4.4 \cdot 10^{-300}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+43}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -52000 or 2.20000000000000001e43 < y

    1. Initial program 91.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. *-commutative91.7%

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

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

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

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

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

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

    if -52000 < y < 4.40000000000000004e-300

    1. Initial program 87.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. *-commutative87.3%

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

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

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

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

    if 4.40000000000000004e-300 < y < 2.20000000000000001e43

    1. Initial program 99.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. *-commutative99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -52000:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{-300}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+43}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \]

Alternative 15: 38.2% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-115}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;t \leq 6.6 \cdot 10^{-18}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.2e-115 or 6.6000000000000003e-18 < t

    1. Initial program 87.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. *-commutative87.9%

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

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

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

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

    if -3.2e-115 < t < 6.6000000000000003e-18

    1. Initial program 98.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. *-commutative98.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.2 \cdot 10^{-115}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;t \leq 6.6 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 16: 26.5% accurate, 15.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 92.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. *-commutative92.3%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification25.4%

    \[\leadsto x \]

Developer target: 97.7% 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 2023283 
(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)))