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

Percentage Accurate: 61.4% → 87.4%
Time: 16.2s
Alternatives: 14
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 61.4% 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.4% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x + y\right)\\ t_2 := t + \left(x + y\right)\\ t_3 := \frac{y}{t_2}\\ t_4 := \frac{\left(\left(y + t\right) \cdot a + t_1\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t_4 \leq -4 \cdot 10^{+273}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t_4 \leq 5 \cdot 10^{+290}:\\ \;\;\;\;a \cdot \left(t_3 + \frac{t}{t_2}\right) + \frac{t_1 - y \cdot b}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t_3 + \frac{x}{t_2}, a\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* z (+ x y)))
        (t_2 (+ t (+ x y)))
        (t_3 (/ y t_2))
        (t_4 (/ (- (+ (* (+ y t) a) t_1) (* y b)) (+ y (+ x t)))))
   (if (<= t_4 -4e+273)
     (- (+ z a) b)
     (if (<= t_4 5e+290)
       (+ (* a (+ t_3 (/ t t_2))) (/ (- t_1 (* y b)) t_2))
       (fma z (+ t_3 (/ x t_2)) a)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = z * (x + y);
	double t_2 = t + (x + y);
	double t_3 = y / t_2;
	double t_4 = ((((y + t) * a) + t_1) - (y * b)) / (y + (x + t));
	double tmp;
	if (t_4 <= -4e+273) {
		tmp = (z + a) - b;
	} else if (t_4 <= 5e+290) {
		tmp = (a * (t_3 + (t / t_2))) + ((t_1 - (y * b)) / t_2);
	} else {
		tmp = fma(z, (t_3 + (x / t_2)), a);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(z * Float64(x + y))
	t_2 = Float64(t + Float64(x + y))
	t_3 = Float64(y / t_2)
	t_4 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + t_1) - Float64(y * b)) / Float64(y + Float64(x + t)))
	tmp = 0.0
	if (t_4 <= -4e+273)
		tmp = Float64(Float64(z + a) - b);
	elseif (t_4 <= 5e+290)
		tmp = Float64(Float64(a * Float64(t_3 + Float64(t / t_2))) + Float64(Float64(t_1 - Float64(y * b)) / t_2));
	else
		tmp = fma(z, Float64(t_3 + Float64(x / t_2)), a);
	end
	return 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[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y / t$95$2), $MachinePrecision]}, Block[{t$95$4 = 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]}, If[LessEqual[t$95$4, -4e+273], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$4, 5e+290], N[(N[(a * N[(t$95$3 + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(z * N[(t$95$3 + N[(x / t$95$2), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_4 \leq 5 \cdot 10^{+290}:\\
\;\;\;\;a \cdot \left(t_3 + \frac{t}{t_2}\right) + \frac{t_1 - y \cdot b}{t_2}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t_3 + \frac{x}{t_2}, a\right)\\


\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)) < -3.99999999999999978e273

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

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

    if -3.99999999999999978e273 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999998e290

    1. Initial program 99.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 a around 0 99.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+99.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. +-commutative99.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. +-commutative99.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. +-commutative99.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-sub99.7%

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

        \[\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. *-commutative99.7%

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

        \[\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. Simplified99.7%

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

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

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

      \[\leadsto \color{blue}{\left(z \cdot \left(\frac{x}{t + \left(x + y\right)} + \frac{y}{t + \left(x + y\right)}\right) + \frac{a \cdot \left(t + 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+33.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(z, \frac{x}{t + \left(y + x\right)} + \frac{y}{t + \left(y + x\right)}, \color{blue}{a}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.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 -4 \cdot 10^{+273}:\\ \;\;\;\;\left(z + a\right) - b\\ \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 5 \cdot 10^{+290}:\\ \;\;\;\;a \cdot \left(\frac{y}{t + \left(x + y\right)} + \frac{t}{t + \left(x + y\right)}\right) + \frac{z \cdot \left(x + y\right) - y \cdot b}{t + \left(x + y\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, \frac{y}{t + \left(x + y\right)} + \frac{x}{t + \left(x + y\right)}, a\right)\\ \end{array} \]

Alternative 2: 88.1% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -3.99999999999999978e273 or 4.9999999999999998e290 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 7.9%

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

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

    if -3.99999999999999978e273 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999998e290

    1. Initial program 99.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 a around 0 99.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+99.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. +-commutative99.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. +-commutative99.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. +-commutative99.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-sub99.7%

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

        \[\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. *-commutative99.7%

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

        \[\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. Simplified99.7%

      \[\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)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification86.7%

    \[\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 -4 \cdot 10^{+273} \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 5 \cdot 10^{+290}\right):\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(\frac{y}{t + \left(x + y\right)} + \frac{t}{t + \left(x + y\right)}\right) + \frac{z \cdot \left(x + y\right) - y \cdot b}{t + \left(x + y\right)}\\ \end{array} \]

Alternative 3: 88.3% 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 -4 \cdot 10^{+273} \lor \neg \left(t_1 \leq 5 \cdot 10^{+290}\right):\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (+ (* (+ y t) a) (* z (+ x y))) (* y b)) (+ y (+ x t)))))
   (if (or (<= t_1 -4e+273) (not (<= t_1 5e+290))) (- (+ z 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 <= -4e+273) || !(t_1 <= 5e+290)) {
		tmp = (z + a) - b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t))
    if ((t_1 <= (-4d+273)) .or. (.not. (t_1 <= 5d+290))) then
        tmp = (z + a) - b
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t));
	double tmp;
	if ((t_1 <= -4e+273) || !(t_1 <= 5e+290)) {
		tmp = (z + 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 <= -4e+273) or not (t_1 <= 5e+290):
		tmp = (z + a) - b
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t)))
	tmp = 0.0
	if ((t_1 <= -4e+273) || !(t_1 <= 5e+290))
		tmp = Float64(Float64(z + a) - b);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t));
	tmp = 0.0;
	if ((t_1 <= -4e+273) || ~((t_1 <= 5e+290)))
		tmp = (z + a) - b;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(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, -4e+273], N[Not[LessEqual[t$95$1, 5e+290]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $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 -4 \cdot 10^{+273} \lor \neg \left(t_1 \leq 5 \cdot 10^{+290}\right):\\
\;\;\;\;\left(z + a\right) - b\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -3.99999999999999978e273 or 4.9999999999999998e290 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 7.9%

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

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

    if -3.99999999999999978e273 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999998e290

    1. Initial program 99.0%

      \[\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 simplification86.3%

    \[\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 -4 \cdot 10^{+273} \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 5 \cdot 10^{+290}\right):\\ \;\;\;\;\left(z + a\right) - 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 4: 64.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t \cdot a + x \cdot z}{x + t}\\ t_2 := \frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\ \mathbf{if}\;y \leq -22000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -7.1 \cdot 10^{-128}:\\ \;\;\;\;\left(a + \frac{y \cdot z}{t}\right) - \frac{y \cdot b}{t}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-222}:\\ \;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-301}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-229}:\\ \;\;\;\;a + \frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-171}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1700000:\\ \;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (+ (* t a) (* x z)) (+ x t)))
        (t_2 (* (/ y (+ x (+ y t))) (+ a (- z b)))))
   (if (<= y -22000.0)
     t_2
     (if (<= y -7.1e-128)
       (- (+ a (/ (* y z) t)) (/ (* y b) t))
       (if (<= y -4.4e-222)
         (/ z (/ (+ t (+ x y)) (+ x y)))
         (if (<= y 1.35e-301)
           t_1
           (if (<= y 5.5e-229)
             (+ a (/ (* x z) (+ x t)))
             (if (<= y 5.6e-171)
               t_1
               (if (<= y 1700000.0)
                 (/ (- (* z (+ x y)) (* y b)) (+ y (+ x t)))
                 t_2)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((t * a) + (x * z)) / (x + t);
	double t_2 = (y / (x + (y + t))) * (a + (z - b));
	double tmp;
	if (y <= -22000.0) {
		tmp = t_2;
	} else if (y <= -7.1e-128) {
		tmp = (a + ((y * z) / t)) - ((y * b) / t);
	} else if (y <= -4.4e-222) {
		tmp = z / ((t + (x + y)) / (x + y));
	} else if (y <= 1.35e-301) {
		tmp = t_1;
	} else if (y <= 5.5e-229) {
		tmp = a + ((x * z) / (x + t));
	} else if (y <= 5.6e-171) {
		tmp = t_1;
	} else if (y <= 1700000.0) {
		tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
	} 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 = ((t * a) + (x * z)) / (x + t)
    t_2 = (y / (x + (y + t))) * (a + (z - b))
    if (y <= (-22000.0d0)) then
        tmp = t_2
    else if (y <= (-7.1d-128)) then
        tmp = (a + ((y * z) / t)) - ((y * b) / t)
    else if (y <= (-4.4d-222)) then
        tmp = z / ((t + (x + y)) / (x + y))
    else if (y <= 1.35d-301) then
        tmp = t_1
    else if (y <= 5.5d-229) then
        tmp = a + ((x * z) / (x + t))
    else if (y <= 5.6d-171) then
        tmp = t_1
    else if (y <= 1700000.0d0) then
        tmp = ((z * (x + y)) - (y * b)) / (y + (x + t))
    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 = ((t * a) + (x * z)) / (x + t);
	double t_2 = (y / (x + (y + t))) * (a + (z - b));
	double tmp;
	if (y <= -22000.0) {
		tmp = t_2;
	} else if (y <= -7.1e-128) {
		tmp = (a + ((y * z) / t)) - ((y * b) / t);
	} else if (y <= -4.4e-222) {
		tmp = z / ((t + (x + y)) / (x + y));
	} else if (y <= 1.35e-301) {
		tmp = t_1;
	} else if (y <= 5.5e-229) {
		tmp = a + ((x * z) / (x + t));
	} else if (y <= 5.6e-171) {
		tmp = t_1;
	} else if (y <= 1700000.0) {
		tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((t * a) + (x * z)) / (x + t)
	t_2 = (y / (x + (y + t))) * (a + (z - b))
	tmp = 0
	if y <= -22000.0:
		tmp = t_2
	elif y <= -7.1e-128:
		tmp = (a + ((y * z) / t)) - ((y * b) / t)
	elif y <= -4.4e-222:
		tmp = z / ((t + (x + y)) / (x + y))
	elif y <= 1.35e-301:
		tmp = t_1
	elif y <= 5.5e-229:
		tmp = a + ((x * z) / (x + t))
	elif y <= 5.6e-171:
		tmp = t_1
	elif y <= 1700000.0:
		tmp = ((z * (x + y)) - (y * b)) / (y + (x + t))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t))
	t_2 = Float64(Float64(y / Float64(x + Float64(y + t))) * Float64(a + Float64(z - b)))
	tmp = 0.0
	if (y <= -22000.0)
		tmp = t_2;
	elseif (y <= -7.1e-128)
		tmp = Float64(Float64(a + Float64(Float64(y * z) / t)) - Float64(Float64(y * b) / t));
	elseif (y <= -4.4e-222)
		tmp = Float64(z / Float64(Float64(t + Float64(x + y)) / Float64(x + y)));
	elseif (y <= 1.35e-301)
		tmp = t_1;
	elseif (y <= 5.5e-229)
		tmp = Float64(a + Float64(Float64(x * z) / Float64(x + t)));
	elseif (y <= 5.6e-171)
		tmp = t_1;
	elseif (y <= 1700000.0)
		tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / Float64(y + Float64(x + t)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = ((t * a) + (x * z)) / (x + t);
	t_2 = (y / (x + (y + t))) * (a + (z - b));
	tmp = 0.0;
	if (y <= -22000.0)
		tmp = t_2;
	elseif (y <= -7.1e-128)
		tmp = (a + ((y * z) / t)) - ((y * b) / t);
	elseif (y <= -4.4e-222)
		tmp = z / ((t + (x + y)) / (x + y));
	elseif (y <= 1.35e-301)
		tmp = t_1;
	elseif (y <= 5.5e-229)
		tmp = a + ((x * z) / (x + t));
	elseif (y <= 5.6e-171)
		tmp = t_1;
	elseif (y <= 1700000.0)
		tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -22000.0], t$95$2, If[LessEqual[y, -7.1e-128], N[(N[(a + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.4e-222], N[(z / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-301], t$95$1, If[LessEqual[y, 5.5e-229], N[(a + N[(N[(x * z), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e-171], t$95$1, If[LessEqual[y, 1700000.0], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -7.1 \cdot 10^{-128}:\\
\;\;\;\;\left(a + \frac{y \cdot z}{t}\right) - \frac{y \cdot b}{t}\\

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

\mathbf{elif}\;y \leq 1.35 \cdot 10^{-301}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 5.6 \cdot 10^{-171}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -22000 or 1.7e6 < y

    1. Initial program 46.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. Taylor expanded in y around inf 37.9%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{\left(x + t\right) + y}{\left(a + z\right) - b}}}\right)} - 1 \]
      4. +-commutative24.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y}{\frac{\color{blue}{y + \left(x + t\right)}}{\left(a + z\right) - b}}\right)} - 1 \]
      5. +-commutative24.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y}{\frac{y + \color{blue}{\left(t + x\right)}}{\left(a + z\right) - b}}\right)} - 1 \]
      6. associate--l+24.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y}{\frac{y + \left(t + x\right)}{\color{blue}{a + \left(z - b\right)}}}\right)} - 1 \]
    4. Applied egg-rr24.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{\frac{y + \left(t + x\right)}{a + \left(z - b\right)}}\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def33.5%

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

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

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

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

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

    if -22000 < y < -7.1000000000000002e-128

    1. Initial program 80.0%

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

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

        \[\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*71.7%

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

        \[\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*71.6%

        \[\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. +-commutative71.6%

        \[\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.6%

        \[\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.6%

      \[\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 76.0%

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

    if -7.1000000000000002e-128 < y < -4.4e-222

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

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

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

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

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

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

    if -4.4e-222 < y < 1.35e-301 or 5.5000000000000001e-229 < y < 5.60000000000000046e-171

    1. Initial program 85.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 0 74.3%

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

    if 1.35e-301 < y < 5.5000000000000001e-229

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

      \[\leadsto \color{blue}{\left(z \cdot \left(\frac{x}{t + \left(x + y\right)} + \frac{y}{t + \left(x + y\right)}\right) + \frac{a \cdot \left(t + 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+54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.60000000000000046e-171 < y < 1.7e6

    1. Initial program 83.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 70.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -22000:\\ \;\;\;\;\frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\ \mathbf{elif}\;y \leq -7.1 \cdot 10^{-128}:\\ \;\;\;\;\left(a + \frac{y \cdot z}{t}\right) - \frac{y \cdot b}{t}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-222}:\\ \;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-301}:\\ \;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-229}:\\ \;\;\;\;a + \frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-171}:\\ \;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 1700000:\\ \;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\ \end{array} \]

Alternative 5: 65.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t \cdot a + x \cdot z}{x + t}\\ t_2 := \frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\ \mathbf{if}\;y \leq -2 \cdot 10^{+22}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-126}:\\ \;\;\;\;a + \frac{y}{\frac{y + t}{z}}\\ \mathbf{elif}\;y \leq -4.15 \cdot 10^{-224}:\\ \;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\ \mathbf{elif}\;y \leq 6.1 \cdot 10^{-307}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-233}:\\ \;\;\;\;a + \frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{-36}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (+ (* t a) (* x z)) (+ x t)))
        (t_2 (* (/ y (+ x (+ y t))) (+ a (- z b)))))
   (if (<= y -2e+22)
     t_2
     (if (<= y -6.5e-126)
       (+ a (/ y (/ (+ y t) z)))
       (if (<= y -4.15e-224)
         (/ z (/ (+ t (+ x y)) (+ x y)))
         (if (<= y 6.1e-307)
           t_1
           (if (<= y 3.1e-233)
             (+ a (/ (* x z) (+ x t)))
             (if (<= y 4.9e-36) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((t * a) + (x * z)) / (x + t);
	double t_2 = (y / (x + (y + t))) * (a + (z - b));
	double tmp;
	if (y <= -2e+22) {
		tmp = t_2;
	} else if (y <= -6.5e-126) {
		tmp = a + (y / ((y + t) / z));
	} else if (y <= -4.15e-224) {
		tmp = z / ((t + (x + y)) / (x + y));
	} else if (y <= 6.1e-307) {
		tmp = t_1;
	} else if (y <= 3.1e-233) {
		tmp = a + ((x * z) / (x + t));
	} else if (y <= 4.9e-36) {
		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 = ((t * a) + (x * z)) / (x + t)
    t_2 = (y / (x + (y + t))) * (a + (z - b))
    if (y <= (-2d+22)) then
        tmp = t_2
    else if (y <= (-6.5d-126)) then
        tmp = a + (y / ((y + t) / z))
    else if (y <= (-4.15d-224)) then
        tmp = z / ((t + (x + y)) / (x + y))
    else if (y <= 6.1d-307) then
        tmp = t_1
    else if (y <= 3.1d-233) then
        tmp = a + ((x * z) / (x + t))
    else if (y <= 4.9d-36) 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 = ((t * a) + (x * z)) / (x + t);
	double t_2 = (y / (x + (y + t))) * (a + (z - b));
	double tmp;
	if (y <= -2e+22) {
		tmp = t_2;
	} else if (y <= -6.5e-126) {
		tmp = a + (y / ((y + t) / z));
	} else if (y <= -4.15e-224) {
		tmp = z / ((t + (x + y)) / (x + y));
	} else if (y <= 6.1e-307) {
		tmp = t_1;
	} else if (y <= 3.1e-233) {
		tmp = a + ((x * z) / (x + t));
	} else if (y <= 4.9e-36) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((t * a) + (x * z)) / (x + t)
	t_2 = (y / (x + (y + t))) * (a + (z - b))
	tmp = 0
	if y <= -2e+22:
		tmp = t_2
	elif y <= -6.5e-126:
		tmp = a + (y / ((y + t) / z))
	elif y <= -4.15e-224:
		tmp = z / ((t + (x + y)) / (x + y))
	elif y <= 6.1e-307:
		tmp = t_1
	elif y <= 3.1e-233:
		tmp = a + ((x * z) / (x + t))
	elif y <= 4.9e-36:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t))
	t_2 = Float64(Float64(y / Float64(x + Float64(y + t))) * Float64(a + Float64(z - b)))
	tmp = 0.0
	if (y <= -2e+22)
		tmp = t_2;
	elseif (y <= -6.5e-126)
		tmp = Float64(a + Float64(y / Float64(Float64(y + t) / z)));
	elseif (y <= -4.15e-224)
		tmp = Float64(z / Float64(Float64(t + Float64(x + y)) / Float64(x + y)));
	elseif (y <= 6.1e-307)
		tmp = t_1;
	elseif (y <= 3.1e-233)
		tmp = Float64(a + Float64(Float64(x * z) / Float64(x + t)));
	elseif (y <= 4.9e-36)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = ((t * a) + (x * z)) / (x + t);
	t_2 = (y / (x + (y + t))) * (a + (z - b));
	tmp = 0.0;
	if (y <= -2e+22)
		tmp = t_2;
	elseif (y <= -6.5e-126)
		tmp = a + (y / ((y + t) / z));
	elseif (y <= -4.15e-224)
		tmp = z / ((t + (x + y)) / (x + y));
	elseif (y <= 6.1e-307)
		tmp = t_1;
	elseif (y <= 3.1e-233)
		tmp = a + ((x * z) / (x + t));
	elseif (y <= 4.9e-36)
		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[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+22], t$95$2, If[LessEqual[y, -6.5e-126], N[(a + N[(y / N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.15e-224], N[(z / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.1e-307], t$95$1, If[LessEqual[y, 3.1e-233], N[(a + N[(N[(x * z), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.9e-36], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -6.5 \cdot 10^{-126}:\\
\;\;\;\;a + \frac{y}{\frac{y + t}{z}}\\

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

\mathbf{elif}\;y \leq 6.1 \cdot 10^{-307}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 4.9 \cdot 10^{-36}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2e22 or 4.8999999999999997e-36 < y

    1. Initial program 48.6%

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{\left(x + t\right) + y}{\left(a + z\right) - b}}}\right)} - 1 \]
      4. +-commutative25.6%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y}{\frac{\color{blue}{y + \left(x + t\right)}}{\left(a + z\right) - b}}\right)} - 1 \]
      5. +-commutative25.6%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y}{\frac{y + \color{blue}{\left(t + x\right)}}{\left(a + z\right) - b}}\right)} - 1 \]
      6. associate--l+25.6%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y}{\frac{y + \left(t + x\right)}{\color{blue}{a + \left(z - b\right)}}}\right)} - 1 \]
    4. Applied egg-rr25.6%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{\frac{y + \left(t + x\right)}{a + \left(z - b\right)}}\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def34.0%

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

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

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

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

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

    if -2e22 < y < -6.50000000000000014e-126

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

      \[\leadsto \color{blue}{\left(z \cdot \left(\frac{x}{t + \left(x + y\right)} + \frac{y}{t + \left(x + y\right)}\right) + \frac{a \cdot \left(t + 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+79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.50000000000000014e-126 < y < -4.14999999999999999e-224

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

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

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

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

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

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

    if -4.14999999999999999e-224 < y < 6.09999999999999974e-307 or 3.10000000000000015e-233 < y < 4.8999999999999997e-36

    1. Initial program 85.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 y around 0 61.2%

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

    if 6.09999999999999974e-307 < y < 3.10000000000000015e-233

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

      \[\leadsto \color{blue}{\left(z \cdot \left(\frac{x}{t + \left(x + y\right)} + \frac{y}{t + \left(x + y\right)}\right) + \frac{a \cdot \left(t + 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+54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+22}:\\ \;\;\;\;\frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-126}:\\ \;\;\;\;a + \frac{y}{\frac{y + t}{z}}\\ \mathbf{elif}\;y \leq -4.15 \cdot 10^{-224}:\\ \;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\ \mathbf{elif}\;y \leq 6.1 \cdot 10^{-307}:\\ \;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-233}:\\ \;\;\;\;a + \frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{-36}:\\ \;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\ \end{array} \]

Alternative 6: 64.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t \cdot a + x \cdot z}{x + t}\\ t_2 := \frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\ \mathbf{if}\;y \leq -6800:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.22 \cdot 10^{-126}:\\ \;\;\;\;\left(a + \frac{y \cdot z}{t}\right) - \frac{y \cdot b}{t}\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-223}:\\ \;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{-301}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-233}:\\ \;\;\;\;a + \frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-36}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (+ (* t a) (* x z)) (+ x t)))
        (t_2 (* (/ y (+ x (+ y t))) (+ a (- z b)))))
   (if (<= y -6800.0)
     t_2
     (if (<= y -1.22e-126)
       (- (+ a (/ (* y z) t)) (/ (* y b) t))
       (if (<= y -9e-223)
         (/ z (/ (+ t (+ x y)) (+ x y)))
         (if (<= y 1.06e-301)
           t_1
           (if (<= y 1.75e-233)
             (+ a (/ (* x z) (+ x t)))
             (if (<= y 2.2e-36) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((t * a) + (x * z)) / (x + t);
	double t_2 = (y / (x + (y + t))) * (a + (z - b));
	double tmp;
	if (y <= -6800.0) {
		tmp = t_2;
	} else if (y <= -1.22e-126) {
		tmp = (a + ((y * z) / t)) - ((y * b) / t);
	} else if (y <= -9e-223) {
		tmp = z / ((t + (x + y)) / (x + y));
	} else if (y <= 1.06e-301) {
		tmp = t_1;
	} else if (y <= 1.75e-233) {
		tmp = a + ((x * z) / (x + t));
	} else if (y <= 2.2e-36) {
		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 = ((t * a) + (x * z)) / (x + t)
    t_2 = (y / (x + (y + t))) * (a + (z - b))
    if (y <= (-6800.0d0)) then
        tmp = t_2
    else if (y <= (-1.22d-126)) then
        tmp = (a + ((y * z) / t)) - ((y * b) / t)
    else if (y <= (-9d-223)) then
        tmp = z / ((t + (x + y)) / (x + y))
    else if (y <= 1.06d-301) then
        tmp = t_1
    else if (y <= 1.75d-233) then
        tmp = a + ((x * z) / (x + t))
    else if (y <= 2.2d-36) 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 = ((t * a) + (x * z)) / (x + t);
	double t_2 = (y / (x + (y + t))) * (a + (z - b));
	double tmp;
	if (y <= -6800.0) {
		tmp = t_2;
	} else if (y <= -1.22e-126) {
		tmp = (a + ((y * z) / t)) - ((y * b) / t);
	} else if (y <= -9e-223) {
		tmp = z / ((t + (x + y)) / (x + y));
	} else if (y <= 1.06e-301) {
		tmp = t_1;
	} else if (y <= 1.75e-233) {
		tmp = a + ((x * z) / (x + t));
	} else if (y <= 2.2e-36) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((t * a) + (x * z)) / (x + t)
	t_2 = (y / (x + (y + t))) * (a + (z - b))
	tmp = 0
	if y <= -6800.0:
		tmp = t_2
	elif y <= -1.22e-126:
		tmp = (a + ((y * z) / t)) - ((y * b) / t)
	elif y <= -9e-223:
		tmp = z / ((t + (x + y)) / (x + y))
	elif y <= 1.06e-301:
		tmp = t_1
	elif y <= 1.75e-233:
		tmp = a + ((x * z) / (x + t))
	elif y <= 2.2e-36:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t))
	t_2 = Float64(Float64(y / Float64(x + Float64(y + t))) * Float64(a + Float64(z - b)))
	tmp = 0.0
	if (y <= -6800.0)
		tmp = t_2;
	elseif (y <= -1.22e-126)
		tmp = Float64(Float64(a + Float64(Float64(y * z) / t)) - Float64(Float64(y * b) / t));
	elseif (y <= -9e-223)
		tmp = Float64(z / Float64(Float64(t + Float64(x + y)) / Float64(x + y)));
	elseif (y <= 1.06e-301)
		tmp = t_1;
	elseif (y <= 1.75e-233)
		tmp = Float64(a + Float64(Float64(x * z) / Float64(x + t)));
	elseif (y <= 2.2e-36)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = ((t * a) + (x * z)) / (x + t);
	t_2 = (y / (x + (y + t))) * (a + (z - b));
	tmp = 0.0;
	if (y <= -6800.0)
		tmp = t_2;
	elseif (y <= -1.22e-126)
		tmp = (a + ((y * z) / t)) - ((y * b) / t);
	elseif (y <= -9e-223)
		tmp = z / ((t + (x + y)) / (x + y));
	elseif (y <= 1.06e-301)
		tmp = t_1;
	elseif (y <= 1.75e-233)
		tmp = a + ((x * z) / (x + t));
	elseif (y <= 2.2e-36)
		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[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6800.0], t$95$2, If[LessEqual[y, -1.22e-126], N[(N[(a + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9e-223], N[(z / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e-301], t$95$1, If[LessEqual[y, 1.75e-233], N[(a + N[(N[(x * z), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-36], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.22 \cdot 10^{-126}:\\
\;\;\;\;\left(a + \frac{y \cdot z}{t}\right) - \frac{y \cdot b}{t}\\

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

\mathbf{elif}\;y \leq 1.06 \cdot 10^{-301}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 2.2 \cdot 10^{-36}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -6800 or 2.1999999999999999e-36 < y

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{y}{\frac{\left(x + t\right) + y}{\left(a + z\right) - b}}}\right)} - 1 \]
      4. +-commutative25.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y}{\frac{\color{blue}{y + \left(x + t\right)}}{\left(a + z\right) - b}}\right)} - 1 \]
      5. +-commutative25.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y}{\frac{y + \color{blue}{\left(t + x\right)}}{\left(a + z\right) - b}}\right)} - 1 \]
      6. associate--l+25.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{y}{\frac{y + \left(t + x\right)}{\color{blue}{a + \left(z - b\right)}}}\right)} - 1 \]
    4. Applied egg-rr25.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{\frac{y + \left(t + x\right)}{a + \left(z - b\right)}}\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def33.7%

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

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

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

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

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

    if -6800 < y < -1.21999999999999996e-126

    1. Initial program 80.0%

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

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

        \[\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*71.7%

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

        \[\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*71.6%

        \[\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. +-commutative71.6%

        \[\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.6%

        \[\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.6%

      \[\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 76.0%

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

    if -1.21999999999999996e-126 < y < -8.99999999999999935e-223

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

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

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

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

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

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

    if -8.99999999999999935e-223 < y < 1.06e-301 or 1.74999999999999995e-233 < y < 2.1999999999999999e-36

    1. Initial program 85.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 y around 0 61.2%

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

    if 1.06e-301 < y < 1.74999999999999995e-233

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

      \[\leadsto \color{blue}{\left(z \cdot \left(\frac{x}{t + \left(x + y\right)} + \frac{y}{t + \left(x + y\right)}\right) + \frac{a \cdot \left(t + 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+54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6800:\\ \;\;\;\;\frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\ \mathbf{elif}\;y \leq -1.22 \cdot 10^{-126}:\\ \;\;\;\;\left(a + \frac{y \cdot z}{t}\right) - \frac{y \cdot b}{t}\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-223}:\\ \;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{-301}:\\ \;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-233}:\\ \;\;\;\;a + \frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-36}:\\ \;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x + \left(y + t\right)} \cdot \left(a + \left(z - b\right)\right)\\ \end{array} \]

Alternative 7: 60.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := \frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\ \mathbf{if}\;y \leq -2.1 \cdot 10^{+35}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -5.7 \cdot 10^{-132}:\\ \;\;\;\;a + \frac{y}{\frac{y + t}{z}}\\ \mathbf{elif}\;y \leq -1.85 \cdot 10^{-222}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-302}:\\ \;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 2.65 \cdot 10^{-232}:\\ \;\;\;\;a + \frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 4000:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- (+ z a) b)) (t_2 (/ z (/ (+ t (+ x y)) (+ x y)))))
   (if (<= y -2.1e+35)
     t_1
     (if (<= y -5.7e-132)
       (+ a (/ y (/ (+ y t) z)))
       (if (<= y -1.85e-222)
         t_2
         (if (<= y 1.35e-302)
           (/ (+ (* t a) (* x z)) (+ x t))
           (if (<= y 2.65e-232)
             (+ a (/ (* x z) (+ x t)))
             (if (<= y 4000.0) t_2 t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double t_2 = z / ((t + (x + y)) / (x + y));
	double tmp;
	if (y <= -2.1e+35) {
		tmp = t_1;
	} else if (y <= -5.7e-132) {
		tmp = a + (y / ((y + t) / z));
	} else if (y <= -1.85e-222) {
		tmp = t_2;
	} else if (y <= 1.35e-302) {
		tmp = ((t * a) + (x * z)) / (x + t);
	} else if (y <= 2.65e-232) {
		tmp = a + ((x * z) / (x + t));
	} else if (y <= 4000.0) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (z + a) - b
    t_2 = z / ((t + (x + y)) / (x + y))
    if (y <= (-2.1d+35)) then
        tmp = t_1
    else if (y <= (-5.7d-132)) then
        tmp = a + (y / ((y + t) / z))
    else if (y <= (-1.85d-222)) then
        tmp = t_2
    else if (y <= 1.35d-302) then
        tmp = ((t * a) + (x * z)) / (x + t)
    else if (y <= 2.65d-232) then
        tmp = a + ((x * z) / (x + t))
    else if (y <= 4000.0d0) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (z + a) - b;
	double t_2 = z / ((t + (x + y)) / (x + y));
	double tmp;
	if (y <= -2.1e+35) {
		tmp = t_1;
	} else if (y <= -5.7e-132) {
		tmp = a + (y / ((y + t) / z));
	} else if (y <= -1.85e-222) {
		tmp = t_2;
	} else if (y <= 1.35e-302) {
		tmp = ((t * a) + (x * z)) / (x + t);
	} else if (y <= 2.65e-232) {
		tmp = a + ((x * z) / (x + t));
	} else if (y <= 4000.0) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + a) - b
	t_2 = z / ((t + (x + y)) / (x + y))
	tmp = 0
	if y <= -2.1e+35:
		tmp = t_1
	elif y <= -5.7e-132:
		tmp = a + (y / ((y + t) / z))
	elif y <= -1.85e-222:
		tmp = t_2
	elif y <= 1.35e-302:
		tmp = ((t * a) + (x * z)) / (x + t)
	elif y <= 2.65e-232:
		tmp = a + ((x * z) / (x + t))
	elif y <= 4000.0:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z + a) - b)
	t_2 = Float64(z / Float64(Float64(t + Float64(x + y)) / Float64(x + y)))
	tmp = 0.0
	if (y <= -2.1e+35)
		tmp = t_1;
	elseif (y <= -5.7e-132)
		tmp = Float64(a + Float64(y / Float64(Float64(y + t) / z)));
	elseif (y <= -1.85e-222)
		tmp = t_2;
	elseif (y <= 1.35e-302)
		tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t));
	elseif (y <= 2.65e-232)
		tmp = Float64(a + Float64(Float64(x * z) / Float64(x + t)));
	elseif (y <= 4000.0)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z + a) - b;
	t_2 = z / ((t + (x + y)) / (x + y));
	tmp = 0.0;
	if (y <= -2.1e+35)
		tmp = t_1;
	elseif (y <= -5.7e-132)
		tmp = a + (y / ((y + t) / z));
	elseif (y <= -1.85e-222)
		tmp = t_2;
	elseif (y <= 1.35e-302)
		tmp = ((t * a) + (x * z)) / (x + t);
	elseif (y <= 2.65e-232)
		tmp = a + ((x * z) / (x + t));
	elseif (y <= 4000.0)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(z / N[(N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e+35], t$95$1, If[LessEqual[y, -5.7e-132], N[(a + N[(y / N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.85e-222], t$95$2, If[LessEqual[y, 1.35e-302], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.65e-232], N[(a + N[(N[(x * z), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4000.0], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -5.7 \cdot 10^{-132}:\\
\;\;\;\;a + \frac{y}{\frac{y + t}{z}}\\

\mathbf{elif}\;y \leq -1.85 \cdot 10^{-222}:\\
\;\;\;\;t_2\\

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

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

\mathbf{elif}\;y \leq 4000:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.0999999999999999e35 or 4e3 < y

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

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

    if -2.0999999999999999e35 < y < -5.7000000000000002e-132

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

      \[\leadsto \color{blue}{\left(z \cdot \left(\frac{x}{t + \left(x + y\right)} + \frac{y}{t + \left(x + y\right)}\right) + \frac{a \cdot \left(t + 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+77.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.7000000000000002e-132 < y < -1.8499999999999999e-222 or 2.6500000000000001e-232 < y < 4e3

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

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

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

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

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

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

    if -1.8499999999999999e-222 < y < 1.35000000000000003e-302

    1. Initial program 87.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. Taylor expanded in y around 0 74.4%

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

    if 1.35000000000000003e-302 < y < 2.6500000000000001e-232

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

      \[\leadsto \color{blue}{\left(z \cdot \left(\frac{x}{t + \left(x + y\right)} + \frac{y}{t + \left(x + y\right)}\right) + \frac{a \cdot \left(t + 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+54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{+35}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;y \leq -5.7 \cdot 10^{-132}:\\ \;\;\;\;a + \frac{y}{\frac{y + t}{z}}\\ \mathbf{elif}\;y \leq -1.85 \cdot 10^{-222}:\\ \;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-302}:\\ \;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 2.65 \cdot 10^{-232}:\\ \;\;\;\;a + \frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 4000:\\ \;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]

Alternative 8: 57.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := a + \frac{y}{\frac{y + t}{z}}\\ \mathbf{if}\;x \leq -4.1 \cdot 10^{+126}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-250}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-171}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-104}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{+184}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- (+ z a) b)) (t_2 (+ a (/ y (/ (+ y t) z)))))
   (if (<= x -4.1e+126)
     z
     (if (<= x -2.1e-250)
       t_2
       (if (<= x 5e-171)
         t_1
         (if (<= x 6.5e-104) t_2 (if (<= x 6.8e+184) t_1 z)))))))
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 / ((y + t) / z));
	double tmp;
	if (x <= -4.1e+126) {
		tmp = z;
	} else if (x <= -2.1e-250) {
		tmp = t_2;
	} else if (x <= 5e-171) {
		tmp = t_1;
	} else if (x <= 6.5e-104) {
		tmp = t_2;
	} else if (x <= 6.8e+184) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (z + a) - b
    t_2 = a + (y / ((y + t) / z))
    if (x <= (-4.1d+126)) then
        tmp = z
    else if (x <= (-2.1d-250)) then
        tmp = t_2
    else if (x <= 5d-171) then
        tmp = t_1
    else if (x <= 6.5d-104) then
        tmp = t_2
    else if (x <= 6.8d+184) then
        tmp = t_1
    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 t_1 = (z + a) - b;
	double t_2 = a + (y / ((y + t) / z));
	double tmp;
	if (x <= -4.1e+126) {
		tmp = z;
	} else if (x <= -2.1e-250) {
		tmp = t_2;
	} else if (x <= 5e-171) {
		tmp = t_1;
	} else if (x <= 6.5e-104) {
		tmp = t_2;
	} else if (x <= 6.8e+184) {
		tmp = t_1;
	} else {
		tmp = z;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (z + a) - b
	t_2 = a + (y / ((y + t) / z))
	tmp = 0
	if x <= -4.1e+126:
		tmp = z
	elif x <= -2.1e-250:
		tmp = t_2
	elif x <= 5e-171:
		tmp = t_1
	elif x <= 6.5e-104:
		tmp = t_2
	elif x <= 6.8e+184:
		tmp = t_1
	else:
		tmp = z
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(z + a) - b)
	t_2 = Float64(a + Float64(y / Float64(Float64(y + t) / z)))
	tmp = 0.0
	if (x <= -4.1e+126)
		tmp = z;
	elseif (x <= -2.1e-250)
		tmp = t_2;
	elseif (x <= 5e-171)
		tmp = t_1;
	elseif (x <= 6.5e-104)
		tmp = t_2;
	elseif (x <= 6.8e+184)
		tmp = t_1;
	else
		tmp = z;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (z + a) - b;
	t_2 = a + (y / ((y + t) / z));
	tmp = 0.0;
	if (x <= -4.1e+126)
		tmp = z;
	elseif (x <= -2.1e-250)
		tmp = t_2;
	elseif (x <= 5e-171)
		tmp = t_1;
	elseif (x <= 6.5e-104)
		tmp = t_2;
	elseif (x <= 6.8e+184)
		tmp = t_1;
	else
		tmp = z;
	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[(y / N[(N[(y + t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.1e+126], z, If[LessEqual[x, -2.1e-250], t$95$2, If[LessEqual[x, 5e-171], t$95$1, If[LessEqual[x, 6.5e-104], t$95$2, If[LessEqual[x, 6.8e+184], t$95$1, z]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -2.1 \cdot 10^{-250}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 5 \cdot 10^{-171}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 6.5 \cdot 10^{-104}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 6.8 \cdot 10^{+184}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.1000000000000001e126 or 6.8000000000000003e184 < x

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

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

    if -4.1000000000000001e126 < x < -2.1000000000000001e-250 or 4.99999999999999992e-171 < x < 6.49999999999999991e-104

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

      \[\leadsto \color{blue}{\left(z \cdot \left(\frac{x}{t + \left(x + y\right)} + \frac{y}{t + \left(x + y\right)}\right) + \frac{a \cdot \left(t + 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+71.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1000000000000001e-250 < x < 4.99999999999999992e-171 or 6.49999999999999991e-104 < x < 6.8000000000000003e184

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{+126}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-250}:\\ \;\;\;\;a + \frac{y}{\frac{y + t}{z}}\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-171}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-104}:\\ \;\;\;\;a + \frac{y}{\frac{y + t}{z}}\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{+184}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]

Alternative 9: 58.5% accurate, 1.2× speedup?

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

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

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

\mathbf{elif}\;y \leq 55000:\\
\;\;\;\;\frac{z}{\frac{t + \left(x + y\right)}{x + y}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.21999999999999999e35 or 55000 < y

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

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

    if -1.21999999999999999e35 < y < -1.9999999999999999e-126

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

      \[\leadsto \color{blue}{\left(z \cdot \left(\frac{x}{t + \left(x + y\right)} + \frac{y}{t + \left(x + y\right)}\right) + \frac{a \cdot \left(t + 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+77.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e-126 < y < 55000

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

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

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

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

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

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

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

Alternative 10: 57.8% accurate, 2.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.4999999999999999e134 or 1.05e184 < x

    1. Initial program 50.5%

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

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

    if -5.4999999999999999e134 < x < 1.05e184

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{+134}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+184}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]

Alternative 11: 52.5% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{-47} \lor \neg \left(a \leq 5.2 \cdot 10^{-141}\right):\\
\;\;\;\;z + a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.2e-47 or 5.20000000000000022e-141 < a

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

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    3. Taylor expanded in b around 0 55.2%

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

    if -1.2e-47 < a < 5.20000000000000022e-141

    1. Initial program 66.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 52.0%

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    3. Taylor expanded in a around 0 51.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.2 \cdot 10^{-47} \lor \neg \left(a \leq 5.2 \cdot 10^{-141}\right):\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;z - b\\ \end{array} \]

Alternative 12: 43.6% accurate, 4.1× speedup?

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

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

\mathbf{elif}\;t \leq 2.2 \cdot 10^{+31}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.5000000000000004e75 or 2.2000000000000001e31 < t

    1. Initial program 48.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 46.3%

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

    if -4.5000000000000004e75 < t < 2.2000000000000001e31

    1. Initial program 67.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 52.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.5 \cdot 10^{+75}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+31}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]

Alternative 13: 51.0% accurate, 7.0× speedup?

\[\begin{array}{l} \\ z + a \end{array} \]
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
	return z + 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 = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return z + a;
}
def code(x, y, z, t, a, b):
	return z + a
function code(x, y, z, t, a, b)
	return Float64(z + a)
end
function tmp = code(x, y, z, t, a, b)
	tmp = z + a;
end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}

\\
z + a
\end{array}
Derivation
  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. Taylor expanded in y around inf 51.8%

    \[\leadsto \color{blue}{\left(a + z\right) - b} \]
  3. Taylor expanded in b around 0 49.1%

    \[\leadsto \color{blue}{a + z} \]
  4. Final simplification49.1%

    \[\leadsto z + a \]

Alternative 14: 32.1% accurate, 21.0× speedup?

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

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

    \[\leadsto \color{blue}{a} \]
  3. Final simplification25.8%

    \[\leadsto a \]

Developer target: 82.5% 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 2023305 
(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)))