Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.6% → 96.4%
Time: 12.3s
Alternatives: 14
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 92.6% accurate, 1.0× speedup?

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

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

Alternative 1: 96.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\ \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 (* y z)) (* t a)) (* (* z a) b))))
   (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 + (y * z)) + (t * a)) + ((z * a) * b);
	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 + (y * z)) + (t * a)) + ((z * a) * b);
	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 + (y * z)) + (t * a)) + ((z * a) * b)
	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(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b))
	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 + (y * z)) + (t * a)) + ((z * a) * b);
	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[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $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 + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\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 98.3%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

Alternative 2: 92.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(y + \frac{x}{z}\right) + a \cdot \left(t + z \cdot b\right)\\ t_2 := x + z \cdot \left(y + a \cdot b\right)\\ \mathbf{if}\;z \leq -1.96 \cdot 10^{+155}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-115}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-132}:\\ \;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+170}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (* z (+ y (/ x z))) (* a (+ t (* z b)))))
        (t_2 (+ x (* z (+ y (* a b))))))
   (if (<= z -1.96e+155)
     t_2
     (if (<= z -1.6e-115)
       t_1
       (if (<= z 7.2e-132)
         (+ x (+ (* t a) (* y z)))
         (if (<= z 8.5e+170) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z * (y + (x / z))) + (a * (t + (z * b)));
	double t_2 = x + (z * (y + (a * b)));
	double tmp;
	if (z <= -1.96e+155) {
		tmp = t_2;
	} else if (z <= -1.6e-115) {
		tmp = t_1;
	} else if (z <= 7.2e-132) {
		tmp = x + ((t * a) + (y * z));
	} else if (z <= 8.5e+170) {
		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 = (z * (y + (x / z))) + (a * (t + (z * b)))
    t_2 = x + (z * (y + (a * b)))
    if (z <= (-1.96d+155)) then
        tmp = t_2
    else if (z <= (-1.6d-115)) then
        tmp = t_1
    else if (z <= 7.2d-132) then
        tmp = x + ((t * a) + (y * z))
    else if (z <= 8.5d+170) 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 = (z * (y + (x / z))) + (a * (t + (z * b)));
	double t_2 = x + (z * (y + (a * b)));
	double tmp;
	if (z <= -1.96e+155) {
		tmp = t_2;
	} else if (z <= -1.6e-115) {
		tmp = t_1;
	} else if (z <= 7.2e-132) {
		tmp = x + ((t * a) + (y * z));
	} else if (z <= 8.5e+170) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z * (y + (x / z))) + (a * (t + (z * b)))
	t_2 = x + (z * (y + (a * b)))
	tmp = 0
	if z <= -1.96e+155:
		tmp = t_2
	elif z <= -1.6e-115:
		tmp = t_1
	elif z <= 7.2e-132:
		tmp = x + ((t * a) + (y * z))
	elif z <= 8.5e+170:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z * Float64(y + Float64(x / z))) + Float64(a * Float64(t + Float64(z * b))))
	t_2 = Float64(x + Float64(z * Float64(y + Float64(a * b))))
	tmp = 0.0
	if (z <= -1.96e+155)
		tmp = t_2;
	elseif (z <= -1.6e-115)
		tmp = t_1;
	elseif (z <= 7.2e-132)
		tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z)));
	elseif (z <= 8.5e+170)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z * (y + (x / z))) + (a * (t + (z * b)));
	t_2 = x + (z * (y + (a * b)));
	tmp = 0.0;
	if (z <= -1.96e+155)
		tmp = t_2;
	elseif (z <= -1.6e-115)
		tmp = t_1;
	elseif (z <= 7.2e-132)
		tmp = x + ((t * a) + (y * z));
	elseif (z <= 8.5e+170)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.96e+155], t$95$2, If[LessEqual[z, -1.6e-115], t$95$1, If[LessEqual[z, 7.2e-132], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+170], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.6 \cdot 10^{-115}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 7.2 \cdot 10^{-132}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.9600000000000001e155 or 8.5000000000000004e170 < z

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

    if -1.9600000000000001e155 < z < -1.6e-115 or 7.20000000000000015e-132 < z < 8.5000000000000004e170

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6e-115 < z < 7.20000000000000015e-132

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.96 \cdot 10^{+155}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-115}:\\ \;\;\;\;z \cdot \left(y + \frac{x}{z}\right) + a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-132}:\\ \;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+170}:\\ \;\;\;\;z \cdot \left(y + \frac{x}{z}\right) + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 37.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq -1.16 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -2.06 \cdot 10^{-91}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 2.25 \cdot 10^{-181}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 2.9 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -2.00000000000000004e95 or 2.8999999999999999e135 < a

    1. Initial program 77.5%

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around 0 65.8%

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

    if -2.00000000000000004e95 < a < -1.16000000000000003e57 or 2.2499999999999999e-181 < a < 2.8999999999999999e135

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.16000000000000003e57 < a < -2.0600000000000001e-91

    1. Initial program 94.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+94.3%

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

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

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

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

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

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

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

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

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

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

    if -2.0600000000000001e-91 < a < 2.2499999999999999e-181

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{+95}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq -1.16 \cdot 10^{+57}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -2.06 \cdot 10^{-91}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 2.25 \cdot 10^{-181}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+135}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 95.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+131} \lor \neg \left(z \leq 2.3 \cdot 10^{+171}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.99999999999999995e131 or 2.30000000000000017e171 < z

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

    if -4.99999999999999995e131 < z < 2.30000000000000017e171

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

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

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

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

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

Alternative 5: 62.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -7.4 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.39999999999999974e93 or 3.80000000000000003e-127 < a

    1. Initial program 83.6%

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

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

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

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

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

    if -7.39999999999999974e93 < a < -8.5999999999999995e64

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

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

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

    if -8.5999999999999995e64 < a < 3.80000000000000003e-127

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot y} \]
    10. Simplified74.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.4 \cdot 10^{+93}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;a \leq -8.6 \cdot 10^{+64}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-127}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 57.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+42}:\\
\;\;\;\;x + t \cdot a\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{+169}:\\
\;\;\;\;y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.25999999999999996e44

    1. Initial program 82.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(z \cdot a\right)} \cdot \left(b + \frac{y}{a}\right) \]
    8. Simplified76.1%

      \[\leadsto \color{blue}{\left(z \cdot a\right) \cdot \left(b + \frac{y}{a}\right)} \]
    9. Taylor expanded in b around inf 47.5%

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

    if -1.25999999999999996e44 < z < 3.39999999999999975e42

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

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

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

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

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

    if 3.39999999999999975e42 < z < 2.1000000000000001e169

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

    if 2.1000000000000001e169 < z

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.26 \cdot 10^{+44}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+42}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+169}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 38.9% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;b \leq -1.1 \cdot 10^{-196}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 2.4 \cdot 10^{+110}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.70000000000000003e35

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

    if -2.70000000000000003e35 < b < -1.10000000000000007e-196

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

    if -1.10000000000000007e-196 < b < 2.40000000000000012e110

    1. Initial program 89.7%

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around 0 45.2%

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

    if 2.40000000000000012e110 < b

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.7 \cdot 10^{+35}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq -1.1 \cdot 10^{-196}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 2.4 \cdot 10^{+110}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 84.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{+93} \lor \neg \left(a \leq 1.25 \cdot 10^{-127}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.9500000000000001e93 or 1.2499999999999999e-127 < a

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9500000000000001e93 < a < 1.2499999999999999e-127

    1. Initial program 96.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+96.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.95 \cdot 10^{+93} \lor \neg \left(a \leq 1.25 \cdot 10^{-127}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 81.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.45 \cdot 10^{+44} \lor \neg \left(z \leq 8.5 \cdot 10^{+42}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.4499999999999999e44 or 8.5000000000000003e42 < z

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

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

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

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

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

    if -3.4499999999999999e44 < z < 8.5000000000000003e42

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 85.2% accurate, 0.8× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e44 < b < 3.79999999999999989e150

    1. Initial program 91.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+91.8%

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

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

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

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

    if 3.79999999999999989e150 < b

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -8.5 \cdot 10^{+44}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;b \leq 3.8 \cdot 10^{+150}:\\ \;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 38.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{+93}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;a \leq -2.8 \cdot 10^{-100}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 1.75 \cdot 10^{-104}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.7999999999999997e93 or 1.75000000000000014e-104 < a

    1. Initial program 83.1%

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around 0 56.3%

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

    if -5.7999999999999997e93 < a < -2.79999999999999995e-100

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

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

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

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

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

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

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

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

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

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

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

    if -2.79999999999999995e-100 < a < 1.75000000000000014e-104

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.8 \cdot 10^{+93}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq -2.8 \cdot 10^{-100}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 1.75 \cdot 10^{-104}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 70.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{+64} \lor \neg \left(a \leq 9.6 \cdot 10^{-148}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.1e64 or 9.6000000000000005e-148 < a

    1. Initial program 84.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+84.3%

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

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

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

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

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

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

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

    if -2.1e64 < a < 9.6000000000000005e-148

    1. Initial program 96.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+96.8%

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{y \cdot z} \]
    9. Step-by-step derivation
      1. *-commutative76.2%

        \[\leadsto x + \color{blue}{z \cdot y} \]
    10. Simplified76.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.1 \cdot 10^{+64} \lor \neg \left(a \leq 9.6 \cdot 10^{-148}\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 38.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.1 \cdot 10^{-86} \lor \neg \left(a \leq 2.6 \cdot 10^{-102}\right):\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.10000000000000006e-86 or 2.59999999999999986e-102 < a

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot t} \]
    6. Taylor expanded in x around 0 47.9%

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

    if -5.10000000000000006e-86 < a < 2.59999999999999986e-102

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 26.1% accurate, 15.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 90.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+90.3%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  9. Add Preprocessing

Developer Target 1: 97.3% accurate, 0.7× 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 2024178 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))

  (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))