Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.4% → 96.3%
Time: 12.0s
Alternatives: 14
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 92.4% accurate, 1.0× speedup?

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

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

Alternative 1: 96.3% accurate, 0.5× speedup?

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

      \[\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*6.7%

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

      \[\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 93.3%

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

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

Alternative 2: 37.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;b \leq -7.6 \cdot 10^{+83}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1 \cdot 10^{-45}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-281}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 5.4 \cdot 10^{-148}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{-43}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 460000:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 1.95 \cdot 10^{+77}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= b -7.6e+83)
     t_1
     (if (<= b -1e-45)
       (* t a)
       (if (<= b -4.2e-281)
         x
         (if (<= b 5.4e-148)
           (* y z)
           (if (<= b 7.5e-43)
             x
             (if (<= b 460000.0)
               (* y z)
               (if (<= b 1.95e+77) (* t a) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (b <= -7.6e+83) {
		tmp = t_1;
	} else if (b <= -1e-45) {
		tmp = t * a;
	} else if (b <= -4.2e-281) {
		tmp = x;
	} else if (b <= 5.4e-148) {
		tmp = y * z;
	} else if (b <= 7.5e-43) {
		tmp = x;
	} else if (b <= 460000.0) {
		tmp = y * z;
	} else if (b <= 1.95e+77) {
		tmp = t * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (b <= (-7.6d+83)) then
        tmp = t_1
    else if (b <= (-1d-45)) then
        tmp = t * a
    else if (b <= (-4.2d-281)) then
        tmp = x
    else if (b <= 5.4d-148) then
        tmp = y * z
    else if (b <= 7.5d-43) then
        tmp = x
    else if (b <= 460000.0d0) then
        tmp = y * z
    else if (b <= 1.95d+77) then
        tmp = t * a
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (b <= -7.6e+83) {
		tmp = t_1;
	} else if (b <= -1e-45) {
		tmp = t * a;
	} else if (b <= -4.2e-281) {
		tmp = x;
	} else if (b <= 5.4e-148) {
		tmp = y * z;
	} else if (b <= 7.5e-43) {
		tmp = x;
	} else if (b <= 460000.0) {
		tmp = y * z;
	} else if (b <= 1.95e+77) {
		tmp = t * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if b <= -7.6e+83:
		tmp = t_1
	elif b <= -1e-45:
		tmp = t * a
	elif b <= -4.2e-281:
		tmp = x
	elif b <= 5.4e-148:
		tmp = y * z
	elif b <= 7.5e-43:
		tmp = x
	elif b <= 460000.0:
		tmp = y * z
	elif b <= 1.95e+77:
		tmp = t * a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (b <= -7.6e+83)
		tmp = t_1;
	elseif (b <= -1e-45)
		tmp = Float64(t * a);
	elseif (b <= -4.2e-281)
		tmp = x;
	elseif (b <= 5.4e-148)
		tmp = Float64(y * z);
	elseif (b <= 7.5e-43)
		tmp = x;
	elseif (b <= 460000.0)
		tmp = Float64(y * z);
	elseif (b <= 1.95e+77)
		tmp = Float64(t * a);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (b <= -7.6e+83)
		tmp = t_1;
	elseif (b <= -1e-45)
		tmp = t * a;
	elseif (b <= -4.2e-281)
		tmp = x;
	elseif (b <= 5.4e-148)
		tmp = y * z;
	elseif (b <= 7.5e-43)
		tmp = x;
	elseif (b <= 460000.0)
		tmp = y * z;
	elseif (b <= 1.95e+77)
		tmp = t * a;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -7.6e+83], t$95$1, If[LessEqual[b, -1e-45], N[(t * a), $MachinePrecision], If[LessEqual[b, -4.2e-281], x, If[LessEqual[b, 5.4e-148], N[(y * z), $MachinePrecision], If[LessEqual[b, 7.5e-43], x, If[LessEqual[b, 460000.0], N[(y * z), $MachinePrecision], If[LessEqual[b, 1.95e+77], N[(t * a), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -1 \cdot 10^{-45}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;b \leq -4.2 \cdot 10^{-281}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 5.4 \cdot 10^{-148}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 7.5 \cdot 10^{-43}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 460000:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 1.95 \cdot 10^{+77}:\\
\;\;\;\;t \cdot a\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -7.6000000000000004e83 or 1.9499999999999999e77 < b

    1. Initial program 90.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+90.8%

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

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

        \[\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*82.2%

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

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

        \[\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-out87.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.6000000000000004e83 < b < -9.99999999999999984e-46 or 4.6e5 < b < 1.9499999999999999e77

    1. Initial program 95.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+95.4%

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

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

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

    if -9.99999999999999984e-46 < b < -4.1999999999999998e-281 or 5.39999999999999976e-148 < b < 7.50000000000000068e-43

    1. Initial program 95.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+95.5%

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

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

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

    if -4.1999999999999998e-281 < b < 5.39999999999999976e-148 or 7.50000000000000068e-43 < b < 4.6e5

    1. Initial program 95.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+95.7%

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

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

      \[\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 52.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.6 \cdot 10^{+83}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;b \leq -1 \cdot 10^{-45}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-281}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 5.4 \cdot 10^{-148}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{-43}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 460000:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 1.95 \cdot 10^{+77}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \end{array} \]

Alternative 3: 38.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(z \cdot a\right)\\ \mathbf{if}\;b \leq -7 \cdot 10^{+88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-45}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-281}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 7.6 \cdot 10^{-148}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 5.8 \cdot 10^{-40}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 470000:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 10^{+78}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (* z a))))
   (if (<= b -7e+88)
     t_1
     (if (<= b -4.2e-45)
       (* t a)
       (if (<= b -4.2e-281)
         x
         (if (<= b 7.6e-148)
           (* y z)
           (if (<= b 5.8e-40)
             x
             (if (<= b 470000.0) (* y z) (if (<= b 1e+78) (* t a) t_1)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (z * a);
	double tmp;
	if (b <= -7e+88) {
		tmp = t_1;
	} else if (b <= -4.2e-45) {
		tmp = t * a;
	} else if (b <= -4.2e-281) {
		tmp = x;
	} else if (b <= 7.6e-148) {
		tmp = y * z;
	} else if (b <= 5.8e-40) {
		tmp = x;
	} else if (b <= 470000.0) {
		tmp = y * z;
	} else if (b <= 1e+78) {
		tmp = t * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = b * (z * a)
    if (b <= (-7d+88)) then
        tmp = t_1
    else if (b <= (-4.2d-45)) then
        tmp = t * a
    else if (b <= (-4.2d-281)) then
        tmp = x
    else if (b <= 7.6d-148) then
        tmp = y * z
    else if (b <= 5.8d-40) then
        tmp = x
    else if (b <= 470000.0d0) then
        tmp = y * z
    else if (b <= 1d+78) then
        tmp = t * a
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (z * a);
	double tmp;
	if (b <= -7e+88) {
		tmp = t_1;
	} else if (b <= -4.2e-45) {
		tmp = t * a;
	} else if (b <= -4.2e-281) {
		tmp = x;
	} else if (b <= 7.6e-148) {
		tmp = y * z;
	} else if (b <= 5.8e-40) {
		tmp = x;
	} else if (b <= 470000.0) {
		tmp = y * z;
	} else if (b <= 1e+78) {
		tmp = t * a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (z * a)
	tmp = 0
	if b <= -7e+88:
		tmp = t_1
	elif b <= -4.2e-45:
		tmp = t * a
	elif b <= -4.2e-281:
		tmp = x
	elif b <= 7.6e-148:
		tmp = y * z
	elif b <= 5.8e-40:
		tmp = x
	elif b <= 470000.0:
		tmp = y * z
	elif b <= 1e+78:
		tmp = t * a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(z * a))
	tmp = 0.0
	if (b <= -7e+88)
		tmp = t_1;
	elseif (b <= -4.2e-45)
		tmp = Float64(t * a);
	elseif (b <= -4.2e-281)
		tmp = x;
	elseif (b <= 7.6e-148)
		tmp = Float64(y * z);
	elseif (b <= 5.8e-40)
		tmp = x;
	elseif (b <= 470000.0)
		tmp = Float64(y * z);
	elseif (b <= 1e+78)
		tmp = Float64(t * a);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (z * a);
	tmp = 0.0;
	if (b <= -7e+88)
		tmp = t_1;
	elseif (b <= -4.2e-45)
		tmp = t * a;
	elseif (b <= -4.2e-281)
		tmp = x;
	elseif (b <= 7.6e-148)
		tmp = y * z;
	elseif (b <= 5.8e-40)
		tmp = x;
	elseif (b <= 470000.0)
		tmp = y * z;
	elseif (b <= 1e+78)
		tmp = t * a;
	else
		tmp = t_1;
	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[b, -7e+88], t$95$1, If[LessEqual[b, -4.2e-45], N[(t * a), $MachinePrecision], If[LessEqual[b, -4.2e-281], x, If[LessEqual[b, 7.6e-148], N[(y * z), $MachinePrecision], If[LessEqual[b, 5.8e-40], x, If[LessEqual[b, 470000.0], N[(y * z), $MachinePrecision], If[LessEqual[b, 1e+78], N[(t * a), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -4.2 \cdot 10^{-45}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;b \leq -4.2 \cdot 10^{-281}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 7.6 \cdot 10^{-148}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 5.8 \cdot 10^{-40}:\\
\;\;\;\;x\\

\mathbf{elif}\;b \leq 470000:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;b \leq 10^{+78}:\\
\;\;\;\;t \cdot a\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -6.9999999999999995e88 or 1.00000000000000001e78 < b

    1. Initial program 90.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+90.7%

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

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

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

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

        \[\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-out86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999995e88 < b < -4.1999999999999999e-45 or 4.7e5 < b < 1.00000000000000001e78

    1. Initial program 95.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+95.6%

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

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

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

      \[\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.5%

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

    if -4.1999999999999999e-45 < b < -4.1999999999999998e-281 or 7.60000000000000028e-148 < b < 5.7999999999999998e-40

    1. Initial program 95.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+95.5%

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

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

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

    if -4.1999999999999998e-281 < b < 7.60000000000000028e-148 or 5.7999999999999998e-40 < b < 4.7e5

    1. Initial program 95.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+95.7%

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

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

      \[\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 52.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{+88}:\\ \;\;\;\;b \cdot \left(z \cdot a\right)\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-45}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-281}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 7.6 \cdot 10^{-148}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 5.8 \cdot 10^{-40}:\\ \;\;\;\;x\\ \mathbf{elif}\;b \leq 470000:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;b \leq 10^{+78}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(z \cdot a\right)\\ \end{array} \]

Alternative 4: 94.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.8 \cdot 10^{-30} \lor \neg \left(a \leq 1.52 \cdot 10^{+66}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.8000000000000007e-30 or 1.52000000000000004e66 < a

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

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

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

        \[\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*88.4%

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

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

        \[\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-out94.2%

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

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

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

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

    if -7.8000000000000007e-30 < a < 1.52000000000000004e66

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

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

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

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

Alternative 5: 85.8% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;a \leq 5.5 \cdot 10^{-32}:\\
\;\;\;\;x + t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.30000000000000008e-39 or 5.50000000000000024e-32 < a

    1. Initial program 88.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+88.5%

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

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

        \[\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*89.8%

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

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

        \[\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-out94.9%

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

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

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

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

    if -2.30000000000000008e-39 < a < -1.12e-162

    1. Initial program 99.8%

      \[\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 95.3%

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

    if -1.12e-162 < a < 5.50000000000000024e-32

    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*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 b around 0 95.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.3 \cdot 10^{-39}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq -1.12 \cdot 10^{-162}:\\ \;\;\;\;\left(t \cdot a + y \cdot z\right) + b \cdot \left(z \cdot a\right)\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{-32}:\\ \;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 6: 80.0% accurate, 1.0× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.69999999999999969e-14 or 9.99999999999999985e-119 < a

    1. Initial program 90.3%

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

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

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

        \[\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*91.5%

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

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

        \[\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-out96.1%

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

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

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

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

    if -5.69999999999999969e-14 < a < -1.94999999999999987e-161

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

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

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

    if -1.94999999999999987e-161 < a < 9.99999999999999985e-119

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.7 \cdot 10^{-14}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq -1.95 \cdot 10^{-161}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 10^{-118}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 7: 38.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.2 \cdot 10^{-13}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;a \leq -6.6 \cdot 10^{-214}:\\
\;\;\;\;y \cdot z\\

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

\mathbf{elif}\;a \leq 5 \cdot 10^{-126}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;a \leq 1.25 \cdot 10^{-57}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.2000000000000001e-13 or 1.25e-57 < a

    1. Initial program 89.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+89.3%

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

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

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

    if -5.2000000000000001e-13 < a < -6.5999999999999996e-214 or -4.8999999999999997e-248 < a < 5.00000000000000006e-126

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified58.3%

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

    if -6.5999999999999996e-214 < a < -4.8999999999999997e-248 or 5.00000000000000006e-126 < a < 1.25e-57

    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.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-13}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq -6.6 \cdot 10^{-214}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq -4.9 \cdot 10^{-248}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-126}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{-57}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t \cdot a\\ \end{array} \]

Alternative 8: 63.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := x + t \cdot a\\
\mathbf{if}\;a \leq -1.05 \cdot 10^{-13}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 2600000000:\\
\;\;\;\;x + y \cdot z\\

\mathbf{elif}\;a \leq 4 \cdot 10^{+196} \lor \neg \left(a \leq 3.3 \cdot 10^{+292}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.04999999999999994e-13 or 2.6e9 < a < 3.9999999999999998e196 or 3.3e292 < a

    1. Initial program 90.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+90.5%

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

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

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

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

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

    if -1.04999999999999994e-13 < a < 2.6e9

    1. Initial program 99.2%

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

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

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

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

    if 3.9999999999999998e196 < a < 3.3e292

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

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

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

        \[\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*83.3%

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

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

        \[\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-out87.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.05 \cdot 10^{-13}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;a \leq 2600000000:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;a \leq 4 \cdot 10^{+196} \lor \neg \left(a \leq 3.3 \cdot 10^{+292}\right):\\ \;\;\;\;x + t \cdot a\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(z \cdot a\right)\\ \end{array} \]

Alternative 9: 71.7% accurate, 1.1× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.75e-12 or 3.7999999999999997e-55 < a

    1. Initial program 89.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+89.3%

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

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

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

    if -1.75e-12 < a < -2.25000000000000013e-160

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

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

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

    if -2.25000000000000013e-160 < a < 3.7999999999999997e-55

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.75 \cdot 10^{-12}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \mathbf{elif}\;a \leq -2.25 \cdot 10^{-160}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-55}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right)\\ \end{array} \]

Alternative 10: 87.6% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.3 \cdot 10^{-30} \lor \neg \left(a \leq 2.5 \cdot 10^{-32}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.29999999999999982e-30 or 2.5e-32 < a

    1. Initial program 88.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+88.3%

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

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

        \[\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*89.7%

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

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

        \[\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-out94.8%

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

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

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

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

    if -6.29999999999999982e-30 < a < 2.5e-32

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

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

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

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

Alternative 11: 73.2% accurate, 1.3× speedup?

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

    1. Initial program 88.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+88.7%

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

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

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

    if -7.0000000000000006e-30 < a < 7.99999999999999996e-55

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

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

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

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

Alternative 12: 57.8% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.35 \cdot 10^{-12}:\\
\;\;\;\;t \cdot a\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.34999999999999988e-12

    1. Initial program 86.4%

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

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

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

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

    if -2.34999999999999988e-12 < a < 7.7999999999999996e64

    1. Initial program 99.2%

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

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

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

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

    if 7.7999999999999996e64 < a

    1. Initial program 88.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+88.6%

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

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

        \[\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*90.4%

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

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

        \[\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-out92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 39.7% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+15} \lor \neg \left(t \leq 1.3 \cdot 10^{-46}\right):\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.9e15 or 1.3000000000000001e-46 < t

    1. Initial program 90.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+90.7%

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

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

      \[\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 46.8%

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

    if -2.9e15 < t < 1.3000000000000001e-46

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

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

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

      \[\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 32.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.9 \cdot 10^{+15} \lor \neg \left(t \leq 1.3 \cdot 10^{-46}\right):\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 14: 26.7% accurate, 15.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification22.9%

    \[\leadsto x \]

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