Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.4% → 96.6%
Time: 11.3s
Alternatives: 13
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 92.4% 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.6% 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}:\\ \;\;\;\;x + 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 (+ x (* 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 = x + (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 = x + (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 = x + (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(x + 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 = x + (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[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;x + 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.1%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 57.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{+176}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-47} \lor \neg \left(a \leq 2.45 \cdot 10^{-20}\right) \land a \leq 1.28 \cdot 10^{+51}:\\ \;\;\;\;x + y \cdot z\\ \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.25e+176)
   (* z (* a b))
   (if (or (<= a 4.5e-47) (and (not (<= a 2.45e-20)) (<= a 1.28e+51)))
     (+ x (* y z))
     (* a (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -1.25e+176) {
		tmp = z * (a * b);
	} else if ((a <= 4.5e-47) || (!(a <= 2.45e-20) && (a <= 1.28e+51))) {
		tmp = x + (y * z);
	} 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.25d+176)) then
        tmp = z * (a * b)
    else if ((a <= 4.5d-47) .or. (.not. (a <= 2.45d-20)) .and. (a <= 1.28d+51)) then
        tmp = x + (y * z)
    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.25e+176) {
		tmp = z * (a * b);
	} else if ((a <= 4.5e-47) || (!(a <= 2.45e-20) && (a <= 1.28e+51))) {
		tmp = x + (y * z);
	} else {
		tmp = a * (z * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -1.25e+176:
		tmp = z * (a * b)
	elif (a <= 4.5e-47) or (not (a <= 2.45e-20) and (a <= 1.28e+51)):
		tmp = x + (y * z)
	else:
		tmp = a * (z * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -1.25e+176)
		tmp = Float64(z * Float64(a * b));
	elseif ((a <= 4.5e-47) || (!(a <= 2.45e-20) && (a <= 1.28e+51)))
		tmp = Float64(x + Float64(y * z));
	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.25e+176)
		tmp = z * (a * b);
	elseif ((a <= 4.5e-47) || (~((a <= 2.45e-20)) && (a <= 1.28e+51)))
		tmp = x + (y * z);
	else
		tmp = a * (z * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.25e+176], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 4.5e-47], And[N[Not[LessEqual[a, 2.45e-20]], $MachinePrecision], LessEqual[a, 1.28e+51]]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 4.5 \cdot 10^{-47} \lor \neg \left(a \leq 2.45 \cdot 10^{-20}\right) \land a \leq 1.28 \cdot 10^{+51}:\\
\;\;\;\;x + y \cdot z\\

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


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

    1. Initial program 65.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+65.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*74.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e176 < a < 4.5e-47 or 2.4500000000000001e-20 < a < 1.27999999999999993e51

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

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

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

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

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

    if 4.5e-47 < a < 2.4500000000000001e-20 or 1.27999999999999993e51 < a

    1. Initial program 86.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+86.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.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 z around inf 62.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.25 \cdot 10^{+176}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-47} \lor \neg \left(a \leq 2.45 \cdot 10^{-20}\right) \land a \leq 1.28 \cdot 10^{+51}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 38.4% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;z \leq 5.8 \cdot 10^{-112}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;z \leq 5.7 \cdot 10^{+54}:\\
\;\;\;\;y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.5e13 or 5.79999999999999985e-112 < z < 5.6999999999999997e54

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

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

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

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

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

    if -8.5e13 < z < 3.19999999999999988e-163

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

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

    if 3.19999999999999988e-163 < z < 5.79999999999999985e-112

    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 t around inf 58.8%

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

    if 5.6999999999999997e54 < z

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

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

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

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

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

Alternative 4: 38.7% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;z \leq 4 \cdot 10^{-112}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+54}:\\
\;\;\;\;y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.16e14 or 3.9999999999999998e-112 < z < 5.20000000000000013e54

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

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

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

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

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

    if -1.16e14 < z < 7.1999999999999996e-162

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

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

    if 7.1999999999999996e-162 < z < 3.9999999999999998e-112

    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 t around inf 58.8%

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

    if 5.20000000000000013e54 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.16 \cdot 10^{+14}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-162}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-112}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+54}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 95.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+166} \lor \neg \left(z \leq 2.3 \cdot 10^{+80}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3e166 or 2.30000000000000004e80 < z

    1. Initial program 73.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+73.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*71.9%

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

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

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

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

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

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

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

    if -1.3e166 < z < 2.30000000000000004e80

    1. Initial program 97.8%

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

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

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

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

Alternative 6: 74.2% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq 3.1 \cdot 10^{-57}:\\
\;\;\;\;x + y \cdot z\\

\mathbf{elif}\;a \leq 2.2 \cdot 10^{+40}:\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.59999999999999983e27 or 2.1999999999999999e40 < a

    1. Initial program 79.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+79.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*84.9%

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

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

    if -3.59999999999999983e27 < a < 3.09999999999999976e-57

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

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

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

    if 3.09999999999999976e-57 < a < 2.1999999999999999e40

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

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

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

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

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

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

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

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

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

Alternative 7: 61.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ \mathbf{if}\;z \leq -1.25 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.06 \cdot 10^{-97}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+59}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* y z))))
   (if (<= z -1.25e+14)
     t_1
     (if (<= z 1.06e-97)
       (+ x (* t a))
       (if (<= z 2.3e+59) 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 <= -1.25e+14) {
		tmp = t_1;
	} else if (z <= 1.06e-97) {
		tmp = x + (t * a);
	} else if (z <= 2.3e+59) {
		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 <= (-1.25d+14)) then
        tmp = t_1
    else if (z <= 1.06d-97) then
        tmp = x + (t * a)
    else if (z <= 2.3d+59) 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 <= -1.25e+14) {
		tmp = t_1;
	} else if (z <= 1.06e-97) {
		tmp = x + (t * a);
	} else if (z <= 2.3e+59) {
		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 <= -1.25e+14:
		tmp = t_1
	elif z <= 1.06e-97:
		tmp = x + (t * a)
	elif z <= 2.3e+59:
		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 <= -1.25e+14)
		tmp = t_1;
	elseif (z <= 1.06e-97)
		tmp = Float64(x + Float64(t * a));
	elseif (z <= 2.3e+59)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(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 <= -1.25e+14)
		tmp = t_1;
	elseif (z <= 1.06e-97)
		tmp = x + (t * a);
	elseif (z <= 2.3e+59)
		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, -1.25e+14], t$95$1, If[LessEqual[z, 1.06e-97], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+59], t$95$1, N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 1.06 \cdot 10^{-97}:\\
\;\;\;\;x + t \cdot a\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.25e14 or 1.06000000000000006e-97 < z < 2.30000000000000008e59

    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*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 a around 0 59.5%

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

    if -1.25e14 < z < 1.06000000000000006e-97

    1. Initial program 99.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+99.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*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 z around 0 77.5%

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

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

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

    if 2.30000000000000008e59 < z

    1. Initial program 74.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+74.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*70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 80.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.4 \cdot 10^{+71} \lor \neg \left(b \leq 1.22 \cdot 10^{+60}\right):\\
\;\;\;\;x + a \cdot \left(z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -7.4e71 or 1.21999999999999995e60 < b

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

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

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

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

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

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

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

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

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

    if -7.4e71 < b < 1.21999999999999995e60

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

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

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

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

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

Alternative 9: 84.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-48} \lor \neg \left(b \leq 1.32 \cdot 10^{-76}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.9999999999999999e-48 or 1.31999999999999996e-76 < b

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

    if -4.9999999999999999e-48 < b < 1.31999999999999996e-76

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

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

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

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

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

Alternative 10: 38.7% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;z \leq 5.8 \cdot 10^{-112}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.95e14 or 5.79999999999999985e-112 < z

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

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

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

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

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

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

    if -1.95e14 < z < 1.39999999999999996e-161

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

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

    if 1.39999999999999996e-161 < z < 5.79999999999999985e-112

    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 t around inf 58.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+14}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-161}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-112}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 73.9% accurate, 0.9× speedup?

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

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

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

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

    if -3.99999999999999991e38 < a < 3.09999999999999976e-57

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

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

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

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

Alternative 12: 39.2% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0013:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-29}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.0012999999999999999 or 1.19999999999999996e-29 < x

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

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

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

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

    if -0.0012999999999999999 < x < 1.19999999999999996e-29

    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*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 t around inf 33.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.0013:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-29}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 26.6% accurate, 15.0× speedup?

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

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

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

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

    \[\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 2024041 
(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)))