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

Percentage Accurate: 59.8% → 88.2%
Time: 13.6s
Alternatives: 11
Speedup: 1.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 88.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x + y\right)\\ t_2 := \frac{\left(\left(y + t\right) \cdot a + t_1\right) - y \cdot b}{y + \left(x + t\right)}\\ t_3 := t + \left(x + y\right)\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;a \cdot \left(\frac{y}{t_3} + \frac{t}{t_3}\right) + \frac{x}{\frac{x + t}{z}}\\ \mathbf{elif}\;t_2 \leq 10^{+287}:\\ \;\;\;\;\frac{a}{\frac{t_3}{y + t}} + \frac{t_1 - y \cdot b}{t_3}\\ \mathbf{else}:\\ \;\;\;\;z + \frac{y}{\frac{x + y}{a - b}}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (+ x y)))
        (t_2 (/ (- (+ (* (+ y t) a) t_1) (* y b)) (+ y (+ x t))))
        (t_3 (+ t (+ x y))))
   (if (<= t_2 (- INFINITY))
     (+ (* a (+ (/ y t_3) (/ t t_3))) (/ x (/ (+ x t) z)))
     (if (<= t_2 1e+287)
       (+ (/ a (/ t_3 (+ y t))) (/ (- t_1 (* y b)) t_3))
       (+ z (/ y (/ (+ x y) (- a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (x + y);
	double t_2 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t));
	double t_3 = t + (x + y);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = (a * ((y / t_3) + (t / t_3))) + (x / ((x + t) / z));
	} else if (t_2 <= 1e+287) {
		tmp = (a / (t_3 / (y + t))) + ((t_1 - (y * b)) / t_3);
	} else {
		tmp = z + (y / ((x + y) / (a - b)));
	}
	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 + t) * a) + t_1) - (y * b)) / (y + (x + t));
	double t_3 = t + (x + y);
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = (a * ((y / t_3) + (t / t_3))) + (x / ((x + t) / z));
	} else if (t_2 <= 1e+287) {
		tmp = (a / (t_3 / (y + t))) + ((t_1 - (y * b)) / t_3);
	} else {
		tmp = z + (y / ((x + y) / (a - b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = z * (x + y)
	t_2 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t))
	t_3 = t + (x + y)
	tmp = 0
	if t_2 <= -math.inf:
		tmp = (a * ((y / t_3) + (t / t_3))) + (x / ((x + t) / z))
	elif t_2 <= 1e+287:
		tmp = (a / (t_3 / (y + t))) + ((t_1 - (y * b)) / t_3)
	else:
		tmp = z + (y / ((x + y) / (a - b)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(z * Float64(x + y))
	t_2 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + t_1) - Float64(y * b)) / Float64(y + Float64(x + t)))
	t_3 = Float64(t + Float64(x + y))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(Float64(a * Float64(Float64(y / t_3) + Float64(t / t_3))) + Float64(x / Float64(Float64(x + t) / z)));
	elseif (t_2 <= 1e+287)
		tmp = Float64(Float64(a / Float64(t_3 / Float64(y + t))) + Float64(Float64(t_1 - Float64(y * b)) / t_3));
	else
		tmp = Float64(z + Float64(y / Float64(Float64(x + y) / Float64(a - b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = z * (x + y);
	t_2 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t));
	t_3 = t + (x + y);
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = (a * ((y / t_3) + (t / t_3))) + (x / ((x + t) / z));
	elseif (t_2 <= 1e+287)
		tmp = (a / (t_3 / (y + t))) + ((t_1 - (y * b)) / t_3);
	else
		tmp = z + (y / ((x + y) / (a - b)));
	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[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(a * N[(N[(y / t$95$3), $MachinePrecision] + N[(t / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(N[(x + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+287], N[(N[(a / N[(t$95$3 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], N[(z + N[(y / N[(N[(x + y), $MachinePrecision] / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_2 \leq 10^{+287}:\\
\;\;\;\;\frac{a}{\frac{t_3}{y + t}} + \frac{t_1 - y \cdot b}{t_3}\\

\mathbf{else}:\\
\;\;\;\;z + \frac{y}{\frac{x + y}{a - 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. Taylor expanded in a around 0 45.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.7%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Taylor expanded in z around inf 99.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) - \frac{b \cdot y}{t + \left(x + y\right)}} \]
    3. Step-by-step derivation
      1. 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)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      2. associate-/l*99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z + \color{blue}{\frac{y}{\frac{x + y}{a - b}}} \]
      2. +-commutative79.8%

        \[\leadsto z + \frac{y}{\frac{\color{blue}{y + x}}{a - b}} \]
    7. Simplified79.8%

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

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

Alternative 2: 88.9% accurate, 0.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z + \color{blue}{\frac{y}{\frac{x + y}{a - b}}} \]
      2. +-commutative77.0%

        \[\leadsto z + \frac{y}{\frac{\color{blue}{y + x}}{a - b}} \]
    7. Simplified77.0%

      \[\leadsto \color{blue}{z + \frac{y}{\frac{y + x}{a - 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)) < 1.0000000000000001e287

    1. Initial program 99.7%

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

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

Alternative 3: 88.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_1 \leq 10^{+287}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;z + \frac{y}{\frac{x + y}{a - 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. Taylor expanded in a around 0 45.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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} \]

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z + \color{blue}{\frac{y}{\frac{x + y}{a - b}}} \]
      2. +-commutative79.8%

        \[\leadsto z + \frac{y}{\frac{\color{blue}{y + x}}{a - b}} \]
    7. Simplified79.8%

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

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

Alternative 4: 73.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := a + \frac{x}{\frac{x + t}{z}}\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+51}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 5.8 \cdot 10^{+149} \lor \neg \left(t \leq 1.02 \cdot 10^{+245}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.2000000000000002e51 or 2.00000000000000006e40 < t < 5.8000000000000004e149 or 1.01999999999999997e245 < t

    1. Initial program 53.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2000000000000002e51 < t < 2.00000000000000006e40

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z + \color{blue}{\frac{y}{\frac{x + y}{a - b}}} \]
      2. +-commutative84.5%

        \[\leadsto z + \frac{y}{\frac{\color{blue}{y + x}}{a - b}} \]
    7. Simplified84.5%

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

    if 5.8000000000000004e149 < t < 1.01999999999999997e245

    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. Taylor expanded in t around inf 42.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{+51}:\\ \;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+40}:\\ \;\;\;\;z + \frac{y}{\frac{x + y}{a - b}}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+149} \lor \neg \left(t \leq 1.02 \cdot 10^{+245}\right):\\ \;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\ \mathbf{else}:\\ \;\;\;\;a + \left(\frac{y}{\frac{t}{z}} - \frac{b}{\frac{t}{y}}\right)\\ \end{array} \]

Alternative 5: 61.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := a + \frac{x}{\frac{x + t}{z}}\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+37}:\\
\;\;\;\;z + \frac{y}{\frac{x}{a - b}}\\

\mathbf{elif}\;x \leq -7.5 \cdot 10^{-192}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 5.1 \cdot 10^{+135}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -6.4999999999999998e37

    1. Initial program 49.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z + \color{blue}{\frac{y}{\frac{x}{a - b}}} \]
    7. Simplified62.6%

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

    if -6.4999999999999998e37 < x < -7.5000000000000001e-192 or 2.8999999999999999e-58 < x < 5.09999999999999982e135

    1. Initial program 61.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5000000000000001e-192 < x < 2.8999999999999999e-58

    1. Initial program 62.4%

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

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

    if 5.09999999999999982e135 < x

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+37}:\\ \;\;\;\;z + \frac{y}{\frac{x}{a - b}}\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{-192}:\\ \;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{-58}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;x \leq 5.1 \cdot 10^{+135}:\\ \;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\ \mathbf{else}:\\ \;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\ \end{array} \]

Alternative 6: 61.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := a + \frac{x}{\frac{x + t}{z}}\\
t_2 := z + \frac{y}{\frac{x}{a - b}}\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+37}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq -4.4 \cdot 10^{-191}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 9.2 \cdot 10^{+134}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.4999999999999998e37 or 9.1999999999999992e134 < x

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z + \color{blue}{\frac{y}{\frac{x}{a - b}}} \]
    7. Simplified71.4%

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

    if -6.4999999999999998e37 < x < -4.39999999999999996e-191 or 1e-58 < x < 9.1999999999999992e134

    1. Initial program 61.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.39999999999999996e-191 < x < 1e-58

    1. Initial program 62.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+37}:\\ \;\;\;\;z + \frac{y}{\frac{x}{a - b}}\\ \mathbf{elif}\;x \leq -4.4 \cdot 10^{-191}:\\ \;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\ \mathbf{elif}\;x \leq 10^{-58}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{+134}:\\ \;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\ \mathbf{else}:\\ \;\;\;\;z + \frac{y}{\frac{x}{a - b}}\\ \end{array} \]

Alternative 7: 73.9% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+51} \lor \neg \left(t \leq 6.5 \cdot 10^{+39}\right):\\
\;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\

\mathbf{else}:\\
\;\;\;\;z + \frac{y}{\frac{x + y}{a - b}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.19999999999999992e51 or 6.5000000000000001e39 < t

    1. Initial program 51.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. Taylor expanded in a around 0 75.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.19999999999999992e51 < t < 6.5000000000000001e39

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z + \color{blue}{\frac{y}{\frac{x + y}{a - b}}} \]
      2. +-commutative84.5%

        \[\leadsto z + \frac{y}{\frac{\color{blue}{y + x}}{a - b}} \]
    7. Simplified84.5%

      \[\leadsto \color{blue}{z + \frac{y}{\frac{y + x}{a - b}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification79.0%

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

Alternative 8: 61.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{-141} \lor \neg \left(t \leq 2.9 \cdot 10^{+38}\right):\\
\;\;\;\;a + \frac{x}{\frac{x + t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.8000000000000002e-141 or 2.90000000000000007e38 < t

    1. Initial program 56.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8000000000000002e-141 < t < 2.90000000000000007e38

    1. Initial program 59.9%

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

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

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

Alternative 9: 43.1% accurate, 2.3× speedup?

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

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

\mathbf{elif}\;x \leq 165000:\\
\;\;\;\;a\\

\mathbf{elif}\;x \leq 2.3 \cdot 10^{+40}:\\
\;\;\;\;z\\

\mathbf{elif}\;x \leq 1.8 \cdot 10^{+162}:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.00000000000000021e35 or 165000 < x < 2.29999999999999994e40 or 1.79999999999999997e162 < x

    1. Initial program 51.7%

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

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

    if -5.00000000000000021e35 < x < 165000 or 2.29999999999999994e40 < x < 1.79999999999999997e162

    1. Initial program 61.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+35}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 165000:\\ \;\;\;\;a\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{+40}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+162}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]

Alternative 10: 58.6% accurate, 2.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.8499999999999999e108 or 1.45000000000000003e162 < x

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

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

    if -1.8499999999999999e108 < x < 1.45000000000000003e162

    1. Initial program 61.0%

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

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

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

Alternative 11: 32.2% accurate, 21.0× speedup?

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

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

    \[\leadsto \color{blue}{a} \]
  3. Final simplification35.4%

    \[\leadsto a \]

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

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

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