Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 91.6% → 96.5%
Time: 8.6s
Alternatives: 13
Speedup: 0.4×

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: 91.6% 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.5% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 96.7%

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{z \cdot \left(y + a \cdot b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.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}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 39.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+59}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -5.8 \cdot 10^{-109}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;x \leq -6.5 \cdot 10^{-248}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;x \leq 2.5 \cdot 10^{-196}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;x \leq 1.8 \cdot 10^{-33}:\\
\;\;\;\;t \cdot a\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -3.5999999999999999e59 or 1.35000000000000008e105 < x

    1. Initial program 89.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 x around inf 66.1%

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

    if -3.5999999999999999e59 < x < -5.8e-109 or 2.5000000000000002e-196 < x < 1.80000000000000017e-33

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

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

    if -5.8e-109 < x < -6.5e-248

    1. Initial program 92.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 z around inf 75.6%

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

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

    if -6.5e-248 < x < 2.5000000000000002e-196

    1. Initial program 87.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 y around inf 47.5%

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

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

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

    if 1.80000000000000017e-33 < x < 1.35000000000000008e105

    1. Initial program 85.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt85.1%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \color{blue}{{\left(\sqrt[3]{b}\right)}^{2}}\right) \cdot \sqrt[3]{b} \]
    4. Applied egg-rr85.0%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(\left(a \cdot z\right) \cdot {\left(\sqrt[3]{b}\right)}^{2}\right) \cdot \sqrt[3]{b}} \]
    5. Taylor expanded in b around inf 44.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{+59}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -5.8 \cdot 10^{-109}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{-248}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{-196}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-33}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+105}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 39.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;x \leq -6.8 \cdot 10^{+56}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4.3 \cdot 10^{-109}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-244}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-196}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-33}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+103}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= x -6.8e+56)
     x
     (if (<= x -4.3e-109)
       (* t a)
       (if (<= x -3.5e-244)
         t_1
         (if (<= x 1.2e-196)
           (* y z)
           (if (<= x 2e-33) (* t a) (if (<= x 2.6e+103) t_1 x))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (x <= -6.8e+56) {
		tmp = x;
	} else if (x <= -4.3e-109) {
		tmp = t * a;
	} else if (x <= -3.5e-244) {
		tmp = t_1;
	} else if (x <= 1.2e-196) {
		tmp = y * z;
	} else if (x <= 2e-33) {
		tmp = t * a;
	} else if (x <= 2.6e+103) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (x <= (-6.8d+56)) then
        tmp = x
    else if (x <= (-4.3d-109)) then
        tmp = t * a
    else if (x <= (-3.5d-244)) then
        tmp = t_1
    else if (x <= 1.2d-196) then
        tmp = y * z
    else if (x <= 2d-33) then
        tmp = t * a
    else if (x <= 2.6d+103) then
        tmp = t_1
    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 t_1 = a * (z * b);
	double tmp;
	if (x <= -6.8e+56) {
		tmp = x;
	} else if (x <= -4.3e-109) {
		tmp = t * a;
	} else if (x <= -3.5e-244) {
		tmp = t_1;
	} else if (x <= 1.2e-196) {
		tmp = y * z;
	} else if (x <= 2e-33) {
		tmp = t * a;
	} else if (x <= 2.6e+103) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if x <= -6.8e+56:
		tmp = x
	elif x <= -4.3e-109:
		tmp = t * a
	elif x <= -3.5e-244:
		tmp = t_1
	elif x <= 1.2e-196:
		tmp = y * z
	elif x <= 2e-33:
		tmp = t * a
	elif x <= 2.6e+103:
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (x <= -6.8e+56)
		tmp = x;
	elseif (x <= -4.3e-109)
		tmp = Float64(t * a);
	elseif (x <= -3.5e-244)
		tmp = t_1;
	elseif (x <= 1.2e-196)
		tmp = Float64(y * z);
	elseif (x <= 2e-33)
		tmp = Float64(t * a);
	elseif (x <= 2.6e+103)
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (x <= -6.8e+56)
		tmp = x;
	elseif (x <= -4.3e-109)
		tmp = t * a;
	elseif (x <= -3.5e-244)
		tmp = t_1;
	elseif (x <= 1.2e-196)
		tmp = y * z;
	elseif (x <= 2e-33)
		tmp = t * a;
	elseif (x <= 2.6e+103)
		tmp = t_1;
	else
		tmp = x;
	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[x, -6.8e+56], x, If[LessEqual[x, -4.3e-109], N[(t * a), $MachinePrecision], If[LessEqual[x, -3.5e-244], t$95$1, If[LessEqual[x, 1.2e-196], N[(y * z), $MachinePrecision], If[LessEqual[x, 2e-33], N[(t * a), $MachinePrecision], If[LessEqual[x, 2.6e+103], t$95$1, x]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -4.3 \cdot 10^{-109}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;x \leq -3.5 \cdot 10^{-244}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-196}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;x \leq 2 \cdot 10^{-33}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;x \leq 2.6 \cdot 10^{+103}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -6.80000000000000002e56 or 2.6000000000000002e103 < x

    1. Initial program 89.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 x around inf 66.1%

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

    if -6.80000000000000002e56 < x < -4.2999999999999997e-109 or 1.2000000000000001e-196 < x < 2.0000000000000001e-33

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

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

    if -4.2999999999999997e-109 < x < -3.49999999999999992e-244 or 2.0000000000000001e-33 < x < 2.6000000000000002e103

    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. Step-by-step derivation
      1. add-cube-cbrt88.3%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \color{blue}{{\left(\sqrt[3]{b}\right)}^{2}}\right) \cdot \sqrt[3]{b} \]
    4. Applied egg-rr88.4%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(\left(a \cdot z\right) \cdot {\left(\sqrt[3]{b}\right)}^{2}\right) \cdot \sqrt[3]{b}} \]
    5. Taylor expanded in b around inf 47.1%

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

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

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

    if -3.49999999999999992e-244 < x < 1.2000000000000001e-196

    1. Initial program 87.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 y around inf 47.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{+56}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4.3 \cdot 10^{-109}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-244}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-196}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-33}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+103}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 39.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+56}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7.4 \cdot 10^{-78}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-196}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 4.9 \cdot 10^{-20}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 620000:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+108}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -4.5e+56)
   x
   (if (<= x -7.4e-78)
     (* t a)
     (if (<= x 9.5e-196)
       (* y z)
       (if (<= x 4.9e-20)
         (* t a)
         (if (<= x 620000.0) (* y z) (if (<= x 1.5e+108) (* t a) x)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -4.5e+56) {
		tmp = x;
	} else if (x <= -7.4e-78) {
		tmp = t * a;
	} else if (x <= 9.5e-196) {
		tmp = y * z;
	} else if (x <= 4.9e-20) {
		tmp = t * a;
	} else if (x <= 620000.0) {
		tmp = y * z;
	} else if (x <= 1.5e+108) {
		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 <= (-4.5d+56)) then
        tmp = x
    else if (x <= (-7.4d-78)) then
        tmp = t * a
    else if (x <= 9.5d-196) then
        tmp = y * z
    else if (x <= 4.9d-20) then
        tmp = t * a
    else if (x <= 620000.0d0) then
        tmp = y * z
    else if (x <= 1.5d+108) 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 <= -4.5e+56) {
		tmp = x;
	} else if (x <= -7.4e-78) {
		tmp = t * a;
	} else if (x <= 9.5e-196) {
		tmp = y * z;
	} else if (x <= 4.9e-20) {
		tmp = t * a;
	} else if (x <= 620000.0) {
		tmp = y * z;
	} else if (x <= 1.5e+108) {
		tmp = t * a;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -4.5e+56:
		tmp = x
	elif x <= -7.4e-78:
		tmp = t * a
	elif x <= 9.5e-196:
		tmp = y * z
	elif x <= 4.9e-20:
		tmp = t * a
	elif x <= 620000.0:
		tmp = y * z
	elif x <= 1.5e+108:
		tmp = t * a
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -4.5e+56)
		tmp = x;
	elseif (x <= -7.4e-78)
		tmp = Float64(t * a);
	elseif (x <= 9.5e-196)
		tmp = Float64(y * z);
	elseif (x <= 4.9e-20)
		tmp = Float64(t * a);
	elseif (x <= 620000.0)
		tmp = Float64(y * z);
	elseif (x <= 1.5e+108)
		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 <= -4.5e+56)
		tmp = x;
	elseif (x <= -7.4e-78)
		tmp = t * a;
	elseif (x <= 9.5e-196)
		tmp = y * z;
	elseif (x <= 4.9e-20)
		tmp = t * a;
	elseif (x <= 620000.0)
		tmp = y * z;
	elseif (x <= 1.5e+108)
		tmp = t * a;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.5e+56], x, If[LessEqual[x, -7.4e-78], N[(t * a), $MachinePrecision], If[LessEqual[x, 9.5e-196], N[(y * z), $MachinePrecision], If[LessEqual[x, 4.9e-20], N[(t * a), $MachinePrecision], If[LessEqual[x, 620000.0], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.5e+108], N[(t * a), $MachinePrecision], x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+56}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -7.4 \cdot 10^{-78}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;x \leq 9.5 \cdot 10^{-196}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;x \leq 4.9 \cdot 10^{-20}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;x \leq 620000:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;x \leq 1.5 \cdot 10^{+108}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.5000000000000003e56 or 1.49999999999999992e108 < x

    1. Initial program 89.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 x around inf 66.1%

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

    if -4.5000000000000003e56 < x < -7.40000000000000011e-78 or 9.50000000000000032e-196 < x < 4.9000000000000002e-20 or 6.2e5 < x < 1.49999999999999992e108

    1. Initial program 90.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 t around inf 46.5%

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

    if -7.40000000000000011e-78 < x < 9.50000000000000032e-196 or 4.9000000000000002e-20 < x < 6.2e5

    1. Initial program 88.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 y around inf 43.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+56}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7.4 \cdot 10^{-78}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-196}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 4.9 \cdot 10^{-20}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 620000:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+108}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 38.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+53}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq -3.2 \cdot 10^{-246}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\

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

\mathbf{elif}\;x \leq 1.55 \cdot 10^{-32}:\\
\;\;\;\;t \cdot a\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -1.49999999999999999e53 or 4.1999999999999997e104 < x

    1. Initial program 89.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 x around inf 65.8%

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

    if -1.49999999999999999e53 < x < -3.2000000000000001e-246

    1. Initial program 92.6%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt92.3%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \color{blue}{{\left(\sqrt[3]{b}\right)}^{2}}\right) \cdot \sqrt[3]{b} \]
    4. Applied egg-rr92.4%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(\left(a \cdot z\right) \cdot {\left(\sqrt[3]{b}\right)}^{2}\right) \cdot \sqrt[3]{b}} \]
    5. Taylor expanded in b around inf 37.5%

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

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

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

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b} \]
    9. Applied egg-rr46.1%

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

    if -3.2000000000000001e-246 < x < 7.6000000000000003e-196

    1. Initial program 87.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 y around inf 47.5%

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

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

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

    if 7.6000000000000003e-196 < x < 1.55000000000000005e-32

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

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

    if 1.55000000000000005e-32 < x < 4.1999999999999997e104

    1. Initial program 85.3%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt85.1%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \color{blue}{{\left(\sqrt[3]{b}\right)}^{2}}\right) \cdot \sqrt[3]{b} \]
    4. Applied egg-rr85.0%

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(\left(a \cdot z\right) \cdot {\left(\sqrt[3]{b}\right)}^{2}\right) \cdot \sqrt[3]{b}} \]
    5. Taylor expanded in b around inf 44.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{+53}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-246}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;x \leq 7.6 \cdot 10^{-196}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{-32}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+104}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 72.7% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;a \leq 1.05 \cdot 10^{+95} \lor \neg \left(a \leq 3.1 \cdot 10^{+160}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.5000000000000001e64 or 4.09999999999999995e33 < a < 1.05e95 or 3.0999999999999998e160 < a

    1. Initial program 79.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 inf 84.4%

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

    if -1.5000000000000001e64 < a < 4.09999999999999995e33

    1. Initial program 98.4%

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

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

    if 1.05e95 < a < 3.0999999999999998e160

    1. Initial program 84.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 z around 0 79.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.5 \cdot 10^{+64}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 4.1 \cdot 10^{+33}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{+95} \lor \neg \left(a \leq 3.1 \cdot 10^{+160}\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 84.9% accurate, 0.7× speedup?

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

    1. Initial program 89.2%

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

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

    if -3.6e20 < b < 3.2000000000000001e72

    1. Initial program 89.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 b around 0 92.8%

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

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

Alternative 8: 79.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 81.1%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt80.6%

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

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

        \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \color{blue}{{\left(\sqrt[3]{b}\right)}^{2}}\right) \cdot \sqrt[3]{b} \]
    4. Applied egg-rr80.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(a \cdot z\right) \cdot b} \]
    9. Applied egg-rr76.1%

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

    if -2.2e232 < b < 7.4999999999999999e82

    1. Initial program 90.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 b around 0 87.3%

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

    if 7.4999999999999999e82 < b

    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 inf 78.1%

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

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

Alternative 9: 75.0% accurate, 0.9× speedup?

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

    1. Initial program 79.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 z around inf 77.5%

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

    if -6.9999999999999994e66 < z < 1.30000000000000009e-27

    1. Initial program 97.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 0 79.1%

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

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

Alternative 10: 62.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 73.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 82.3%

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

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

    if -1.74999999999999989e68 < z < 1.35e62

    1. Initial program 96.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 0 74.9%

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

    if 1.35e62 < z

    1. Initial program 80.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 a around 0 65.9%

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

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

Alternative 11: 60.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 73.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 82.3%

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

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

    if -4.5000000000000003e68 < z < 1.09999999999999994e132

    1. Initial program 97.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 z around 0 72.6%

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

    if 1.09999999999999994e132 < z

    1. Initial program 72.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 y around inf 59.8%

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

        \[\leadsto \color{blue}{z \cdot y} \]
    5. Simplified59.8%

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

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

Alternative 12: 39.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+56} \lor \neg \left(x \leq 4.6 \cdot 10^{+103}\right):\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.80000000000000014e56 or 4.60000000000000017e103 < x

    1. Initial program 89.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 x around inf 66.1%

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

    if -5.80000000000000014e56 < x < 4.60000000000000017e103

    1. Initial program 89.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 t around inf 35.4%

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

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

Alternative 13: 26.4% accurate, 15.0× speedup?

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

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

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