Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.5% → 99.1%
Time: 10.9s
Alternatives: 13
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 92.5% 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: 99.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+59} \lor \neg \left(z \leq 8.2 \cdot 10^{+35}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.9999999999999997e59 or 8.1999999999999997e35 < z

    1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999997e59 < z < 8.1999999999999997e35

    1. Initial program 99.7%

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

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

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

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

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

Alternative 2: 38.7% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-293}:\\
\;\;\;\;a \cdot t\\

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

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

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+275}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.0500000000000001e23 or 4.30000000000000005e36 < z < 1.19999999999999998e275

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.0500000000000001e23 < z < -1.1e-173 or -2.8999999999999999e-293 < z < 1.82000000000000003e-115

    1. Initial program 99.6%

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

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

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

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

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

    if -1.1e-173 < z < -2.8999999999999999e-293 or 1.82000000000000003e-115 < z < 4.30000000000000005e36

    1. Initial program 98.2%

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

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

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

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

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

    if 1.19999999999999998e275 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+23}:\\ \;\;\;\;b \cdot \left(z \cdot a\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-173}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-293}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;z \leq 1.82 \cdot 10^{-115}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{+36}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+275}:\\ \;\;\;\;b \cdot \left(z \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 38.5% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-297}:\\
\;\;\;\;a \cdot t\\

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

\mathbf{elif}\;z \leq 3.3 \cdot 10^{+39}:\\
\;\;\;\;a \cdot t\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{+275}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.8e22 or 3.30000000000000021e39 < z < 5.5000000000000002e275

    1. Initial program 83.0%

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

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

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

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

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

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

    if -1.8e22 < z < -4.2000000000000001e-182 or -3.4999999999999999e-297 < z < 3.1000000000000001e-118

    1. Initial program 99.6%

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

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

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

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

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

    if -4.2000000000000001e-182 < z < -3.4999999999999999e-297 or 3.1000000000000001e-118 < z < 3.30000000000000021e39

    1. Initial program 98.2%

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

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

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

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

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

    if 5.5000000000000002e275 < z

    1. Initial program 100.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot y} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 4: 81.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+158} \lor \neg \left(z \leq -1.9 \cdot 10^{+71}\right) \land \left(z \leq -3400000000 \lor \neg \left(z \leq 2 \cdot 10^{+61}\right)\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2000000000000001e158 or -1.9e71 < z < -3.4e9 or 1.9999999999999999e61 < z

    1. Initial program 84.4%

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

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

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

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

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

    if -2.2000000000000001e158 < z < -1.9e71 or -3.4e9 < z < 1.9999999999999999e61

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+158} \lor \neg \left(z \leq -1.9 \cdot 10^{+71}\right) \land \left(z \leq -3400000000 \lor \neg \left(z \leq 2 \cdot 10^{+61}\right)\right):\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 39.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;t \leq -6.1 \cdot 10^{+81}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;t \leq -1.15 \cdot 10^{-46}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -2.5 \cdot 10^{-217}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{-70}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{+81}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= t -6.1e+81)
     (* a t)
     (if (<= t -1.15e-46)
       t_1
       (if (<= t -2.5e-217)
         x
         (if (<= t 1.65e-70) t_1 (if (<= t 6.8e+81) x (* a t))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (t <= -6.1e+81) {
		tmp = a * t;
	} else if (t <= -1.15e-46) {
		tmp = t_1;
	} else if (t <= -2.5e-217) {
		tmp = x;
	} else if (t <= 1.65e-70) {
		tmp = t_1;
	} else if (t <= 6.8e+81) {
		tmp = x;
	} else {
		tmp = a * t;
	}
	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 (t <= (-6.1d+81)) then
        tmp = a * t
    else if (t <= (-1.15d-46)) then
        tmp = t_1
    else if (t <= (-2.5d-217)) then
        tmp = x
    else if (t <= 1.65d-70) then
        tmp = t_1
    else if (t <= 6.8d+81) then
        tmp = x
    else
        tmp = a * t
    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 (t <= -6.1e+81) {
		tmp = a * t;
	} else if (t <= -1.15e-46) {
		tmp = t_1;
	} else if (t <= -2.5e-217) {
		tmp = x;
	} else if (t <= 1.65e-70) {
		tmp = t_1;
	} else if (t <= 6.8e+81) {
		tmp = x;
	} else {
		tmp = a * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if t <= -6.1e+81:
		tmp = a * t
	elif t <= -1.15e-46:
		tmp = t_1
	elif t <= -2.5e-217:
		tmp = x
	elif t <= 1.65e-70:
		tmp = t_1
	elif t <= 6.8e+81:
		tmp = x
	else:
		tmp = a * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (t <= -6.1e+81)
		tmp = Float64(a * t);
	elseif (t <= -1.15e-46)
		tmp = t_1;
	elseif (t <= -2.5e-217)
		tmp = x;
	elseif (t <= 1.65e-70)
		tmp = t_1;
	elseif (t <= 6.8e+81)
		tmp = x;
	else
		tmp = Float64(a * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (t <= -6.1e+81)
		tmp = a * t;
	elseif (t <= -1.15e-46)
		tmp = t_1;
	elseif (t <= -2.5e-217)
		tmp = x;
	elseif (t <= 1.65e-70)
		tmp = t_1;
	elseif (t <= 6.8e+81)
		tmp = x;
	else
		tmp = a * t;
	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[t, -6.1e+81], N[(a * t), $MachinePrecision], If[LessEqual[t, -1.15e-46], t$95$1, If[LessEqual[t, -2.5e-217], x, If[LessEqual[t, 1.65e-70], t$95$1, If[LessEqual[t, 6.8e+81], x, N[(a * t), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.15 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -2.5 \cdot 10^{-217}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 1.65 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 6.8 \cdot 10^{+81}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.10000000000000038e81 or 6.80000000000000005e81 < 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. Step-by-step derivation
      1. associate-+l+92.8%

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

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

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

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

    if -6.10000000000000038e81 < t < -1.15e-46 or -2.5000000000000001e-217 < t < 1.65000000000000008e-70

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

    if -1.15e-46 < t < -2.5000000000000001e-217 or 1.65000000000000008e-70 < t < 6.80000000000000005e81

    1. Initial program 91.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.1 \cdot 10^{+81}:\\ \;\;\;\;a \cdot t\\ \mathbf{elif}\;t \leq -1.15 \cdot 10^{-46}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;t \leq -2.5 \cdot 10^{-217}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{-70}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{+81}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 39.6% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-292}:\\
\;\;\;\;a \cdot t\\

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

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+60}:\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.69999999999999996 or 2.30000000000000017e60 < z

    1. Initial program 84.4%

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

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

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

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

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

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

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

    if -1.69999999999999996 < z < -2.9999999999999998e-183 or -2.89999999999999993e-292 < z < 8.49999999999999981e-117

    1. Initial program 99.5%

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

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

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

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

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

    if -2.9999999999999998e-183 < z < -2.89999999999999993e-292 or 8.49999999999999981e-117 < z < 2.30000000000000017e60

    1. Initial program 98.3%

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

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

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

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

      \[\leadsto \color{blue}{a \cdot t} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 72.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x + z \cdot y\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -4.6 \cdot 10^{-34}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 10^{-17}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 8.6 \cdot 10^{+95}:\\
\;\;\;\;x + a \cdot t\\

\mathbf{elif}\;a \leq 1.6 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.60000000000000022e-34 or 1.6000000000000001e131 < a

    1. Initial program 83.7%

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

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

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

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

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

    if -4.60000000000000022e-34 < a < 1.00000000000000007e-17 or 8.6e95 < a < 1.6000000000000001e131

    1. Initial program 98.1%

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

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

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

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

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

    if 1.00000000000000007e-17 < a < 8.6e95

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.6 \cdot 10^{-34}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 10^{-17}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;a \leq 8.6 \cdot 10^{+95}:\\ \;\;\;\;x + a \cdot t\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{+131}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 62.9% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;z \leq -3400000000 \lor \neg \left(z \leq 1.55 \cdot 10^{+60}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.7000000000000003e226 or -1.00000000000000004e121 < z < -3.4e9 or 1.55e60 < z

    1. Initial program 84.3%

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

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

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

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

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

    if -2.7000000000000003e226 < z < -1.00000000000000004e121

    1. Initial program 83.4%

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

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

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

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

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

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

    if -3.4e9 < z < 1.55e60

    1. Initial program 99.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+226}:\\ \;\;\;\;x + z \cdot y\\ \mathbf{elif}\;z \leq -1 \cdot 10^{+121}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq -3400000000 \lor \neg \left(z \leq 1.55 \cdot 10^{+60}\right):\\ \;\;\;\;x + z \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 94.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-74} \lor \neg \left(z \leq 2.8\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.8000000000000001e-74 or 2.7999999999999998 < z

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

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

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

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

    if -1.8000000000000001e-74 < z < 2.7999999999999998

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 74.4% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4200 or 6.60000000000000027e44 < z

    1. Initial program 84.6%

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

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

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

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

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

    if -4200 < z < 6.60000000000000027e44

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

Alternative 11: 57.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+16} \lor \neg \left(a \leq 1.65 \cdot 10^{+131}\right):\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5e16 or 1.6499999999999999e131 < a

    1. Initial program 81.9%

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

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

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

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

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

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

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

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

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

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

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

    if -5e16 < a < 1.6499999999999999e131

    1. Initial program 98.5%

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

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

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

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

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

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

Alternative 12: 39.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.55 \cdot 10^{+56} \lor \neg \left(t \leq 6 \cdot 10^{+81}\right):\\
\;\;\;\;a \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5500000000000001e56 or 5.99999999999999995e81 < t

    1. Initial program 92.3%

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

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

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

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

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

    if -2.5500000000000001e56 < t < 5.99999999999999995e81

    1. Initial program 92.0%

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

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

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

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

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

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

Alternative 13: 26.1% 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 92.1%

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

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

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

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

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

Developer target: 97.4% 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 2024087 
(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)))