Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.5% → 98.1%
Time: 8.1s
Alternatives: 15
Speedup: 0.9×

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 15 alternatives:

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

Initial Program: 92.5% accurate, 1.0× speedup?

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

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

Alternative 1: 98.1% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{+114} \lor \neg \left(z \leq 10^{+68}\right):\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -4.3e+114) (not (<= z 1e+68)))
   (fma z (fma a b y) (fma t a x))
   (fma a (+ t (* z b)) (fma y z x))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -4.3e+114) || !(z <= 1e+68)) {
		tmp = fma(z, fma(a, b, y), fma(t, a, x));
	} else {
		tmp = fma(a, (t + (z * b)), fma(y, z, x));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((z <= -4.3e+114) || !(z <= 1e+68))
		tmp = fma(z, fma(a, b, y), fma(t, a, x));
	else
		tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, x));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.3e+114], N[Not[LessEqual[z, 1e+68]], $MachinePrecision]], N[(z * N[(a * b + y), $MachinePrecision] + N[(t * a + x), $MachinePrecision]), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+114} \lor \neg \left(z \leq 10^{+68}\right):\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.3000000000000001e114 or 9.99999999999999953e67 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.3000000000000001e114 < z < 9.99999999999999953e67

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

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

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

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

        \[\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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{+114} \lor \neg \left(z \leq 10^{+68}\right):\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), \mathsf{fma}\left(t, a, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\ \end{array} \]

Alternative 2: 95.6% accurate, 0.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 9.00000000000000039e131

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

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

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

        \[\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)} \]

    if 9.00000000000000039e131 < z

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 96.6% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 38.9% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq -1.02 \cdot 10^{-38}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -1.45 \cdot 10^{-137}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq 1.3 \cdot 10^{-278}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 4.1 \cdot 10^{+61}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq 10^{+117}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 3.8 \cdot 10^{+181}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq 1.35 \cdot 10^{+235}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -6.99999999999999956e127 or 1.00000000000000005e117 < a < 3.8000000000000001e181 or 1.3499999999999999e235 < a

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

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

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

    if -6.99999999999999956e127 < a < -1.01999999999999998e-38 or 3.8000000000000001e181 < a < 1.3499999999999999e235

    1. Initial program 94.2%

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

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

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

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

    if -1.01999999999999998e-38 < a < -1.44999999999999993e-137 or 1.2999999999999999e-278 < a < 4.09999999999999972e61

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

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

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

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

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

    if -1.44999999999999993e-137 < a < 1.2999999999999999e-278 or 4.09999999999999972e61 < a < 1.00000000000000005e117

    1. Initial program 98.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7 \cdot 10^{+127}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -1.02 \cdot 10^{-38}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -1.45 \cdot 10^{-137}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{-278}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 4.1 \cdot 10^{+61}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 10^{+117}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{+181}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+235}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 5: 38.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4 \cdot 10^{+120}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -2.95 \cdot 10^{-34}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -2.5 \cdot 10^{-134}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 1.02 \cdot 10^{-278}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{+64}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 10^{+117}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{+179}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{+232}:\\ \;\;\;\;b \cdot \left(z \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -4e+120)
   (* a t)
   (if (<= a -2.95e-34)
     (* a (* z b))
     (if (<= a -2.5e-134)
       (* z y)
       (if (<= a 1.02e-278)
         x
         (if (<= a 1.85e+64)
           (* z y)
           (if (<= a 1e+117)
             x
             (if (<= a 5.8e+179)
               (* a t)
               (if (<= a 3.5e+232) (* b (* z a)) (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -4e+120) {
		tmp = a * t;
	} else if (a <= -2.95e-34) {
		tmp = a * (z * b);
	} else if (a <= -2.5e-134) {
		tmp = z * y;
	} else if (a <= 1.02e-278) {
		tmp = x;
	} else if (a <= 1.85e+64) {
		tmp = z * y;
	} else if (a <= 1e+117) {
		tmp = x;
	} else if (a <= 5.8e+179) {
		tmp = a * t;
	} else if (a <= 3.5e+232) {
		tmp = b * (z * a);
	} else {
		tmp = a * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-4d+120)) then
        tmp = a * t
    else if (a <= (-2.95d-34)) then
        tmp = a * (z * b)
    else if (a <= (-2.5d-134)) then
        tmp = z * y
    else if (a <= 1.02d-278) then
        tmp = x
    else if (a <= 1.85d+64) then
        tmp = z * y
    else if (a <= 1d+117) then
        tmp = x
    else if (a <= 5.8d+179) then
        tmp = a * t
    else if (a <= 3.5d+232) then
        tmp = b * (z * a)
    else
        tmp = a * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -4e+120) {
		tmp = a * t;
	} else if (a <= -2.95e-34) {
		tmp = a * (z * b);
	} else if (a <= -2.5e-134) {
		tmp = z * y;
	} else if (a <= 1.02e-278) {
		tmp = x;
	} else if (a <= 1.85e+64) {
		tmp = z * y;
	} else if (a <= 1e+117) {
		tmp = x;
	} else if (a <= 5.8e+179) {
		tmp = a * t;
	} else if (a <= 3.5e+232) {
		tmp = b * (z * a);
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -4e+120:
		tmp = a * t
	elif a <= -2.95e-34:
		tmp = a * (z * b)
	elif a <= -2.5e-134:
		tmp = z * y
	elif a <= 1.02e-278:
		tmp = x
	elif a <= 1.85e+64:
		tmp = z * y
	elif a <= 1e+117:
		tmp = x
	elif a <= 5.8e+179:
		tmp = a * t
	elif a <= 3.5e+232:
		tmp = b * (z * a)
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -4e+120)
		tmp = Float64(a * t);
	elseif (a <= -2.95e-34)
		tmp = Float64(a * Float64(z * b));
	elseif (a <= -2.5e-134)
		tmp = Float64(z * y);
	elseif (a <= 1.02e-278)
		tmp = x;
	elseif (a <= 1.85e+64)
		tmp = Float64(z * y);
	elseif (a <= 1e+117)
		tmp = x;
	elseif (a <= 5.8e+179)
		tmp = Float64(a * t);
	elseif (a <= 3.5e+232)
		tmp = Float64(b * Float64(z * a));
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -4e+120)
		tmp = a * t;
	elseif (a <= -2.95e-34)
		tmp = a * (z * b);
	elseif (a <= -2.5e-134)
		tmp = z * y;
	elseif (a <= 1.02e-278)
		tmp = x;
	elseif (a <= 1.85e+64)
		tmp = z * y;
	elseif (a <= 1e+117)
		tmp = x;
	elseif (a <= 5.8e+179)
		tmp = a * t;
	elseif (a <= 3.5e+232)
		tmp = b * (z * a);
	else
		tmp = a * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4e+120], N[(a * t), $MachinePrecision], If[LessEqual[a, -2.95e-34], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.5e-134], N[(z * y), $MachinePrecision], If[LessEqual[a, 1.02e-278], x, If[LessEqual[a, 1.85e+64], N[(z * y), $MachinePrecision], If[LessEqual[a, 1e+117], x, If[LessEqual[a, 5.8e+179], N[(a * t), $MachinePrecision], If[LessEqual[a, 3.5e+232], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], N[(a * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.95 \cdot 10^{-34}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\

\mathbf{elif}\;a \leq -2.5 \cdot 10^{-134}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq 1.02 \cdot 10^{-278}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.85 \cdot 10^{+64}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq 10^{+117}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 5.8 \cdot 10^{+179}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;a \leq 3.5 \cdot 10^{+232}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -3.9999999999999999e120 or 1.00000000000000005e117 < a < 5.80000000000000038e179 or 3.50000000000000013e232 < a

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

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

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

    if -3.9999999999999999e120 < a < -2.9500000000000001e-34

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

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

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

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

    if -2.9500000000000001e-34 < a < -2.5000000000000002e-134 or 1.01999999999999993e-278 < a < 1.84999999999999992e64

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

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

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

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

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

    if -2.5000000000000002e-134 < a < 1.01999999999999993e-278 or 1.84999999999999992e64 < a < 1.00000000000000005e117

    1. Initial program 98.0%

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

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

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

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

    if 5.80000000000000038e179 < a < 3.50000000000000013e232

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4 \cdot 10^{+120}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -2.95 \cdot 10^{-34}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -2.5 \cdot 10^{-134}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 1.02 \cdot 10^{-278}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.85 \cdot 10^{+64}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 10^{+117}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{+179}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{+232}:\\ \;\;\;\;b \cdot \left(z \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 6: 93.6% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 4.1999999999999999e41

    1. Initial program 93.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+93.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*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)} \]

    if 4.1999999999999999e41 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 58.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+73}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{+49} \lor \neg \left(z \leq -3.8 \cdot 10^{-29}\right) \land \left(z \leq -1 \cdot 10^{-61} \lor \neg \left(z \leq 1.55 \cdot 10^{+54}\right)\right):\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -4.2e+73)
   (* z (* a b))
   (if (or (<= z -2.8e+49)
           (and (not (<= z -3.8e-29))
                (or (<= z -1e-61) (not (<= z 1.55e+54)))))
     (* z y)
     (+ x (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.2e+73) {
		tmp = z * (a * b);
	} else if ((z <= -2.8e+49) || (!(z <= -3.8e-29) && ((z <= -1e-61) || !(z <= 1.55e+54)))) {
		tmp = z * y;
	} else {
		tmp = x + (a * t);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (z <= (-4.2d+73)) then
        tmp = z * (a * b)
    else if ((z <= (-2.8d+49)) .or. (.not. (z <= (-3.8d-29))) .and. (z <= (-1d-61)) .or. (.not. (z <= 1.55d+54))) then
        tmp = z * y
    else
        tmp = x + (a * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.2e+73) {
		tmp = z * (a * b);
	} else if ((z <= -2.8e+49) || (!(z <= -3.8e-29) && ((z <= -1e-61) || !(z <= 1.55e+54)))) {
		tmp = z * y;
	} else {
		tmp = x + (a * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -4.2e+73:
		tmp = z * (a * b)
	elif (z <= -2.8e+49) or (not (z <= -3.8e-29) and ((z <= -1e-61) or not (z <= 1.55e+54))):
		tmp = z * y
	else:
		tmp = x + (a * t)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -4.2e+73)
		tmp = Float64(z * Float64(a * b));
	elseif ((z <= -2.8e+49) || (!(z <= -3.8e-29) && ((z <= -1e-61) || !(z <= 1.55e+54))))
		tmp = Float64(z * y);
	else
		tmp = Float64(x + Float64(a * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -4.2e+73)
		tmp = z * (a * b);
	elseif ((z <= -2.8e+49) || (~((z <= -3.8e-29)) && ((z <= -1e-61) || ~((z <= 1.55e+54)))))
		tmp = z * y;
	else
		tmp = x + (a * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.2e+73], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.8e+49], And[N[Not[LessEqual[z, -3.8e-29]], $MachinePrecision], Or[LessEqual[z, -1e-61], N[Not[LessEqual[z, 1.55e+54]], $MachinePrecision]]]], N[(z * y), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.8 \cdot 10^{+49} \lor \neg \left(z \leq -3.8 \cdot 10^{-29}\right) \land \left(z \leq -1 \cdot 10^{-61} \lor \neg \left(z \leq 1.55 \cdot 10^{+54}\right)\right):\\
\;\;\;\;z \cdot y\\

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


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

    1. Initial program 81.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+81.1%

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

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

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

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

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

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

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

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

    if -4.2000000000000003e73 < z < -2.7999999999999998e49 or -3.79999999999999976e-29 < z < -1e-61 or 1.55e54 < z

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

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

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

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

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

    if -2.7999999999999998e49 < z < -3.79999999999999976e-29 or -1e-61 < z < 1.55e54

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+73}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{+49} \lor \neg \left(z \leq -3.8 \cdot 10^{-29}\right) \land \left(z \leq -1 \cdot 10^{-61} \lor \neg \left(z \leq 1.55 \cdot 10^{+54}\right)\right):\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot t\\ \end{array} \]

Alternative 8: 74.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-62} \lor \neg \left(z \leq 2.7 \cdot 10^{-9} \lor \neg \left(z \leq 1.08 \cdot 10^{+16}\right) \land z \leq 4.5 \cdot 10^{+44}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.20000000000000021e-62 or 2.7000000000000002e-9 < z < 1.08e16 or 4.5e44 < z

    1. Initial program 85.8%

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

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

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

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

    if -3.20000000000000021e-62 < z < 2.7000000000000002e-9 or 1.08e16 < z < 4.5e44

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{-62} \lor \neg \left(z \leq 2.7 \cdot 10^{-9} \lor \neg \left(z \leq 1.08 \cdot 10^{+16}\right) \land z \leq 4.5 \cdot 10^{+44}\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot t\\ \end{array} \]

Alternative 9: 38.7% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;a \leq -1.25 \cdot 10^{-140}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq 1.4 \cdot 10^{-278}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.9 \cdot 10^{+62}:\\
\;\;\;\;z \cdot y\\

\mathbf{elif}\;a \leq 10^{+117}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.7e50 or 1.00000000000000005e117 < a

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

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

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

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

    if -2.7e50 < a < -1.25000000000000004e-140 or 1.40000000000000004e-278 < a < 1.89999999999999992e62

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

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

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

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

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

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

    if -1.25000000000000004e-140 < a < 1.40000000000000004e-278 or 1.89999999999999992e62 < a < 1.00000000000000005e117

    1. Initial program 98.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.7 \cdot 10^{+50}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq -1.25 \cdot 10^{-140}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-278}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{+62}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;a \leq 10^{+117}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 10: 82.4% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.49999999999999955e-57 or 2.0999999999999999e-32 < a

    1. Initial program 87.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+87.7%

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

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

        \[\leadsto \left(\color{blue}{a \cdot t} + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right) \]
      4. associate-*l*92.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-out96.0%

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

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

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

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

    if -8.49999999999999955e-57 < a < 2.0999999999999999e-32

    1. Initial program 98.1%

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

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

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

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

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

Alternative 11: 83.9% accurate, 1.1× speedup?

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

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

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

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


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

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

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

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

        \[\leadsto \left(\color{blue}{a \cdot t} + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right) \]
      4. associate-*l*80.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-out91.6%

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

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

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

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

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

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

    if -8.1999999999999999e82 < b < 8.20000000000000008e158

    1. Initial program 94.0%

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

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

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

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

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

    if 8.20000000000000008e158 < b

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 85.7% accurate, 1.1× speedup?

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

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

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

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


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

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

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

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

        \[\leadsto \left(\color{blue}{a \cdot t} + \left(a \cdot z\right) \cdot b\right) + \left(x + y \cdot z\right) \]
      4. associate-*l*80.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-out91.6%

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

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

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

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

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

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

    if -6.50000000000000027e84 < b < 3e114

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

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

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

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

    if 3e114 < b

    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. +-commutative91.1%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 60.8% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;z \leq -5 \cdot 10^{-62} \lor \neg \left(z \leq 3.5 \cdot 10^{-37}\right):\\
\;\;\;\;x + z \cdot y\\

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


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

    1. Initial program 81.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+81.1%

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

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

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

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

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

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

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

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

    if -4.4e73 < z < -5.0000000000000002e-62 or 3.5000000000000001e-37 < z

    1. Initial program 90.3%

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

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

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

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

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

    if -5.0000000000000002e-62 < z < 3.5000000000000001e-37

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+73}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-62} \lor \neg \left(z \leq 3.5 \cdot 10^{-37}\right):\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot t\\ \end{array} \]

Alternative 14: 37.7% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;a \leq 1.25 \cdot 10^{+117}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.36e-27 or 1.24999999999999996e117 < a

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

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

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

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

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

    if -1.36e-27 < a < 1.24999999999999996e117

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.36 \cdot 10^{-27}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{+117}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]

Alternative 15: 25.4% accurate, 15.0× speedup?

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

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

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

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

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

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

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

    \[\leadsto x \]

Developer target: 97.6% 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 2023207 
(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)))