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

Percentage Accurate: 61.1% → 88.7%
Time: 13.5s
Alternatives: 12
Speedup: 1.1×

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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 88.7% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+279}\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 5.0000000000000002e279 < (/.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.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 76.9%

      \[\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)) < 5.0000000000000002e279

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

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

Alternative 2: 62.3% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;t \leq 5.2 \cdot 10^{+156}:\\
\;\;\;\;z + a \cdot \frac{t}{x + t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.3999999999999999e61 or 5.20000000000000037e156 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3999999999999999e61 < t < 5.1999999999999995e-32

    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 64.5%

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

    if 5.1999999999999995e-32 < t < 5.20000000000000037e156

    1. Initial program 61.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 b around -inf 56.3%

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

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

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

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

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

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

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

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

        \[\leadsto a \cdot \frac{t}{x + t} + \color{blue}{x \cdot \frac{z}{t + x}} \]
      4. +-commutative72.4%

        \[\leadsto a \cdot \frac{t}{x + t} + x \cdot \frac{z}{\color{blue}{x + t}} \]
    8. Simplified72.4%

      \[\leadsto \color{blue}{a \cdot \frac{t}{x + t} + x \cdot \frac{z}{x + t}} \]
    9. Taylor expanded in x around inf 66.6%

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

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

Alternative 3: 71.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+43} \lor \neg \left(y \leq 7 \cdot 10^{-15}\right):\\
\;\;\;\;\left(z + a\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.70000000000000006e43 or 7.0000000000000001e-15 < y

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

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

    if -1.70000000000000006e43 < y < 7.0000000000000001e-15

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t}{t + x}} + \frac{x \cdot z}{t + x} \]
      2. +-commutative67.4%

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

        \[\leadsto a \cdot \frac{t}{x + t} + \color{blue}{x \cdot \frac{z}{t + x}} \]
      4. +-commutative72.6%

        \[\leadsto a \cdot \frac{t}{x + t} + x \cdot \frac{z}{\color{blue}{x + t}} \]
    8. Simplified72.6%

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

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

Alternative 4: 63.8% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq 2.9 \cdot 10^{-179}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+116}:\\
\;\;\;\;z + a \cdot \frac{t}{x + t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.50000000000000046e-166 or 7.5e116 < y

    1. Initial program 46.2%

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

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

    if -9.50000000000000046e-166 < y < 2.8999999999999999e-179

    1. Initial program 82.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 0 72.5%

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

    if 2.8999999999999999e-179 < y < 7.5e116

    1. Initial program 64.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 b around -inf 57.3%

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

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

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

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

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

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

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

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

        \[\leadsto a \cdot \frac{t}{x + t} + \color{blue}{x \cdot \frac{z}{t + x}} \]
      4. +-commutative66.3%

        \[\leadsto a \cdot \frac{t}{x + t} + x \cdot \frac{z}{\color{blue}{x + t}} \]
    8. Simplified66.3%

      \[\leadsto \color{blue}{a \cdot \frac{t}{x + t} + x \cdot \frac{z}{x + t}} \]
    9. Taylor expanded in x around inf 64.7%

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

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

Alternative 5: 66.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+77} \lor \neg \left(y \leq 6.2 \cdot 10^{+116}\right):\\
\;\;\;\;\left(z + a\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.7500000000000001e77 or 6.19999999999999992e116 < y

    1. Initial program 30.6%

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

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

    if -1.7500000000000001e77 < y < 6.19999999999999992e116

    1. Initial program 71.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 b around -inf 63.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t}{t + x}} + \frac{x \cdot z}{t + x} \]
      2. +-commutative63.8%

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

        \[\leadsto a \cdot \frac{t}{x + t} + \color{blue}{x \cdot \frac{z}{t + x}} \]
      4. +-commutative68.8%

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

      \[\leadsto \color{blue}{a \cdot \frac{t}{x + t} + x \cdot \frac{z}{x + t}} \]
    9. Taylor expanded in x around inf 60.2%

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

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

Alternative 6: 45.2% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;x \leq 5.2 \cdot 10^{-252}:\\
\;\;\;\;a\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.6000000000000005e99 or 4.9999999999999997e162 < x

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

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

    if -9.6000000000000005e99 < x < 5.1999999999999998e-252

    1. Initial program 62.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 49.5%

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

    if 5.1999999999999998e-252 < x < 4.9999999999999997e162

    1. Initial program 63.0%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 46.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. +-commutative46.8%

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

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

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

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

Alternative 7: 59.4% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.62 \cdot 10^{+156} \lor \neg \left(t \leq 4.1 \cdot 10^{+120}\right):\\
\;\;\;\;a \cdot \frac{t}{x + t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.62000000000000006e156 or 4.1e120 < t

    1. Initial program 48.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 41.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. +-commutative41.5%

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

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

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

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

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

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

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

    if -1.62000000000000006e156 < t < 4.1e120

    1. Initial program 63.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 62.0%

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

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

Alternative 8: 59.1% accurate, 1.2× speedup?

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

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

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

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


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

    1. Initial program 51.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1000000000000001e60 < t < 9.99999999999999944e118

    1. Initial program 63.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 62.7%

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

    if 9.99999999999999944e118 < t

    1. Initial program 49.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 z around 0 41.7%

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

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

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

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

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

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

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

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

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

Alternative 9: 58.4% accurate, 1.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.1000000000000002e165 or 1.16000000000000003e120 < t

    1. Initial program 48.6%

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

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

    if -3.1000000000000002e165 < t < 1.16000000000000003e120

    1. Initial program 63.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 62.0%

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

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

Alternative 10: 47.4% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;t \leq 4.2 \cdot 10^{+64}:\\
\;\;\;\;z - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.00000000000000023e63 or 4.2000000000000001e64 < t

    1. Initial program 52.7%

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

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

    if -4.00000000000000023e63 < t < 4.2000000000000001e64

    1. Initial program 63.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 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 y around inf 50.7%

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

Alternative 11: 44.3% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;x \leq 4.2 \cdot 10^{+47}:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.34999999999999997e97 or 4.2e47 < x

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

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

    if -1.34999999999999997e97 < x < 4.2e47

    1. Initial program 65.0%

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

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

Alternative 12: 32.1% 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 58.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 t around inf 35.9%

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

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

  :alt
  (! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b))))

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