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

Percentage Accurate: 59.9% → 90.7%
Time: 10.7s
Alternatives: 13
Speedup: 0.8×

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 13 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: 59.9% 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: 90.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + \left(x + t\right)\\ t_2 := t + \left(x + y\right)\\ \mathbf{if}\;z \leq -29000000000000 \lor \neg \left(z \leq 6 \cdot 10^{+151}\right):\\ \;\;\;\;z \cdot \left(\frac{x}{t\_1} + \left(\mathsf{fma}\left(\frac{a}{z}, \frac{y + t}{t\_1}, \frac{y}{t\_1}\right) - \frac{b}{t\_1} \cdot \frac{y}{z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\frac{t}{t\_2} + \left(\left(\frac{y}{t\_2} + \frac{z}{a} \cdot \frac{x + y}{t\_2}\right) - b \cdot \frac{y}{a \cdot t\_2}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (+ x t))) (t_2 (+ t (+ x y))))
   (if (or (<= z -29000000000000.0) (not (<= z 6e+151)))
     (*
      z
      (+
       (/ x t_1)
       (- (fma (/ a z) (/ (+ y t) t_1) (/ y t_1)) (* (/ b t_1) (/ y z)))))
     (*
      a
      (+
       (/ t t_2)
       (- (+ (/ y t_2) (* (/ z a) (/ (+ x y) t_2))) (* b (/ y (* a 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 = t + (x + y);
	double tmp;
	if ((z <= -29000000000000.0) || !(z <= 6e+151)) {
		tmp = z * ((x / t_1) + (fma((a / z), ((y + t) / t_1), (y / t_1)) - ((b / t_1) * (y / z))));
	} else {
		tmp = a * ((t / t_2) + (((y / t_2) + ((z / a) * ((x + y) / t_2))) - (b * (y / (a * t_2)))));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(x + t))
	t_2 = Float64(t + Float64(x + y))
	tmp = 0.0
	if ((z <= -29000000000000.0) || !(z <= 6e+151))
		tmp = Float64(z * Float64(Float64(x / t_1) + Float64(fma(Float64(a / z), Float64(Float64(y + t) / t_1), Float64(y / t_1)) - Float64(Float64(b / t_1) * Float64(y / z)))));
	else
		tmp = Float64(a * Float64(Float64(t / t_2) + Float64(Float64(Float64(y / t_2) + Float64(Float64(z / a) * Float64(Float64(x + y) / t_2))) - Float64(b * Float64(y / Float64(a * t_2))))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -29000000000000.0], N[Not[LessEqual[z, 6e+151]], $MachinePrecision]], N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(N[(N[(a / z), $MachinePrecision] * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(b / t$95$1), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t / t$95$2), $MachinePrecision] + N[(N[(N[(y / t$95$2), $MachinePrecision] + N[(N[(z / a), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / N[(a * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := t + \left(x + y\right)\\
\mathbf{if}\;z \leq -29000000000000 \lor \neg \left(z \leq 6 \cdot 10^{+151}\right):\\
\;\;\;\;z \cdot \left(\frac{x}{t\_1} + \left(\mathsf{fma}\left(\frac{a}{z}, \frac{y + t}{t\_1}, \frac{y}{t\_1}\right) - \frac{b}{t\_1} \cdot \frac{y}{z}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9e13 or 5.9999999999999998e151 < z

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

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

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

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

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

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

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

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

    if -2.9e13 < z < 5.9999999999999998e151

    1. Initial program 73.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 85.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 87.9% accurate, 0.3× speedup?

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

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

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


\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 4.00000000000000025e290 < (/.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.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 y around inf 72.8%

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

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

    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. Taylor expanded in b around 0 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.0% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\left(a \cdot \left(y + t\right) + 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 4 \cdot 10^{+290}\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 4.00000000000000025e290 < (/.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.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 y around inf 72.8%

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

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

    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 simplification88.8%

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

Alternative 4: 82.2% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.5000000000000003e151

    1. Initial program 18.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 85.2%

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

    if -3.5000000000000003e151 < z < 8.4999999999999998e157

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

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

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

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

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

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

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

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

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

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

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

    if 8.4999999999999998e157 < z

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

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

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

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

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

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

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

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

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

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

Alternative 5: 61.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t \cdot a + z \cdot x}{x + t}\\ t_2 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -9.5 \cdot 10^{-39}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-209}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-110}:\\ \;\;\;\;a \cdot \left(\frac{z}{a} + t \cdot \frac{1}{x + t}\right)\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{-44} \lor \neg \left(y \leq 10^{+72}\right):\\ \;\;\;\;t\_2\\ \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
 (let* ((t_1 (/ (+ (* t a) (* z x)) (+ x t))) (t_2 (- (+ z a) b)))
   (if (<= y -9.5e-39)
     t_2
     (if (<= y -1.4e-209)
       t_1
       (if (<= y 1.65e-110)
         (* a (+ (/ z a) (* t (/ 1.0 (+ x t)))))
         (if (<= y 7.5e-82)
           t_1
           (if (or (<= y 9.8e-44) (not (<= y 1e+72)))
             t_2
             (* a (/ (+ y t) (+ y (+ x t)))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((t * a) + (z * x)) / (x + t);
	double t_2 = (z + a) - b;
	double tmp;
	if (y <= -9.5e-39) {
		tmp = t_2;
	} else if (y <= -1.4e-209) {
		tmp = t_1;
	} else if (y <= 1.65e-110) {
		tmp = a * ((z / a) + (t * (1.0 / (x + t))));
	} else if (y <= 7.5e-82) {
		tmp = t_1;
	} else if ((y <= 9.8e-44) || !(y <= 1e+72)) {
		tmp = t_2;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((t * a) + (z * x)) / (x + t)
    t_2 = (z + a) - b
    if (y <= (-9.5d-39)) then
        tmp = t_2
    else if (y <= (-1.4d-209)) then
        tmp = t_1
    else if (y <= 1.65d-110) then
        tmp = a * ((z / a) + (t * (1.0d0 / (x + t))))
    else if (y <= 7.5d-82) then
        tmp = t_1
    else if ((y <= 9.8d-44) .or. (.not. (y <= 1d+72))) then
        tmp = t_2
    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 t_1 = ((t * a) + (z * x)) / (x + t);
	double t_2 = (z + a) - b;
	double tmp;
	if (y <= -9.5e-39) {
		tmp = t_2;
	} else if (y <= -1.4e-209) {
		tmp = t_1;
	} else if (y <= 1.65e-110) {
		tmp = a * ((z / a) + (t * (1.0 / (x + t))));
	} else if (y <= 7.5e-82) {
		tmp = t_1;
	} else if ((y <= 9.8e-44) || !(y <= 1e+72)) {
		tmp = t_2;
	} else {
		tmp = a * ((y + t) / (y + (x + t)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((t * a) + (z * x)) / (x + t)
	t_2 = (z + a) - b
	tmp = 0
	if y <= -9.5e-39:
		tmp = t_2
	elif y <= -1.4e-209:
		tmp = t_1
	elif y <= 1.65e-110:
		tmp = a * ((z / a) + (t * (1.0 / (x + t))))
	elif y <= 7.5e-82:
		tmp = t_1
	elif (y <= 9.8e-44) or not (y <= 1e+72):
		tmp = t_2
	else:
		tmp = a * ((y + t) / (y + (x + t)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(t * a) + Float64(z * x)) / Float64(x + t))
	t_2 = Float64(Float64(z + a) - b)
	tmp = 0.0
	if (y <= -9.5e-39)
		tmp = t_2;
	elseif (y <= -1.4e-209)
		tmp = t_1;
	elseif (y <= 1.65e-110)
		tmp = Float64(a * Float64(Float64(z / a) + Float64(t * Float64(1.0 / Float64(x + t)))));
	elseif (y <= 7.5e-82)
		tmp = t_1;
	elseif ((y <= 9.8e-44) || !(y <= 1e+72))
		tmp = t_2;
	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)
	t_1 = ((t * a) + (z * x)) / (x + t);
	t_2 = (z + a) - b;
	tmp = 0.0;
	if (y <= -9.5e-39)
		tmp = t_2;
	elseif (y <= -1.4e-209)
		tmp = t_1;
	elseif (y <= 1.65e-110)
		tmp = a * ((z / a) + (t * (1.0 / (x + t))));
	elseif (y <= 7.5e-82)
		tmp = t_1;
	elseif ((y <= 9.8e-44) || ~((y <= 1e+72)))
		tmp = t_2;
	else
		tmp = a * ((y + t) / (y + (x + t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -9.5e-39], t$95$2, If[LessEqual[y, -1.4e-209], t$95$1, If[LessEqual[y, 1.65e-110], N[(a * N[(N[(z / a), $MachinePrecision] + N[(t * N[(1.0 / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e-82], t$95$1, If[Or[LessEqual[y, 9.8e-44], N[Not[LessEqual[y, 1e+72]], $MachinePrecision]], t$95$2, N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.4 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 7.5 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 9.8 \cdot 10^{-44} \lor \neg \left(y \leq 10^{+72}\right):\\
\;\;\;\;t\_2\\

\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 y < -9.4999999999999999e-39 or 7.4999999999999997e-82 < y < 9.8000000000000006e-44 or 9.99999999999999944e71 < y

    1. Initial program 45.2%

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

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

    if -9.4999999999999999e-39 < y < -1.40000000000000006e-209 or 1.65e-110 < y < 7.4999999999999997e-82

    1. Initial program 86.0%

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

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

    if -1.40000000000000006e-209 < y < 1.65e-110

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto a \cdot \left(t \cdot \frac{1}{\color{blue}{x + t}} + x \cdot \frac{\frac{z}{a}}{t + x}\right) \]
    10. Applied egg-rr79.9%

      \[\leadsto a \cdot \left(\color{blue}{t \cdot \frac{1}{x + t}} + x \cdot \frac{\frac{z}{a}}{t + x}\right) \]
    11. Taylor expanded in x around inf 80.5%

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

    if 9.8000000000000006e-44 < y < 9.99999999999999944e71

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{-39}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-209}:\\ \;\;\;\;\frac{t \cdot a + z \cdot x}{x + t}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-110}:\\ \;\;\;\;a \cdot \left(\frac{z}{a} + t \cdot \frac{1}{x + t}\right)\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-82}:\\ \;\;\;\;\frac{t \cdot a + z \cdot x}{x + t}\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{-44} \lor \neg \left(y \leq 10^{+72}\right):\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 62.4% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq 3 \cdot 10^{-43} \lor \neg \left(y \leq 9.5 \cdot 10^{+79}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.40000000000000002e-39 or 9.50000000000000051e-83 < y < 3.00000000000000003e-43 or 9.49999999999999994e79 < y

    1. Initial program 45.2%

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

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

    if -4.40000000000000002e-39 < y < 9.50000000000000051e-83

    1. Initial program 76.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 0 65.6%

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

    if 3.00000000000000003e-43 < y < 9.49999999999999994e79

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{-39}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-83}:\\ \;\;\;\;\frac{t \cdot a + z \cdot x}{x + t}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-43} \lor \neg \left(y \leq 9.5 \cdot 10^{+79}\right):\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+55} \lor \neg \left(y \leq 0.00021\right):\\
\;\;\;\;\left(z + a\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.6e55 or 2.1000000000000001e-4 < y

    1. Initial program 46.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 75.1%

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

    if -2.6e55 < y < 2.1000000000000001e-4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 56.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.0105 \lor \neg \left(t \leq 490000\right):\\ \;\;\;\;a \cdot \frac{y + t}{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 (<= t -0.0105) (not (<= t 490000.0)))
   (* a (/ (+ y t) (+ y (+ x t))))
   (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((t <= -0.0105) || !(t <= 490000.0)) {
		tmp = a * ((y + t) / (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 ((t <= (-0.0105d0)) .or. (.not. (t <= 490000.0d0))) then
        tmp = a * ((y + t) / (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 ((t <= -0.0105) || !(t <= 490000.0)) {
		tmp = a * ((y + t) / (y + (x + t)));
	} else {
		tmp = (z + a) - b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (t <= -0.0105) or not (t <= 490000.0):
		tmp = a * ((y + t) / (y + (x + t)))
	else:
		tmp = (z + a) - b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((t <= -0.0105) || !(t <= 490000.0))
		tmp = Float64(a * Float64(Float64(y + t) / 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 ((t <= -0.0105) || ~((t <= 490000.0)))
		tmp = a * ((y + t) / (y + (x + t)));
	else
		tmp = (z + a) - b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -0.0105], N[Not[LessEqual[t, 490000.0]], $MachinePrecision]], N[(a * N[(N[(y + t), $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}\;t \leq -0.0105 \lor \neg \left(t \leq 490000\right):\\
\;\;\;\;a \cdot \frac{y + t}{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 t < -0.0105000000000000007 or 4.9e5 < t

    1. Initial program 55.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 38.0%

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

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

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

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

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

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

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

    if -0.0105000000000000007 < t < 4.9e5

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

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

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

Alternative 9: 59.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 55.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 0 49.7%

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

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

    if -5.40000000000000018e138 < t < 4.9e5

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

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

    if 4.9e5 < t

    1. Initial program 59.0%

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

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

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

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

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

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

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

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

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

Alternative 10: 57.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.9 \cdot 10^{+139} \lor \neg \left(t \leq 490000\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 -2.9e+139) (not (<= t 490000.0)))
   (* 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 <= -2.9e+139) || !(t <= 490000.0)) {
		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 <= (-2.9d+139)) .or. (.not. (t <= 490000.0d0))) 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 <= -2.9e+139) || !(t <= 490000.0)) {
		tmp = a * (t / (x + t));
	} else {
		tmp = (z + a) - b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (t <= -2.9e+139) or not (t <= 490000.0):
		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 <= -2.9e+139) || !(t <= 490000.0))
		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 <= -2.9e+139) || ~((t <= 490000.0)))
		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, -2.9e+139], N[Not[LessEqual[t, 490000.0]], $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 -2.9 \cdot 10^{+139} \lor \neg \left(t \leq 490000\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 < -2.8999999999999999e139 or 4.9e5 < t

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{t}{t + x}} \]
    6. Simplified65.3%

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

    if -2.8999999999999999e139 < t < 4.9e5

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

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

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

Alternative 11: 58.1% accurate, 1.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.8999999999999999e139 or 9.00000000000000016e147 < t

    1. Initial program 57.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 66.5%

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

    if -2.8999999999999999e139 < t < 9.00000000000000016e147

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

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

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

Alternative 12: 43.6% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.6e52 or 5.20000000000000019e-65 < x

    1. Initial program 51.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 47.8%

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

    if -1.6e52 < x < 5.20000000000000019e-65

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

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

Alternative 13: 31.0% accurate, 21.0× speedup?

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

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

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

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

Developer target: 81.8% 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 2024108 
(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)))