Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.5% → 97.8%
Time: 10.4s
Alternatives: 13
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 13 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.5% 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: 97.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 86.9%

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

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. 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 z around inf 97.7%

      \[\leadsto \left(x + y \cdot z\right) + \color{blue}{z \cdot \left(a \cdot b + \frac{a \cdot t}{z}\right)} \]
    6. Step-by-step derivation
      1. associate-/l*97.7%

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

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

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

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

    1. Initial program 99.5%

      \[\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. +-commutative0.0%

        \[\leadsto \color{blue}{\left(y \cdot z + x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      3. fma-define0.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*10.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 inf 90.0%

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

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

Alternative 2: 97.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ t_2 := \left(z \cdot a\right) \cdot b + \left(t\_1 + t \cdot a\right)\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1 + z \cdot \left(a \cdot \left(b + \frac{t}{z}\right)\right)\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;t\_2\\ \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_2 (+ (* (* z a) b) (+ t_1 (* t a)))))
   (if (<= t_2 (- INFINITY))
     (+ t_1 (* z (* a (+ b (/ t z)))))
     (if (<= t_2 INFINITY) t_2 (* z (+ y (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double t_2 = ((z * a) * b) + (t_1 + (t * a));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1 + (z * (a * (b + (t / z))));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_2;
	} 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);
	double t_2 = ((z * a) * b) + (t_1 + (t * a));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1 + (z * (a * (b + (t / z))));
	} else if (t_2 <= Double.POSITIVE_INFINITY) {
		tmp = t_2;
	} else {
		tmp = z * (y + (a * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * z)
	t_2 = ((z * a) * b) + (t_1 + (t * a))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1 + (z * (a * (b + (t / z))))
	elif t_2 <= math.inf:
		tmp = t_2
	else:
		tmp = z * (y + (a * b))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	t_2 = Float64(Float64(Float64(z * a) * b) + Float64(t_1 + Float64(t * a)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(t_1 + Float64(z * Float64(a * Float64(b + Float64(t / z)))));
	elseif (t_2 <= Inf)
		tmp = t_2;
	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_2 = ((z * a) * b) + (t_1 + (t * a));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1 + (z * (a * (b + (t / z))));
	elseif (t_2 <= Inf)
		tmp = t_2;
	else
		tmp = z * (y + (a * b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision] + N[(t$95$1 + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$1 + N[(z * N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$2, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 86.9%

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

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. 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 z around inf 97.7%

      \[\leadsto \left(x + y \cdot z\right) + \color{blue}{z \cdot \left(a \cdot b + \frac{a \cdot t}{z}\right)} \]
    6. Step-by-step derivation
      1. associate-/l*97.7%

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

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

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

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

    1. Initial program 99.5%

      \[\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*10.0%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified10.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 90.0%

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

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

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

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

Alternative 3: 80.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{if}\;a \leq -3.8 \cdot 10^{-160}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.76 \cdot 10^{-184}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 5.6 \cdot 10^{-59} \lor \neg \left(a \leq 1.25 \cdot 10^{+40}\right):\\ \;\;\;\;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 (* a (+ t (* z b))))))
   (if (<= a -3.8e-160)
     t_1
     (if (<= a 1.76e-184)
       (+ x (* y z))
       (if (or (<= a 5.6e-59) (not (<= a 1.25e+40)))
         t_1
         (* z (+ y (* a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (a * (t + (z * b)));
	double tmp;
	if (a <= -3.8e-160) {
		tmp = t_1;
	} else if (a <= 1.76e-184) {
		tmp = x + (y * z);
	} else if ((a <= 5.6e-59) || !(a <= 1.25e+40)) {
		tmp = t_1;
	} else {
		tmp = 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) :: t_1
    real(8) :: tmp
    t_1 = x + (a * (t + (z * b)))
    if (a <= (-3.8d-160)) then
        tmp = t_1
    else if (a <= 1.76d-184) then
        tmp = x + (y * z)
    else if ((a <= 5.6d-59) .or. (.not. (a <= 1.25d+40))) then
        tmp = t_1
    else
        tmp = 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 t_1 = x + (a * (t + (z * b)));
	double tmp;
	if (a <= -3.8e-160) {
		tmp = t_1;
	} else if (a <= 1.76e-184) {
		tmp = x + (y * z);
	} else if ((a <= 5.6e-59) || !(a <= 1.25e+40)) {
		tmp = t_1;
	} else {
		tmp = z * (y + (a * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (a * (t + (z * b)))
	tmp = 0
	if a <= -3.8e-160:
		tmp = t_1
	elif a <= 1.76e-184:
		tmp = x + (y * z)
	elif (a <= 5.6e-59) or not (a <= 1.25e+40):
		tmp = t_1
	else:
		tmp = z * (y + (a * b))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(a * Float64(t + Float64(z * b))))
	tmp = 0.0
	if (a <= -3.8e-160)
		tmp = t_1;
	elseif (a <= 1.76e-184)
		tmp = Float64(x + Float64(y * z));
	elseif ((a <= 5.6e-59) || !(a <= 1.25e+40))
		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 + (a * (t + (z * b)));
	tmp = 0.0;
	if (a <= -3.8e-160)
		tmp = t_1;
	elseif (a <= 1.76e-184)
		tmp = x + (y * z);
	elseif ((a <= 5.6e-59) || ~((a <= 1.25e+40)))
		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[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.8e-160], t$95$1, If[LessEqual[a, 1.76e-184], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 5.6e-59], N[Not[LessEqual[a, 1.25e+40]], $MachinePrecision]], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;a \leq 5.6 \cdot 10^{-59} \lor \neg \left(a \leq 1.25 \cdot 10^{+40}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.7999999999999998e-160 or 1.76e-184 < a < 5.59999999999999961e-59 or 1.25000000000000001e40 < a

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{\left(-\left(-b \cdot z\right)\right)}\right) \]
      9. *-commutative96.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-out96.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-neg96.7%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \color{blue}{\left(t - \left(-z\right) \cdot b\right)} \]
      12. sub-neg96.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-out96.7%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \left(-\color{blue}{\left(-z \cdot b\right)}\right)\right) \]
      14. *-commutative96.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-neg96.7%

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z \cdot b}\right) \]
    3. Simplified96.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 87.4%

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

    if -3.7999999999999998e-160 < a < 1.76e-184

    1. Initial program 99.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+99.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*86.0%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified86.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 a around 0 86.8%

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

    if 5.59999999999999961e-59 < a < 1.25000000000000001e40

    1. Initial program 89.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+89.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*94.4%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.8 \cdot 10^{-160}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 1.76 \cdot 10^{-184}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 5.6 \cdot 10^{-59} \lor \neg \left(a \leq 1.25 \cdot 10^{+40}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+166} \lor \neg \left(z \leq -5.5 \cdot 10^{+137} \lor \neg \left(z \leq -7 \cdot 10^{+56}\right) \land z \leq 2.5 \cdot 10^{-27}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.99999999999999952e166 or -5.5000000000000002e137 < z < -6.99999999999999999e56 or 2.5000000000000001e-27 < z

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified86.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 80.7%

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

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

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

    if -7.99999999999999952e166 < z < -5.5000000000000002e137 or -6.99999999999999999e56 < z < 2.5000000000000001e-27

    1. Initial program 97.8%

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

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. 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 z around 0 79.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+166} \lor \neg \left(z \leq -5.5 \cdot 10^{+137} \lor \neg \left(z \leq -7 \cdot 10^{+56}\right) \land z \leq 2.5 \cdot 10^{-27}\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 39.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq 1.55 \cdot 10^{-13}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 9.2 \cdot 10^{+138} \lor \neg \left(z \leq 6.8 \cdot 10^{+208}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.55000000000000011e57 or 1.55e-13 < z < 9.2000000000000003e138 or 6.7999999999999997e208 < z

    1. Initial program 87.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+87.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*84.2%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified84.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 z around inf 77.3%

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

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

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

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

    if -2.55000000000000011e57 < z < 1.55e-13

    1. Initial program 98.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+98.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*99.2%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified99.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 x around inf 41.4%

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

    if 9.2000000000000003e138 < z < 6.7999999999999997e208

    1. Initial program 89.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+89.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*89.2%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified89.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 y around inf 59.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.55 \cdot 10^{+57}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+138} \lor \neg \left(z \leq 6.8 \cdot 10^{+208}\right):\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 92.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{-70} \lor \neg \left(z \leq 6.2 \cdot 10^{-43}\right):\\ \;\;\;\;\left(x + y \cdot z\right) + z \cdot \left(a \cdot \left(b + \frac{t}{z}\right)\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 -1.6e-70) (not (<= z 6.2e-43)))
   (+ (+ x (* y z)) (* z (* a (+ b (/ t z)))))
   (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1.6e-70) || !(z <= 6.2e-43)) {
		tmp = (x + (y * z)) + (z * (a * (b + (t / z))));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((z <= (-1.6d-70)) .or. (.not. (z <= 6.2d-43))) then
        tmp = (x + (y * z)) + (z * (a * (b + (t / z))))
    else
        tmp = x + (a * (t + (z * b)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -1.6e-70) || !(z <= 6.2e-43)) {
		tmp = (x + (y * z)) + (z * (a * (b + (t / z))));
	} else {
		tmp = x + (a * (t + (z * b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -1.6e-70) or not (z <= 6.2e-43):
		tmp = (x + (y * z)) + (z * (a * (b + (t / z))))
	else:
		tmp = x + (a * (t + (z * b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -1.6e-70) || !(z <= 6.2e-43))
		tmp = Float64(Float64(x + Float64(y * z)) + Float64(z * Float64(a * Float64(b + Float64(t / z)))));
	else
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((z <= -1.6e-70) || ~((z <= 6.2e-43)))
		tmp = (x + (y * z)) + (z * (a * (b + (t / z))));
	else
		tmp = x + (a * (t + (z * b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.6e-70], N[Not[LessEqual[z, 6.2e-43]], $MachinePrecision]], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(z * N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $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 -1.6 \cdot 10^{-70} \lor \neg \left(z \leq 6.2 \cdot 10^{-43}\right):\\
\;\;\;\;\left(x + y \cdot z\right) + z \cdot \left(a \cdot \left(b + \frac{t}{z}\right)\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 < -1.5999999999999999e-70 or 6.1999999999999999e-43 < z

    1. Initial program 89.6%

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

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified87.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 inf 95.3%

      \[\leadsto \left(x + y \cdot z\right) + \color{blue}{z \cdot \left(a \cdot b + \frac{a \cdot t}{z}\right)} \]
    6. Step-by-step derivation
      1. associate-/l*96.6%

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

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

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

    if -1.5999999999999999e-70 < z < 6.1999999999999999e-43

    1. Initial program 99.0%

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

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

        \[\leadsto \color{blue}{\left(y \cdot z + x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      3. fma-define99.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*99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 90.8%

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

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

Alternative 7: 96.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ \mathbf{if}\;z \leq -2 \cdot 10^{+132} \lor \neg \left(z \leq 1.7 \cdot 10^{-14}\right):\\ \;\;\;\;t\_1 + z \cdot \left(a \cdot \left(b + \frac{t}{z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 + \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
 (let* ((t_1 (+ x (* y z))))
   (if (or (<= z -2e+132) (not (<= z 1.7e-14)))
     (+ t_1 (* z (* a (+ b (/ t z)))))
     (+ t_1 (+ (* a (* z b)) (* t a))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double tmp;
	if ((z <= -2e+132) || !(z <= 1.7e-14)) {
		tmp = t_1 + (z * (a * (b + (t / z))));
	} else {
		tmp = t_1 + ((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) :: t_1
    real(8) :: tmp
    t_1 = x + (y * z)
    if ((z <= (-2d+132)) .or. (.not. (z <= 1.7d-14))) then
        tmp = t_1 + (z * (a * (b + (t / z))))
    else
        tmp = t_1 + ((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 t_1 = x + (y * z);
	double tmp;
	if ((z <= -2e+132) || !(z <= 1.7e-14)) {
		tmp = t_1 + (z * (a * (b + (t / z))));
	} else {
		tmp = t_1 + ((a * (z * b)) + (t * a));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * z)
	tmp = 0
	if (z <= -2e+132) or not (z <= 1.7e-14):
		tmp = t_1 + (z * (a * (b + (t / z))))
	else:
		tmp = t_1 + ((a * (z * b)) + (t * a))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	tmp = 0.0
	if ((z <= -2e+132) || !(z <= 1.7e-14))
		tmp = Float64(t_1 + Float64(z * Float64(a * Float64(b + Float64(t / z)))));
	else
		tmp = Float64(t_1 + Float64(Float64(a * Float64(z * b)) + Float64(t * a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (y * z);
	tmp = 0.0;
	if ((z <= -2e+132) || ~((z <= 1.7e-14)))
		tmp = t_1 + (z * (a * (b + (t / z))));
	else
		tmp = t_1 + ((a * (z * b)) + (t * a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -2e+132], N[Not[LessEqual[z, 1.7e-14]], $MachinePrecision]], N[(t$95$1 + N[(z * N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;z \leq -2 \cdot 10^{+132} \lor \neg \left(z \leq 1.7 \cdot 10^{-14}\right):\\
\;\;\;\;t\_1 + z \cdot \left(a \cdot \left(b + \frac{t}{z}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 + \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 < -1.99999999999999998e132 or 1.70000000000000001e-14 < z

    1. Initial program 86.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+86.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*83.2%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified83.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 z around inf 93.6%

      \[\leadsto \left(x + y \cdot z\right) + \color{blue}{z \cdot \left(a \cdot b + \frac{a \cdot t}{z}\right)} \]
    6. Step-by-step derivation
      1. associate-/l*96.3%

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

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

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

    if -1.99999999999999998e132 < z < 1.70000000000000001e-14

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified99.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
  3. Recombined 2 regimes into one program.
  4. Final simplification98.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+132} \lor \neg \left(z \leq 1.7 \cdot 10^{-14}\right):\\ \;\;\;\;\left(x + y \cdot z\right) + z \cdot \left(a \cdot \left(b + \frac{t}{z}\right)\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 8: 87.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.8 \cdot 10^{+78} \lor \neg \left(b \leq 1.4 \cdot 10^{+46}\right):\\
\;\;\;\;x + b \cdot \left(a \cdot \left(z + \frac{t}{b}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.80000000000000034e78 or 1.40000000000000009e46 < b

    1. Initial program 92.6%

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

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

        \[\leadsto \color{blue}{\left(y \cdot z + x\right)} + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right) \]
      3. fma-define92.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*83.6%

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{\left(-\left(-b \cdot z\right)\right)}\right) \]
      9. *-commutative87.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-out87.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-neg87.7%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \color{blue}{\left(t - \left(-z\right) \cdot b\right)} \]
      12. sub-neg87.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-out87.7%

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \left(-\color{blue}{\left(-z \cdot b\right)}\right)\right) \]
      14. *-commutative87.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-neg87.7%

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + \color{blue}{z \cdot b}\right) \]
    3. Simplified87.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 83.3%

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

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

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

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

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

    if -5.80000000000000034e78 < b < 1.40000000000000009e46

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified97.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 t around inf 90.9%

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

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

Alternative 9: 87.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{-8} \lor \neg \left(a \leq 1.9 \cdot 10^{+41}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.19999999999999962e-8 or 1.9000000000000001e41 < a

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, z, x\right) + \left(t \cdot a + a \cdot \color{blue}{\left(b \cdot z\right)}\right) \]
      6. *-commutative93.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-out97.5%

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

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

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

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

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

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

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

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

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

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

      \[\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 + b \cdot z\right)} \]

    if -7.19999999999999962e-8 < a < 1.9000000000000001e41

    1. Initial program 98.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+98.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*91.1%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified91.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 inf 87.8%

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

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

Alternative 10: 58.5% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.6999999999999998e70 or 2.70000000000000008e159 < a

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified90.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 inf 52.7%

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

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

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

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

    if -4.6999999999999998e70 < a < 2.70000000000000008e159

    1. Initial program 97.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+97.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*93.1%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified93.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 a around 0 68.2%

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

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

Alternative 11: 63.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-47} \lor \neg \left(y \leq 7 \cdot 10^{+56}\right):\\
\;\;\;\;x + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.7000000000000001e-47 or 6.99999999999999999e56 < y

    1. Initial program 92.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+92.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*91.2%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified91.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 a around 0 67.0%

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

    if -1.7000000000000001e-47 < y < 6.99999999999999999e56

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified93.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 z around 0 62.2%

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

        \[\leadsto \color{blue}{a \cdot t + x} \]
    7. Simplified62.2%

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

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

Alternative 12: 38.5% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+91}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 5.6 \cdot 10^{-71}:\\
\;\;\;\;y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.09999999999999998e91 or 5.60000000000000001e-71 < x

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

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified94.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 x around inf 47.5%

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

    if -3.09999999999999998e91 < x < 5.60000000000000001e-71

    1. Initial program 92.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l+92.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*90.7%

        \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
    3. Simplified90.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 y around inf 35.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{+91}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{-71}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 26.7% accurate, 15.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 93.5%

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

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

      \[\leadsto \left(x + y \cdot z\right) + \left(t \cdot a + \color{blue}{a \cdot \left(z \cdot b\right)}\right) \]
  3. Simplified92.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 x around inf 27.5%

    \[\leadsto \color{blue}{x} \]
  6. Final simplification27.5%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 97.2% 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 2024130 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :alt
  (if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

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