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

Percentage Accurate: 59.5% → 86.0%
Time: 12.1s
Alternatives: 14
Speedup: 1.2×

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 14 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.5% 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: 86.0% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+267}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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.9999999999999999e267

    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

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

    1. Initial program 8.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 inf 79.0%

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

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

Alternative 2: 87.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+302} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+267}\right):\\
\;\;\;\;\left(z + a\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.0000000000000002e302 or 4.9999999999999999e267 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 9.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 76.5%

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

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

    1. Initial program 99.7%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification90.4%

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

Alternative 3: 59.2% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -7.4999999999999995e76 or 4.1000000000000001e114 < a

    1. Initial program 43.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 inf 32.2%

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

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

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

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

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

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

    if -7.4999999999999995e76 < a < -4.9000000000000002e-8

    1. Initial program 40.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 81.6%

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

    if -4.9000000000000002e-8 < a < 1.55e6

    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 0 67.5%

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

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

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

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

    if 1.55e6 < a < 4.1000000000000001e114

    1. Initial program 80.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 74.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.5 \cdot 10^{+76}:\\ \;\;\;\;a \cdot \frac{y + t}{x + \left(y + t\right)}\\ \mathbf{elif}\;a \leq -4.9 \cdot 10^{-8}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;a \leq 1550000:\\ \;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{elif}\;a \leq 4.1 \cdot 10^{+114}:\\ \;\;\;\;\frac{a \cdot \left(y + t\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{y + t}{x + \left(y + t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 62.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := \frac{y \cdot t\_1}{y + \left(x + t\right)}\\ \mathbf{if}\;y \leq -2 \cdot 10^{+86}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-85}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-84}:\\ \;\;\;\;z \cdot \left(\frac{x}{x + \left(y + t\right)} + \frac{a}{z}\right)\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+56}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- (+ z a) b)) (t_2 (/ (* y t_1) (+ y (+ x t)))))
   (if (<= y -2e+86)
     t_1
     (if (<= y -5.5e-85)
       t_2
       (if (<= y 4.2e-84)
         (* z (+ (/ x (+ x (+ y t))) (/ a z)))
         (if (<= y 6.6e+56) t_2 t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double t_2 = (y * t_1) / (y + (x + t));
	double tmp;
	if (y <= -2e+86) {
		tmp = t_1;
	} else if (y <= -5.5e-85) {
		tmp = t_2;
	} else if (y <= 4.2e-84) {
		tmp = z * ((x / (x + (y + t))) + (a / z));
	} else if (y <= 6.6e+56) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = (z + a) - b
    t_2 = (y * t_1) / (y + (x + t))
    if (y <= (-2d+86)) then
        tmp = t_1
    else if (y <= (-5.5d-85)) then
        tmp = t_2
    else if (y <= 4.2d-84) then
        tmp = z * ((x / (x + (y + t))) + (a / z))
    else if (y <= 6.6d+56) then
        tmp = t_2
    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 t_2 = (y * t_1) / (y + (x + t));
	double tmp;
	if (y <= -2e+86) {
		tmp = t_1;
	} else if (y <= -5.5e-85) {
		tmp = t_2;
	} else if (y <= 4.2e-84) {
		tmp = z * ((x / (x + (y + t))) + (a / z));
	} else if (y <= 6.6e+56) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + a) - b
	t_2 = (y * t_1) / (y + (x + t))
	tmp = 0
	if y <= -2e+86:
		tmp = t_1
	elif y <= -5.5e-85:
		tmp = t_2
	elif y <= 4.2e-84:
		tmp = z * ((x / (x + (y + t))) + (a / z))
	elif y <= 6.6e+56:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z + a) - b)
	t_2 = Float64(Float64(y * t_1) / Float64(y + Float64(x + t)))
	tmp = 0.0
	if (y <= -2e+86)
		tmp = t_1;
	elseif (y <= -5.5e-85)
		tmp = t_2;
	elseif (y <= 4.2e-84)
		tmp = Float64(z * Float64(Float64(x / Float64(x + Float64(y + t))) + Float64(a / z)));
	elseif (y <= 6.6e+56)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z + a) - b;
	t_2 = (y * t_1) / (y + (x + t));
	tmp = 0.0;
	if (y <= -2e+86)
		tmp = t_1;
	elseif (y <= -5.5e-85)
		tmp = t_2;
	elseif (y <= 4.2e-84)
		tmp = z * ((x / (x + (y + t))) + (a / z));
	elseif (y <= 6.6e+56)
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(N[(y * t$95$1), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+86], t$95$1, If[LessEqual[y, -5.5e-85], t$95$2, If[LessEqual[y, 4.2e-84], N[(z * N[(N[(x / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+56], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -5.5 \cdot 10^{-85}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;y \leq 6.6 \cdot 10^{+56}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2e86 or 6.60000000000000004e56 < y

    1. Initial program 36.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 81.8%

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

    if -2e86 < y < -5.4999999999999997e-85 or 4.19999999999999996e-84 < y < 6.60000000000000004e56

    1. Initial program 81.6%

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

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

    if -5.4999999999999997e-85 < y < 4.19999999999999996e-84

    1. Initial program 73.6%

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

      \[\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+73.1%

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

        \[\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+73.1%

        \[\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) \]
    5. Simplified80.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+86}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-85}:\\ \;\;\;\;\frac{y \cdot \left(\left(z + a\right) - b\right)}{y + \left(x + t\right)}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-84}:\\ \;\;\;\;z \cdot \left(\frac{x}{x + \left(y + t\right)} + \frac{a}{z}\right)\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+56}:\\ \;\;\;\;\frac{y \cdot \left(\left(z + a\right) - b\right)}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 63.5% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.64999999999999986e-85 or 2.04999999999999995e-69 < y

    1. Initial program 55.7%

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

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

    if -1.64999999999999986e-85 < y < 5.19999999999999979e-288

    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 z around inf 74.0%

      \[\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+74.0%

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

        \[\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+74.0%

        \[\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) \]
    5. Simplified83.8%

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

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

    if 5.19999999999999979e-288 < y < 2.04999999999999995e-69

    1. Initial program 78.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 0 63.7%

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

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

Alternative 6: 63.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-170} \lor \neg \left(y \leq 4.4 \cdot 10^{-68}\right):\\
\;\;\;\;\left(z + a\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.54999999999999993e-170 or 4.40000000000000005e-68 < y

    1. Initial program 56.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 67.0%

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

    if -1.54999999999999993e-170 < y < 4.40000000000000005e-68

    1. Initial program 78.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 0 68.6%

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

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

Alternative 7: 62.1% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.5999999999999998e24 or 3.70000000000000004e112 < x

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5999999999999998e24 < x < 3.70000000000000004e112

    1. Initial program 67.4%

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

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

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

Alternative 8: 57.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
\mathbf{if}\;a \leq -3.2 \cdot 10^{+16} \lor \neg \left(a \leq 13000000000\right):\\
\;\;\;\;a \cdot \frac{y + t}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.2e16 or 1.3e10 < a

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

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

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

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

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

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

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

    if -3.2e16 < a < 1.3e10

    1. Initial program 77.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 inf 44.9%

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

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

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

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

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

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

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

Alternative 9: 59.8% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+25} \lor \neg \left(x \leq 5.9 \cdot 10^{+109}\right):\\
\;\;\;\;z - b \cdot \frac{y}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.69999999999999992e25 or 5.8999999999999997e109 < x

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.69999999999999992e25 < x < 5.8999999999999997e109

    1. Initial program 67.4%

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

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

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

Alternative 10: 60.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+144} \lor \neg \left(x \leq 4.4 \cdot 10^{+118}\right):\\
\;\;\;\;z + y \cdot \frac{a}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.19999999999999993e144 or 4.39999999999999972e118 < x

    1. Initial program 58.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.19999999999999993e144 < x < 4.39999999999999972e118

    1. Initial program 65.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 65.2%

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

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

Alternative 11: 45.0% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.05 \cdot 10^{+17}:\\
\;\;\;\;a\\

\mathbf{elif}\;a \leq 950000000000:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.05e17

    1. Initial program 53.3%

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

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

    if -1.05e17 < a < 9.5e11

    1. Initial program 77.0%

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

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

    if 9.5e11 < a

    1. Initial program 49.1%

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

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

        \[\leadsto \frac{a \cdot \left(y + t\right) - \color{blue}{y \cdot b}}{\left(x + t\right) + y} \]
    5. Simplified45.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 inf 57.6%

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

Alternative 12: 44.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{+16}:\\
\;\;\;\;a\\

\mathbf{elif}\;a \leq 5100000:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.6e16 or 5.1e6 < a

    1. Initial program 51.1%

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

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

    if -5.6e16 < a < 5.1e6

    1. Initial program 77.0%

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

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

Alternative 13: 56.7% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 58.4%

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

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

    if -1.7999999999999999e77 < x

    1. Initial program 64.5%

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

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

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

Alternative 14: 32.8% accurate, 21.0× speedup?

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

\\
a
\end{array}
Derivation
  1. Initial program 63.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 33.2%

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

Developer Target 1: 81.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 2024157 
(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)))