Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.6% → 97.0%
Time: 13.8s
Alternatives: 10
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 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.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: 97.0% accurate, 0.5× 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}:\\ \;\;\;\;a \cdot \left(t + z \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 (* a (+ t (* z 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 = a * (t + (z * 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 = a * (t + (z * 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 = a * (t + (z * 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(a * Float64(t + Float64(z * 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 = a * (t + (z * 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[(a * N[(t + N[(z * 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}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\


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

    1. Initial program 99.2%

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b \]

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

    1. Initial program 0.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \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}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 2: 79.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot z\\ t_2 := x + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\ \mathbf{if}\;a \leq -7.6 \cdot 10^{-5}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-129}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.08 \cdot 10^{-162}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{-177}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{-87}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ x (* y z))) (t_2 (+ x (+ (* t a) (* a (* z b))))))
   (if (<= a -7.6e-5)
     t_2
     (if (<= a -4.2e-129)
       t_1
       (if (<= a -1.08e-162)
         t_2
         (if (<= a -2.3e-177)
           (* z (+ y (* a b)))
           (if (<= a 3.7e-87) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x + (y * z);
	double t_2 = x + ((t * a) + (a * (z * b)));
	double tmp;
	if (a <= -7.6e-5) {
		tmp = t_2;
	} else if (a <= -4.2e-129) {
		tmp = t_1;
	} else if (a <= -1.08e-162) {
		tmp = t_2;
	} else if (a <= -2.3e-177) {
		tmp = z * (y + (a * b));
	} else if (a <= 3.7e-87) {
		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 + (y * z)
    t_2 = x + ((t * a) + (a * (z * b)))
    if (a <= (-7.6d-5)) then
        tmp = t_2
    else if (a <= (-4.2d-129)) then
        tmp = t_1
    else if (a <= (-1.08d-162)) then
        tmp = t_2
    else if (a <= (-2.3d-177)) then
        tmp = z * (y + (a * b))
    else if (a <= 3.7d-87) 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 + (y * z);
	double t_2 = x + ((t * a) + (a * (z * b)));
	double tmp;
	if (a <= -7.6e-5) {
		tmp = t_2;
	} else if (a <= -4.2e-129) {
		tmp = t_1;
	} else if (a <= -1.08e-162) {
		tmp = t_2;
	} else if (a <= -2.3e-177) {
		tmp = z * (y + (a * b));
	} else if (a <= 3.7e-87) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x + (y * z)
	t_2 = x + ((t * a) + (a * (z * b)))
	tmp = 0
	if a <= -7.6e-5:
		tmp = t_2
	elif a <= -4.2e-129:
		tmp = t_1
	elif a <= -1.08e-162:
		tmp = t_2
	elif a <= -2.3e-177:
		tmp = z * (y + (a * b))
	elif a <= 3.7e-87:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x + Float64(y * z))
	t_2 = Float64(x + Float64(Float64(t * a) + Float64(a * Float64(z * b))))
	tmp = 0.0
	if (a <= -7.6e-5)
		tmp = t_2;
	elseif (a <= -4.2e-129)
		tmp = t_1;
	elseif (a <= -1.08e-162)
		tmp = t_2;
	elseif (a <= -2.3e-177)
		tmp = Float64(z * Float64(y + Float64(a * b)));
	elseif (a <= 3.7e-87)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x + (y * z);
	t_2 = x + ((t * a) + (a * (z * b)));
	tmp = 0.0;
	if (a <= -7.6e-5)
		tmp = t_2;
	elseif (a <= -4.2e-129)
		tmp = t_1;
	elseif (a <= -1.08e-162)
		tmp = t_2;
	elseif (a <= -2.3e-177)
		tmp = z * (y + (a * b));
	elseif (a <= 3.7e-87)
		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[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.6e-5], t$95$2, If[LessEqual[a, -4.2e-129], t$95$1, If[LessEqual[a, -1.08e-162], t$95$2, If[LessEqual[a, -2.3e-177], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.7e-87], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -4.2 \cdot 10^{-129}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -1.08 \cdot 10^{-162}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;a \leq 3.7 \cdot 10^{-87}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.6000000000000004e-5 or -4.2e-129 < a < -1.08000000000000006e-162 or 3.7000000000000002e-87 < a

    1. Initial program 87.1%

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

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

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

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

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

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

    if -7.6000000000000004e-5 < a < -4.2e-129 or -2.30000000000000022e-177 < a < 3.7000000000000002e-87

    1. Initial program 97.9%

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

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

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

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

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

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

    if -1.08000000000000006e-162 < a < -2.30000000000000022e-177

    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. *-commutative100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.6 \cdot 10^{-5}:\\ \;\;\;\;x + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-129}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq -1.08 \cdot 10^{-162}:\\ \;\;\;\;x + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\ \mathbf{elif}\;a \leq -2.3 \cdot 10^{-177}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 3.7 \cdot 10^{-87}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\ \end{array} \]

Alternative 3: 79.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq -1.25 \cdot 10^{-134}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 5 \cdot 10^{-94}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -8.6000000000000002e-8 or 4.9999999999999995e-94 < a

    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. *-commutative86.5%

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

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

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

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

    if -8.6000000000000002e-8 < a < -1.2500000000000001e-134 or -1.4499999999999999e-179 < a < 4.9999999999999995e-94

    1. Initial program 98.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+98.0%

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

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

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

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

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

    if -1.2500000000000001e-134 < a < -1.4499999999999999e-179

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.6 \cdot 10^{-8}:\\ \;\;\;\;x + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\ \mathbf{elif}\;a \leq -1.25 \cdot 10^{-134}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq -1.45 \cdot 10^{-179}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b + \left(y \cdot z + t \cdot a\right)\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-94}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\ \end{array} \]

Alternative 4: 93.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 68.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+68.7%

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

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

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

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

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

    if -8.0000000000000006e244 < a < 1.1599999999999999e70

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

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

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

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

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

    if 1.1599999999999999e70 < a

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8 \cdot 10^{+244}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq 1.16 \cdot 10^{+70}:\\ \;\;\;\;\left(x + y \cdot z\right) + \left(z \cdot \left(a \cdot b\right) + t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\ \end{array} \]

Alternative 5: 39.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+16}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;a \leq 3.4 \cdot 10^{-273}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 3.4 \cdot 10^{-221}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.4 \cdot 10^{-87}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 2.16 \cdot 10^{+15}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.6e16 or 2.16e15 < a

    1. Initial program 84.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+84.1%

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

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

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

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

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

    if -1.6e16 < a < 3.39999999999999991e-273 or 3.4000000000000001e-221 < a < 1.4e-87

    1. Initial program 98.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+98.0%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified55.4%

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

    if 3.39999999999999991e-273 < a < 3.4000000000000001e-221 or 1.4e-87 < a < 2.16e15

    1. Initial program 99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{+16}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-273}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-221}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{-87}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 2.16 \cdot 10^{+15}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]

Alternative 6: 59.7% accurate, 1.3× speedup?

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

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

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

\mathbf{elif}\;z \leq 2.05 \cdot 10^{+238}:\\
\;\;\;\;y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.59999999999999974e145

    1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef90.8%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(z, y, x\right) + \color{blue}{a \cdot t}\right) \]
    5. Applied egg-rr90.8%

      \[\leadsto \mathsf{fma}\left(z, a \cdot b, \color{blue}{\mathsf{fma}\left(z, y, x\right) + a \cdot t}\right) \]
    6. Taylor expanded in b around inf 48.2%

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

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

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

    if -3.59999999999999974e145 < z < 1.04999999999999999e148

    1. Initial program 98.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+98.8%

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

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

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

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

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

    if 1.04999999999999999e148 < z < 2.0499999999999999e238

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified59.9%

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

    if 2.0499999999999999e238 < z

    1. Initial program 63.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. +-commutative63.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, a \cdot b, \mathsf{fma}\left(t, a, \mathsf{fma}\left(y, z, x\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef78.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z, a \cdot b, \color{blue}{a \cdot t + y \cdot z}\right) \]
    7. Taylor expanded in b around inf 61.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+145}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+148}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+238}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \end{array} \]

Alternative 7: 74.9% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.15 \cdot 10^{+31} \lor \neg \left(a \leq 70000\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.15e31 or 7e4 < a

    1. Initial program 84.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+84.2%

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

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

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

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

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

    if -1.15e31 < a < 7e4

    1. Initial program 97.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.15 \cdot 10^{+31} \lor \neg \left(a \leq 70000\right):\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]

Alternative 8: 63.9% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{+16} \lor \neg \left(a \leq 1.3 \cdot 10^{-93}\right):\\
\;\;\;\;x + t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.2e16 or 1.2999999999999999e-93 < a

    1. Initial program 86.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+86.2%

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

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

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

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

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

    if -5.2e16 < a < 1.2999999999999999e-93

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{+16} \lor \neg \left(a \leq 1.3 \cdot 10^{-93}\right):\\ \;\;\;\;x + t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]

Alternative 9: 39.9% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{+28}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;a \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.9499999999999999e28 or 2.1e15 < a

    1. Initial program 84.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+84.1%

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

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

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

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

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

    if -1.9499999999999999e28 < a < 2.1e15

    1. Initial program 97.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.95 \cdot 10^{+28}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq 2.1 \cdot 10^{+15}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]

Alternative 10: 27.3% 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 91.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+91.4%

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification26.2%

    \[\leadsto x \]

Developer target: 97.3% accurate, 0.9× 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 2023297 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

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

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