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

Percentage Accurate: 61.8% → 88.6%
Time: 11.4s
Alternatives: 11
Speedup: 0.7×

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.8% 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: 88.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(\left(y + t\right) \cdot a + \left(x + y\right) \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+302} \lor \neg \left(t\_1 \leq 10^{+268}\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 (/ (- (+ (* (+ y t) a) (* (+ x y) z)) (* y b)) (+ y (+ x t)))))
   (if (or (<= t_1 -2e+302) (not (<= t_1 1e+268))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / (y + (x + t));
	double tmp;
	if ((t_1 <= -2e+302) || !(t_1 <= 1e+268)) {
		tmp = (z + a) - b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / (y + (x + t))
    if ((t_1 <= (-2d+302)) .or. (.not. (t_1 <= 1d+268))) then
        tmp = (z + a) - b
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / (y + (x + t));
	double tmp;
	if ((t_1 <= -2e+302) || !(t_1 <= 1e+268)) {
		tmp = (z + a) - b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / (y + (x + t))
	tmp = 0
	if (t_1 <= -2e+302) or not (t_1 <= 1e+268):
		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(y + t) * a) + Float64(Float64(x + y) * z)) - Float64(y * b)) / Float64(y + Float64(x + t)))
	tmp = 0.0
	if ((t_1 <= -2e+302) || !(t_1 <= 1e+268))
		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 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / (y + (x + t));
	tmp = 0.0;
	if ((t_1 <= -2e+302) || ~((t_1 <= 1e+268)))
		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[(y + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+302], N[Not[LessEqual[t$95$1, 1e+268]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(\left(y + t\right) \cdot a + \left(x + y\right) \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+302} \lor \neg \left(t\_1 \leq 10^{+268}\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)) < -2.0000000000000002e302 or 9.9999999999999997e267 < (/.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.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 77.4%

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

    if -2.0000000000000002e302 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999997e267

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

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

Alternative 2: 62.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -1.86 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.5 \cdot 10^{+73}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq -1.4 \cdot 10^{-131}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_2}\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.2000000000000003e141 or -1.86000000000000011e87 < z < -1.50000000000000005e73 or 1.8999999999999999e106 < 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 34.6%

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

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

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

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

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

    if -7.2000000000000003e141 < z < -1.86000000000000011e87 or -1.4e-131 < z < 1.8999999999999999e106

    1. Initial program 73.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. Step-by-step derivation
      1. div-sub73.9%

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

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

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

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

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

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

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

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

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

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

    if -1.50000000000000005e73 < z < -1.4e-131

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t + y}{t + \left(y + x\right)} \cdot a} \]
    5. Applied egg-rr68.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+141}:\\ \;\;\;\;z \cdot \frac{x + y}{\left(x + y\right) + t}\\ \mathbf{elif}\;z \leq -1.86 \cdot 10^{+87}:\\ \;\;\;\;a - y \cdot \frac{b}{x + \left(y + t\right)}\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{+73}:\\ \;\;\;\;z \cdot \frac{x + y}{\left(x + y\right) + t}\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-131}:\\ \;\;\;\;a \cdot \frac{y + t}{\left(x + y\right) + t}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+106}:\\ \;\;\;\;a - y \cdot \frac{b}{x + \left(y + t\right)}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{\left(x + y\right) + t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 64.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -1.16 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.7 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.3999999999999999e142 or 1.69999999999999997e106 < z

    1. Initial program 37.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 33.3%

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

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

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

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

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

    if -2.3999999999999999e142 < z < -1.16000000000000012e40 or -4.8e-67 < z < 1.69999999999999997e106

    1. Initial program 72.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-sub72.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. +-commutative72.8%

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

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

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

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

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

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

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

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

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

    if -1.16000000000000012e40 < z < -4.8e-67

    1. Initial program 89.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 t around 0 71.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+142}:\\ \;\;\;\;z \cdot \frac{x + y}{\left(x + y\right) + t}\\ \mathbf{elif}\;z \leq -1.16 \cdot 10^{+40}:\\ \;\;\;\;a - y \cdot \frac{b}{x + \left(y + t\right)}\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-67}:\\ \;\;\;\;\frac{\left(y \cdot a + \left(x + y\right) \cdot z\right) - y \cdot b}{x + y}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+106}:\\ \;\;\;\;a - y \cdot \frac{b}{x + \left(y + t\right)}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{\left(x + y\right) + t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.8% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2e142 or 1.2e106 < z

    1. Initial program 37.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 33.3%

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

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

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

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

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

    if -1.2e142 < z < 1.2e106

    1. Initial program 74.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. Step-by-step derivation
      1. div-sub74.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 57.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -2.1 \cdot 10^{-66}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-108}:\\ \;\;\;\;z \cdot \frac{x + y}{\left(x + y\right) + t}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-88}:\\ \;\;\;\;a \cdot \frac{t}{x + t}\\ \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 -2.1e-66)
     t_1
     (if (<= y -6.2e-108)
       (* z (/ (+ x y) (+ (+ x y) t)))
       (if (<= y 4.5e-88) (* a (/ t (+ 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 <= -2.1e-66) {
		tmp = t_1;
	} else if (y <= -6.2e-108) {
		tmp = z * ((x + y) / ((x + y) + t));
	} else if (y <= 4.5e-88) {
		tmp = a * (t / (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 <= (-2.1d-66)) then
        tmp = t_1
    else if (y <= (-6.2d-108)) then
        tmp = z * ((x + y) / ((x + y) + t))
    else if (y <= 4.5d-88) then
        tmp = a * (t / (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 <= -2.1e-66) {
		tmp = t_1;
	} else if (y <= -6.2e-108) {
		tmp = z * ((x + y) / ((x + y) + t));
	} else if (y <= 4.5e-88) {
		tmp = a * (t / (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 <= -2.1e-66:
		tmp = t_1
	elif y <= -6.2e-108:
		tmp = z * ((x + y) / ((x + y) + t))
	elif y <= 4.5e-88:
		tmp = a * (t / (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 <= -2.1e-66)
		tmp = t_1;
	elseif (y <= -6.2e-108)
		tmp = Float64(z * Float64(Float64(x + y) / Float64(Float64(x + y) + t)));
	elseif (y <= 4.5e-88)
		tmp = Float64(a * Float64(t / 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 <= -2.1e-66)
		tmp = t_1;
	elseif (y <= -6.2e-108)
		tmp = z * ((x + y) / ((x + y) + t));
	elseif (y <= 4.5e-88)
		tmp = a * (t / (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, -2.1e-66], t$95$1, If[LessEqual[y, -6.2e-108], N[(z * N[(N[(x + y), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-88], N[(a * N[(t / 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 -2.1 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-88}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.1e-66 or 4.49999999999999991e-88 < y

    1. Initial program 50.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 70.5%

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

    if -2.1e-66 < y < -6.20000000000000028e-108

    1. Initial program 67.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 57.1%

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

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

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

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

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

    if -6.20000000000000028e-108 < y < 4.49999999999999991e-88

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

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

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

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

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

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

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

Alternative 6: 56.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+73} \lor \neg \left(z \leq 1.8 \cdot 10^{+56}\right):\\
\;\;\;\;z \cdot \frac{x + y}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6999999999999999e73 or 1.79999999999999999e56 < z

    1. Initial program 45.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 34.1%

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

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

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

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

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

    if -2.6999999999999999e73 < z < 1.79999999999999999e56

    1. Initial program 75.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 a around inf 47.7%

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

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

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

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

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

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

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

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

Alternative 7: 58.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+168} \lor \neg \left(t \leq 1.5 \cdot 10^{+81}\right):\\
\;\;\;\;a \cdot \frac{t}{x + t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.15e168 or 1.49999999999999999e81 < t

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t}{t + \left(x + y\right)}} \]
    6. Simplified58.1%

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

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

    if -1.15e168 < t < 1.49999999999999999e81

    1. Initial program 67.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 61.8%

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

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

Alternative 8: 58.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+112}:\\
\;\;\;\;a - \frac{y \cdot b}{y + t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.4000000000000001e112

    1. Initial program 56.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. Step-by-step derivation
      1. div-sub56.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4000000000000001e112 < t < 8.6000000000000003e81

    1. Initial program 67.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 62.2%

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

    if 8.6000000000000003e81 < t

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

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

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

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

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

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

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

Alternative 9: 57.7% accurate, 1.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.19999999999999981e167 or 1.0199999999999999e147 < t

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

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

    if -3.19999999999999981e167 < t < 1.0199999999999999e147

    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 y around inf 60.8%

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

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

Alternative 10: 44.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+68}:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq 7 \cdot 10^{+56}:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.95000000000000009e68 or 6.99999999999999999e56 < z

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

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

    if -1.95000000000000009e68 < z < 6.99999999999999999e56

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

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

Alternative 11: 32.2% 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 63.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 t around inf 33.7%

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

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

  :alt
  (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)))