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

Percentage Accurate: 61.0% → 87.0%
Time: 12.3s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 61.0% accurate, 1.0× speedup?

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

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

Alternative 1: 87.0% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 8.5%

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

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

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

    1. Initial program 99.1%

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

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

Alternative 2: 57.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + \left(x + t\right)\\ t_2 := \left(z + a\right) - b\\ t_3 := z \cdot \frac{x + y}{t\_1}\\ \mathbf{if}\;y \leq -6 \cdot 10^{-12}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -8.3 \cdot 10^{-227}:\\ \;\;\;\;a \cdot \frac{y + t}{t\_1}\\ \mathbf{elif}\;y \leq -6.9 \cdot 10^{-282}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-253}:\\ \;\;\;\;a \cdot \frac{t}{x + t}\\ \mathbf{elif}\;y \leq 7.9 \cdot 10^{-29}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (+ x t))) (t_2 (- (+ z a) b)) (t_3 (* z (/ (+ x y) t_1))))
   (if (<= y -6e-12)
     t_2
     (if (<= y -8.3e-227)
       (* a (/ (+ y t) t_1))
       (if (<= y -6.9e-282)
         t_3
         (if (<= y 1.25e-253)
           (* a (/ t (+ x t)))
           (if (<= y 7.9e-29) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (x + t);
	double t_2 = (z + a) - b;
	double t_3 = z * ((x + y) / t_1);
	double tmp;
	if (y <= -6e-12) {
		tmp = t_2;
	} else if (y <= -8.3e-227) {
		tmp = a * ((y + t) / t_1);
	} else if (y <= -6.9e-282) {
		tmp = t_3;
	} else if (y <= 1.25e-253) {
		tmp = a * (t / (x + t));
	} else if (y <= 7.9e-29) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = y + (x + t)
    t_2 = (z + a) - b
    t_3 = z * ((x + y) / t_1)
    if (y <= (-6d-12)) then
        tmp = t_2
    else if (y <= (-8.3d-227)) then
        tmp = a * ((y + t) / t_1)
    else if (y <= (-6.9d-282)) then
        tmp = t_3
    else if (y <= 1.25d-253) then
        tmp = a * (t / (x + t))
    else if (y <= 7.9d-29) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (x + t);
	double t_2 = (z + a) - b;
	double t_3 = z * ((x + y) / t_1);
	double tmp;
	if (y <= -6e-12) {
		tmp = t_2;
	} else if (y <= -8.3e-227) {
		tmp = a * ((y + t) / t_1);
	} else if (y <= -6.9e-282) {
		tmp = t_3;
	} else if (y <= 1.25e-253) {
		tmp = a * (t / (x + t));
	} else if (y <= 7.9e-29) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y + (x + t)
	t_2 = (z + a) - b
	t_3 = z * ((x + y) / t_1)
	tmp = 0
	if y <= -6e-12:
		tmp = t_2
	elif y <= -8.3e-227:
		tmp = a * ((y + t) / t_1)
	elif y <= -6.9e-282:
		tmp = t_3
	elif y <= 1.25e-253:
		tmp = a * (t / (x + t))
	elif y <= 7.9e-29:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(x + t))
	t_2 = Float64(Float64(z + a) - b)
	t_3 = Float64(z * Float64(Float64(x + y) / t_1))
	tmp = 0.0
	if (y <= -6e-12)
		tmp = t_2;
	elseif (y <= -8.3e-227)
		tmp = Float64(a * Float64(Float64(y + t) / t_1));
	elseif (y <= -6.9e-282)
		tmp = t_3;
	elseif (y <= 1.25e-253)
		tmp = Float64(a * Float64(t / Float64(x + t)));
	elseif (y <= 7.9e-29)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y + (x + t);
	t_2 = (z + a) - b;
	t_3 = z * ((x + y) / t_1);
	tmp = 0.0;
	if (y <= -6e-12)
		tmp = t_2;
	elseif (y <= -8.3e-227)
		tmp = a * ((y + t) / t_1);
	elseif (y <= -6.9e-282)
		tmp = t_3;
	elseif (y <= 1.25e-253)
		tmp = a * (t / (x + t));
	elseif (y <= 7.9e-29)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e-12], t$95$2, If[LessEqual[y, -8.3e-227], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.9e-282], t$95$3, If[LessEqual[y, 1.25e-253], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.9e-29], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -8.3 \cdot 10^{-227}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1}\\

\mathbf{elif}\;y \leq -6.9 \cdot 10^{-282}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{-253}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\

\mathbf{elif}\;y \leq 7.9 \cdot 10^{-29}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.0000000000000003e-12 or 7.9000000000000001e-29 < y

    1. Initial program 37.0%

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

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

    if -6.0000000000000003e-12 < y < -8.2999999999999996e-227

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

    if -8.2999999999999996e-227 < y < -6.89999999999999967e-282 or 1.24999999999999993e-253 < y < 7.9000000000000001e-29

    1. Initial program 79.7%

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

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

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

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

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

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

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

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

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

    if -6.89999999999999967e-282 < y < 1.24999999999999993e-253

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{-12}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq -8.3 \cdot 10^{-227}:\\ \;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\ \mathbf{elif}\;y \leq -6.9 \cdot 10^{-282}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-253}:\\ \;\;\;\;a \cdot \frac{t}{x + t}\\ \mathbf{elif}\;y \leq 7.9 \cdot 10^{-29}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 57.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t \leq 1.05 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 4.2 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.7e91 or 4.19999999999999991e42 < t

    1. Initial program 52.9%

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

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

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

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

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

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

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

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

    if -2.7e91 < t < 1.05e-303 or 1.40000000000000002e-21 < t < 4.19999999999999991e42

    1. Initial program 60.6%

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

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

    if 1.05e-303 < t < 1.40000000000000002e-21

    1. Initial program 68.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{+91}:\\ \;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{-303}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{-21}:\\ \;\;\;\;a \cdot \left(\frac{y}{x + y} + \frac{z}{a}\right)\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{+42}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 55.5% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq -1.9 \cdot 10^{-306}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4.6 \cdot 10^{-123}:\\
\;\;\;\;z\\

\mathbf{elif}\;t \leq 4.4 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.7e91 or 4.4000000000000003e42 < t

    1. Initial program 52.9%

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

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

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

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

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

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

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

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

    if -2.7e91 < t < -1.9e-306 or 4.59999999999999973e-123 < t < 4.4000000000000003e42

    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. Add Preprocessing
    3. Taylor expanded in y around inf 68.1%

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

    if -1.9e-306 < t < 4.59999999999999973e-123

    1. Initial program 70.9%

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

      \[\leadsto \color{blue}{z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{+91}:\\ \;\;\;\;a \cdot \frac{t}{x + t}\\ \mathbf{elif}\;t \leq -1.9 \cdot 10^{-306}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-123}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 4.4 \cdot 10^{+42}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{t}{x + t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 56.6% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq -8.8 \cdot 10^{-307}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 8 \cdot 10^{-120}:\\
\;\;\;\;z\\

\mathbf{elif}\;t \leq 1.3 \cdot 10^{+183}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 53.5%

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

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

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

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

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

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

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

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

    if -2.7e91 < t < -8.8e-307 or 7.99999999999999983e-120 < t < 1.3e183

    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. Add Preprocessing
    3. Taylor expanded in y around inf 63.2%

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

    if -8.8e-307 < t < 7.99999999999999983e-120

    1. Initial program 70.9%

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

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

    if 1.3e183 < t

    1. Initial program 41.2%

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

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

        \[\leadsto \left(a + \left(\color{blue}{a \cdot \frac{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) \]
      2. associate-/l*70.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a - \frac{b \cdot y}{t}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification65.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{+91}:\\ \;\;\;\;a \cdot \frac{t}{x + t}\\ \mathbf{elif}\;t \leq -8.8 \cdot 10^{-307}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-120}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+183}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a - \frac{y \cdot b}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 57.5% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t \leq 3.5 \cdot 10^{-296}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.35 \cdot 10^{+183}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 53.5%

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

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

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

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

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

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

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

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

    if -6.3e87 < t < 3.4999999999999999e-296 or 4.20000000000000016e-22 < t < 1.34999999999999991e183

    1. Initial program 61.4%

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

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

    if 3.4999999999999999e-296 < t < 4.20000000000000016e-22

    1. Initial program 68.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.34999999999999991e183 < t

    1. Initial program 41.2%

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

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

        \[\leadsto \left(a + \left(\color{blue}{a \cdot \frac{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) \]
      2. associate-/l*70.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a - \frac{b \cdot y}{t}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification65.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.3 \cdot 10^{+87}:\\ \;\;\;\;a \cdot \frac{t}{x + t}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-296}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-22}:\\ \;\;\;\;a \cdot \left(\frac{y}{x + y} + \frac{z}{a}\right)\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+183}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a - \frac{y \cdot b}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 67.9% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.35e-10 or 115 < y

    1. Initial program 34.9%

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

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

    if -1.35e-10 < y < 115

    1. Initial program 81.2%

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

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

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

Alternative 8: 56.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{+123}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 7.8 \cdot 10^{+65} \lor \neg \left(x \leq 5.2 \cdot 10^{+156}\right) \land x \leq 10^{+179}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -2.45e+123)
   z
   (if (or (<= x 7.8e+65) (and (not (<= x 5.2e+156)) (<= x 1e+179)))
     (- (+ z a) b)
     z)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -2.45e+123) {
		tmp = z;
	} else if ((x <= 7.8e+65) || (!(x <= 5.2e+156) && (x <= 1e+179))) {
		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 <= (-2.45d+123)) then
        tmp = z
    else if ((x <= 7.8d+65) .or. (.not. (x <= 5.2d+156)) .and. (x <= 1d+179)) 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 <= -2.45e+123) {
		tmp = z;
	} else if ((x <= 7.8e+65) || (!(x <= 5.2e+156) && (x <= 1e+179))) {
		tmp = (z + a) - b;
	} else {
		tmp = z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -2.45e+123:
		tmp = z
	elif (x <= 7.8e+65) or (not (x <= 5.2e+156) and (x <= 1e+179)):
		tmp = (z + a) - b
	else:
		tmp = z
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -2.45e+123)
		tmp = z;
	elseif ((x <= 7.8e+65) || (!(x <= 5.2e+156) && (x <= 1e+179)))
		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 <= -2.45e+123)
		tmp = z;
	elseif ((x <= 7.8e+65) || (~((x <= 5.2e+156)) && (x <= 1e+179)))
		tmp = (z + a) - b;
	else
		tmp = z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.45e+123], z, If[Or[LessEqual[x, 7.8e+65], And[N[Not[LessEqual[x, 5.2e+156]], $MachinePrecision], LessEqual[x, 1e+179]]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 7.8 \cdot 10^{+65} \lor \neg \left(x \leq 5.2 \cdot 10^{+156}\right) \land x \leq 10^{+179}:\\
\;\;\;\;\left(z + a\right) - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.44999999999999988e123 or 7.7999999999999996e65 < x < 5.20000000000000037e156 or 9.9999999999999998e178 < x

    1. Initial program 53.5%

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

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

    if -2.44999999999999988e123 < x < 7.7999999999999996e65 or 5.20000000000000037e156 < x < 9.9999999999999998e178

    1. Initial program 62.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{+123}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 7.8 \cdot 10^{+65} \lor \neg \left(x \leq 5.2 \cdot 10^{+156}\right) \land x \leq 10^{+179}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 63.5% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.6000000000000001e-26 or 1.8000000000000001e-26 < y

    1. Initial program 36.8%

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

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

    if -2.6000000000000001e-26 < y < 1.8000000000000001e-26

    1. Initial program 82.2%

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

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

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

Alternative 10: 47.7% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -108000000:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+14}:\\
\;\;\;\;a - b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.08e8 or 1.2e14 < z

    1. Initial program 46.7%

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

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

    if -1.08e8 < z < 1.2e14

    1. Initial program 71.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -108000000:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+14}:\\ \;\;\;\;a - b\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 44.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2250000:\\
\;\;\;\;z\\

\mathbf{elif}\;z \leq 4.6 \cdot 10^{+14}:\\
\;\;\;\;a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.25e6 or 4.6e14 < z

    1. Initial program 46.7%

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

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

    if -2.25e6 < z < 4.6e14

    1. Initial program 71.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2250000:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+14}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 32.4% 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 59.5%

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

    \[\leadsto \color{blue}{a} \]
  4. Final simplification33.5%

    \[\leadsto a \]
  5. Add Preprocessing

Developer target: 82.0% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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