Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 91.8% → 96.9%
Time: 8.5s
Alternatives: 14
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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: 91.8% 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.9% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t \cdot \left(a + \frac{x + z \cdot \left(y + a \cdot b\right)}{t}\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 99.2%

      \[\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. Add Preprocessing
    3. Taylor expanded in t around -inf 50.0%

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \left(-1 \cdot \left(a + \frac{\left(\color{blue}{\left(a \cdot b\right) \cdot z} + y \cdot z\right) + x}{t}\right)\right) \]
      6. distribute-rgt-in81.3%

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

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

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

Alternative 2: 96.2% accurate, 0.4× speedup?

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

      \[\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. Add Preprocessing
    3. Taylor expanded in t around 0 44.3%

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

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

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

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

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

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

Alternative 3: 60.8% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+159} \lor \neg \left(z \leq 1.5 \cdot 10^{+256}\right):\\
\;\;\;\;x + 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 < -4.20000000000000019e108

    1. Initial program 84.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 78.4%

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

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

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

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

    if -4.20000000000000019e108 < z < 1.70000000000000002e-45

    1. Initial program 99.4%

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

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

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

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

    if 1.70000000000000002e-45 < z < 1.89999999999999983e159 or 1.5e256 < z

    1. Initial program 88.6%

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

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

    if 1.89999999999999983e159 < z < 1.5e256

    1. Initial program 67.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 83.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+108}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-45}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+159} \lor \neg \left(z \leq 1.5 \cdot 10^{+256}\right):\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 59.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ \mathbf{if}\;t \leq -6.7 \cdot 10^{+173}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;t \leq -1.32 \cdot 10^{+94}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{+67}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{+134}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* y z))))
   (if (<= t -6.7e+173)
     (* t a)
     (if (<= t -1.32e+94)
       t_1
       (if (<= t -3.8e+67) (* a (* z b)) (if (<= t 1.7e+134) t_1 (* t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double tmp;
	if (t <= -6.7e+173) {
		tmp = t * a;
	} else if (t <= -1.32e+94) {
		tmp = t_1;
	} else if (t <= -3.8e+67) {
		tmp = a * (z * b);
	} else if (t <= 1.7e+134) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x + (y * z)
    if (t <= (-6.7d+173)) then
        tmp = t * a
    else if (t <= (-1.32d+94)) then
        tmp = t_1
    else if (t <= (-3.8d+67)) then
        tmp = a * (z * b)
    else if (t <= 1.7d+134) then
        tmp = t_1
    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 t_1 = x + (y * z);
	double tmp;
	if (t <= -6.7e+173) {
		tmp = t * a;
	} else if (t <= -1.32e+94) {
		tmp = t_1;
	} else if (t <= -3.8e+67) {
		tmp = a * (z * b);
	} else if (t <= 1.7e+134) {
		tmp = t_1;
	} else {
		tmp = t * a;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * z)
	tmp = 0
	if t <= -6.7e+173:
		tmp = t * a
	elif t <= -1.32e+94:
		tmp = t_1
	elif t <= -3.8e+67:
		tmp = a * (z * b)
	elif t <= 1.7e+134:
		tmp = t_1
	else:
		tmp = t * a
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	tmp = 0.0
	if (t <= -6.7e+173)
		tmp = Float64(t * a);
	elseif (t <= -1.32e+94)
		tmp = t_1;
	elseif (t <= -3.8e+67)
		tmp = Float64(a * Float64(z * b));
	elseif (t <= 1.7e+134)
		tmp = t_1;
	else
		tmp = Float64(t * a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (y * z);
	tmp = 0.0;
	if (t <= -6.7e+173)
		tmp = t * a;
	elseif (t <= -1.32e+94)
		tmp = t_1;
	elseif (t <= -3.8e+67)
		tmp = a * (z * b);
	elseif (t <= 1.7e+134)
		tmp = t_1;
	else
		tmp = t * a;
	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[t, -6.7e+173], N[(t * a), $MachinePrecision], If[LessEqual[t, -1.32e+94], t$95$1, If[LessEqual[t, -3.8e+67], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e+134], t$95$1, N[(t * a), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;t \leq -6.7 \cdot 10^{+173}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;t \leq -1.32 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.7 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.7000000000000002e173 or 1.70000000000000009e134 < t

    1. Initial program 92.8%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf 93.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-t\right) \cdot \left(-1 \cdot \left(a + \frac{z \cdot \left(a \cdot b + y\right) + x}{t}\right)\right)} \]
    6. Taylor expanded in t around inf 68.2%

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

    if -6.7000000000000002e173 < t < -1.32000000000000003e94 or -3.8000000000000002e67 < t < 1.70000000000000009e134

    1. Initial program 93.3%

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

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

    if -1.32000000000000003e94 < t < -3.8000000000000002e67

    1. Initial program 86.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 71.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.7 \cdot 10^{+173}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;t \leq -1.32 \cdot 10^{+94}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{+67}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{+134}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 38.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;b \leq -1.76 \cdot 10^{-43}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 1.42 \cdot 10^{-188}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 5 \cdot 10^{-8}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -3.4e44

    1. Initial program 88.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 63.6%

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

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

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

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

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

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

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

    if -3.4e44 < b < -1.7600000000000001e-43

    1. Initial program 90.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 61.2%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    5. Simplified61.2%

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

    if -1.7600000000000001e-43 < b < 1.4200000000000001e-188

    1. Initial program 95.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 46.3%

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

    if 1.4200000000000001e-188 < b < 4.9999999999999998e-8

    1. Initial program 91.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf 84.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-t\right) \cdot \left(-1 \cdot \left(a + \frac{z \cdot \left(a \cdot b + y\right) + x}{t}\right)\right)} \]
    6. Taylor expanded in t around inf 49.2%

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

    if 4.9999999999999998e-8 < b

    1. Initial program 96.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 50.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.4 \cdot 10^{+44}:\\ \;\;\;\;b \cdot \left(z \cdot a\right)\\ \mathbf{elif}\;b \leq -1.76 \cdot 10^{-43}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 1.42 \cdot 10^{-188}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-8}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 38.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;b \leq -1.15 \cdot 10^{-40}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 2.65 \cdot 10^{-188}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 1.35 \cdot 10^{-8}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -9.20000000000000018e44 or 1.35000000000000001e-8 < b

    1. Initial program 92.4%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 57.1%

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

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

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

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

    if -9.20000000000000018e44 < b < -1.15e-40

    1. Initial program 90.0%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 61.2%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    5. Simplified61.2%

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

    if -1.15e-40 < b < 2.65000000000000007e-188

    1. Initial program 95.9%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 46.3%

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

    if 2.65000000000000007e-188 < b < 1.35000000000000001e-8

    1. Initial program 91.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf 84.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-t\right) \cdot \left(-1 \cdot \left(a + \frac{z \cdot \left(a \cdot b + y\right) + x}{t}\right)\right)} \]
    6. Taylor expanded in t around inf 49.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9.2 \cdot 10^{+44}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;b \leq -1.15 \cdot 10^{-40}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 2.65 \cdot 10^{-188}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{-8}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 86.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;b \leq -1.25 \cdot 10^{+46} \lor \neg \left(b \leq 0.0035\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


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

    1. Initial program 94.2%

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

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

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

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

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

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

    if -1.1e171 < b < -1.2500000000000001e46 or 0.00350000000000000007 < b

    1. Initial program 91.2%

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

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

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

    if -1.2500000000000001e46 < b < 0.00350000000000000007

    1. Initial program 93.7%

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

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

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

Alternative 8: 86.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -8.4999999999999996e45 or 0.0030000000000000001 < b

    1. Initial program 92.1%

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

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

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

    if -8.4999999999999996e45 < b < 0.0030000000000000001

    1. Initial program 93.7%

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

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

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

Alternative 9: 80.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.3 \cdot 10^{-201} \lor \neg \left(a \leq 5 \cdot 10^{-201}\right):\\ \;\;\;\;x + 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 -4.3e-201) (not (<= a 5e-201)))
   (+ x (* 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 <= -4.3e-201) || !(a <= 5e-201)) {
		tmp = x + (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 <= (-4.3d-201)) .or. (.not. (a <= 5d-201))) then
        tmp = x + (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 <= -4.3e-201) || !(a <= 5e-201)) {
		tmp = x + (a * (t + (z * b)));
	} else {
		tmp = x + (y * z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -4.3e-201) or not (a <= 5e-201):
		tmp = x + (a * (t + (z * b)))
	else:
		tmp = x + (y * z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -4.3e-201) || !(a <= 5e-201))
		tmp = Float64(x + 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 <= -4.3e-201) || ~((a <= 5e-201)))
		tmp = x + (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, -4.3e-201], N[Not[LessEqual[a, 5e-201]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{-201} \lor \neg \left(a \leq 5 \cdot 10^{-201}\right):\\
\;\;\;\;x + 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 < -4.2999999999999997e-201 or 4.9999999999999999e-201 < a

    1. Initial program 91.3%

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

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

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

    if -4.2999999999999997e-201 < a < 4.9999999999999999e-201

    1. Initial program 99.9%

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

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

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

Alternative 10: 87.3% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

    if -3.49999999999999986e92 < b < 0.00320000000000000015

    1. Initial program 92.7%

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

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

    if 0.00320000000000000015 < b

    1. Initial program 96.2%

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

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

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

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

Alternative 11: 95.6% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 96.4%

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

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

    if 1.76000000000000013e129 < z

    1. Initial program 71.5%

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

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

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

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

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

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

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

Alternative 12: 74.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+29} \lor \neg \left(z \leq 2.4 \cdot 10^{-42}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.8000000000000005e29 or 2.40000000000000003e-42 < z

    1. Initial program 84.5%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 77.6%

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

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

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

    if -8.8000000000000005e29 < z < 2.40000000000000003e-42

    1. Initial program 100.0%

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

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

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

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

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

Alternative 13: 41.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+37} \lor \neg \left(t \leq 1900000000000\right):\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5999999999999999e37 or 1.9e12 < t

    1. Initial program 91.7%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf 92.1%

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \left(-1 \cdot \left(a + \frac{\left(\color{blue}{\left(a \cdot b\right) \cdot z} + y \cdot z\right) + x}{t}\right)\right) \]
      6. distribute-rgt-in93.3%

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

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

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

    if -2.5999999999999999e37 < t < 1.9e12

    1. Initial program 94.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 41.0%

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

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

Alternative 14: 26.5% 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.0%

    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 28.4%

    \[\leadsto \color{blue}{x} \]
  4. Add Preprocessing

Developer target: 97.1% 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 2024111 
(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)))