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

Percentage Accurate: 61.0% → 89.3%
Time: 43.1s
Alternatives: 11
Speedup: 1.0×

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 11 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: 61.0% 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: 89.3% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + \left(x + t\right)\\ t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{t\_1}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+282}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\frac{x}{t\_1} + \left(\mathsf{fma}\left(\frac{a}{z}, \frac{y + t}{t\_1}, \frac{y}{t\_1}\right) - \frac{b}{t\_1} \cdot \frac{y}{z}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (+ x t)))
        (t_2 (/ (- (+ (* (+ x y) z) (* (+ y t) a)) (* y b)) t_1)))
   (if (<= t_2 (- INFINITY))
     (- (+ z a) b)
     (if (<= t_2 2e+282)
       t_2
       (*
        z
        (+
         (/ x t_1)
         (-
          (fma (/ a z) (/ (+ y t) t_1) (/ y t_1))
          (* (/ b t_1) (/ y z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (x + t);
	double t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / t_1;
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = (z + a) - b;
	} else if (t_2 <= 2e+282) {
		tmp = t_2;
	} else {
		tmp = z * ((x / t_1) + (fma((a / z), ((y + t) / t_1), (y / t_1)) - ((b / t_1) * (y / z))));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(x + t))
	t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(y + t) * a)) - Float64(y * b)) / t_1)
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(Float64(z + a) - b);
	elseif (t_2 <= 2e+282)
		tmp = t_2;
	else
		tmp = Float64(z * Float64(Float64(x / t_1) + Float64(fma(Float64(a / z), Float64(Float64(y + t) / t_1), Float64(y / t_1)) - Float64(Float64(b / t_1) * Float64(y / z)))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$2, 2e+282], t$95$2, N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(N[(N[(a / z), $MachinePrecision] * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(b / t$95$1), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{x}{t\_1} + \left(\mathsf{fma}\left(\frac{a}{z}, \frac{y + t}{t\_1}, \frac{y}{t\_1}\right) - \frac{b}{t\_1} \cdot \frac{y}{z}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 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

    1. Initial program 6.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 73.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)) < 2.00000000000000007e282

    1. Initial program 99.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

    if 2.00000000000000007e282 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 4.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 z around inf 32.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{x + y}\\ t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+246}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\frac{x}{x + y} + \left(t\_1 + \left(\frac{a}{z} \cdot t\_1 - t\_1 \cdot \frac{b}{z}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ y (+ x y)))
        (t_2 (/ (- (+ (* (+ x y) z) (* (+ y t) a)) (* y b)) (+ y (+ x t)))))
   (if (<= t_2 (- INFINITY))
     (- (+ z a) b)
     (if (<= t_2 5e+246)
       t_2
       (* z (+ (/ x (+ x y)) (+ t_1 (- (* (/ a z) t_1) (* t_1 (/ b z))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y / (x + y);
	double t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = (z + a) - b;
	} else if (t_2 <= 5e+246) {
		tmp = t_2;
	} else {
		tmp = z * ((x / (x + y)) + (t_1 + (((a / z) * t_1) - (t_1 * (b / z)))));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y / (x + y);
	double t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = (z + a) - b;
	} else if (t_2 <= 5e+246) {
		tmp = t_2;
	} else {
		tmp = z * ((x / (x + y)) + (t_1 + (((a / z) * t_1) - (t_1 * (b / z)))));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y / (x + y)
	t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = (z + a) - b
	elif t_2 <= 5e+246:
		tmp = t_2
	else:
		tmp = z * ((x / (x + y)) + (t_1 + (((a / z) * t_1) - (t_1 * (b / z)))))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y / Float64(x + y))
	t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t)))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(Float64(z + a) - b);
	elseif (t_2 <= 5e+246)
		tmp = t_2;
	else
		tmp = Float64(z * Float64(Float64(x / Float64(x + y)) + Float64(t_1 + Float64(Float64(Float64(a / z) * t_1) - Float64(t_1 * Float64(b / z))))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y / (x + y);
	t_2 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = (z + a) - b;
	elseif (t_2 <= 5e+246)
		tmp = t_2;
	else
		tmp = z * ((x / (x + y)) + (t_1 + (((a / z) * t_1) - (t_1 * (b / z)))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$2, 5e+246], t$95$2, N[(z * N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[(N[(a / z), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(t$95$1 * N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+246}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 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

    1. Initial program 6.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 73.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.99999999999999976e246

    1. Initial program 99.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

    if 4.99999999999999976e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 9.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 z around inf 36.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(\left(x + y\right) \cdot z + \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 10^{+245}\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 (/ (- (+ (* (+ x y) z) (* (+ y t) a)) (* y b)) (+ y (+ x t)))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+245))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+245)) {
		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 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+245)) {
		tmp = (z + a) - b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t))
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 1e+245):
		tmp = (z + a) - b
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t)))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+245))
		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 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 1e+245)))
		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[(N[(x + y), $MachinePrecision] * z), $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, 1e+245]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \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 10^{+245}\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 1.00000000000000004e245 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 8.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. Taylor expanded in y around inf 72.3%

      \[\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)) < 1.00000000000000004e245

    1. Initial program 99.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. Recombined 2 regimes into one program.
  4. Final simplification88.0%

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

Alternative 4: 69.8% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq 4 \cdot 10^{+31}:\\
\;\;\;\;\frac{\left(x + y\right) \cdot z + \left(y + t\right) \cdot a}{y + \left(x + t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.40000000000000002e-21 or 3.9999999999999999e31 < y

    1. Initial program 39.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 78.3%

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

    if -1.40000000000000002e-21 < y < 3.50000000000000021e-86

    1. Initial program 77.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 z around inf 76.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(\frac{x}{t + x} + \frac{a \cdot t}{z \cdot \left(t + x\right)}\right)} \]
    7. Step-by-step derivation
      1. times-frac76.1%

        \[\leadsto z \cdot \left(\frac{x}{t + x} + \color{blue}{\frac{a}{z} \cdot \frac{t}{t + x}}\right) \]
    8. Simplified76.1%

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

    if 3.50000000000000021e-86 < y < 3.9999999999999999e31

    1. Initial program 90.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 b around 0 77.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{-21}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-86}:\\ \;\;\;\;z \cdot \left(\frac{x}{x + t} + \frac{a}{z} \cdot \frac{t}{x + t}\right)\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+31}:\\ \;\;\;\;\frac{\left(x + y\right) \cdot z + \left(y + t\right) \cdot a}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 69.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.35000000000000003e-24 or 2.50000000000000011e47 < y

    1. Initial program 39.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 78.9%

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

    if -1.35000000000000003e-24 < y < 2.50000000000000011e47

    1. Initial program 79.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 z around inf 80.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(\frac{x}{t + x} + \color{blue}{\frac{a}{z} \cdot \frac{t}{t + x}}\right) \]
    8. Simplified70.5%

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

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

Alternative 6: 63.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-28} \lor \neg \left(y \leq 4.25 \cdot 10^{-91}\right):\\
\;\;\;\;\left(z + a\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.3e-28 or 4.24999999999999992e-91 < y

    1. Initial program 49.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 71.5%

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

    if -1.3e-28 < y < 4.24999999999999992e-91

    1. Initial program 78.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. Taylor expanded in y around 0 62.4%

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

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

Alternative 7: 57.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-13} \lor \neg \left(y \leq 4.15 \cdot 10^{+46}\right):\\
\;\;\;\;\left(z + a\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.80000000000000031e-13 or 4.14999999999999976e46 < y

    1. Initial program 38.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 79.6%

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

    if -6.80000000000000031e-13 < y < 4.14999999999999976e46

    1. Initial program 79.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 z around inf 38.4%

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

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

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

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

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

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

Alternative 8: 59.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+183} \lor \neg \left(x \leq 6.8 \cdot 10^{+105}\right):\\
\;\;\;\;z \cdot \frac{x}{x + t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.00000000000000034e183 or 6.7999999999999999e105 < x

    1. Initial program 51.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 z around inf 77.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(\frac{x}{t + x} + \frac{a \cdot t}{z \cdot \left(t + x\right)}\right)} \]
    7. Step-by-step derivation
      1. times-frac78.9%

        \[\leadsto z \cdot \left(\frac{x}{t + x} + \color{blue}{\frac{a}{z} \cdot \frac{t}{t + x}}\right) \]
    8. Simplified78.9%

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

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

    if -9.00000000000000034e183 < x < 6.7999999999999999e105

    1. Initial program 65.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 59.4%

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

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

Alternative 9: 58.9% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+191}:\\
\;\;\;\;z\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.1999999999999997e191 or 3.2e105 < x

    1. Initial program 51.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 x around inf 66.0%

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

    if -9.1999999999999997e191 < x < 3.2e105

    1. Initial program 65.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 59.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.2 \cdot 10^{+191}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{+105}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 42.7% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;z \leq 0.006:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.4999999999999998e-130 or 0.0060000000000000001 < z

    1. Initial program 59.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 x around inf 54.3%

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

    if -2.4999999999999998e-130 < z < 0.0060000000000000001

    1. Initial program 66.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 t around inf 48.8%

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

Alternative 11: 32.8% 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 61.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 30.6%

    \[\leadsto \color{blue}{a} \]
  4. Add Preprocessing

Developer Target 1: 83.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 2024116 
(FPCore (x y z t a b)
  :name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ 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)))