Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1

Percentage Accurate: 92.2% → 95.7%
Time: 18.0s
Alternatives: 15
Speedup: 1.2×

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 15 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.2% 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: 95.7% accurate, 0.5× speedup?

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

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

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

    1. Initial program 98.9%

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

    if 2.00000000000000012e279 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b))

    1. Initial program 67.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. *-commutative67.0%

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

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

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

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

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

Alternative 2: 36.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;z \leq -8.5 \cdot 10^{+113}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{+29}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-195}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-87}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-56}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+202} \lor \neg \left(z \leq 5.7 \cdot 10^{+256}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= z -8.5e+113)
     t_1
     (if (<= z -4.3e+29)
       (* t a)
       (if (<= z 2e-195)
         x
         (if (<= z 6.2e-87)
           (* t a)
           (if (<= z 4.4e-56)
             x
             (if (or (<= z 2.2e+202) (not (<= z 5.7e+256))) t_1 (* y z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (z <= -8.5e+113) {
		tmp = t_1;
	} else if (z <= -4.3e+29) {
		tmp = t * a;
	} else if (z <= 2e-195) {
		tmp = x;
	} else if (z <= 6.2e-87) {
		tmp = t * a;
	} else if (z <= 4.4e-56) {
		tmp = x;
	} else if ((z <= 2.2e+202) || !(z <= 5.7e+256)) {
		tmp = t_1;
	} else {
		tmp = y * z;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (z <= (-8.5d+113)) then
        tmp = t_1
    else if (z <= (-4.3d+29)) then
        tmp = t * a
    else if (z <= 2d-195) then
        tmp = x
    else if (z <= 6.2d-87) then
        tmp = t * a
    else if (z <= 4.4d-56) then
        tmp = x
    else if ((z <= 2.2d+202) .or. (.not. (z <= 5.7d+256))) then
        tmp = t_1
    else
        tmp = y * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (z <= -8.5e+113) {
		tmp = t_1;
	} else if (z <= -4.3e+29) {
		tmp = t * a;
	} else if (z <= 2e-195) {
		tmp = x;
	} else if (z <= 6.2e-87) {
		tmp = t * a;
	} else if (z <= 4.4e-56) {
		tmp = x;
	} else if ((z <= 2.2e+202) || !(z <= 5.7e+256)) {
		tmp = t_1;
	} else {
		tmp = y * z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if z <= -8.5e+113:
		tmp = t_1
	elif z <= -4.3e+29:
		tmp = t * a
	elif z <= 2e-195:
		tmp = x
	elif z <= 6.2e-87:
		tmp = t * a
	elif z <= 4.4e-56:
		tmp = x
	elif (z <= 2.2e+202) or not (z <= 5.7e+256):
		tmp = t_1
	else:
		tmp = y * z
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (z <= -8.5e+113)
		tmp = t_1;
	elseif (z <= -4.3e+29)
		tmp = Float64(t * a);
	elseif (z <= 2e-195)
		tmp = x;
	elseif (z <= 6.2e-87)
		tmp = Float64(t * a);
	elseif (z <= 4.4e-56)
		tmp = x;
	elseif ((z <= 2.2e+202) || !(z <= 5.7e+256))
		tmp = t_1;
	else
		tmp = Float64(y * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (z <= -8.5e+113)
		tmp = t_1;
	elseif (z <= -4.3e+29)
		tmp = t * a;
	elseif (z <= 2e-195)
		tmp = x;
	elseif (z <= 6.2e-87)
		tmp = t * a;
	elseif (z <= 4.4e-56)
		tmp = x;
	elseif ((z <= 2.2e+202) || ~((z <= 5.7e+256)))
		tmp = t_1;
	else
		tmp = y * z;
	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[z, -8.5e+113], t$95$1, If[LessEqual[z, -4.3e+29], N[(t * a), $MachinePrecision], If[LessEqual[z, 2e-195], x, If[LessEqual[z, 6.2e-87], N[(t * a), $MachinePrecision], If[LessEqual[z, 4.4e-56], x, If[Or[LessEqual[z, 2.2e+202], N[Not[LessEqual[z, 5.7e+256]], $MachinePrecision]], t$95$1, N[(y * z), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 2 \cdot 10^{-195}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{-87}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;z \leq 4.4 \cdot 10^{-56}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.2 \cdot 10^{+202} \lor \neg \left(z \leq 5.7 \cdot 10^{+256}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.5000000000000001e113 or 4.40000000000000008e-56 < z < 2.19999999999999978e202 or 5.6999999999999997e256 < z

    1. Initial program 85.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. *-commutative85.6%

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

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

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

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

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

    if -8.5000000000000001e113 < z < -4.3000000000000003e29 or 2.0000000000000002e-195 < z < 6.19999999999999995e-87

    1. Initial program 99.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. *-commutative99.8%

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

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

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

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

    if -4.3000000000000003e29 < z < 2.0000000000000002e-195 or 6.19999999999999995e-87 < z < 4.40000000000000008e-56

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

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

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

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

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

    if 2.19999999999999978e202 < z < 5.6999999999999997e256

    1. Initial program 44.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. *-commutative44.4%

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified66.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+113}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{+29}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-195}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-87}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-56}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+202} \lor \neg \left(z \leq 5.7 \cdot 10^{+256}\right):\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 3: 71.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot a + y \cdot z\\ t_2 := z \cdot \left(y + a \cdot b\right)\\ \mathbf{if}\;z \leq -6.2 \cdot 10^{+114}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{+30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-46}:\\ \;\;\;\;x + a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-86}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-137}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-58}:\\ \;\;\;\;x + t \cdot a\\ \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 (* z (+ y (* a b)))))
   (if (<= z -6.2e+114)
     t_2
     (if (<= z -4.3e+30)
       t_1
       (if (<= z -2.1e-46)
         (+ x (* a (* z b)))
         (if (<= z -3.5e-86)
           t_1
           (if (<= z -1.25e-137)
             (+ x (* y z))
             (if (<= z 1.35e-58) (+ x (* t a)) 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 = z * (y + (a * b));
	double tmp;
	if (z <= -6.2e+114) {
		tmp = t_2;
	} else if (z <= -4.3e+30) {
		tmp = t_1;
	} else if (z <= -2.1e-46) {
		tmp = x + (a * (z * b));
	} else if (z <= -3.5e-86) {
		tmp = t_1;
	} else if (z <= -1.25e-137) {
		tmp = x + (y * z);
	} else if (z <= 1.35e-58) {
		tmp = x + (t * a);
	} 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 = z * (y + (a * b))
    if (z <= (-6.2d+114)) then
        tmp = t_2
    else if (z <= (-4.3d+30)) then
        tmp = t_1
    else if (z <= (-2.1d-46)) then
        tmp = x + (a * (z * b))
    else if (z <= (-3.5d-86)) then
        tmp = t_1
    else if (z <= (-1.25d-137)) then
        tmp = x + (y * z)
    else if (z <= 1.35d-58) then
        tmp = x + (t * a)
    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 = z * (y + (a * b));
	double tmp;
	if (z <= -6.2e+114) {
		tmp = t_2;
	} else if (z <= -4.3e+30) {
		tmp = t_1;
	} else if (z <= -2.1e-46) {
		tmp = x + (a * (z * b));
	} else if (z <= -3.5e-86) {
		tmp = t_1;
	} else if (z <= -1.25e-137) {
		tmp = x + (y * z);
	} else if (z <= 1.35e-58) {
		tmp = x + (t * a);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (t * a) + (y * z)
	t_2 = z * (y + (a * b))
	tmp = 0
	if z <= -6.2e+114:
		tmp = t_2
	elif z <= -4.3e+30:
		tmp = t_1
	elif z <= -2.1e-46:
		tmp = x + (a * (z * b))
	elif z <= -3.5e-86:
		tmp = t_1
	elif z <= -1.25e-137:
		tmp = x + (y * z)
	elif z <= 1.35e-58:
		tmp = x + (t * a)
	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(z * Float64(y + Float64(a * b)))
	tmp = 0.0
	if (z <= -6.2e+114)
		tmp = t_2;
	elseif (z <= -4.3e+30)
		tmp = t_1;
	elseif (z <= -2.1e-46)
		tmp = Float64(x + Float64(a * Float64(z * b)));
	elseif (z <= -3.5e-86)
		tmp = t_1;
	elseif (z <= -1.25e-137)
		tmp = Float64(x + Float64(y * z));
	elseif (z <= 1.35e-58)
		tmp = Float64(x + Float64(t * a));
	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 = z * (y + (a * b));
	tmp = 0.0;
	if (z <= -6.2e+114)
		tmp = t_2;
	elseif (z <= -4.3e+30)
		tmp = t_1;
	elseif (z <= -2.1e-46)
		tmp = x + (a * (z * b));
	elseif (z <= -3.5e-86)
		tmp = t_1;
	elseif (z <= -1.25e-137)
		tmp = x + (y * z);
	elseif (z <= 1.35e-58)
		tmp = x + (t * a);
	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[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e+114], t$95$2, If[LessEqual[z, -4.3e+30], t$95$1, If[LessEqual[z, -2.1e-46], N[(x + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.5e-86], t$95$1, If[LessEqual[z, -1.25e-137], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e-58], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -4.3 \cdot 10^{+30}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-86}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -6.2000000000000001e114 or 1.3499999999999999e-58 < z

    1. Initial program 83.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. *-commutative83.2%

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

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

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

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

    if -6.2000000000000001e114 < z < -4.3e30 or -2.09999999999999987e-46 < z < -3.50000000000000021e-86

    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 87.3%

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

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

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

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

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

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

    if -4.3e30 < z < -2.09999999999999987e-46

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.50000000000000021e-86 < z < -1.25e-137

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

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

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

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

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

    if -1.25e-137 < z < 1.3499999999999999e-58

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{+114}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{+30}:\\ \;\;\;\;t \cdot a + y \cdot z\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-46}:\\ \;\;\;\;x + a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-86}:\\ \;\;\;\;t \cdot a + y \cdot z\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-137}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-58}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \end{array} \]

Alternative 4: 36.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(z \cdot b\right)\\ \mathbf{if}\;a \leq -2.8 \cdot 10^{+246}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.5 \cdot 10^{+214}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq -2.5 \cdot 10^{-85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.85 \cdot 10^{-104}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{-270}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-149}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* z b))))
   (if (<= a -2.8e+246)
     t_1
     (if (<= a -1.5e+214)
       (* t a)
       (if (<= a -2.5e-85)
         t_1
         (if (<= a -1.85e-104)
           (* t a)
           (if (<= a 1.95e-270)
             x
             (if (<= a 5e-149) (* y z) (* (* z a) b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (a <= -2.8e+246) {
		tmp = t_1;
	} else if (a <= -1.5e+214) {
		tmp = t * a;
	} else if (a <= -2.5e-85) {
		tmp = t_1;
	} else if (a <= -1.85e-104) {
		tmp = t * a;
	} else if (a <= 1.95e-270) {
		tmp = x;
	} else if (a <= 5e-149) {
		tmp = y * z;
	} else {
		tmp = (z * a) * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a * (z * b)
    if (a <= (-2.8d+246)) then
        tmp = t_1
    else if (a <= (-1.5d+214)) then
        tmp = t * a
    else if (a <= (-2.5d-85)) then
        tmp = t_1
    else if (a <= (-1.85d-104)) then
        tmp = t * a
    else if (a <= 1.95d-270) then
        tmp = x
    else if (a <= 5d-149) then
        tmp = y * z
    else
        tmp = (z * a) * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (z * b);
	double tmp;
	if (a <= -2.8e+246) {
		tmp = t_1;
	} else if (a <= -1.5e+214) {
		tmp = t * a;
	} else if (a <= -2.5e-85) {
		tmp = t_1;
	} else if (a <= -1.85e-104) {
		tmp = t * a;
	} else if (a <= 1.95e-270) {
		tmp = x;
	} else if (a <= 5e-149) {
		tmp = y * z;
	} else {
		tmp = (z * a) * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (z * b)
	tmp = 0
	if a <= -2.8e+246:
		tmp = t_1
	elif a <= -1.5e+214:
		tmp = t * a
	elif a <= -2.5e-85:
		tmp = t_1
	elif a <= -1.85e-104:
		tmp = t * a
	elif a <= 1.95e-270:
		tmp = x
	elif a <= 5e-149:
		tmp = y * z
	else:
		tmp = (z * a) * b
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(z * b))
	tmp = 0.0
	if (a <= -2.8e+246)
		tmp = t_1;
	elseif (a <= -1.5e+214)
		tmp = Float64(t * a);
	elseif (a <= -2.5e-85)
		tmp = t_1;
	elseif (a <= -1.85e-104)
		tmp = Float64(t * a);
	elseif (a <= 1.95e-270)
		tmp = x;
	elseif (a <= 5e-149)
		tmp = Float64(y * z);
	else
		tmp = Float64(Float64(z * a) * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (z * b);
	tmp = 0.0;
	if (a <= -2.8e+246)
		tmp = t_1;
	elseif (a <= -1.5e+214)
		tmp = t * a;
	elseif (a <= -2.5e-85)
		tmp = t_1;
	elseif (a <= -1.85e-104)
		tmp = t * a;
	elseif (a <= 1.95e-270)
		tmp = x;
	elseif (a <= 5e-149)
		tmp = y * z;
	else
		tmp = (z * a) * b;
	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[a, -2.8e+246], t$95$1, If[LessEqual[a, -1.5e+214], N[(t * a), $MachinePrecision], If[LessEqual[a, -2.5e-85], t$95$1, If[LessEqual[a, -1.85e-104], N[(t * a), $MachinePrecision], If[LessEqual[a, 1.95e-270], x, If[LessEqual[a, 5e-149], N[(y * z), $MachinePrecision], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.5 \cdot 10^{+214}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;a \leq -2.5 \cdot 10^{-85}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -1.85 \cdot 10^{-104}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;a \leq 1.95 \cdot 10^{-270}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -2.79999999999999988e246 or -1.5000000000000001e214 < a < -2.5000000000000001e-85

    1. Initial program 85.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. *-commutative85.1%

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

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

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

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

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

    if -2.79999999999999988e246 < a < -1.5000000000000001e214 or -2.5000000000000001e-85 < a < -1.85e-104

    1. Initial program 92.2%

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

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

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

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

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

    if -1.85e-104 < a < 1.94999999999999993e-270

    1. Initial program 98.1%

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

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

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

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

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

    if 1.94999999999999993e-270 < a < 4.99999999999999968e-149

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

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

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

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

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

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

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

    if 4.99999999999999968e-149 < a

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.8 \cdot 10^{+246}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -1.5 \cdot 10^{+214}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq -2.5 \cdot 10^{-85}:\\ \;\;\;\;a \cdot \left(z \cdot b\right)\\ \mathbf{elif}\;a \leq -1.85 \cdot 10^{-104}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{-270}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-149}:\\ \;\;\;\;y \cdot z\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \end{array} \]

Alternative 5: 39.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+129}:\\
\;\;\;\;y \cdot z\\

\mathbf{elif}\;y \leq -8.5 \cdot 10^{+63}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;y \leq -230000000:\\
\;\;\;\;x\\

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

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-257}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.60000000000000012e129 or 5.6000000000000003e105 < y

    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. *-commutative90.3%

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

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

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

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

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

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

    if -2.60000000000000012e129 < y < -8.5000000000000004e63

    1. Initial program 75.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. *-commutative75.0%

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

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

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

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

    if -8.5000000000000004e63 < y < -2.3e8 or -1.3800000000000001e-105 < y < -1.09999999999999994e-257

    1. Initial program 93.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. *-commutative93.6%

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

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

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

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

    if -2.3e8 < y < -1.3800000000000001e-105

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.09999999999999994e-257 < y < 5.6000000000000003e105

    1. Initial program 89.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. *-commutative89.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+129}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{+63}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;y \leq -230000000:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1.38 \cdot 10^{-105}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-257}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+105}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 6: 71.9% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq -220:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -4.1 \cdot 10^{-22}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-63}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.59999999999999988e76 or -220 < z < -4.0999999999999999e-22 or 3.60000000000000008e-63 < z

    1. Initial program 84.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. *-commutative84.9%

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

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

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

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

    if -1.59999999999999988e76 < z < -220 or -1.25e-137 < z < 3.60000000000000008e-63

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

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

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

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

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

    if -4.0999999999999999e-22 < z < -1.25e-137

    1. Initial program 99.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. *-commutative99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+76}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;z \leq -220:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-22}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-137}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-63}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y + a \cdot b\right)\\ \end{array} \]

Alternative 7: 60.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq -1.4 \cdot 10^{+60}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+116} \lor \neg \left(z \leq 5.7 \cdot 10^{+256}\right):\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\

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


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

    1. Initial program 73.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1999999999999999e213 < z < -1.4e60 or 3.40000000000000023e116 < z < 5.6999999999999997e256

    1. Initial program 82.3%

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

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

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

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

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

    if -1.4e60 < z < 2.2999999999999998e-22

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

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

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

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

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

    if 2.2999999999999998e-22 < z < 3.40000000000000023e116 or 5.6999999999999997e256 < z

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+213}:\\ \;\;\;\;\left(z \cdot a\right) \cdot b\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{+60}:\\ \;\;\;\;x + y \cdot z\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-22}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+116} \lor \neg \left(z \leq 5.7 \cdot 10^{+256}\right):\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot z\\ \end{array} \]

Alternative 8: 40.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+131}:\\
\;\;\;\;y \cdot z\\

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

\mathbf{elif}\;y \leq -360000000000:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -3.8 \cdot 10^{-69}:\\
\;\;\;\;t \cdot a\\

\mathbf{elif}\;y \leq 6 \cdot 10^{-29}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.2000000000000002e131 or 6.0000000000000005e-29 < y

    1. Initial program 86.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. *-commutative86.9%

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

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

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

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

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

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

    if -3.2000000000000002e131 < y < -7.7999999999999996e64 or -3.6e11 < y < -3.7999999999999998e-69

    1. Initial program 87.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. *-commutative87.5%

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

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

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

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

    if -7.7999999999999996e64 < y < -3.6e11 or -3.7999999999999998e-69 < y < 6.0000000000000005e-29

    1. Initial program 94.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. *-commutative94.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+131}:\\ \;\;\;\;y \cdot z\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{+64}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;y \leq -360000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-69}:\\ \;\;\;\;t \cdot a\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-29}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 9: 56.9% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;z \leq 3 \cdot 10^{+198} \lor \neg \left(z \leq 2.1 \cdot 10^{+255}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.2000000000000001e128 or 4.4000000000000001e-22 < z < 3.00000000000000019e198 or 2.1e255 < z

    1. Initial program 85.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. *-commutative85.4%

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

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

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

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

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

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

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

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

    if -1.2000000000000001e128 < z < 4.4000000000000001e-22

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

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

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

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

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

    if 3.00000000000000019e198 < z < 2.1e255

    1. Initial program 44.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. *-commutative44.4%

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

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

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

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

        \[\leadsto \color{blue}{z \cdot y} \]
    6. Simplified66.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+128}:\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-22}:\\ \;\;\;\;x + t \cdot a\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+198} \lor \neg \left(z \leq 2.1 \cdot 10^{+255}\right):\\ \;\;\;\;z \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot z\\ \end{array} \]

Alternative 10: 85.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -8200000000000 \lor \neg \left(a \leq 4.2 \cdot 10^{-149}\right):\\ \;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + t \cdot a\right) + y \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -8200000000000.0) (not (<= a 4.2e-149)))
   (+ 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 <= -8200000000000.0) || !(a <= 4.2e-149)) {
		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 <= (-8200000000000.0d0)) .or. (.not. (a <= 4.2d-149))) 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 <= -8200000000000.0) || !(a <= 4.2e-149)) {
		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 <= -8200000000000.0) or not (a <= 4.2e-149):
		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 <= -8200000000000.0) || !(a <= 4.2e-149))
		tmp = Float64(x + Float64(a * Float64(t + Float64(z * b))));
	else
		tmp = Float64(Float64(x + 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 <= -8200000000000.0) || ~((a <= 4.2e-149)))
		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, -8200000000000.0], N[Not[LessEqual[a, 4.2e-149]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.2e12 or 4.20000000000000022e-149 < a

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.2e12 < a < 4.20000000000000022e-149

    1. Initial program 99.0%

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

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

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

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

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

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

Alternative 11: 85.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.5 \cdot 10^{-47} \lor \neg \left(b \leq 0.66\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.50000000000000006e-47 or 0.660000000000000031 < b

    1. Initial program 92.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. *-commutative92.6%

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

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

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

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

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

    if -2.50000000000000006e-47 < b < 0.660000000000000031

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

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

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

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

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

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

Alternative 12: 80.2% accurate, 1.1× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t \cdot a + y \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.7000000000000002e143

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

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

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

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

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

    if -3.7000000000000002e143 < y < 6.50000000000000054e138

    1. Initial program 91.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+91.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.50000000000000054e138 < y

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

Alternative 13: 93.8% accurate, 1.2× speedup?

\[\begin{array}{l} \\ z \cdot \left(y + a \cdot b\right) + \left(x + t \cdot a\right) \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (* z (+ y (* a b))) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
	return (z * (y + (a * b))) + (x + (t * a));
}
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 = (z * (y + (a * b))) + (x + (t * a))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (z * (y + (a * b))) + (x + (t * a));
}
def code(x, y, z, t, a, b):
	return (z * (y + (a * b))) + (x + (t * a))
function code(x, y, z, t, a, b)
	return Float64(Float64(z * Float64(y + Float64(a * b))) + Float64(x + Float64(t * a)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (z * (y + (a * b))) + (x + (t * a));
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
z \cdot \left(y + a \cdot b\right) + \left(x + t \cdot a\right)
\end{array}
Derivation
  1. Initial program 90.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. *-commutative90.6%

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

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

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

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

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

Alternative 14: 38.6% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-74}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 2.2 \cdot 10^{+124}:\\
\;\;\;\;t \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.05e-74 or 2.2000000000000001e124 < x

    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. *-commutative90.7%

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

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

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

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

    if -1.05e-74 < x < 2.2000000000000001e124

    1. Initial program 90.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. *-commutative90.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{-74}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+124}:\\ \;\;\;\;t \cdot a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 15: 26.6% 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 90.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. *-commutative90.6%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification24.7%

    \[\leadsto x \]

Developer target: 97.2% 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 2023274 
(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)))