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

Percentage Accurate: 60.6% → 87.4%
Time: 12.2s
Alternatives: 15
Speedup: 0.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 60.6% accurate, 1.0× speedup?

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

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

Alternative 1: 87.4% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(\frac{x}{t_1} + \frac{y}{t_1}\right) + \frac{t_2}{t_1}\right) - \frac{y \cdot b}{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 9.99999999999999952e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

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

      \[\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)) < 9.99999999999999952e246

    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. Taylor expanded in z around 0 99.8%

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

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

Alternative 2: 87.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(\left(y + t\right) \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+264} \lor \neg \left(t_1 \leq 10^{+247}\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) (* z (+ x y))) (* y b)) (+ y (+ x t)))))
   (if (or (<= t_1 -1e+264) (not (<= t_1 1e+247))) (- (+ 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) + (z * (x + y))) - (y * b)) / (y + (x + t));
	double tmp;
	if ((t_1 <= -1e+264) || !(t_1 <= 1e+247)) {
		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) + (z * (x + y))) - (y * b)) / (y + (x + t))
    if ((t_1 <= (-1d+264)) .or. (.not. (t_1 <= 1d+247))) 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) + (z * (x + y))) - (y * b)) / (y + (x + t));
	double tmp;
	if ((t_1 <= -1e+264) || !(t_1 <= 1e+247)) {
		tmp = (z + a) - b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t))
	tmp = 0
	if (t_1 <= -1e+264) or not (t_1 <= 1e+247):
		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(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t)))
	tmp = 0.0
	if ((t_1 <= -1e+264) || !(t_1 <= 1e+247))
		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) + (z * (x + y))) - (y * b)) / (y + (x + t));
	tmp = 0.0;
	if ((t_1 <= -1e+264) || ~((t_1 <= 1e+247)))
		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[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+264], N[Not[LessEqual[t$95$1, 1e+247]], $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 + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+264} \lor \neg \left(t_1 \leq 10^{+247}\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)) < -1.00000000000000004e264 or 9.99999999999999952e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

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

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

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

    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} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.8%

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

Alternative 3: 60.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \mathbf{if}\;z \leq -2.2 \cdot 10^{+19}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-296}:\\ \;\;\;\;\left(z + a\right) - \frac{y \cdot b}{t + \left(x + y\right)}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-260}:\\ \;\;\;\;y \cdot \frac{a - b}{x + y}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-182}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{-63}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+24}:\\ \;\;\;\;\frac{\left(y \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{x + y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ z (/ (+ x (+ y t)) (+ x y)))))
   (if (<= z -2.2e+19)
     t_1
     (if (<= z -3.7e-296)
       (- (+ z a) (/ (* y b) (+ t (+ x y))))
       (if (<= z 1.05e-260)
         (* y (/ (- a b) (+ x y)))
         (if (<= z 1.1e-182)
           (/ (- (* (+ y t) a) (* y b)) (+ y (+ x t)))
           (if (<= z 7.4e-63)
             (- (+ z a) b)
             (if (<= z 1.05e+24)
               (/ (- (+ (* y a) (* z (+ x y))) (* y b)) (+ x y))
               t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z / ((x + (y + t)) / (x + y));
	double tmp;
	if (z <= -2.2e+19) {
		tmp = t_1;
	} else if (z <= -3.7e-296) {
		tmp = (z + a) - ((y * b) / (t + (x + y)));
	} else if (z <= 1.05e-260) {
		tmp = y * ((a - b) / (x + y));
	} else if (z <= 1.1e-182) {
		tmp = (((y + t) * a) - (y * b)) / (y + (x + t));
	} else if (z <= 7.4e-63) {
		tmp = (z + a) - b;
	} else if (z <= 1.05e+24) {
		tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z / ((x + (y + t)) / (x + y))
    if (z <= (-2.2d+19)) then
        tmp = t_1
    else if (z <= (-3.7d-296)) then
        tmp = (z + a) - ((y * b) / (t + (x + y)))
    else if (z <= 1.05d-260) then
        tmp = y * ((a - b) / (x + y))
    else if (z <= 1.1d-182) then
        tmp = (((y + t) * a) - (y * b)) / (y + (x + t))
    else if (z <= 7.4d-63) then
        tmp = (z + a) - b
    else if (z <= 1.05d+24) then
        tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z / ((x + (y + t)) / (x + y));
	double tmp;
	if (z <= -2.2e+19) {
		tmp = t_1;
	} else if (z <= -3.7e-296) {
		tmp = (z + a) - ((y * b) / (t + (x + y)));
	} else if (z <= 1.05e-260) {
		tmp = y * ((a - b) / (x + y));
	} else if (z <= 1.1e-182) {
		tmp = (((y + t) * a) - (y * b)) / (y + (x + t));
	} else if (z <= 7.4e-63) {
		tmp = (z + a) - b;
	} else if (z <= 1.05e+24) {
		tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = z / ((x + (y + t)) / (x + y))
	tmp = 0
	if z <= -2.2e+19:
		tmp = t_1
	elif z <= -3.7e-296:
		tmp = (z + a) - ((y * b) / (t + (x + y)))
	elif z <= 1.05e-260:
		tmp = y * ((a - b) / (x + y))
	elif z <= 1.1e-182:
		tmp = (((y + t) * a) - (y * b)) / (y + (x + t))
	elif z <= 7.4e-63:
		tmp = (z + a) - b
	elif z <= 1.05e+24:
		tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(z / Float64(Float64(x + Float64(y + t)) / Float64(x + y)))
	tmp = 0.0
	if (z <= -2.2e+19)
		tmp = t_1;
	elseif (z <= -3.7e-296)
		tmp = Float64(Float64(z + a) - Float64(Float64(y * b) / Float64(t + Float64(x + y))));
	elseif (z <= 1.05e-260)
		tmp = Float64(y * Float64(Float64(a - b) / Float64(x + y)));
	elseif (z <= 1.1e-182)
		tmp = Float64(Float64(Float64(Float64(y + t) * a) - Float64(y * b)) / Float64(y + Float64(x + t)));
	elseif (z <= 7.4e-63)
		tmp = Float64(Float64(z + a) - b);
	elseif (z <= 1.05e+24)
		tmp = Float64(Float64(Float64(Float64(y * a) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(x + y));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = z / ((x + (y + t)) / (x + y));
	tmp = 0.0;
	if (z <= -2.2e+19)
		tmp = t_1;
	elseif (z <= -3.7e-296)
		tmp = (z + a) - ((y * b) / (t + (x + y)));
	elseif (z <= 1.05e-260)
		tmp = y * ((a - b) / (x + y));
	elseif (z <= 1.1e-182)
		tmp = (((y + t) * a) - (y * b)) / (y + (x + t));
	elseif (z <= 7.4e-63)
		tmp = (z + a) - b;
	elseif (z <= 1.05e+24)
		tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z / N[(N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+19], t$95$1, If[LessEqual[z, -3.7e-296], N[(N[(z + a), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-260], N[(y * N[(N[(a - b), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-182], N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e-63], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[z, 1.05e+24], N[(N[(N[(N[(y * a), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-260}:\\
\;\;\;\;y \cdot \frac{a - b}{x + y}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -2.2e19 or 1.0500000000000001e24 < z

    1. Initial program 53.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. Taylor expanded in z around inf 43.3%

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

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

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

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

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

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

    if -2.2e19 < z < -3.70000000000000027e-296

    1. Initial program 64.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. Taylor expanded in z around 0 64.5%

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

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

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

    if -3.70000000000000027e-296 < z < 1.05000000000000002e-260

    1. Initial program 39.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. Taylor expanded in z around 0 39.4%

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

      \[\leadsto \color{blue}{\frac{a \cdot y - b \cdot y}{x + y}} \]
    4. Step-by-step derivation
      1. distribute-rgt-out--41.8%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(a - b\right)}{y + x}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u24.1%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{y + x}\right)} - 1} \]
      3. +-commutative2.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{\color{blue}{x + y}}\right)} - 1 \]
    7. Applied egg-rr2.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{x + y}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def24.1%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{a - b}{x + y}} \]
      4. +-commutative77.6%

        \[\leadsto y \cdot \frac{a - b}{\color{blue}{y + x}} \]
    9. Simplified77.6%

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

    if 1.05000000000000002e-260 < z < 1.1e-182

    1. Initial program 70.5%

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

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

    if 1.1e-182 < z < 7.40000000000000025e-63

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

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

    if 7.40000000000000025e-63 < z < 1.0500000000000001e24

    1. Initial program 99.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. Taylor expanded in t around 0 80.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+19}:\\ \;\;\;\;\frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{-296}:\\ \;\;\;\;\left(z + a\right) - \frac{y \cdot b}{t + \left(x + y\right)}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-260}:\\ \;\;\;\;y \cdot \frac{a - b}{x + y}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-182}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{-63}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+24}:\\ \;\;\;\;\frac{\left(y \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \end{array} \]

Alternative 4: 60.6% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;z \leq 5.8 \cdot 10^{-262}:\\
\;\;\;\;y \cdot \frac{a - b}{x + y}\\

\mathbf{elif}\;z \leq 2.8 \cdot 10^{-180}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+22}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -3.6e20 or 8.49999999999999979e22 < z

    1. Initial program 53.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. Taylor expanded in z around inf 43.3%

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

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

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

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

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

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

    if -3.6e20 < z < -2.4499999999999999e-296

    1. Initial program 64.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. Taylor expanded in z around 0 64.5%

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

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

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

    if -2.4499999999999999e-296 < z < 5.79999999999999993e-262

    1. Initial program 39.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. Taylor expanded in z around 0 39.4%

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

      \[\leadsto \color{blue}{\frac{a \cdot y - b \cdot y}{x + y}} \]
    4. Step-by-step derivation
      1. distribute-rgt-out--41.8%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(a - b\right)}{y + x}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u24.1%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{y + x}\right)} - 1} \]
      3. +-commutative2.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{\color{blue}{x + y}}\right)} - 1 \]
    7. Applied egg-rr2.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{x + y}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def24.1%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{a - b}{x + y}} \]
      4. +-commutative77.6%

        \[\leadsto y \cdot \frac{a - b}{\color{blue}{y + x}} \]
    9. Simplified77.6%

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

    if 5.79999999999999993e-262 < z < 2.79999999999999997e-180 or 7.80000000000000044e-63 < z < 8.49999999999999979e22

    1. Initial program 84.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. Taylor expanded in z around 0 67.7%

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

    if 2.79999999999999997e-180 < z < 7.80000000000000044e-63

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+20}:\\ \;\;\;\;\frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{-296}:\\ \;\;\;\;\left(z + a\right) - \frac{y \cdot b}{t + \left(x + y\right)}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-262}:\\ \;\;\;\;y \cdot \frac{a - b}{x + y}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-180}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-63}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+22}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \end{array} \]

Alternative 5: 69.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-63}:\\
\;\;\;\;\left(y + t\right) \cdot \frac{a}{t_1} - \frac{b}{\frac{t_1}{y}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.2e19 or 9.1999999999999996e24 < z

    1. Initial program 53.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. Taylor expanded in z around inf 43.3%

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

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

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

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

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

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

    if -2.2e19 < z < 3.60000000000000008e-63

    1. Initial program 60.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. Taylor expanded in z around 0 50.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.60000000000000008e-63 < z < 9.1999999999999996e24

    1. Initial program 99.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. Taylor expanded in t around 0 80.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+19}:\\ \;\;\;\;\frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-63}:\\ \;\;\;\;\left(y + t\right) \cdot \frac{a}{t + \left(x + y\right)} - \frac{b}{\frac{t + \left(x + y\right)}{y}}\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+24}:\\ \;\;\;\;\frac{\left(y \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \end{array} \]

Alternative 6: 59.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := z \cdot \frac{x + y}{y + \left(x + t\right)}\\ t_3 := \frac{a}{\frac{x + \left(y + t\right)}{y + t}}\\ \mathbf{if}\;z \leq -2 \cdot 10^{+20}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-161}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-301}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-260}:\\ \;\;\;\;y \cdot \frac{a - b}{x + y}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-184}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+45}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- (+ z a) b))
        (t_2 (* z (/ (+ x y) (+ y (+ x t)))))
        (t_3 (/ a (/ (+ x (+ y t)) (+ y t)))))
   (if (<= z -2e+20)
     t_2
     (if (<= z -2.7e-161)
       t_1
       (if (<= z -3.8e-301)
         t_3
         (if (<= z 1.9e-260)
           (* y (/ (- a b) (+ x y)))
           (if (<= z 2.9e-184) t_3 (if (<= z 3.1e+45) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double t_2 = z * ((x + y) / (y + (x + t)));
	double t_3 = a / ((x + (y + t)) / (y + t));
	double tmp;
	if (z <= -2e+20) {
		tmp = t_2;
	} else if (z <= -2.7e-161) {
		tmp = t_1;
	} else if (z <= -3.8e-301) {
		tmp = t_3;
	} else if (z <= 1.9e-260) {
		tmp = y * ((a - b) / (x + y));
	} else if (z <= 2.9e-184) {
		tmp = t_3;
	} else if (z <= 3.1e+45) {
		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) :: t_3
    real(8) :: tmp
    t_1 = (z + a) - b
    t_2 = z * ((x + y) / (y + (x + t)))
    t_3 = a / ((x + (y + t)) / (y + t))
    if (z <= (-2d+20)) then
        tmp = t_2
    else if (z <= (-2.7d-161)) then
        tmp = t_1
    else if (z <= (-3.8d-301)) then
        tmp = t_3
    else if (z <= 1.9d-260) then
        tmp = y * ((a - b) / (x + y))
    else if (z <= 2.9d-184) then
        tmp = t_3
    else if (z <= 3.1d+45) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double t_2 = z * ((x + y) / (y + (x + t)));
	double t_3 = a / ((x + (y + t)) / (y + t));
	double tmp;
	if (z <= -2e+20) {
		tmp = t_2;
	} else if (z <= -2.7e-161) {
		tmp = t_1;
	} else if (z <= -3.8e-301) {
		tmp = t_3;
	} else if (z <= 1.9e-260) {
		tmp = y * ((a - b) / (x + y));
	} else if (z <= 2.9e-184) {
		tmp = t_3;
	} else if (z <= 3.1e+45) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + a) - b
	t_2 = z * ((x + y) / (y + (x + t)))
	t_3 = a / ((x + (y + t)) / (y + t))
	tmp = 0
	if z <= -2e+20:
		tmp = t_2
	elif z <= -2.7e-161:
		tmp = t_1
	elif z <= -3.8e-301:
		tmp = t_3
	elif z <= 1.9e-260:
		tmp = y * ((a - b) / (x + y))
	elif z <= 2.9e-184:
		tmp = t_3
	elif z <= 3.1e+45:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z + a) - b)
	t_2 = Float64(z * Float64(Float64(x + y) / Float64(y + Float64(x + t))))
	t_3 = Float64(a / Float64(Float64(x + Float64(y + t)) / Float64(y + t)))
	tmp = 0.0
	if (z <= -2e+20)
		tmp = t_2;
	elseif (z <= -2.7e-161)
		tmp = t_1;
	elseif (z <= -3.8e-301)
		tmp = t_3;
	elseif (z <= 1.9e-260)
		tmp = Float64(y * Float64(Float64(a - b) / Float64(x + y)));
	elseif (z <= 2.9e-184)
		tmp = t_3;
	elseif (z <= 3.1e+45)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z + a) - b;
	t_2 = z * ((x + y) / (y + (x + t)));
	t_3 = a / ((x + (y + t)) / (y + t));
	tmp = 0.0;
	if (z <= -2e+20)
		tmp = t_2;
	elseif (z <= -2.7e-161)
		tmp = t_1;
	elseif (z <= -3.8e-301)
		tmp = t_3;
	elseif (z <= 1.9e-260)
		tmp = y * ((a - b) / (x + y));
	elseif (z <= 2.9e-184)
		tmp = t_3;
	elseif (z <= 3.1e+45)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(x + y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(a / N[(N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+20], t$95$2, If[LessEqual[z, -2.7e-161], t$95$1, If[LessEqual[z, -3.8e-301], t$95$3, If[LessEqual[z, 1.9e-260], N[(y * N[(N[(a - b), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-184], t$95$3, If[LessEqual[z, 3.1e+45], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.7 \cdot 10^{-161}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -3.8 \cdot 10^{-301}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-260}:\\
\;\;\;\;y \cdot \frac{a - b}{x + y}\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{-184}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq 3.1 \cdot 10^{+45}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2e20 or 3.09999999999999988e45 < z

    1. Initial program 53.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. Taylor expanded in z around inf 43.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}} \]
    6. Step-by-step derivation
      1. associate-+r+43.4%

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

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

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

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

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

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

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

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

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

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

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

    if -2e20 < z < -2.6999999999999999e-161 or 2.90000000000000014e-184 < z < 3.09999999999999988e45

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

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

    if -2.6999999999999999e-161 < z < -3.79999999999999996e-301 or 1.9000000000000002e-260 < z < 2.90000000000000014e-184

    1. Initial program 64.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. Taylor expanded in a around inf 39.4%

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

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

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

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

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

    if -3.79999999999999996e-301 < z < 1.9000000000000002e-260

    1. Initial program 42.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. Taylor expanded in z around 0 42.4%

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

      \[\leadsto \color{blue}{\frac{a \cdot y - b \cdot y}{x + y}} \]
    4. Step-by-step derivation
      1. distribute-rgt-out--45.1%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(a - b\right)}{y + x}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u25.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{y + x}\right)\right)} \]
      2. expm1-udef2.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{y + x}\right)} - 1} \]
      3. +-commutative2.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{\color{blue}{x + y}}\right)} - 1 \]
    7. Applied egg-rr2.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{x + y}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def25.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{x + y}\right)\right)} \]
      2. expm1-log1p45.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+20}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-161}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-301}:\\ \;\;\;\;\frac{a}{\frac{x + \left(y + t\right)}{y + t}}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-260}:\\ \;\;\;\;y \cdot \frac{a - b}{x + y}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-184}:\\ \;\;\;\;\frac{a}{\frac{x + \left(y + t\right)}{y + t}}\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+45}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \end{array} \]

Alternative 7: 59.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := x + \left(y + t\right)\\ t_3 := \frac{z}{\frac{t_2}{x + y}}\\ t_4 := \frac{a}{\frac{t_2}{y + t}}\\ \mathbf{if}\;z \leq -1.35 \cdot 10^{+20}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-161}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-300}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-261}:\\ \;\;\;\;y \cdot \frac{a - b}{x + y}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-183}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- (+ z a) b))
        (t_2 (+ x (+ y t)))
        (t_3 (/ z (/ t_2 (+ x y))))
        (t_4 (/ a (/ t_2 (+ y t)))))
   (if (<= z -1.35e+20)
     t_3
     (if (<= z -2e-161)
       t_1
       (if (<= z -1.1e-300)
         t_4
         (if (<= z 9.5e-261)
           (* y (/ (- a b) (+ x y)))
           (if (<= z 2.2e-183) t_4 (if (<= z 4.2e+52) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double t_2 = x + (y + t);
	double t_3 = z / (t_2 / (x + y));
	double t_4 = a / (t_2 / (y + t));
	double tmp;
	if (z <= -1.35e+20) {
		tmp = t_3;
	} else if (z <= -2e-161) {
		tmp = t_1;
	} else if (z <= -1.1e-300) {
		tmp = t_4;
	} else if (z <= 9.5e-261) {
		tmp = y * ((a - b) / (x + y));
	} else if (z <= 2.2e-183) {
		tmp = t_4;
	} else if (z <= 4.2e+52) {
		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) :: t_4
    real(8) :: tmp
    t_1 = (z + a) - b
    t_2 = x + (y + t)
    t_3 = z / (t_2 / (x + y))
    t_4 = a / (t_2 / (y + t))
    if (z <= (-1.35d+20)) then
        tmp = t_3
    else if (z <= (-2d-161)) then
        tmp = t_1
    else if (z <= (-1.1d-300)) then
        tmp = t_4
    else if (z <= 9.5d-261) then
        tmp = y * ((a - b) / (x + y))
    else if (z <= 2.2d-183) then
        tmp = t_4
    else if (z <= 4.2d+52) 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 = (z + a) - b;
	double t_2 = x + (y + t);
	double t_3 = z / (t_2 / (x + y));
	double t_4 = a / (t_2 / (y + t));
	double tmp;
	if (z <= -1.35e+20) {
		tmp = t_3;
	} else if (z <= -2e-161) {
		tmp = t_1;
	} else if (z <= -1.1e-300) {
		tmp = t_4;
	} else if (z <= 9.5e-261) {
		tmp = y * ((a - b) / (x + y));
	} else if (z <= 2.2e-183) {
		tmp = t_4;
	} else if (z <= 4.2e+52) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + a) - b
	t_2 = x + (y + t)
	t_3 = z / (t_2 / (x + y))
	t_4 = a / (t_2 / (y + t))
	tmp = 0
	if z <= -1.35e+20:
		tmp = t_3
	elif z <= -2e-161:
		tmp = t_1
	elif z <= -1.1e-300:
		tmp = t_4
	elif z <= 9.5e-261:
		tmp = y * ((a - b) / (x + y))
	elif z <= 2.2e-183:
		tmp = t_4
	elif z <= 4.2e+52:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z + a) - b)
	t_2 = Float64(x + Float64(y + t))
	t_3 = Float64(z / Float64(t_2 / Float64(x + y)))
	t_4 = Float64(a / Float64(t_2 / Float64(y + t)))
	tmp = 0.0
	if (z <= -1.35e+20)
		tmp = t_3;
	elseif (z <= -2e-161)
		tmp = t_1;
	elseif (z <= -1.1e-300)
		tmp = t_4;
	elseif (z <= 9.5e-261)
		tmp = Float64(y * Float64(Float64(a - b) / Float64(x + y)));
	elseif (z <= 2.2e-183)
		tmp = t_4;
	elseif (z <= 4.2e+52)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z + a) - b;
	t_2 = x + (y + t);
	t_3 = z / (t_2 / (x + y));
	t_4 = a / (t_2 / (y + t));
	tmp = 0.0;
	if (z <= -1.35e+20)
		tmp = t_3;
	elseif (z <= -2e-161)
		tmp = t_1;
	elseif (z <= -1.1e-300)
		tmp = t_4;
	elseif (z <= 9.5e-261)
		tmp = y * ((a - b) / (x + y));
	elseif (z <= 2.2e-183)
		tmp = t_4;
	elseif (z <= 4.2e+52)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z / N[(t$95$2 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(a / N[(t$95$2 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+20], t$95$3, If[LessEqual[z, -2e-161], t$95$1, If[LessEqual[z, -1.1e-300], t$95$4, If[LessEqual[z, 9.5e-261], N[(y * N[(N[(a - b), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e-183], t$95$4, If[LessEqual[z, 4.2e+52], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2 \cdot 10^{-161}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.1 \cdot 10^{-300}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;z \leq 9.5 \cdot 10^{-261}:\\
\;\;\;\;y \cdot \frac{a - b}{x + y}\\

\mathbf{elif}\;z \leq 2.2 \cdot 10^{-183}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;z \leq 4.2 \cdot 10^{+52}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.35e20 or 4.2e52 < z

    1. Initial program 53.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. Taylor expanded in z around inf 43.4%

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

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

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

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

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

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

    if -1.35e20 < z < -2.00000000000000006e-161 or 2.2e-183 < z < 4.2e52

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

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

    if -2.00000000000000006e-161 < z < -1.10000000000000001e-300 or 9.5000000000000008e-261 < z < 2.2e-183

    1. Initial program 64.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. Taylor expanded in a around inf 39.4%

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

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

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

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

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

    if -1.10000000000000001e-300 < z < 9.5000000000000008e-261

    1. Initial program 42.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. Taylor expanded in z around 0 42.4%

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

      \[\leadsto \color{blue}{\frac{a \cdot y - b \cdot y}{x + y}} \]
    4. Step-by-step derivation
      1. distribute-rgt-out--45.1%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(a - b\right)}{y + x}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u25.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{y + x}\right)\right)} \]
      2. expm1-udef2.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{y + x}\right)} - 1} \]
      3. +-commutative2.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{\color{blue}{x + y}}\right)} - 1 \]
    7. Applied egg-rr2.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{x + y}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def25.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{x + y}\right)\right)} \]
      2. expm1-log1p45.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+20}:\\ \;\;\;\;\frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-161}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-300}:\\ \;\;\;\;\frac{a}{\frac{x + \left(y + t\right)}{y + t}}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-261}:\\ \;\;\;\;y \cdot \frac{a - b}{x + y}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-183}:\\ \;\;\;\;\frac{a}{\frac{x + \left(y + t\right)}{y + t}}\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+52}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \end{array} \]

Alternative 8: 60.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq -2.55 \cdot 10^{-297}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 2 \cdot 10^{-270}:\\
\;\;\;\;y \cdot \frac{a - b}{x + y}\\

\mathbf{elif}\;z \leq 1.1 \cdot 10^{-181}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.7 \cdot 10^{+18}:\\
\;\;\;\;\frac{a}{\frac{t_2}{y + t}}\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2e20 or 1.7e18 < z

    1. Initial program 53.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. Taylor expanded in z around inf 43.4%

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

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

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

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

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

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

    if -2e20 < z < -2.55000000000000004e-297 or 2.0000000000000001e-270 < z < 1.09999999999999999e-181

    1. Initial program 66.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. Taylor expanded in z around 0 66.0%

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

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

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

    if -2.55000000000000004e-297 < z < 2.0000000000000001e-270

    1. Initial program 23.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. Taylor expanded in z around 0 23.6%

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

      \[\leadsto \color{blue}{\frac{a \cdot y - b \cdot y}{x + y}} \]
    4. Step-by-step derivation
      1. distribute-rgt-out--26.3%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(a - b\right)}{y + x}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u12.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{y + x}\right)\right)} \]
      2. expm1-udef2.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{y + x}\right)} - 1} \]
      3. +-commutative2.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{\color{blue}{x + y}}\right)} - 1 \]
    7. Applied egg-rr2.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y \cdot \left(a - b\right)}{x + y}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def12.6%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{a - b}{x + y}} \]
      4. +-commutative78.1%

        \[\leadsto y \cdot \frac{a - b}{\color{blue}{y + x}} \]
    9. Simplified78.1%

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

    if 1.09999999999999999e-181 < z < 7.80000000000000044e-63

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

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

    if 7.80000000000000044e-63 < z < 1.7e18

    1. Initial program 99.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. Taylor expanded in a around inf 66.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+20}:\\ \;\;\;\;\frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \mathbf{elif}\;z \leq -2.55 \cdot 10^{-297}:\\ \;\;\;\;\left(z + a\right) - \frac{y \cdot b}{t + \left(x + y\right)}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-270}:\\ \;\;\;\;y \cdot \frac{a - b}{x + y}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-181}:\\ \;\;\;\;\left(z + a\right) - \frac{y \cdot b}{t + \left(x + y\right)}\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-63}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+18}:\\ \;\;\;\;\frac{a}{\frac{x + \left(y + t\right)}{y + t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \end{array} \]

Alternative 9: 56.3% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq -6.7 \cdot 10^{-116}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.1 \cdot 10^{-117}:\\
\;\;\;\;\frac{a}{1 + \frac{x}{t}}\\

\mathbf{elif}\;y \leq 3.1 \cdot 10^{+28}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.7e18 or 3.1000000000000001e28 < y

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

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

    if -2.7e18 < y < -6.69999999999999993e-116 or 1.1000000000000001e-117 < y < 3.1000000000000001e28

    1. Initial program 81.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. Taylor expanded in z around inf 55.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}} \]
    6. Step-by-step derivation
      1. associate-+r+55.4%

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

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

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

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

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

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

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

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

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

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

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

    if -6.69999999999999993e-116 < y < 1.1000000000000001e-117

    1. Initial program 84.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. Taylor expanded in a around inf 44.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{+18}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq -6.7 \cdot 10^{-116}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-117}:\\ \;\;\;\;\frac{a}{1 + \frac{x}{t}}\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{+28}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]

Alternative 10: 60.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{+160} \lor \neg \left(x \leq 6.2 \cdot 10^{+157}\right):\\
\;\;\;\;z - \frac{y}{\frac{x}{b}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.14999999999999994e160 or 6.1999999999999994e157 < x

    1. Initial program 47.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. Taylor expanded in x around inf 54.7%

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

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

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

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

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

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

      \[\leadsto z + \color{blue}{-1 \cdot \frac{b \cdot y}{x}} \]
    6. Step-by-step derivation
      1. mul-1-neg57.4%

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

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

      \[\leadsto z + \color{blue}{\left(-\frac{y \cdot b}{x}\right)} \]
    8. Step-by-step derivation
      1. unsub-neg57.4%

        \[\leadsto \color{blue}{z - \frac{y \cdot b}{x}} \]
      2. associate-/l*66.0%

        \[\leadsto z - \color{blue}{\frac{y}{\frac{x}{b}}} \]
    9. Applied egg-rr66.0%

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

    if -2.14999999999999994e160 < x < 6.1999999999999994e157

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.15 \cdot 10^{+160} \lor \neg \left(x \leq 6.2 \cdot 10^{+157}\right):\\ \;\;\;\;z - \frac{y}{\frac{x}{b}}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]

Alternative 11: 56.6% accurate, 2.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+163}:\\
\;\;\;\;z + z \cdot \frac{t}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.5e163

    1. Initial program 48.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. Taylor expanded in x around inf 60.6%

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

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

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

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

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

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

      \[\leadsto z + \color{blue}{-1 \cdot \frac{t \cdot z}{x}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u38.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(z + -1 \cdot \frac{t \cdot z}{x}\right)\right)} \]
      2. expm1-udef27.1%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(z + -1 \cdot \frac{t \cdot z}{x}\right)} - 1} \]
    7. Applied egg-rr29.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(z + \frac{z}{\frac{x}{t}}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def41.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(z + \frac{z}{\frac{x}{t}}\right)\right)} \]
      2. expm1-log1p56.3%

        \[\leadsto \color{blue}{z + \frac{z}{\frac{x}{t}}} \]
      3. associate-/l*53.3%

        \[\leadsto z + \color{blue}{\frac{z \cdot t}{x}} \]
      4. associate-*r/56.3%

        \[\leadsto z + \color{blue}{z \cdot \frac{t}{x}} \]
      5. *-commutative56.3%

        \[\leadsto z + \color{blue}{\frac{t}{x} \cdot z} \]
      6. *-commutative56.3%

        \[\leadsto z + \color{blue}{z \cdot \frac{t}{x}} \]
    9. Simplified56.3%

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

    if -2.5e163 < x

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

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

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

Alternative 12: 48.3% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;z \leq 760000000000:\\
\;\;\;\;a - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.35e20 or 7.6e11 < z

    1. Initial program 53.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. Taylor expanded in x around inf 56.1%

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

    if -1.35e20 < z < 7.6e11

    1. Initial program 64.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. Taylor expanded in z around 0 52.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+20}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 760000000000:\\ \;\;\;\;a - b\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]

Alternative 13: 56.6% accurate, 3.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.5500000000000001e164

    1. Initial program 48.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. Taylor expanded in x around inf 56.1%

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

    if -1.5500000000000001e164 < x

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

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

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

Alternative 14: 45.2% accurate, 4.1× speedup?

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

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

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+18}:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.35e20 or 2.9e18 < z

    1. Initial program 53.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. Taylor expanded in x around inf 56.1%

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

    if -1.35e20 < z < 2.9e18

    1. Initial program 64.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. Taylor expanded in t around inf 44.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+20}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+18}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]

Alternative 15: 32.5% accurate, 21.0× speedup?

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

\\
a
\end{array}
Derivation
  1. Initial program 59.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. Taylor expanded in t around inf 32.2%

    \[\leadsto \color{blue}{a} \]
  3. Final simplification32.2%

    \[\leadsto a \]

Developer target: 82.0% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t_1}{t_2}}\\

\mathbf{else}:\\
\;\;\;\;t_4\\


\end{array}
\end{array}

Reproduce

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

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

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