Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.2% → 94.4%
Time: 12.1s
Alternatives: 15
Speedup: 0.7×

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

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

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

Alternative 1: 94.4% accurate, 0.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4999999999999997e82

    1. Initial program 75.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+75.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*75.9%

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

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

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

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

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

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

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

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

    if -4.4999999999999997e82 < z

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+82}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\ \mathbf{else}:\\ \;\;\;\;\left(x + z \cdot y\right) + \mathsf{fma}\left(z \cdot b, a, a \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 95.2% accurate, 0.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4999999999999997e82

    1. Initial program 75.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+75.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*75.9%

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

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

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

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

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

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

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

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

    if -4.4999999999999997e82 < z

    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. +-commutative97.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+82}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(z \cdot b + t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 96.1% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 98.7%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

Alternative 4: 71.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.088 \lor \neg \left(a \leq 1.6 \cdot 10^{-90}\right) \land \left(a \leq 2400000000000 \lor \neg \left(a \leq 2 \cdot 10^{+118}\right)\right):\\
\;\;\;\;a \cdot \left(z \cdot b + t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -0.087999999999999995 or 1.60000000000000004e-90 < a < 2.4e12 or 1.99999999999999993e118 < a

    1. Initial program 90.6%

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

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

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

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

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

    if -0.087999999999999995 < a < 1.60000000000000004e-90 or 2.4e12 < a < 1.99999999999999993e118

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.088 \lor \neg \left(a \leq 1.6 \cdot 10^{-90}\right) \land \left(a \leq 2400000000000 \lor \neg \left(a \leq 2 \cdot 10^{+118}\right)\right):\\ \;\;\;\;a \cdot \left(z \cdot b + t\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 38.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{-14}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 6 \cdot 10^{+248} \lor \neg \left(z \leq 6.1 \cdot 10^{+289}\right):\\
\;\;\;\;z \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.99999999999999956e-85 or 6e248 < z < 6.10000000000000029e289

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

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

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

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

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

    if -6.99999999999999956e-85 < z < 2.8000000000000001e-14

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

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

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

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

    if 2.8000000000000001e-14 < z < 6e248 or 6.10000000000000029e289 < z

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-85}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+248} \lor \neg \left(z \leq 6.1 \cdot 10^{+289}\right):\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 60.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq 1.7 \cdot 10^{-89}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 11200000000000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \leq 3.8 \cdot 10^{+187}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -19 or 1.7e-89 < a < 1.12e13

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

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

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

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

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

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

    if -19 < a < 1.7e-89 or 1.12e13 < a < 3.8e187

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

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

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

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

    if 3.8e187 < a

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

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

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

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

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

Alternative 7: 39.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -2.15 \cdot 10^{-57}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;z \leq -5.8 \cdot 10^{-75} \lor \neg \left(z \leq 0.000175\right):\\
\;\;\;\;z \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.3e81 or -2.15000000000000011e-57 < z < -5.8000000000000003e-75 or 1.74999999999999998e-4 < z

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

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

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

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

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

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

    if -3.3e81 < z < -2.15000000000000011e-57

    1. Initial program 98.6%

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

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

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

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

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

    if -5.8000000000000003e-75 < z < 1.74999999999999998e-4

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+81}:\\ \;\;\;\;z \cdot y\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{-57}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-75} \lor \neg \left(z \leq 0.000175\right):\\ \;\;\;\;z \cdot y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 93.7% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4000000000000002e82

    1. Initial program 75.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+75.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*75.9%

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

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

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

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

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

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

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

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

    if -4.4000000000000002e82 < z

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

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

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

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

Alternative 9: 82.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+82} \lor \neg \left(z \leq 1.05 \cdot 10^{+115}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4999999999999997e82 or 1.05000000000000002e115 < z

    1. Initial program 83.1%

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

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

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

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

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

    if -4.4999999999999997e82 < z < 1.05000000000000002e115

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

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

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

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

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

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

Alternative 10: 86.1% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -76000 or 8.5000000000000008e84 < b

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

    if -76000 < b < 8.5000000000000008e84

    1. Initial program 95.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+95.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. Add Preprocessing
    5. Taylor expanded in b around 0 94.3%

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

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

Alternative 11: 85.3% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 94.1%

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

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

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

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

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

    if -6.5e9 < b < 3.19999999999999975e82

    1. Initial program 95.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+95.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. Add Preprocessing
    5. Taylor expanded in b around 0 94.3%

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

    if 3.19999999999999975e82 < b

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 58.9% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.5799999999999999e63

    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. associate-+l+83.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*87.6%

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

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

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

    if -1.5799999999999999e63 < a < 3.8e187

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

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

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

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

    if 3.8e187 < a

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

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

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

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

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

Alternative 13: 38.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{-13} \lor \neg \left(a \leq 3.7 \cdot 10^{-96}\right):\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.3e-13 or 3.69999999999999986e-96 < a

    1. Initial program 91.5%

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

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

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

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

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

    if -1.3e-13 < a < 3.69999999999999986e-96

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

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

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

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

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

Alternative 14: 38.0% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.20000000000000012e-89

    1. Initial program 87.6%

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

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

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

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative88.2%

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

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

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

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

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

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

    if -2.20000000000000012e-89 < z < 6.5000000000000003e-10

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

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

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

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

    if 6.5000000000000003e-10 < z

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{-89}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-10}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 25.7% accurate, 15.0× speedup?

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

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

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

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

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

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 97.5% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024020 
(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)))