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

Percentage Accurate: 61.2% → 97.6%
Time: 12.8s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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.2% 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: 97.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + \left(x + t\right)\\ \mathsf{fma}\left(z, \frac{y + x}{t\_1}, a \cdot \frac{y + t}{t\_1}\right) - y \cdot \frac{b}{t\_1} \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (+ x t))))
   (- (fma z (/ (+ y x) t_1) (* a (/ (+ y t) t_1))) (* y (/ b t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (x + t);
	return fma(z, ((y + x) / t_1), (a * ((y + t) / t_1))) - (y * (b / t_1));
}
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(x + t))
	return Float64(fma(z, Float64(Float64(y + x) / t_1), Float64(a * Float64(Float64(y + t) / t_1))) - Float64(y * Float64(b / t_1)))
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, N[(N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathsf{fma}\left(z, \frac{y + x}{t\_1}, a \cdot \frac{y + t}{t\_1}\right) - y \cdot \frac{b}{t\_1}
\end{array}
\end{array}
Derivation
  1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(z, \frac{y + x}{y + \left(x + t\right)}, a \cdot \frac{y + t}{y + \left(x + t\right)}\right) - y \cdot \frac{b}{y + \left(x + t\right)} \]
  7. Add Preprocessing

Alternative 2: 90.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(y + t\right)\\ t_2 := y + \left(x + t\right)\\ t_3 := \frac{\left(z \cdot \left(y + x\right) + t\_1\right) - y \cdot b}{t\_2}\\ t_4 := y \cdot \frac{b}{t\_2}\\ \mathbf{if}\;t\_3 \leq -\infty:\\ \;\;\;\;\left(a + y \cdot \frac{z}{y + t}\right) - t\_4\\ \mathbf{elif}\;t\_3 \leq 10^{+299}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1\right) - y \cdot b}{x + \left(y + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a \cdot \frac{y}{y + x}\right) - t\_4\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (+ y t)))
        (t_2 (+ y (+ x t)))
        (t_3 (/ (- (+ (* z (+ y x)) t_1) (* y b)) t_2))
        (t_4 (* y (/ b t_2))))
   (if (<= t_3 (- INFINITY))
     (- (+ a (* y (/ z (+ y t)))) t_4)
     (if (<= t_3 1e+299)
       (/ (- (fma (+ y x) z t_1) (* y b)) (+ x (+ y t)))
       (- (+ z (* a (/ y (+ y x)))) t_4)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (y + t);
	double t_2 = y + (x + t);
	double t_3 = (((z * (y + x)) + t_1) - (y * b)) / t_2;
	double t_4 = y * (b / t_2);
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = (a + (y * (z / (y + t)))) - t_4;
	} else if (t_3 <= 1e+299) {
		tmp = (fma((y + x), z, t_1) - (y * b)) / (x + (y + t));
	} else {
		tmp = (z + (a * (y / (y + x)))) - t_4;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(y + t))
	t_2 = Float64(y + Float64(x + t))
	t_3 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + t_1) - Float64(y * b)) / t_2)
	t_4 = Float64(y * Float64(b / t_2))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(Float64(a + Float64(y * Float64(z / Float64(y + t)))) - t_4);
	elseif (t_3 <= 1e+299)
		tmp = Float64(Float64(fma(Float64(y + x), z, t_1) - Float64(y * b)) / Float64(x + Float64(y + t)));
	else
		tmp = Float64(Float64(z + Float64(a * Float64(y / Float64(y + x)))) - t_4);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(y * N[(b / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(a + N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$4), $MachinePrecision], If[LessEqual[t$95$3, 1e+299], N[(N[(N[(N[(y + x), $MachinePrecision] * z + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(a * N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$4), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_3 \leq 10^{+299}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1\right) - y \cdot b}{x + \left(y + t\right)}\\

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


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

    1. Initial program 6.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.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. Step-by-step derivation
      1. fma-define99.8%

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

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

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

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

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

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

    1. Initial program 5.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.9% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+299}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 6.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.8%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing

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

    1. Initial program 5.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 72.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y + \left(x + t\right)\\ \mathbf{if}\;x \leq -8.2 \cdot 10^{+173}:\\ \;\;\;\;z \cdot \frac{y + x}{t\_1}\\ \mathbf{elif}\;x \leq -1.1 \cdot 10^{+76} \lor \neg \left(x \leq -6.5 \cdot 10^{+38}\right) \land x \leq 1.5 \cdot 10^{+65}:\\ \;\;\;\;\left(a + y \cdot \frac{z}{y + t}\right) - b \cdot \frac{y}{y + t}\\ \mathbf{else}:\\ \;\;\;\;z - y \cdot \frac{b}{t\_1}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ y (+ x t))))
   (if (<= x -8.2e+173)
     (* z (/ (+ y x) t_1))
     (if (or (<= x -1.1e+76) (and (not (<= x -6.5e+38)) (<= x 1.5e+65)))
       (- (+ a (* y (/ z (+ y t)))) (* b (/ y (+ y t))))
       (- z (* y (/ b t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (x + t);
	double tmp;
	if (x <= -8.2e+173) {
		tmp = z * ((y + x) / t_1);
	} else if ((x <= -1.1e+76) || (!(x <= -6.5e+38) && (x <= 1.5e+65))) {
		tmp = (a + (y * (z / (y + t)))) - (b * (y / (y + t)));
	} else {
		tmp = z - (y * (b / 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 + (x + t)
    if (x <= (-8.2d+173)) then
        tmp = z * ((y + x) / t_1)
    else if ((x <= (-1.1d+76)) .or. (.not. (x <= (-6.5d+38))) .and. (x <= 1.5d+65)) then
        tmp = (a + (y * (z / (y + t)))) - (b * (y / (y + t)))
    else
        tmp = z - (y * (b / 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 + (x + t);
	double tmp;
	if (x <= -8.2e+173) {
		tmp = z * ((y + x) / t_1);
	} else if ((x <= -1.1e+76) || (!(x <= -6.5e+38) && (x <= 1.5e+65))) {
		tmp = (a + (y * (z / (y + t)))) - (b * (y / (y + t)));
	} else {
		tmp = z - (y * (b / t_1));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y + (x + t)
	tmp = 0
	if x <= -8.2e+173:
		tmp = z * ((y + x) / t_1)
	elif (x <= -1.1e+76) or (not (x <= -6.5e+38) and (x <= 1.5e+65)):
		tmp = (a + (y * (z / (y + t)))) - (b * (y / (y + t)))
	else:
		tmp = z - (y * (b / t_1))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y + Float64(x + t))
	tmp = 0.0
	if (x <= -8.2e+173)
		tmp = Float64(z * Float64(Float64(y + x) / t_1));
	elseif ((x <= -1.1e+76) || (!(x <= -6.5e+38) && (x <= 1.5e+65)))
		tmp = Float64(Float64(a + Float64(y * Float64(z / Float64(y + t)))) - Float64(b * Float64(y / Float64(y + t))));
	else
		tmp = Float64(z - Float64(y * Float64(b / t_1)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y + (x + t);
	tmp = 0.0;
	if (x <= -8.2e+173)
		tmp = z * ((y + x) / t_1);
	elseif ((x <= -1.1e+76) || (~((x <= -6.5e+38)) && (x <= 1.5e+65)))
		tmp = (a + (y * (z / (y + t)))) - (b * (y / (y + t)));
	else
		tmp = z - (y * (b / t_1));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.2e+173], N[(z * N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.1e+76], And[N[Not[LessEqual[x, -6.5e+38]], $MachinePrecision], LessEqual[x, 1.5e+65]]], N[(N[(a + N[(y * N[(z / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.1 \cdot 10^{+76} \lor \neg \left(x \leq -6.5 \cdot 10^{+38}\right) \land x \leq 1.5 \cdot 10^{+65}:\\
\;\;\;\;\left(a + y \cdot \frac{z}{y + t}\right) - b \cdot \frac{y}{y + t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.19999999999999951e173

    1. Initial program 50.6%

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

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

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

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

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

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

    if -8.19999999999999951e173 < x < -1.1e76 or -6.5e38 < x < 1.5000000000000001e65

    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. Add Preprocessing
    3. Taylor expanded in b around 0 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e76 < x < -6.5e38 or 1.5000000000000001e65 < x

    1. Initial program 51.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{+173}:\\ \;\;\;\;z \cdot \frac{y + x}{y + \left(x + t\right)}\\ \mathbf{elif}\;x \leq -1.1 \cdot 10^{+76} \lor \neg \left(x \leq -6.5 \cdot 10^{+38}\right) \land x \leq 1.5 \cdot 10^{+65}:\\ \;\;\;\;\left(a + y \cdot \frac{z}{y + t}\right) - b \cdot \frac{y}{y + t}\\ \mathbf{else}:\\ \;\;\;\;z - y \cdot \frac{b}{y + \left(x + t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 72.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq -2.25 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -6.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{\left(z \cdot \left(y + x\right) + y \cdot a\right) - y \cdot b}{y + x}\\

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

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


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

    1. Initial program 50.6%

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

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

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

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

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

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

    if -4.0000000000000001e173 < x < -2.25e74 or -6.5e38 < x < 1.35000000000000009e65

    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. Add Preprocessing
    3. Taylor expanded in b around 0 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.25e74 < x < -6.5e38

    1. Initial program 92.6%

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

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

    if 1.35000000000000009e65 < x

    1. Initial program 41.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+173}:\\ \;\;\;\;z \cdot \frac{y + x}{y + \left(x + t\right)}\\ \mathbf{elif}\;x \leq -2.25 \cdot 10^{+74}:\\ \;\;\;\;\left(a + y \cdot \frac{z}{y + t}\right) - b \cdot \frac{y}{y + t}\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{+38}:\\ \;\;\;\;\frac{\left(z \cdot \left(y + x\right) + y \cdot a\right) - y \cdot b}{y + x}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+65}:\\ \;\;\;\;\left(a + y \cdot \frac{z}{y + t}\right) - b \cdot \frac{y}{y + t}\\ \mathbf{else}:\\ \;\;\;\;z - y \cdot \frac{b}{y + \left(x + t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 63.4% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;y \leq 8.2 \cdot 10^{-55} \lor \neg \left(y \leq 1.9 \cdot 10^{-6}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.10000000000000001e-41 or 2.5000000000000001e-115 < y < 8.1999999999999996e-55 or 1.9e-6 < y

    1. Initial program 47.1%

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

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

    if -3.10000000000000001e-41 < y < 2.5000000000000001e-115

    1. Initial program 85.6%

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

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

    if 8.1999999999999996e-55 < y < 1.9e-6

    1. Initial program 99.7%

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

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

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

Alternative 7: 58.1% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;z \leq -4.8 \cdot 10^{-77}:\\
\;\;\;\;z - y \cdot \frac{b}{t\_1}\\

\mathbf{elif}\;z \leq 9000:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.79999999999999987e63 or 9e3 < z

    1. Initial program 47.8%

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

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

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

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

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

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

    if -2.79999999999999987e63 < z < -1.35000000000000008e-34

    1. Initial program 47.7%

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

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

    if -1.35000000000000008e-34 < z < -4.7999999999999998e-77

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.7999999999999998e-77 < z < 9e3

    1. Initial program 76.8%

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

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

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

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

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

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

Alternative 8: 80.5% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.00000000000000028e-33 or 1.4e13 < t

    1. Initial program 55.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000028e-33 < t < 1.4e13

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 71.2% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 25.7%

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

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

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

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

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

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

    if -5.6000000000000005e176 < z < 2.39999999999999983e137

    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. Add Preprocessing
    3. Taylor expanded in b around 0 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.39999999999999983e137 < z

    1. Initial program 34.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto z \cdot \color{blue}{{\left(\frac{y + \left(t + x\right)}{y + x}\right)}^{-1}} \]
    8. Step-by-step derivation
      1. unpow-183.3%

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

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

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

Alternative 10: 57.2% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.20000000000000012e-41 or 4.50000000000000026e-221 < y

    1. Initial program 53.9%

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

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

    if -3.20000000000000012e-41 < y < 4.50000000000000026e-221

    1. Initial program 85.4%

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

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

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

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

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

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

Alternative 11: 57.7% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.09999999999999965e44 or 6600 < z

    1. Initial program 48.3%

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

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

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

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

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

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

    if -4.09999999999999965e44 < z < 6600

    1. Initial program 72.5%

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

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

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

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

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

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

Alternative 12: 64.1% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.0000000000000003e-42 or 2.49999999999999996e-119 < y

    1. Initial program 50.1%

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

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

    if -8.0000000000000003e-42 < y < 2.49999999999999996e-119

    1. Initial program 85.6%

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

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

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

Alternative 13: 54.2% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.10000000000000003e-42 or 4.2e-221 < y

    1. Initial program 53.9%

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

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

    if -1.10000000000000003e-42 < y < 4.2e-221

    1. Initial program 85.4%

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

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

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

Alternative 14: 44.1% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+56}:\\
\;\;\;\;z\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.65000000000000001e56 or 6500 < z

    1. Initial program 48.3%

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

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

    if -1.65000000000000001e56 < z < 6500

    1. Initial program 72.5%

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

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

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

Alternative 15: 32.0% accurate, 21.0× speedup?

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

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

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

    \[\leadsto \color{blue}{a} \]
  4. Final simplification36.9%

    \[\leadsto a \]
  5. Add Preprocessing

Developer target: 82.3% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

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

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