Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.8% → 95.7%
Time: 10.5s
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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 95.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{+130} \lor \neg \left(z \leq 2.5 \cdot 10^{+67}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.60000000000000097e130 or 2.49999999999999988e67 < z

    1. Initial program 78.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+78.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*78.9%

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

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

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

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

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

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

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

    if -9.60000000000000097e130 < z < 2.49999999999999988e67

    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*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
  3. Recombined 2 regimes into one program.
  4. Final simplification97.3%

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

Alternative 2: 96.8% 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 2 \cdot 10^{+304}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(a \cdot \left(\frac{t}{y} + z \cdot \frac{b}{y}\right) + \left(z + \frac{x}{y}\right)\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 2e+304)
     t_1
     (* y (+ (* a (+ (/ t y) (* z (/ b y)))) (+ z (/ x y)))))))
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 <= 2e+304) {
		tmp = t_1;
	} else {
		tmp = y * ((a * ((t / y) + (z * (b / y)))) + (z + (x / y)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b)
    if (t_1 <= 2d+304) then
        tmp = t_1
    else
        tmp = y * ((a * ((t / y) + (z * (b / y)))) + (z + (x / y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
	double tmp;
	if (t_1 <= 2e+304) {
		tmp = t_1;
	} else {
		tmp = y * ((a * ((t / y) + (z * (b / y)))) + (z + (x / y)));
	}
	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 <= 2e+304:
		tmp = t_1
	else:
		tmp = y * ((a * ((t / y) + (z * (b / y)))) + (z + (x / y)))
	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 <= 2e+304)
		tmp = t_1;
	else
		tmp = Float64(y * Float64(Float64(a * Float64(Float64(t / y) + Float64(z * Float64(b / y)))) + Float64(z + Float64(x / y))));
	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 <= 2e+304)
		tmp = t_1;
	else
		tmp = y * ((a * ((t / y) + (z * (b / y)))) + (z + (x / y)));
	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, 2e+304], t$95$1, N[(y * N[(N[(a * N[(N[(t / y), $MachinePrecision] + N[(z * N[(b / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z + N[(x / y), $MachinePrecision]), $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 2 \cdot 10^{+304}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 97.6%

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

    if 1.9999999999999999e304 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 63.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+63.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*76.1%

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

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

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

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

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

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

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

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

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

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

    \[\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 2 \cdot 10^{+304}:\\ \;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(a \cdot \left(\frac{t}{y} + z \cdot \frac{b}{y}\right) + \left(z + \frac{x}{y}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 96.7% 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 97.1%

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

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

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

    \[\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 4: 40.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z \cdot a\right) \cdot b\\ \mathbf{if}\;y \leq -6.6 \cdot 10^{+25}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-172}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.9 \cdot 10^{-259}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-289}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-218}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4200000:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (* z a) b)))
   (if (<= y -6.6e+25)
     (* y z)
     (if (<= y -2.2e-172)
       t_1
       (if (<= y -4.9e-259)
         x
         (if (<= y 1.6e-289)
           t_1
           (if (<= y 1.4e-218) x (if (<= y 4200000.0) (* t a) (* y z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z * a) * b;
	double tmp;
	if (y <= -6.6e+25) {
		tmp = y * z;
	} else if (y <= -2.2e-172) {
		tmp = t_1;
	} else if (y <= -4.9e-259) {
		tmp = x;
	} else if (y <= 1.6e-289) {
		tmp = t_1;
	} else if (y <= 1.4e-218) {
		tmp = x;
	} else if (y <= 4200000.0) {
		tmp = t * a;
	} else {
		tmp = y * z;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z * a) * b
    if (y <= (-6.6d+25)) then
        tmp = y * z
    else if (y <= (-2.2d-172)) then
        tmp = t_1
    else if (y <= (-4.9d-259)) then
        tmp = x
    else if (y <= 1.6d-289) then
        tmp = t_1
    else if (y <= 1.4d-218) then
        tmp = x
    else if (y <= 4200000.0d0) then
        tmp = t * a
    else
        tmp = y * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z * a) * b;
	double tmp;
	if (y <= -6.6e+25) {
		tmp = y * z;
	} else if (y <= -2.2e-172) {
		tmp = t_1;
	} else if (y <= -4.9e-259) {
		tmp = x;
	} else if (y <= 1.6e-289) {
		tmp = t_1;
	} else if (y <= 1.4e-218) {
		tmp = x;
	} else if (y <= 4200000.0) {
		tmp = t * a;
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z * a) * b
	tmp = 0
	if y <= -6.6e+25:
		tmp = y * z
	elif y <= -2.2e-172:
		tmp = t_1
	elif y <= -4.9e-259:
		tmp = x
	elif y <= 1.6e-289:
		tmp = t_1
	elif y <= 1.4e-218:
		tmp = x
	elif y <= 4200000.0:
		tmp = t * a
	else:
		tmp = y * z
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z * a) * b)
	tmp = 0.0
	if (y <= -6.6e+25)
		tmp = Float64(y * z);
	elseif (y <= -2.2e-172)
		tmp = t_1;
	elseif (y <= -4.9e-259)
		tmp = x;
	elseif (y <= 1.6e-289)
		tmp = t_1;
	elseif (y <= 1.4e-218)
		tmp = x;
	elseif (y <= 4200000.0)
		tmp = Float64(t * a);
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z * a) * b;
	tmp = 0.0;
	if (y <= -6.6e+25)
		tmp = y * z;
	elseif (y <= -2.2e-172)
		tmp = t_1;
	elseif (y <= -4.9e-259)
		tmp = x;
	elseif (y <= 1.6e-289)
		tmp = t_1;
	elseif (y <= 1.4e-218)
		tmp = x;
	elseif (y <= 4200000.0)
		tmp = t * a;
	else
		tmp = y * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[y, -6.6e+25], N[(y * z), $MachinePrecision], If[LessEqual[y, -2.2e-172], t$95$1, If[LessEqual[y, -4.9e-259], x, If[LessEqual[y, 1.6e-289], t$95$1, If[LessEqual[y, 1.4e-218], x, If[LessEqual[y, 4200000.0], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.2 \cdot 10^{-172}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -4.9 \cdot 10^{-259}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.6 \cdot 10^{-289}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{-218}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.6000000000000002e25 or 4.2e6 < y

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

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

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

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

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

    if -6.6000000000000002e25 < y < -2.20000000000000009e-172 or -4.90000000000000023e-259 < y < 1.6000000000000001e-289

    1. Initial program 95.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+95.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*89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000009e-172 < y < -4.90000000000000023e-259 or 1.6000000000000001e-289 < y < 1.40000000000000004e-218

    1. Initial program 97.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+97.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.0%

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

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

    if 1.40000000000000004e-218 < y < 4.2e6

    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*93.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+25}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-172}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;y \leq -4.9 \cdot 10^{-259}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-289}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-218}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4200000:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 59.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;a \leq -1.85 \cdot 10^{+209}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.55 \cdot 10^{+180}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq -4.5 \cdot 10^{+44}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{+117}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= a -1.85e+209)
     t_1
     (if (<= a -1.55e+180)
       (* t a)
       (if (<= a -4.5e+44)
         (* (* z a) b)
         (if (<= a 3.8e+117) (+ x (* y z)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (a <= -1.85e+209) {
		tmp = t_1;
	} else if (a <= -1.55e+180) {
		tmp = t * a;
	} else if (a <= -4.5e+44) {
		tmp = (z * a) * b;
	} else if (a <= 3.8e+117) {
		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 = a * (z * b)
    if (a <= (-1.85d+209)) then
        tmp = t_1
    else if (a <= (-1.55d+180)) then
        tmp = t * a
    else if (a <= (-4.5d+44)) then
        tmp = (z * a) * b
    else if (a <= 3.8d+117) 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 = a * (z * b);
	double tmp;
	if (a <= -1.85e+209) {
		tmp = t_1;
	} else if (a <= -1.55e+180) {
		tmp = t * a;
	} else if (a <= -4.5e+44) {
		tmp = (z * a) * b;
	} else if (a <= 3.8e+117) {
		tmp = x + (y * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if a <= -1.85e+209:
		tmp = t_1
	elif a <= -1.55e+180:
		tmp = t * a
	elif a <= -4.5e+44:
		tmp = (z * a) * b
	elif a <= 3.8e+117:
		tmp = x + (y * z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (a <= -1.85e+209)
		tmp = t_1;
	elseif (a <= -1.55e+180)
		tmp = Float64(t * a);
	elseif (a <= -4.5e+44)
		tmp = Float64(Float64(z * a) * b);
	elseif (a <= 3.8e+117)
		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 = a * (z * b);
	tmp = 0.0;
	if (a <= -1.85e+209)
		tmp = t_1;
	elseif (a <= -1.55e+180)
		tmp = t * a;
	elseif (a <= -4.5e+44)
		tmp = (z * a) * b;
	elseif (a <= 3.8e+117)
		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[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.85e+209], t$95$1, If[LessEqual[a, -1.55e+180], N[(t * a), $MachinePrecision], If[LessEqual[a, -4.5e+44], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 3.8e+117], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.55 \cdot 10^{+180}:\\
\;\;\;\;t \cdot a\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.85e209 or 3.8000000000000002e117 < a

    1. Initial program 80.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.85e209 < a < -1.54999999999999999e180

    1. Initial program 63.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+63.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*81.8%

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

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

    if -1.54999999999999999e180 < a < -4.5e44

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5e44 < a < 3.8000000000000002e117

    1. Initial program 98.1%

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

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

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

Alternative 6: 88.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+157} \lor \neg \left(z \leq 1.4 \cdot 10^{+108}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.8000000000000003e157 or 1.3999999999999999e108 < z

    1. Initial program 78.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+78.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*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 81.4%

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

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

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

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

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

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

    if -9.8000000000000003e157 < z < 1.3999999999999999e108

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

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

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

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

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

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

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

Alternative 7: 82.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+69} \lor \neg \left(x \leq 7 \cdot 10^{-84}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.90000000000000014e69 or 7.0000000000000002e-84 < x

    1. Initial program 89.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+89.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*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 t around 0 83.1%

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

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

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

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

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

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

    if -1.90000000000000014e69 < x < 7.0000000000000002e-84

    1. Initial program 92.8%

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

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

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

Alternative 8: 63.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -7.6 \cdot 10^{-9} \lor \neg \left(z \leq 10^{+66}\right):\\
\;\;\;\;x + y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.04999999999999998e245

    1. Initial program 67.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+67.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*83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.04999999999999998e245 < z < -7.60000000000000023e-9 or 9.99999999999999945e65 < z

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

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

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

    if -7.60000000000000023e-9 < z < 9.99999999999999945e65

    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*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 z around 0 70.7%

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

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

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

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

Alternative 9: 82.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.3 \cdot 10^{+82} \lor \neg \left(a \leq 8.5 \cdot 10^{+19}\right):\\ \;\;\;\;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 -2.3e+82) (not (<= a 8.5e+19)))
   (* 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 <= -2.3e+82) || !(a <= 8.5e+19)) {
		tmp = 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 <= (-2.3d+82)) .or. (.not. (a <= 8.5d+19))) then
        tmp = 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 <= -2.3e+82) || !(a <= 8.5e+19)) {
		tmp = 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 <= -2.3e+82) or not (a <= 8.5e+19):
		tmp = 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 <= -2.3e+82) || !(a <= 8.5e+19))
		tmp = 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 <= -2.3e+82) || ~((a <= 8.5e+19)))
		tmp = 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, -2.3e+82], N[Not[LessEqual[a, 8.5e+19]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $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 -2.3 \cdot 10^{+82} \lor \neg \left(a \leq 8.5 \cdot 10^{+19}\right):\\
\;\;\;\;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 < -2.29999999999999988e82 or 8.5e19 < a

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

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

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

    if -2.29999999999999988e82 < a < 8.5e19

    1. Initial program 97.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+97.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.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 0 78.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.3 \cdot 10^{+82} \lor \neg \left(a \leq 8.5 \cdot 10^{+19}\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 10: 40.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 4.3 \cdot 10^{-218}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.5000000000000002e36 or 4.2e6 < y

    1. Initial program 90.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+90.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*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 y around inf 54.2%

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

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

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

    if -5.5000000000000002e36 < y < 4.3e-218

    1. Initial program 96.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+96.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*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 x around inf 39.6%

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

    if 4.3e-218 < y < 4.2e6

    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*93.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+36}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-218}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4200000:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 74.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.85 \cdot 10^{-7} \lor \neg \left(a \leq 2.55 \cdot 10^{+19}\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 -1.85e-7) (not (<= a 2.55e+19)))
   (* 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 <= -1.85e-7) || !(a <= 2.55e+19)) {
		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 <= (-1.85d-7)) .or. (.not. (a <= 2.55d+19))) 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 <= -1.85e-7) || !(a <= 2.55e+19)) {
		tmp = a * (t + (z * b));
	} else {
		tmp = x + (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -1.85e-7) or not (a <= 2.55e+19):
		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 <= -1.85e-7) || !(a <= 2.55e+19))
		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 <= -1.85e-7) || ~((a <= 2.55e+19)))
		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, -1.85e-7], N[Not[LessEqual[a, 2.55e+19]], $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 -1.85 \cdot 10^{-7} \lor \neg \left(a \leq 2.55 \cdot 10^{+19}\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 < -1.85000000000000002e-7 or 2.55e19 < a

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

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

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

    if -1.85000000000000002e-7 < a < 2.55e19

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

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

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

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

Alternative 12: 38.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{-15} \lor \neg \left(a \leq 6.6 \cdot 10^{-94}\right):\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.6e-15 or 6.6000000000000003e-94 < a

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

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

    if -1.6e-15 < a < 6.6000000000000003e-94

    1. Initial program 99.1%

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

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

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

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

Alternative 13: 26.6% 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 91.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+91.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*91.5%

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

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

Developer target: 97.4% 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 2024092 
(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)))