Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.2% → 96.7%
Time: 8.9s
Alternatives: 17
Speedup: 0.8×

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 17 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 96.7% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(z \cdot a, b, \mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (+ (+ (* t a) (+ x (* y z))) (* (* z a) b)) INFINITY)
   (fma (* z a) b (fma a t (fma z y x)))
   (* z (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((((t * a) + (x + (y * z))) + ((z * a) * b)) <= ((double) INFINITY)) {
		tmp = fma((z * a), b, fma(a, t, fma(z, y, x)));
	} else {
		tmp = z * (y + (a * b));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(Float64(z * a) * b)) <= Inf)
		tmp = fma(Float64(z * a), b, fma(a, t, fma(z, y, x)));
	else
		tmp = Float64(z * Float64(y + Float64(a * b)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * a), $MachinePrecision] * b + N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

Alternative 2: 96.7% accurate, 0.5× speedup?

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

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


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

    1. Initial program 98.8%

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

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

    1. Initial program 0.0%

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

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

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

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

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

Alternative 3: 73.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -41000000000 \lor \neg \left(z \leq -2.05 \cdot 10^{-60}\right) \land \left(z \leq -5.4 \cdot 10^{-95} \lor \neg \left(z \leq 1.5 \cdot 10^{-55}\right) \land \left(z \leq 9.2 \cdot 10^{+34} \lor \neg \left(z \leq 2.35 \cdot 10^{+67}\right)\right)\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 -41000000000.0)
         (and (not (<= z -2.05e-60))
              (or (<= z -5.4e-95)
                  (and (not (<= z 1.5e-55))
                       (or (<= z 9.2e+34) (not (<= z 2.35e+67)))))))
   (* 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 <= -41000000000.0) || (!(z <= -2.05e-60) && ((z <= -5.4e-95) || (!(z <= 1.5e-55) && ((z <= 9.2e+34) || !(z <= 2.35e+67)))))) {
		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 <= (-41000000000.0d0)) .or. (.not. (z <= (-2.05d-60))) .and. (z <= (-5.4d-95)) .or. (.not. (z <= 1.5d-55)) .and. (z <= 9.2d+34) .or. (.not. (z <= 2.35d+67))) 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 <= -41000000000.0) || (!(z <= -2.05e-60) && ((z <= -5.4e-95) || (!(z <= 1.5e-55) && ((z <= 9.2e+34) || !(z <= 2.35e+67)))))) {
		tmp = z * (y + (a * b));
	} else {
		tmp = x + (t * a);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (z <= -41000000000.0) or (not (z <= -2.05e-60) and ((z <= -5.4e-95) or (not (z <= 1.5e-55) and ((z <= 9.2e+34) or not (z <= 2.35e+67))))):
		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 <= -41000000000.0) || (!(z <= -2.05e-60) && ((z <= -5.4e-95) || (!(z <= 1.5e-55) && ((z <= 9.2e+34) || !(z <= 2.35e+67))))))
		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 <= -41000000000.0) || (~((z <= -2.05e-60)) && ((z <= -5.4e-95) || (~((z <= 1.5e-55)) && ((z <= 9.2e+34) || ~((z <= 2.35e+67)))))))
		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, -41000000000.0], And[N[Not[LessEqual[z, -2.05e-60]], $MachinePrecision], Or[LessEqual[z, -5.4e-95], And[N[Not[LessEqual[z, 1.5e-55]], $MachinePrecision], Or[LessEqual[z, 9.2e+34], N[Not[LessEqual[z, 2.35e+67]], $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 -41000000000 \lor \neg \left(z \leq -2.05 \cdot 10^{-60}\right) \land \left(z \leq -5.4 \cdot 10^{-95} \lor \neg \left(z \leq 1.5 \cdot 10^{-55}\right) \land \left(z \leq 9.2 \cdot 10^{+34} \lor \neg \left(z \leq 2.35 \cdot 10^{+67}\right)\right)\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 < -4.1e10 or -2.05000000000000006e-60 < z < -5.4e-95 or 1.50000000000000008e-55 < z < 9.1999999999999993e34 or 2.35000000000000009e67 < z

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

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

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

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

    if -4.1e10 < z < -2.05000000000000006e-60 or -5.4e-95 < z < 1.50000000000000008e-55 or 9.1999999999999993e34 < z < 2.35000000000000009e67

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -41000000000 \lor \neg \left(z \leq -2.05 \cdot 10^{-60}\right) \land \left(z \leq -5.4 \cdot 10^{-95} \lor \neg \left(z \leq 1.5 \cdot 10^{-55}\right) \land \left(z \leq 9.2 \cdot 10^{+34} \lor \neg \left(z \leq 2.35 \cdot 10^{+67}\right)\right)\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]

Alternative 4: 86.6% accurate, 0.8× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.8e11 or 1.15e112 < z

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8e11 < z < 1.5199999999999999e-57

    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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

    if 1.5199999999999999e-57 < z < 5.00000000000000007e42

    1. Initial program 99.9%

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

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

    if 5.00000000000000007e42 < z < 1.15e112

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -380000000000:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;z \leq 1.52 \cdot 10^{-57}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+42}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b + \left(y \cdot z + t \cdot a\right)\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+112}:\\ \;\;\;\;y \cdot z + \left(x + t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\ \end{array} \]

Alternative 5: 95.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+93} \lor \neg \left(z \leq 2 \cdot 10^{+111}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.2000000000000006e93 or 1.99999999999999991e111 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.2000000000000006e93 < z < 1.99999999999999991e111

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

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

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

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

Alternative 6: 74.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -9.4 \cdot 10^{-27} \lor \neg \left(a \leq 2.45 \cdot 10^{-42}\right) \land \left(a \leq 5400000 \lor \neg \left(a \leq 1.2 \cdot 10^{+70}\right)\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 -9.4e-27)
         (and (not (<= a 2.45e-42))
              (or (<= a 5400000.0) (not (<= a 1.2e+70)))))
   (* 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 <= -9.4e-27) || (!(a <= 2.45e-42) && ((a <= 5400000.0) || !(a <= 1.2e+70)))) {
		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 <= (-9.4d-27)) .or. (.not. (a <= 2.45d-42)) .and. (a <= 5400000.0d0) .or. (.not. (a <= 1.2d+70))) 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 <= -9.4e-27) || (!(a <= 2.45e-42) && ((a <= 5400000.0) || !(a <= 1.2e+70)))) {
		tmp = a * (t + (z * b));
	} else {
		tmp = x + (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -9.4e-27) or (not (a <= 2.45e-42) and ((a <= 5400000.0) or not (a <= 1.2e+70))):
		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 <= -9.4e-27) || (!(a <= 2.45e-42) && ((a <= 5400000.0) || !(a <= 1.2e+70))))
		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 <= -9.4e-27) || (~((a <= 2.45e-42)) && ((a <= 5400000.0) || ~((a <= 1.2e+70)))))
		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, -9.4e-27], And[N[Not[LessEqual[a, 2.45e-42]], $MachinePrecision], Or[LessEqual[a, 5400000.0], N[Not[LessEqual[a, 1.2e+70]], $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 -9.4 \cdot 10^{-27} \lor \neg \left(a \leq 2.45 \cdot 10^{-42}\right) \land \left(a \leq 5400000 \lor \neg \left(a \leq 1.2 \cdot 10^{+70}\right)\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 < -9.40000000000000065e-27 or 2.45e-42 < a < 5.4e6 or 1.19999999999999993e70 < a

    1. Initial program 92.1%

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

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

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

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

    if -9.40000000000000065e-27 < a < 2.45e-42 or 5.4e6 < a < 1.19999999999999993e70

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.4 \cdot 10^{-27} \lor \neg \left(a \leq 2.45 \cdot 10^{-42}\right) \land \left(a \leq 5400000 \lor \neg \left(a \leq 1.2 \cdot 10^{+70}\right)\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]

Alternative 7: 74.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a \leq 1.4 \cdot 10^{-61}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 50000000:\\
\;\;\;\;y \cdot z + t \cdot a\\

\mathbf{elif}\;a \leq 6.6 \cdot 10^{+69}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.72e-38 or 6.5999999999999997e69 < a

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

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

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

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

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

    if -1.72e-38 < a < 1.4000000000000001e-61 or 5e7 < a < 6.5999999999999997e69

    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*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. Taylor expanded in a around 0 77.7%

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

    if 1.4000000000000001e-61 < a < 5e7

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.72 \cdot 10^{-38}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-61}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 50000000:\\ \;\;\;\;y \cdot z + t \cdot a\\ \mathbf{elif}\;a \leq 6.6 \cdot 10^{+69}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 8: 40.0% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;t \leq -4.5 \cdot 10^{-268}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{-291}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 1.7 \cdot 10^{-106}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;t \leq 2.2 \cdot 10^{+121}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.50000000000000002e77 or 2.20000000000000001e121 < t

    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.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. Taylor expanded in t around inf 63.5%

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

    if -2.50000000000000002e77 < t < -4.5000000000000001e-268

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

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

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

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

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

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

    if -4.5000000000000001e-268 < t < 1.10000000000000001e-291 or 1.69999999999999991e-106 < t < 2.20000000000000001e121

    1. Initial program 97.9%

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

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

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

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

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

    if 1.10000000000000001e-291 < t < 1.69999999999999991e-106

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.5 \cdot 10^{+77}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;t \leq -4.5 \cdot 10^{-268}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{-291}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-106}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+121}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]

Alternative 9: 39.5% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;t \leq -6 \cdot 10^{-176}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\

\mathbf{elif}\;t \leq 7.8 \cdot 10^{-292}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 6.5 \cdot 10^{-96}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;t \leq 2.8 \cdot 10^{+120}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -7.4999999999999998e129 or 2.8000000000000001e120 < t

    1. Initial program 94.6%

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

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

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

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

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

    if -7.4999999999999998e129 < t < -6e-176

    1. Initial program 95.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+95.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*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. Step-by-step derivation
      1. associate-+r+90.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6e-176 < t < 7.8e-292 or 6.50000000000000001e-96 < t < 2.8000000000000001e120

    1. Initial program 97.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+97.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.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. Taylor expanded in x around inf 40.8%

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

    if 7.8e-292 < t < 6.50000000000000001e-96

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{+129}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;t \leq -6 \cdot 10^{-176}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{-292}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-96}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{+120}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]

Alternative 10: 61.6% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;z \leq -1.35 \cdot 10^{-59}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -9.5 \cdot 10^{-115}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 2.2 \cdot 10^{+115}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.7e12 or -1.3499999999999999e-59 < z < -9.4999999999999996e-115

    1. Initial program 92.1%

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

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

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

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

    if -2.7e12 < z < -1.3499999999999999e-59 or -9.4999999999999996e-115 < z < 2.2e115

    1. Initial program 99.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+99.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*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. Taylor expanded in z around 0 74.9%

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

    if 2.2e115 < z

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 87.4% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.19999999999999938e38 or 6.5999999999999997e69 < a

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999938e38 < a < 6.5999999999999997e69

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

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

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

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

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

Alternative 12: 87.3% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.6e12 or 1.8000000000000001e57 < z

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6e12 < z < 1.8000000000000001e57

    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. +-commutative99.9%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 80.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+158}:\\
\;\;\;\;x + y \cdot z\\

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

\mathbf{else}:\\
\;\;\;\;y \cdot z + t \cdot a\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.4999999999999998e158

    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*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. Taylor expanded in a around 0 82.9%

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

    if -2.4999999999999998e158 < y < 1.65e72

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

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

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

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

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

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

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

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

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

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

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

    if 1.65e72 < y

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

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

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

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

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

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

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

Alternative 14: 59.3% accurate, 1.6× speedup?

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

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

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

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


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

    1. Initial program 90.8%

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

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

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

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

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

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

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

    if -2.8e12 < z < 1.7e117

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

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

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

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

    if 1.7e117 < z

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 38.3% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;x \leq 2.8 \cdot 10^{+119}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.5e120 or 2.80000000000000013e119 < x

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

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

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

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

    if -9.5e120 < x < 2.80000000000000013e119

    1. Initial program 94.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.5 \cdot 10^{+120}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+119}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 16: 40.1% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;y \leq 6.2 \cdot 10^{+62}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.2e73 or 6.20000000000000029e62 < y

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

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

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

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

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

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

    if -2.2e73 < y < 6.20000000000000029e62

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+73}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{+62}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 17: 26.0% 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 95.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+95.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*93.9%

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

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

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

    \[\leadsto x \]

Developer target: 97.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023240 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

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

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