AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1

Percentage Accurate: 60.2% → 87.3%
Time: 16.4s
Alternatives: 14
Speedup: 0.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 60.2% accurate, 1.0× speedup?

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

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

Alternative 1: 87.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+207}\right):\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) (+ y (+ x t)))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+207))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+207)) {
		tmp = (z + a) - b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+207)) {
		tmp = (z + a) - b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t))
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 5e+207):
		tmp = (z + a) - b
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t)))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+207))
		tmp = Float64(Float64(z + a) - b);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 5e+207)))
		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[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+207]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+207}\right):\\
\;\;\;\;\left(z + a\right) - b\\

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


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

    1. Initial program 10.0%

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

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

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

    1. Initial program 99.8%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification87.0%

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

Alternative 2: 59.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{b}{y + t}\\ t_2 := y + \left(x + t\right)\\ t_3 := a \cdot \frac{y + t}{t\_2}\\ t_4 := z \cdot \frac{x + y}{t\_2}\\ \mathbf{if}\;z \leq -7.5 \cdot 10^{+80}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{+19}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-32}:\\ \;\;\;\;z - t\_1\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-107}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-194}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-242}:\\ \;\;\;\;b \cdot \frac{y}{\left(-y\right) - \left(x + t\right)}\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{-257}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{+95}:\\ \;\;\;\;a - t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* y (/ b (+ y t))))
        (t_2 (+ y (+ x t)))
        (t_3 (* a (/ (+ y t) t_2)))
        (t_4 (* z (/ (+ x y) t_2))))
   (if (<= z -7.5e+80)
     t_4
     (if (<= z -3.3e+19)
       (+ z a)
       (if (<= z -2.8e-32)
         (- z t_1)
         (if (<= z -1.6e-107)
           (- (+ z a) b)
           (if (<= z -1.9e-194)
             t_3
             (if (<= z -4.5e-242)
               (* b (/ y (- (- y) (+ x t))))
               (if (<= z 2.85e-257)
                 t_3
                 (if (<= z 1.32e+95) (- a t_1) t_4))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (b / (y + t));
	double t_2 = y + (x + t);
	double t_3 = a * ((y + t) / t_2);
	double t_4 = z * ((x + y) / t_2);
	double tmp;
	if (z <= -7.5e+80) {
		tmp = t_4;
	} else if (z <= -3.3e+19) {
		tmp = z + a;
	} else if (z <= -2.8e-32) {
		tmp = z - t_1;
	} else if (z <= -1.6e-107) {
		tmp = (z + a) - b;
	} else if (z <= -1.9e-194) {
		tmp = t_3;
	} else if (z <= -4.5e-242) {
		tmp = b * (y / (-y - (x + t)));
	} else if (z <= 2.85e-257) {
		tmp = t_3;
	} else if (z <= 1.32e+95) {
		tmp = a - t_1;
	} else {
		tmp = t_4;
	}
	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) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = y * (b / (y + t))
    t_2 = y + (x + t)
    t_3 = a * ((y + t) / t_2)
    t_4 = z * ((x + y) / t_2)
    if (z <= (-7.5d+80)) then
        tmp = t_4
    else if (z <= (-3.3d+19)) then
        tmp = z + a
    else if (z <= (-2.8d-32)) then
        tmp = z - t_1
    else if (z <= (-1.6d-107)) then
        tmp = (z + a) - b
    else if (z <= (-1.9d-194)) then
        tmp = t_3
    else if (z <= (-4.5d-242)) then
        tmp = b * (y / (-y - (x + t)))
    else if (z <= 2.85d-257) then
        tmp = t_3
    else if (z <= 1.32d+95) then
        tmp = a - t_1
    else
        tmp = t_4
    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 = y * (b / (y + t));
	double t_2 = y + (x + t);
	double t_3 = a * ((y + t) / t_2);
	double t_4 = z * ((x + y) / t_2);
	double tmp;
	if (z <= -7.5e+80) {
		tmp = t_4;
	} else if (z <= -3.3e+19) {
		tmp = z + a;
	} else if (z <= -2.8e-32) {
		tmp = z - t_1;
	} else if (z <= -1.6e-107) {
		tmp = (z + a) - b;
	} else if (z <= -1.9e-194) {
		tmp = t_3;
	} else if (z <= -4.5e-242) {
		tmp = b * (y / (-y - (x + t)));
	} else if (z <= 2.85e-257) {
		tmp = t_3;
	} else if (z <= 1.32e+95) {
		tmp = a - t_1;
	} else {
		tmp = t_4;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y * (b / (y + t))
	t_2 = y + (x + t)
	t_3 = a * ((y + t) / t_2)
	t_4 = z * ((x + y) / t_2)
	tmp = 0
	if z <= -7.5e+80:
		tmp = t_4
	elif z <= -3.3e+19:
		tmp = z + a
	elif z <= -2.8e-32:
		tmp = z - t_1
	elif z <= -1.6e-107:
		tmp = (z + a) - b
	elif z <= -1.9e-194:
		tmp = t_3
	elif z <= -4.5e-242:
		tmp = b * (y / (-y - (x + t)))
	elif z <= 2.85e-257:
		tmp = t_3
	elif z <= 1.32e+95:
		tmp = a - t_1
	else:
		tmp = t_4
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y * Float64(b / Float64(y + t)))
	t_2 = Float64(y + Float64(x + t))
	t_3 = Float64(a * Float64(Float64(y + t) / t_2))
	t_4 = Float64(z * Float64(Float64(x + y) / t_2))
	tmp = 0.0
	if (z <= -7.5e+80)
		tmp = t_4;
	elseif (z <= -3.3e+19)
		tmp = Float64(z + a);
	elseif (z <= -2.8e-32)
		tmp = Float64(z - t_1);
	elseif (z <= -1.6e-107)
		tmp = Float64(Float64(z + a) - b);
	elseif (z <= -1.9e-194)
		tmp = t_3;
	elseif (z <= -4.5e-242)
		tmp = Float64(b * Float64(y / Float64(Float64(-y) - Float64(x + t))));
	elseif (z <= 2.85e-257)
		tmp = t_3;
	elseif (z <= 1.32e+95)
		tmp = Float64(a - t_1);
	else
		tmp = t_4;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y * (b / (y + t));
	t_2 = y + (x + t);
	t_3 = a * ((y + t) / t_2);
	t_4 = z * ((x + y) / t_2);
	tmp = 0.0;
	if (z <= -7.5e+80)
		tmp = t_4;
	elseif (z <= -3.3e+19)
		tmp = z + a;
	elseif (z <= -2.8e-32)
		tmp = z - t_1;
	elseif (z <= -1.6e-107)
		tmp = (z + a) - b;
	elseif (z <= -1.9e-194)
		tmp = t_3;
	elseif (z <= -4.5e-242)
		tmp = b * (y / (-y - (x + t)));
	elseif (z <= 2.85e-257)
		tmp = t_3;
	elseif (z <= 1.32e+95)
		tmp = a - t_1;
	else
		tmp = t_4;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(a * N[(N[(y + t), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.5e+80], t$95$4, If[LessEqual[z, -3.3e+19], N[(z + a), $MachinePrecision], If[LessEqual[z, -2.8e-32], N[(z - t$95$1), $MachinePrecision], If[LessEqual[z, -1.6e-107], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[z, -1.9e-194], t$95$3, If[LessEqual[z, -4.5e-242], N[(b * N[(y / N[((-y) - N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.85e-257], t$95$3, If[LessEqual[z, 1.32e+95], N[(a - t$95$1), $MachinePrecision], t$95$4]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{b}{y + t}\\
t_2 := y + \left(x + t\right)\\
t_3 := a \cdot \frac{y + t}{t\_2}\\
t_4 := z \cdot \frac{x + y}{t\_2}\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{+80}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;z \leq -3.3 \cdot 10^{+19}:\\
\;\;\;\;z + a\\

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-32}:\\
\;\;\;\;z - t\_1\\

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

\mathbf{elif}\;z \leq -1.9 \cdot 10^{-194}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-242}:\\
\;\;\;\;b \cdot \frac{y}{\left(-y\right) - \left(x + t\right)}\\

\mathbf{elif}\;z \leq 2.85 \cdot 10^{-257}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 1.32 \cdot 10^{+95}:\\
\;\;\;\;a - t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if z < -7.49999999999999994e80 or 1.32e95 < z

    1. Initial program 38.6%

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

      \[\leadsto \color{blue}{\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*77.4%

        \[\leadsto \color{blue}{z \cdot \frac{x + y}{t + \left(x + y\right)}} \]
      2. +-commutative77.4%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{t + \left(x + y\right)} \]
      3. +-commutative77.4%

        \[\leadsto z \cdot \frac{y + x}{\color{blue}{\left(x + y\right) + t}} \]
      4. +-commutative77.4%

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

        \[\leadsto z \cdot \frac{y + x}{\color{blue}{y + \left(x + t\right)}} \]
      6. +-commutative77.4%

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

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

    if -7.49999999999999994e80 < z < -3.3e19

    1. Initial program 51.9%

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

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

      \[\leadsto \color{blue}{a + z} \]
    5. Step-by-step derivation
      1. +-commutative88.1%

        \[\leadsto \color{blue}{z + a} \]
    6. Simplified88.1%

      \[\leadsto \color{blue}{z + a} \]

    if -3.3e19 < z < -2.7999999999999999e-32

    1. Initial program 68.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub68.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z} - y \cdot \frac{b}{x + \left(y + t\right)} \]
    6. Taylor expanded in x around 0 44.5%

      \[\leadsto z - \color{blue}{\frac{b \cdot y}{t + y}} \]
    7. Step-by-step derivation
      1. *-commutative20.5%

        \[\leadsto a - \frac{\color{blue}{y \cdot b}}{t + y} \]
      2. +-commutative20.5%

        \[\leadsto a - \frac{y \cdot b}{\color{blue}{y + t}} \]
      3. associate-/l*39.9%

        \[\leadsto a - \color{blue}{y \cdot \frac{b}{y + t}} \]
      4. +-commutative39.9%

        \[\leadsto a - y \cdot \frac{b}{\color{blue}{t + y}} \]
    8. Simplified63.9%

      \[\leadsto z - \color{blue}{y \cdot \frac{b}{t + y}} \]

    if -2.7999999999999999e-32 < z < -1.60000000000000006e-107

    1. Initial program 43.4%

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

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

    if -1.60000000000000006e-107 < z < -1.9000000000000001e-194 or -4.4999999999999999e-242 < z < 2.8499999999999999e-257

    1. Initial program 73.7%

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

      \[\leadsto \color{blue}{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*73.3%

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

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

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

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

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

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

    if -1.9000000000000001e-194 < z < -4.4999999999999999e-242

    1. Initial program 90.7%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b \cdot y}{t + \left(x + y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg68.0%

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

        \[\leadsto -\color{blue}{b \cdot \frac{y}{t + \left(x + y\right)}} \]
      3. distribute-rgt-neg-in68.1%

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

        \[\leadsto b \cdot \left(-\frac{y}{\color{blue}{\left(x + y\right) + t}}\right) \]
      5. +-commutative68.1%

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

        \[\leadsto b \cdot \left(-\frac{y}{\color{blue}{y + \left(x + t\right)}}\right) \]
      7. +-commutative68.1%

        \[\leadsto b \cdot \left(-\frac{y}{y + \color{blue}{\left(t + x\right)}}\right) \]
    5. Simplified68.1%

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

    if 2.8499999999999999e-257 < z < 1.32e95

    1. Initial program 70.2%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub70.2%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a} - y \cdot \frac{b}{x + \left(y + t\right)} \]
    6. Taylor expanded in x around 0 66.3%

      \[\leadsto a - \color{blue}{\frac{b \cdot y}{t + y}} \]
    7. Step-by-step derivation
      1. *-commutative66.3%

        \[\leadsto a - \frac{\color{blue}{y \cdot b}}{t + y} \]
      2. +-commutative66.3%

        \[\leadsto a - \frac{y \cdot b}{\color{blue}{y + t}} \]
      3. associate-/l*72.9%

        \[\leadsto a - \color{blue}{y \cdot \frac{b}{y + t}} \]
      4. +-commutative72.9%

        \[\leadsto a - y \cdot \frac{b}{\color{blue}{t + y}} \]
    8. Simplified72.9%

      \[\leadsto a - \color{blue}{y \cdot \frac{b}{t + y}} \]
  3. Recombined 7 regimes into one program.
  4. Final simplification75.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+80}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{+19}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-32}:\\ \;\;\;\;z - y \cdot \frac{b}{y + t}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-107}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-194}:\\ \;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-242}:\\ \;\;\;\;b \cdot \frac{y}{\left(-y\right) - \left(x + t\right)}\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{-257}:\\ \;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{+95}:\\ \;\;\;\;a - y \cdot \frac{b}{y + t}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 63.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{b}{x + \left(y + t\right)}\\ t_2 := y + \left(x + t\right)\\ t_3 := z \cdot \frac{x + y}{t\_2}\\ \mathbf{if}\;z \leq -7 \cdot 10^{+80}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+20}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{-32}:\\ \;\;\;\;z - t\_1\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-111}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-285}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{t\_2}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+95}:\\ \;\;\;\;a - t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* y (/ b (+ x (+ y t)))))
        (t_2 (+ y (+ x t)))
        (t_3 (* z (/ (+ x y) t_2))))
   (if (<= z -7e+80)
     t_3
     (if (<= z -1.8e+20)
       (+ z a)
       (if (<= z -2.45e-32)
         (- z t_1)
         (if (<= z -1.9e-111)
           (- (+ z a) b)
           (if (<= z -3.3e-285)
             (/ (- (* (+ y t) a) (* y b)) t_2)
             (if (<= z 1.3e+95) (- a t_1) t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (b / (x + (y + t)));
	double t_2 = y + (x + t);
	double t_3 = z * ((x + y) / t_2);
	double tmp;
	if (z <= -7e+80) {
		tmp = t_3;
	} else if (z <= -1.8e+20) {
		tmp = z + a;
	} else if (z <= -2.45e-32) {
		tmp = z - t_1;
	} else if (z <= -1.9e-111) {
		tmp = (z + a) - b;
	} else if (z <= -3.3e-285) {
		tmp = (((y + t) * a) - (y * b)) / t_2;
	} else if (z <= 1.3e+95) {
		tmp = a - t_1;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = y * (b / (x + (y + t)))
    t_2 = y + (x + t)
    t_3 = z * ((x + y) / t_2)
    if (z <= (-7d+80)) then
        tmp = t_3
    else if (z <= (-1.8d+20)) then
        tmp = z + a
    else if (z <= (-2.45d-32)) then
        tmp = z - t_1
    else if (z <= (-1.9d-111)) then
        tmp = (z + a) - b
    else if (z <= (-3.3d-285)) then
        tmp = (((y + t) * a) - (y * b)) / t_2
    else if (z <= 1.3d+95) then
        tmp = a - t_1
    else
        tmp = t_3
    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 = y * (b / (x + (y + t)));
	double t_2 = y + (x + t);
	double t_3 = z * ((x + y) / t_2);
	double tmp;
	if (z <= -7e+80) {
		tmp = t_3;
	} else if (z <= -1.8e+20) {
		tmp = z + a;
	} else if (z <= -2.45e-32) {
		tmp = z - t_1;
	} else if (z <= -1.9e-111) {
		tmp = (z + a) - b;
	} else if (z <= -3.3e-285) {
		tmp = (((y + t) * a) - (y * b)) / t_2;
	} else if (z <= 1.3e+95) {
		tmp = a - t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y * (b / (x + (y + t)))
	t_2 = y + (x + t)
	t_3 = z * ((x + y) / t_2)
	tmp = 0
	if z <= -7e+80:
		tmp = t_3
	elif z <= -1.8e+20:
		tmp = z + a
	elif z <= -2.45e-32:
		tmp = z - t_1
	elif z <= -1.9e-111:
		tmp = (z + a) - b
	elif z <= -3.3e-285:
		tmp = (((y + t) * a) - (y * b)) / t_2
	elif z <= 1.3e+95:
		tmp = a - t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y * Float64(b / Float64(x + Float64(y + t))))
	t_2 = Float64(y + Float64(x + t))
	t_3 = Float64(z * Float64(Float64(x + y) / t_2))
	tmp = 0.0
	if (z <= -7e+80)
		tmp = t_3;
	elseif (z <= -1.8e+20)
		tmp = Float64(z + a);
	elseif (z <= -2.45e-32)
		tmp = Float64(z - t_1);
	elseif (z <= -1.9e-111)
		tmp = Float64(Float64(z + a) - b);
	elseif (z <= -3.3e-285)
		tmp = Float64(Float64(Float64(Float64(y + t) * a) - Float64(y * b)) / t_2);
	elseif (z <= 1.3e+95)
		tmp = Float64(a - t_1);
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y * (b / (x + (y + t)));
	t_2 = y + (x + t);
	t_3 = z * ((x + y) / t_2);
	tmp = 0.0;
	if (z <= -7e+80)
		tmp = t_3;
	elseif (z <= -1.8e+20)
		tmp = z + a;
	elseif (z <= -2.45e-32)
		tmp = z - t_1;
	elseif (z <= -1.9e-111)
		tmp = (z + a) - b;
	elseif (z <= -3.3e-285)
		tmp = (((y + t) * a) - (y * b)) / t_2;
	elseif (z <= 1.3e+95)
		tmp = a - t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+80], t$95$3, If[LessEqual[z, -1.8e+20], N[(z + a), $MachinePrecision], If[LessEqual[z, -2.45e-32], N[(z - t$95$1), $MachinePrecision], If[LessEqual[z, -1.9e-111], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[z, -3.3e-285], N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[z, 1.3e+95], N[(a - t$95$1), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{b}{x + \left(y + t\right)}\\
t_2 := y + \left(x + t\right)\\
t_3 := z \cdot \frac{x + y}{t\_2}\\
\mathbf{if}\;z \leq -7 \cdot 10^{+80}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq -1.8 \cdot 10^{+20}:\\
\;\;\;\;z + a\\

\mathbf{elif}\;z \leq -2.45 \cdot 10^{-32}:\\
\;\;\;\;z - t\_1\\

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

\mathbf{elif}\;z \leq -3.3 \cdot 10^{-285}:\\
\;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{t\_2}\\

\mathbf{elif}\;z \leq 1.3 \cdot 10^{+95}:\\
\;\;\;\;a - t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -6.99999999999999987e80 or 1.29999999999999995e95 < z

    1. Initial program 38.6%

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

      \[\leadsto \color{blue}{\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*77.4%

        \[\leadsto \color{blue}{z \cdot \frac{x + y}{t + \left(x + y\right)}} \]
      2. +-commutative77.4%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{t + \left(x + y\right)} \]
      3. +-commutative77.4%

        \[\leadsto z \cdot \frac{y + x}{\color{blue}{\left(x + y\right) + t}} \]
      4. +-commutative77.4%

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

        \[\leadsto z \cdot \frac{y + x}{\color{blue}{y + \left(x + t\right)}} \]
      6. +-commutative77.4%

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

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

    if -6.99999999999999987e80 < z < -1.8e20

    1. Initial program 51.9%

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

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

      \[\leadsto \color{blue}{a + z} \]
    5. Step-by-step derivation
      1. +-commutative88.1%

        \[\leadsto \color{blue}{z + a} \]
    6. Simplified88.1%

      \[\leadsto \color{blue}{z + a} \]

    if -1.8e20 < z < -2.4499999999999999e-32

    1. Initial program 68.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub68.0%

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

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

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

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

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

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

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

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

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

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

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

    if -2.4499999999999999e-32 < z < -1.90000000000000011e-111

    1. Initial program 41.0%

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

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

    if -1.90000000000000011e-111 < z < -3.29999999999999985e-285

    1. Initial program 82.3%

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

      \[\leadsto \frac{\color{blue}{a \cdot \left(t + y\right) - b \cdot y}}{\left(x + t\right) + y} \]
    4. Step-by-step derivation
      1. *-commutative81.0%

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

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

    if -3.29999999999999985e-285 < z < 1.29999999999999995e95

    1. Initial program 70.6%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub70.6%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+80}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{+20}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{-32}:\\ \;\;\;\;z - y \cdot \frac{b}{x + \left(y + t\right)}\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-111}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-285}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+95}:\\ \;\;\;\;a - y \cdot \frac{b}{x + \left(y + t\right)}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 64.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot \frac{x + y}{y + \left(x + t\right)}\\
\mathbf{if}\;z \leq -5 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -3.9 \cdot 10^{+19}:\\
\;\;\;\;z + a\\

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-32}:\\
\;\;\;\;z - y \cdot \frac{b}{y + t}\\

\mathbf{elif}\;z \leq 1.32 \cdot 10^{+95}:\\
\;\;\;\;a - y \cdot \frac{b}{x + \left(y + t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.99999999999999984e78 or 1.32e95 < z

    1. Initial program 38.6%

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

      \[\leadsto \color{blue}{\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*77.4%

        \[\leadsto \color{blue}{z \cdot \frac{x + y}{t + \left(x + y\right)}} \]
      2. +-commutative77.4%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{t + \left(x + y\right)} \]
      3. +-commutative77.4%

        \[\leadsto z \cdot \frac{y + x}{\color{blue}{\left(x + y\right) + t}} \]
      4. +-commutative77.4%

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

        \[\leadsto z \cdot \frac{y + x}{\color{blue}{y + \left(x + t\right)}} \]
      6. +-commutative77.4%

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

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

    if -4.99999999999999984e78 < z < -3.9e19

    1. Initial program 51.9%

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

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

      \[\leadsto \color{blue}{a + z} \]
    5. Step-by-step derivation
      1. +-commutative88.1%

        \[\leadsto \color{blue}{z + a} \]
    6. Simplified88.1%

      \[\leadsto \color{blue}{z + a} \]

    if -3.9e19 < z < -2.7999999999999999e-32

    1. Initial program 68.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub68.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z} - y \cdot \frac{b}{x + \left(y + t\right)} \]
    6. Taylor expanded in x around 0 44.5%

      \[\leadsto z - \color{blue}{\frac{b \cdot y}{t + y}} \]
    7. Step-by-step derivation
      1. *-commutative20.5%

        \[\leadsto a - \frac{\color{blue}{y \cdot b}}{t + y} \]
      2. +-commutative20.5%

        \[\leadsto a - \frac{y \cdot b}{\color{blue}{y + t}} \]
      3. associate-/l*39.9%

        \[\leadsto a - \color{blue}{y \cdot \frac{b}{y + t}} \]
      4. +-commutative39.9%

        \[\leadsto a - y \cdot \frac{b}{\color{blue}{t + y}} \]
    8. Simplified63.9%

      \[\leadsto z - \color{blue}{y \cdot \frac{b}{t + y}} \]

    if -2.7999999999999999e-32 < z < 1.32e95

    1. Initial program 70.0%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub70.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+78}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{+19}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-32}:\\ \;\;\;\;z - y \cdot \frac{b}{y + t}\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{+95}:\\ \;\;\;\;a - y \cdot \frac{b}{x + \left(y + t\right)}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 65.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -1.02 \cdot 10^{+20}:\\
\;\;\;\;z + a\\

\mathbf{elif}\;z \leq -2.15 \cdot 10^{-32}:\\
\;\;\;\;z - t\_2\\

\mathbf{elif}\;z \leq 1.32 \cdot 10^{+95}:\\
\;\;\;\;a - t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.49999999999999993e80 or 1.32e95 < z

    1. Initial program 38.6%

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

      \[\leadsto \color{blue}{\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*77.4%

        \[\leadsto \color{blue}{z \cdot \frac{x + y}{t + \left(x + y\right)}} \]
      2. +-commutative77.4%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{t + \left(x + y\right)} \]
      3. +-commutative77.4%

        \[\leadsto z \cdot \frac{y + x}{\color{blue}{\left(x + y\right) + t}} \]
      4. +-commutative77.4%

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

        \[\leadsto z \cdot \frac{y + x}{\color{blue}{y + \left(x + t\right)}} \]
      6. +-commutative77.4%

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

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

    if -1.49999999999999993e80 < z < -1.02e20

    1. Initial program 51.9%

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

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

      \[\leadsto \color{blue}{a + z} \]
    5. Step-by-step derivation
      1. +-commutative88.1%

        \[\leadsto \color{blue}{z + a} \]
    6. Simplified88.1%

      \[\leadsto \color{blue}{z + a} \]

    if -1.02e20 < z < -2.14999999999999995e-32

    1. Initial program 68.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub68.0%

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

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

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

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

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

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

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

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

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

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

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

    if -2.14999999999999995e-32 < z < 1.32e95

    1. Initial program 70.0%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub70.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+80}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{+20}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{-32}:\\ \;\;\;\;z - y \cdot \frac{b}{x + \left(y + t\right)}\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{+95}:\\ \;\;\;\;a - y \cdot \frac{b}{x + \left(y + t\right)}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 61.0% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t \leq -2.2 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 9 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.7999999999999998e139 or 8.99999999999999927e115 < t

    1. Initial program 46.4%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub46.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a} - y \cdot \frac{b}{x + \left(y + t\right)} \]
    6. Taylor expanded in x around 0 62.9%

      \[\leadsto a - \color{blue}{\frac{b \cdot y}{t + y}} \]
    7. Step-by-step derivation
      1. *-commutative62.9%

        \[\leadsto a - \frac{\color{blue}{y \cdot b}}{t + y} \]
      2. +-commutative62.9%

        \[\leadsto a - \frac{y \cdot b}{\color{blue}{y + t}} \]
      3. associate-/l*68.3%

        \[\leadsto a - \color{blue}{y \cdot \frac{b}{y + t}} \]
      4. +-commutative68.3%

        \[\leadsto a - y \cdot \frac{b}{\color{blue}{t + y}} \]
    8. Simplified68.3%

      \[\leadsto a - \color{blue}{y \cdot \frac{b}{t + y}} \]

    if -2.7999999999999998e139 < t < -2.20000000000000013e-48 or -1.61999999999999996e-180 < t < 8.99999999999999927e115

    1. Initial program 60.0%

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

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

    if -2.20000000000000013e-48 < t < -1.61999999999999996e-180

    1. Initial program 72.4%

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

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

      \[\leadsto \color{blue}{a + z} \]
    5. Step-by-step derivation
      1. +-commutative66.5%

        \[\leadsto \color{blue}{z + a} \]
    6. Simplified66.5%

      \[\leadsto \color{blue}{z + a} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{+139}:\\ \;\;\;\;a - y \cdot \frac{b}{y + t}\\ \mathbf{elif}\;t \leq -2.2 \cdot 10^{-48}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t \leq -1.62 \cdot 10^{-180}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;t \leq 9 \cdot 10^{+115}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a - y \cdot \frac{b}{y + t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.6% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq -1.2 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 6.8 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.6500000000000001e139 or 6.80000000000000046e116 < t

    1. Initial program 46.4%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub46.3%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto a - \color{blue}{\frac{b \cdot y}{t}} \]
    7. Step-by-step derivation
      1. associate-/l*65.3%

        \[\leadsto a - \color{blue}{b \cdot \frac{y}{t}} \]
    8. Simplified65.3%

      \[\leadsto a - \color{blue}{b \cdot \frac{y}{t}} \]

    if -1.6500000000000001e139 < t < -1.2e-48 or -4.8999999999999999e-179 < t < 6.80000000000000046e116

    1. Initial program 60.0%

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

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

    if -1.2e-48 < t < -4.8999999999999999e-179

    1. Initial program 72.4%

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

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

      \[\leadsto \color{blue}{a + z} \]
    5. Step-by-step derivation
      1. +-commutative66.5%

        \[\leadsto \color{blue}{z + a} \]
    6. Simplified66.5%

      \[\leadsto \color{blue}{z + a} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.65 \cdot 10^{+139}:\\ \;\;\;\;a - b \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq -1.2 \cdot 10^{-48}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t \leq -4.9 \cdot 10^{-179}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{+116}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a - b \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 64.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := z - y \cdot \frac{b}{x + y}\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 1.6 \cdot 10^{+49}:\\
\;\;\;\;a + \frac{y \cdot \left(z - b\right)}{y + t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.60000000000000021e188 or 1.60000000000000007e49 < x

    1. Initial program 46.8%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub46.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z} - y \cdot \frac{b}{x + \left(y + t\right)} \]
    6. Taylor expanded in t around 0 68.9%

      \[\leadsto z - y \cdot \color{blue}{\frac{b}{x + y}} \]
    7. Step-by-step derivation
      1. +-commutative68.9%

        \[\leadsto z - y \cdot \frac{b}{\color{blue}{y + x}} \]
    8. Simplified68.9%

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

    if -3.60000000000000021e188 < x < -1.45000000000000006e-28

    1. Initial program 49.5%

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

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

    if -1.45000000000000006e-28 < x < 1.60000000000000007e49

    1. Initial program 66.7%

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

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

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

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

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

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

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

        \[\leadsto a + \color{blue}{\frac{y \cdot z - y \cdot b}{y + t}} \]
      6. distribute-lft-out--71.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{+188}:\\ \;\;\;\;z - y \cdot \frac{b}{x + y}\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{-28}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+49}:\\ \;\;\;\;a + \frac{y \cdot \left(z - b\right)}{y + t}\\ \mathbf{else}:\\ \;\;\;\;z - y \cdot \frac{b}{x + y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 62.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := z - y \cdot \frac{b}{x + y}\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{+181}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 1.6 \cdot 10^{+50}:\\
\;\;\;\;a - y \cdot \frac{b}{y + t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.40000000000000031e181 or 1.59999999999999991e50 < x

    1. Initial program 46.8%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub46.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z} - y \cdot \frac{b}{x + \left(y + t\right)} \]
    6. Taylor expanded in t around 0 68.9%

      \[\leadsto z - y \cdot \color{blue}{\frac{b}{x + y}} \]
    7. Step-by-step derivation
      1. +-commutative68.9%

        \[\leadsto z - y \cdot \frac{b}{\color{blue}{y + x}} \]
    8. Simplified68.9%

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

    if -3.40000000000000031e181 < x < -3.55000000000000004e-71

    1. Initial program 55.5%

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

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

    if -3.55000000000000004e-71 < x < 1.59999999999999991e50

    1. Initial program 65.4%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub65.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a} - y \cdot \frac{b}{x + \left(y + t\right)} \]
    6. Taylor expanded in x around 0 60.6%

      \[\leadsto a - \color{blue}{\frac{b \cdot y}{t + y}} \]
    7. Step-by-step derivation
      1. *-commutative60.6%

        \[\leadsto a - \frac{\color{blue}{y \cdot b}}{t + y} \]
      2. +-commutative60.6%

        \[\leadsto a - \frac{y \cdot b}{\color{blue}{y + t}} \]
      3. associate-/l*66.4%

        \[\leadsto a - \color{blue}{y \cdot \frac{b}{y + t}} \]
      4. +-commutative66.4%

        \[\leadsto a - y \cdot \frac{b}{\color{blue}{t + y}} \]
    8. Simplified66.4%

      \[\leadsto a - \color{blue}{y \cdot \frac{b}{t + y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{+181}:\\ \;\;\;\;z - y \cdot \frac{b}{x + y}\\ \mathbf{elif}\;x \leq -3.55 \cdot 10^{-71}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+50}:\\ \;\;\;\;a - y \cdot \frac{b}{y + t}\\ \mathbf{else}:\\ \;\;\;\;z - y \cdot \frac{b}{x + y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 52.4% accurate, 1.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;a - b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.5000000000000005e-5 or 9.4999999999999995e38 < z

    1. Initial program 43.2%

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

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

      \[\leadsto \color{blue}{a + z} \]
    5. Step-by-step derivation
      1. +-commutative60.9%

        \[\leadsto \color{blue}{z + a} \]
    6. Simplified60.9%

      \[\leadsto \color{blue}{z + a} \]

    if -9.5000000000000005e-5 < z < 9.4999999999999995e38

    1. Initial program 70.5%

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

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

      \[\leadsto \color{blue}{a - b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.9%

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

Alternative 11: 44.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-34}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq 1.6 \cdot 10^{+95}:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.8000000000000001e-34 or 1.6e95 < z

    1. Initial program 42.2%

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

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

    if -3.8000000000000001e-34 < z < 1.6e95

    1. Initial program 70.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{-34}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+95}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 57.2% accurate, 2.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.2500000000000001e197

    1. Initial program 59.1%

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

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

    if 2.2500000000000001e197 < t

    1. Initial program 44.5%

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

      \[\leadsto \color{blue}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.25 \cdot 10^{+197}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 51.9% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 8 \cdot 10^{+256}:\\
\;\;\;\;z + a\\

\mathbf{else}:\\
\;\;\;\;-b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 8.0000000000000002e256

    1. Initial program 59.5%

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

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

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

        \[\leadsto \color{blue}{z + a} \]
    6. Simplified55.4%

      \[\leadsto \color{blue}{z + a} \]

    if 8.0000000000000002e256 < b

    1. Initial program 20.9%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b \cdot y}{t + \left(x + y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg22.9%

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

        \[\leadsto -\color{blue}{b \cdot \frac{y}{t + \left(x + y\right)}} \]
      3. distribute-rgt-neg-in67.4%

        \[\leadsto \color{blue}{b \cdot \left(-\frac{y}{t + \left(x + y\right)}\right)} \]
      4. +-commutative67.4%

        \[\leadsto b \cdot \left(-\frac{y}{\color{blue}{\left(x + y\right) + t}}\right) \]
      5. +-commutative67.4%

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

        \[\leadsto b \cdot \left(-\frac{y}{\color{blue}{y + \left(x + t\right)}}\right) \]
      7. +-commutative67.4%

        \[\leadsto b \cdot \left(-\frac{y}{y + \color{blue}{\left(t + x\right)}}\right) \]
    5. Simplified67.4%

      \[\leadsto \color{blue}{b \cdot \left(-\frac{y}{y + \left(t + x\right)}\right)} \]
    6. Taylor expanded in y around inf 55.5%

      \[\leadsto \color{blue}{-1 \cdot b} \]
    7. Step-by-step derivation
      1. neg-mul-155.5%

        \[\leadsto \color{blue}{-b} \]
    8. Simplified55.5%

      \[\leadsto \color{blue}{-b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{+256}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;-b\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 32.5% accurate, 21.0× speedup?

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

\\
a
\end{array}
Derivation
  1. Initial program 57.7%

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

    \[\leadsto \color{blue}{a} \]
  4. Final simplification34.3%

    \[\leadsto a \]
  5. Add Preprocessing

Developer target: 82.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + t\right) + y\\ t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\ t_3 := \frac{t\_2}{t\_1}\\ t_4 := \left(z + a\right) - b\\ \mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\ \;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (+ x t) y))
        (t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
        (t_3 (/ t_2 t_1))
        (t_4 (- (+ z a) b)))
   (if (< t_3 -3.5813117084150564e+153)
     t_4
     (if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + t) + y;
	double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
	double t_3 = t_2 / t_1;
	double t_4 = (z + a) - b;
	double tmp;
	if (t_3 < -3.5813117084150564e+153) {
		tmp = t_4;
	} else if (t_3 < 1.2285964308315609e+82) {
		tmp = 1.0 / (t_1 / t_2);
	} else {
		tmp = t_4;
	}
	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) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = (x + t) + y
    t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
    t_3 = t_2 / t_1
    t_4 = (z + a) - b
    if (t_3 < (-3.5813117084150564d+153)) then
        tmp = t_4
    else if (t_3 < 1.2285964308315609d+82) then
        tmp = 1.0d0 / (t_1 / t_2)
    else
        tmp = t_4
    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) + y;
	double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
	double t_3 = t_2 / t_1;
	double t_4 = (z + a) - b;
	double tmp;
	if (t_3 < -3.5813117084150564e+153) {
		tmp = t_4;
	} else if (t_3 < 1.2285964308315609e+82) {
		tmp = 1.0 / (t_1 / t_2);
	} else {
		tmp = t_4;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (x + t) + y
	t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
	t_3 = t_2 / t_1
	t_4 = (z + a) - b
	tmp = 0
	if t_3 < -3.5813117084150564e+153:
		tmp = t_4
	elif t_3 < 1.2285964308315609e+82:
		tmp = 1.0 / (t_1 / t_2)
	else:
		tmp = t_4
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(x + t) + y)
	t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b))
	t_3 = Float64(t_2 / t_1)
	t_4 = Float64(Float64(z + a) - b)
	tmp = 0.0
	if (t_3 < -3.5813117084150564e+153)
		tmp = t_4;
	elseif (t_3 < 1.2285964308315609e+82)
		tmp = Float64(1.0 / Float64(t_1 / t_2));
	else
		tmp = t_4;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (x + t) + y;
	t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
	t_3 = t_2 / t_1;
	t_4 = (z + a) - b;
	tmp = 0.0;
	if (t_3 < -3.5813117084150564e+153)
		tmp = t_4;
	elseif (t_3 < 1.2285964308315609e+82)
		tmp = 1.0 / (t_1 / t_2);
	else
		tmp = t_4;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024039 
(FPCore (x y z t a b)
  :name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
  :precision binary64

  :herbie-target
  (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))

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