Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.0% → 96.1%
Time: 7.7s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 92.0% accurate, 1.0× speedup?

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

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

Alternative 1: 96.1% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 98.4%

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

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

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

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

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

Alternative 2: 40.0% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -0.00054:\\
\;\;\;\;y \cdot z\\

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

\mathbf{elif}\;z \leq 7.2 \cdot 10^{+36}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;z \leq 3.3 \cdot 10^{+249}:\\
\;\;\;\;y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.9000000000000002e239 or -1.02000000000000002e151 < z < -5.40000000000000007e-4 or 7.1999999999999995e36 < z < 3.30000000000000014e249

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

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

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

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

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

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

    if -2.9000000000000002e239 < z < -1.02000000000000002e151

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

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

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

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

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

    if -5.40000000000000007e-4 < z < -1.49999999999999994e-35

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

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

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

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

    if -1.49999999999999994e-35 < z < 7.1999999999999995e36

    1. Initial program 99.1%

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

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

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

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

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

    if 3.30000000000000014e249 < z

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+239}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{+151}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -0.00054:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-35}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+36}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+249}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 62.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+239}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq -0.64:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.75 \cdot 10^{+249}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.69999999999999998e239 or -1.7500000000000001e151 < z < -0.640000000000000013 or 1.0400000000000001e37 < z < 1.75000000000000006e249

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

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

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

    if -3.69999999999999998e239 < z < -1.7500000000000001e151

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

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

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

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

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

    if -0.640000000000000013 < z < 1.0400000000000001e37

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

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

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

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

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

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

    if 1.75000000000000006e249 < z

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+239}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{+151}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -0.64:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq 1.04 \cdot 10^{+37}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+249}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 40.2% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-156}:\\
\;\;\;\;t \cdot a\\

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

\mathbf{elif}\;z \leq 1.1 \cdot 10^{+40}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.214999999999999997 or 1.0999999999999999e40 < z

    1. Initial program 88.2%

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

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

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

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

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

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

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

    if -0.214999999999999997 < z < -1.9499999999999999e-35 or 1.4500000000000001e-156 < z < 7.59999999999999987e-75

    1. Initial program 99.9%

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

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

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

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

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

    if -1.9499999999999999e-35 < z < 1.4500000000000001e-156 or 7.59999999999999987e-75 < z < 1.0999999999999999e40

    1. Initial program 99.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.215:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-35}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-156}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-75}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+40}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 40.0% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq -2.6 \cdot 10^{-7}:\\
\;\;\;\;y \cdot z\\

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

\mathbf{elif}\;z \leq 6 \cdot 10^{+34}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.69999999999999998e239 or -1.28000000000000006e151 < z < -2.59999999999999999e-7 or 6.00000000000000037e34 < z

    1. Initial program 87.9%

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

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

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

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

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

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

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

    if -3.69999999999999998e239 < z < -1.28000000000000006e151

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

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

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

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

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

    if -2.59999999999999999e-7 < z < -1.3499999999999999e-35

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

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

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

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

    if -1.3499999999999999e-35 < z < 6.00000000000000037e34

    1. Initial program 99.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+239}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1.28 \cdot 10^{+151}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-7}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-35}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+34}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 74.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -7 \cdot 10^{+16}:\\
\;\;\;\;x + y \cdot z\\

\mathbf{elif}\;z \leq -3700000000 \lor \neg \left(z \leq 2.3 \cdot 10^{+44}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.79999999999999961e71 or -7e16 < z < -3.7e9 or 2.30000000000000004e44 < 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*83.8%

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

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

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

    if -4.79999999999999961e71 < z < -7e16

    1. Initial program 92.9%

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

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

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

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

    if -3.7e9 < z < 2.30000000000000004e44

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+71}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;z \leq -7 \cdot 10^{+16}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq -3700000000 \lor \neg \left(z \leq 2.3 \cdot 10^{+44}\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq -3.4 \cdot 10^{+169}:\\
\;\;\;\;t \cdot a\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.20000000000000006e250

    1. Initial program 77.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+77.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*84.6%

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

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

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

    if -1.20000000000000006e250 < a < -3.40000000000000028e169 or 7.2e45 < a

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

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

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

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

    if -3.40000000000000028e169 < a < -4.3000000000000002e105

    1. Initial program 100.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+100.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*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 z around inf 68.4%

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

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

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

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

    if -4.3000000000000002e105 < a < 7.2e45

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

        \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)} \]
      2. associate-*l*90.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. Add Preprocessing
    5. Taylor expanded in a around 0 69.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.2 \cdot 10^{+250}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -3.4 \cdot 10^{+169}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq -4.3 \cdot 10^{+105}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{+45}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 92.8% accurate, 0.7× speedup?

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

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

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


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

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

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

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

    if -4.5000000000000003e179 < z

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

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

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

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

Alternative 9: 82.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+44} \lor \neg \left(z \leq 2.26 \cdot 10^{+67}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9e44 or 2.26000000000000009e67 < z

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

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

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

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

    if -9e44 < z < 2.26000000000000009e67

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 86.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+55} \lor \neg \left(y \leq 1.12 \cdot 10^{-66}\right):\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.50000000000000023e55 or 1.12000000000000004e-66 < y

    1. Initial program 90.4%

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

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

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

    if -2.50000000000000023e55 < y < 1.12000000000000004e-66

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 74.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{+51} \lor \neg \left(a \leq 2.5 \cdot 10^{+17}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.89999999999999984e51 or 2.5e17 < a

    1. Initial program 89.6%

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

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

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

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

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

    if -3.89999999999999984e51 < a < 2.5e17

    1. Initial program 96.4%

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

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

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

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

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

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

Alternative 12: 39.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{+83} \lor \neg \left(t \leq 7.6 \cdot 10^{+118}\right):\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.3e83 or 7.60000000000000033e118 < t

    1. Initial program 89.6%

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

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

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

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

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

    if -4.3e83 < t < 7.60000000000000033e118

    1. Initial program 95.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{+83} \lor \neg \left(t \leq 7.6 \cdot 10^{+118}\right):\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 25.9% accurate, 15.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification25.1%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 97.2% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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