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

Percentage Accurate: 61.6% → 87.6%
Time: 13.1s
Alternatives: 12
Speedup: 0.6×

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 12 alternatives:

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

Initial Program: 61.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.6% 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 -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+241}\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 (- INFINITY)) (not (<= t_1 2e+241))) (- (+ 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 <= -((double) INFINITY)) || !(t_1 <= 2e+241)) {
		tmp = (z + a) - b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t));
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+241)) {
		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 <= -math.inf) or not (t_1 <= 2e+241):
		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 <= Float64(-Inf)) || !(t_1 <= 2e+241))
		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 <= -Inf) || ~((t_1 <= 2e+241)))
		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, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+241]], $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 -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+241}\right):\\
\;\;\;\;\left(z + a\right) - b\\

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


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

    1. Initial program 6.4%

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

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

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

    1. Initial program 99.7%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification87.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 2 \cdot 10^{+241}\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} \]
  5. Add Preprocessing

Alternative 2: 58.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + \left(x + t\right)\\ t_2 := \frac{\left(y + t\right) \cdot a - y \cdot b}{t\_1}\\ t_3 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -3.2 \cdot 10^{+26}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq -4.3 \cdot 10^{-51}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-138}:\\ \;\;\;\;z \cdot \frac{x + y}{t\_1}\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{-207}:\\ \;\;\;\;a\\ \mathbf{elif}\;y \leq 8.4 \cdot 10^{-274}:\\ \;\;\;\;z \cdot \frac{1}{\frac{t + \left(x + y\right)}{x + y}}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-25}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (+ x t)))
        (t_2 (/ (- (* (+ y t) a) (* y b)) t_1))
        (t_3 (- (+ z a) b)))
   (if (<= y -3.2e+26)
     t_3
     (if (<= y -4.3e-51)
       t_2
       (if (<= y -5.6e-138)
         (* z (/ (+ x y) t_1))
         (if (<= y -3.1e-207)
           a
           (if (<= y 8.4e-274)
             (* z (/ 1.0 (/ (+ t (+ x y)) (+ x y))))
             (if (<= y 2.5e-25) t_2 t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (x + t);
	double t_2 = (((y + t) * a) - (y * b)) / t_1;
	double t_3 = (z + a) - b;
	double tmp;
	if (y <= -3.2e+26) {
		tmp = t_3;
	} else if (y <= -4.3e-51) {
		tmp = t_2;
	} else if (y <= -5.6e-138) {
		tmp = z * ((x + y) / t_1);
	} else if (y <= -3.1e-207) {
		tmp = a;
	} else if (y <= 8.4e-274) {
		tmp = z * (1.0 / ((t + (x + y)) / (x + y)));
	} else if (y <= 2.5e-25) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = y + (x + t)
    t_2 = (((y + t) * a) - (y * b)) / t_1
    t_3 = (z + a) - b
    if (y <= (-3.2d+26)) then
        tmp = t_3
    else if (y <= (-4.3d-51)) then
        tmp = t_2
    else if (y <= (-5.6d-138)) then
        tmp = z * ((x + y) / t_1)
    else if (y <= (-3.1d-207)) then
        tmp = a
    else if (y <= 8.4d-274) then
        tmp = z * (1.0d0 / ((t + (x + y)) / (x + y)))
    else if (y <= 2.5d-25) then
        tmp = t_2
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (x + t);
	double t_2 = (((y + t) * a) - (y * b)) / t_1;
	double t_3 = (z + a) - b;
	double tmp;
	if (y <= -3.2e+26) {
		tmp = t_3;
	} else if (y <= -4.3e-51) {
		tmp = t_2;
	} else if (y <= -5.6e-138) {
		tmp = z * ((x + y) / t_1);
	} else if (y <= -3.1e-207) {
		tmp = a;
	} else if (y <= 8.4e-274) {
		tmp = z * (1.0 / ((t + (x + y)) / (x + y)));
	} else if (y <= 2.5e-25) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y + (x + t)
	t_2 = (((y + t) * a) - (y * b)) / t_1
	t_3 = (z + a) - b
	tmp = 0
	if y <= -3.2e+26:
		tmp = t_3
	elif y <= -4.3e-51:
		tmp = t_2
	elif y <= -5.6e-138:
		tmp = z * ((x + y) / t_1)
	elif y <= -3.1e-207:
		tmp = a
	elif y <= 8.4e-274:
		tmp = z * (1.0 / ((t + (x + y)) / (x + y)))
	elif y <= 2.5e-25:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(x + t))
	t_2 = Float64(Float64(Float64(Float64(y + t) * a) - Float64(y * b)) / t_1)
	t_3 = Float64(Float64(z + a) - b)
	tmp = 0.0
	if (y <= -3.2e+26)
		tmp = t_3;
	elseif (y <= -4.3e-51)
		tmp = t_2;
	elseif (y <= -5.6e-138)
		tmp = Float64(z * Float64(Float64(x + y) / t_1));
	elseif (y <= -3.1e-207)
		tmp = a;
	elseif (y <= 8.4e-274)
		tmp = Float64(z * Float64(1.0 / Float64(Float64(t + Float64(x + y)) / Float64(x + y))));
	elseif (y <= 2.5e-25)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y + (x + t);
	t_2 = (((y + t) * a) - (y * b)) / t_1;
	t_3 = (z + a) - b;
	tmp = 0.0;
	if (y <= -3.2e+26)
		tmp = t_3;
	elseif (y <= -4.3e-51)
		tmp = t_2;
	elseif (y <= -5.6e-138)
		tmp = z * ((x + y) / t_1);
	elseif (y <= -3.1e-207)
		tmp = a;
	elseif (y <= 8.4e-274)
		tmp = z * (1.0 / ((t + (x + y)) / (x + y)));
	elseif (y <= 2.5e-25)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -3.2e+26], t$95$3, If[LessEqual[y, -4.3e-51], t$95$2, If[LessEqual[y, -5.6e-138], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.1e-207], a, If[LessEqual[y, 8.4e-274], N[(z * N[(1.0 / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e-25], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -4.3 \cdot 10^{-51}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -5.6 \cdot 10^{-138}:\\
\;\;\;\;z \cdot \frac{x + y}{t\_1}\\

\mathbf{elif}\;y \leq -3.1 \cdot 10^{-207}:\\
\;\;\;\;a\\

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

\mathbf{elif}\;y \leq 2.5 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -3.20000000000000029e26 or 2.49999999999999981e-25 < y

    1. Initial program 47.7%

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

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

    if -3.20000000000000029e26 < y < -4.2999999999999997e-51 or 8.39999999999999977e-274 < y < 2.49999999999999981e-25

    1. Initial program 83.6%

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

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

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

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

    if -4.2999999999999997e-51 < y < -5.60000000000000002e-138

    1. Initial program 91.4%

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

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

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

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

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

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

    if -5.60000000000000002e-138 < y < -3.1000000000000001e-207

    1. Initial program 67.2%

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

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

    if -3.1000000000000001e-207 < y < 8.39999999999999977e-274

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot {\left(\frac{t + \color{blue}{\left(y + x\right)}}{y + x}\right)}^{-1} \]
    7. Applied egg-rr55.7%

      \[\leadsto z \cdot \color{blue}{{\left(\frac{t + \left(y + x\right)}{y + x}\right)}^{-1}} \]
    8. Step-by-step derivation
      1. unpow-155.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+26}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq -4.3 \cdot 10^{-51}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-138}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{-207}:\\ \;\;\;\;a\\ \mathbf{elif}\;y \leq 8.4 \cdot 10^{-274}:\\ \;\;\;\;z \cdot \frac{1}{\frac{t + \left(x + y\right)}{x + y}}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-25}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 60.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := z \cdot \left(x + y\right)\\ t_3 := y + \left(x + t\right)\\ t_4 := a \cdot \frac{y + t}{t\_3}\\ \mathbf{if}\;a \leq -1.2 \cdot 10^{+156}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;a \leq -3500000:\\ \;\;\;\;z \cdot \left(1 + \frac{y \cdot \left(a - b\right)}{t\_2}\right)\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-174}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 0.19:\\ \;\;\;\;\frac{t\_2 - y \cdot b}{t\_3}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+96}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- (+ z a) b))
        (t_2 (* z (+ x y)))
        (t_3 (+ y (+ x t)))
        (t_4 (* a (/ (+ y t) t_3))))
   (if (<= a -1.2e+156)
     t_4
     (if (<= a -3500000.0)
       (* z (+ 1.0 (/ (* y (- a b)) t_2)))
       (if (<= a -1.2e-174)
         t_1
         (if (<= a 0.19)
           (/ (- t_2 (* y b)) t_3)
           (if (<= a 1.5e+96) t_1 t_4)))))))
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);
	double t_3 = y + (x + t);
	double t_4 = a * ((y + t) / t_3);
	double tmp;
	if (a <= -1.2e+156) {
		tmp = t_4;
	} else if (a <= -3500000.0) {
		tmp = z * (1.0 + ((y * (a - b)) / t_2));
	} else if (a <= -1.2e-174) {
		tmp = t_1;
	} else if (a <= 0.19) {
		tmp = (t_2 - (y * b)) / t_3;
	} else if (a <= 1.5e+96) {
		tmp = t_1;
	} else {
		tmp = t_4;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = (z + a) - b
    t_2 = z * (x + y)
    t_3 = y + (x + t)
    t_4 = a * ((y + t) / t_3)
    if (a <= (-1.2d+156)) then
        tmp = t_4
    else if (a <= (-3500000.0d0)) then
        tmp = z * (1.0d0 + ((y * (a - b)) / t_2))
    else if (a <= (-1.2d-174)) then
        tmp = t_1
    else if (a <= 0.19d0) then
        tmp = (t_2 - (y * b)) / t_3
    else if (a <= 1.5d+96) then
        tmp = t_1
    else
        tmp = t_4
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double t_2 = z * (x + y);
	double t_3 = y + (x + t);
	double t_4 = a * ((y + t) / t_3);
	double tmp;
	if (a <= -1.2e+156) {
		tmp = t_4;
	} else if (a <= -3500000.0) {
		tmp = z * (1.0 + ((y * (a - b)) / t_2));
	} else if (a <= -1.2e-174) {
		tmp = t_1;
	} else if (a <= 0.19) {
		tmp = (t_2 - (y * b)) / t_3;
	} else if (a <= 1.5e+96) {
		tmp = t_1;
	} else {
		tmp = t_4;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + a) - b
	t_2 = z * (x + y)
	t_3 = y + (x + t)
	t_4 = a * ((y + t) / t_3)
	tmp = 0
	if a <= -1.2e+156:
		tmp = t_4
	elif a <= -3500000.0:
		tmp = z * (1.0 + ((y * (a - b)) / t_2))
	elif a <= -1.2e-174:
		tmp = t_1
	elif a <= 0.19:
		tmp = (t_2 - (y * b)) / t_3
	elif a <= 1.5e+96:
		tmp = t_1
	else:
		tmp = t_4
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z + a) - b)
	t_2 = Float64(z * Float64(x + y))
	t_3 = Float64(y + Float64(x + t))
	t_4 = Float64(a * Float64(Float64(y + t) / t_3))
	tmp = 0.0
	if (a <= -1.2e+156)
		tmp = t_4;
	elseif (a <= -3500000.0)
		tmp = Float64(z * Float64(1.0 + Float64(Float64(y * Float64(a - b)) / t_2)));
	elseif (a <= -1.2e-174)
		tmp = t_1;
	elseif (a <= 0.19)
		tmp = Float64(Float64(t_2 - Float64(y * b)) / t_3);
	elseif (a <= 1.5e+96)
		tmp = t_1;
	else
		tmp = t_4;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z + a) - b;
	t_2 = z * (x + y);
	t_3 = y + (x + t);
	t_4 = a * ((y + t) / t_3);
	tmp = 0.0;
	if (a <= -1.2e+156)
		tmp = t_4;
	elseif (a <= -3500000.0)
		tmp = z * (1.0 + ((y * (a - b)) / t_2));
	elseif (a <= -1.2e-174)
		tmp = t_1;
	elseif (a <= 0.19)
		tmp = (t_2 - (y * b)) / t_3;
	elseif (a <= 1.5e+96)
		tmp = t_1;
	else
		tmp = t_4;
	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[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(a * N[(N[(y + t), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.2e+156], t$95$4, If[LessEqual[a, -3500000.0], N[(z * N[(1.0 + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.2e-174], t$95$1, If[LessEqual[a, 0.19], N[(N[(t$95$2 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[a, 1.5e+96], t$95$1, t$95$4]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -3500000:\\
\;\;\;\;z \cdot \left(1 + \frac{y \cdot \left(a - b\right)}{t\_2}\right)\\

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

\mathbf{elif}\;a \leq 0.19:\\
\;\;\;\;\frac{t\_2 - y \cdot b}{t\_3}\\

\mathbf{elif}\;a \leq 1.5 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.2000000000000001e156 or 1.5e96 < a

    1. Initial program 37.5%

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

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

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

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

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

    if -1.2000000000000001e156 < a < -3.5e6

    1. Initial program 87.5%

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

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

        \[\leadsto \color{blue}{-z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)} \]
      2. distribute-rgt-neg-in95.7%

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

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

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

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

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

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

        \[\leadsto z \cdot \left(1 + \color{blue}{\frac{a \cdot y - b \cdot y}{z \cdot \left(x + y\right)}}\right) \]
      3. distribute-rgt-out--78.7%

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

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

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

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

    if -3.5e6 < a < -1.2e-174 or 0.19 < a < 1.5e96

    1. Initial program 59.1%

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

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

    if -1.2e-174 < a < 0.19

    1. Initial program 78.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.2 \cdot 10^{+156}:\\ \;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\ \mathbf{elif}\;a \leq -3500000:\\ \;\;\;\;z \cdot \left(1 + \frac{y \cdot \left(a - b\right)}{z \cdot \left(x + y\right)}\right)\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-174}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;a \leq 0.19:\\ \;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+96}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 67.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -8.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{t\_1}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.50000000000000022e26 or 5.6000000000000005e-20 < y

    1. Initial program 47.7%

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

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

    if -6.50000000000000022e26 < y < -8.60000000000000027e-44

    1. Initial program 76.1%

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

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

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

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

    if -8.60000000000000027e-44 < y < 1.65e-187

    1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(\frac{x}{x + t} + \frac{a}{z} \cdot \frac{t}{\color{blue}{x + t}}\right) \]
    11. Simplified79.4%

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

    if 1.65e-187 < y < 5.6000000000000005e-20

    1. Initial program 85.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{+26}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq -8.6 \cdot 10^{-44}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-187}:\\ \;\;\;\;z \cdot \left(\frac{x}{x + t} + \frac{a}{z} \cdot \frac{t}{x + t}\right)\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-20}:\\ \;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 59.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+135}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -3.99999999999999985e135

    1. Initial program 52.5%

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t}{t + x}} \]
      2. +-commutative60.1%

        \[\leadsto a \cdot \frac{t}{\color{blue}{x + t}} \]
    8. Simplified60.1%

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

    if -3.99999999999999985e135 < t < -2.0999999999999999e-116

    1. Initial program 60.9%

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

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

    if -2.0999999999999999e-116 < t < 6.79999999999999998e120

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(1 + \color{blue}{\frac{a \cdot y - b \cdot y}{z \cdot \left(x + y\right)}}\right) \]
      3. distribute-rgt-out--71.3%

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

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

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

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

    if 6.79999999999999998e120 < t

    1. Initial program 35.3%

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

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

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

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

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

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

Alternative 6: 46.1% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq -6.5 \cdot 10^{+31}:\\
\;\;\;\;a\\

\mathbf{elif}\;x \leq -4.2 \cdot 10^{-57}:\\
\;\;\;\;z\\

\mathbf{elif}\;x \leq 2.9 \cdot 10^{+119}:\\
\;\;\;\;a - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.2000000000000001e97 or -6.5000000000000004e31 < x < -4.1999999999999999e-57 or 2.90000000000000007e119 < x

    1. Initial program 54.0%

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

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

    if -2.2000000000000001e97 < x < -6.5000000000000004e31

    1. Initial program 47.5%

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

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

    if -4.1999999999999999e-57 < x < 2.90000000000000007e119

    1. Initial program 68.4%

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

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

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

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

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

Alternative 7: 58.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{+45} \lor \neg \left(x \leq 2.4 \cdot 10^{+123}\right):\\
\;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.9000000000000002e45 or 2.39999999999999989e123 < x

    1. Initial program 51.4%

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

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

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

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

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

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

    if -4.9000000000000002e45 < x < 2.39999999999999989e123

    1. Initial program 67.5%

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

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

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

Alternative 8: 58.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+107} \lor \neg \left(x \leq 3.7 \cdot 10^{+154}\right):\\
\;\;\;\;z - \frac{y \cdot b}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.39999999999999992e107 or 3.69999999999999994e154 < x

    1. Initial program 53.0%

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

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

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

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

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

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

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

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

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

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

    if -1.39999999999999992e107 < x < 3.69999999999999994e154

    1. Initial program 65.7%

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

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

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

Alternative 9: 57.6% accurate, 1.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.7500000000000001e135 or 4.8000000000000002e156 < x

    1. Initial program 57.4%

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

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

    if -1.7500000000000001e135 < x < 4.8000000000000002e156

    1. Initial program 63.8%

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

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

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

Alternative 10: 46.6% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+75} \lor \neg \left(z \leq 7.6 \cdot 10^{+142}\right):\\
\;\;\;\;z - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.0999999999999998e75 or 7.59999999999999979e142 < z

    1. Initial program 39.2%

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

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

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

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

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

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

    if -4.0999999999999998e75 < z < 7.59999999999999979e142

    1. Initial program 73.4%

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

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

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

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

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

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

Alternative 11: 43.1% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;z \leq 7.5 \cdot 10^{+142}:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.4000000000000006e76 or 7.5000000000000002e142 < z

    1. Initial program 39.2%

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

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

    if -9.4000000000000006e76 < z < 7.5000000000000002e142

    1. Initial program 73.4%

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

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

Alternative 12: 32.2% accurate, 21.0× speedup?

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

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

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

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

Developer target: 82.0% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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