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

Percentage Accurate: 59.9% → 92.2%
Time: 10.7s
Alternatives: 13
Speedup: 2.4×

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 13 alternatives:

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

Initial Program: 59.9% 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: 92.2% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3e-72 or 3.2e-81 < z

    1. Initial program 52.2%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
      4. lower-*.f64N/A

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right)} \]
      3. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \color{blue}{\left(-z\right)} \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right) \]
      5. lower--.f64N/A

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

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

    if -3e-72 < z < 3.2e-81

    1. Initial program 75.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. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
      4. lower-*.f64N/A

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \left(\left(-1 \cdot \frac{t + y}{t + \left(x + y\right)} + \frac{b \cdot y}{a \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{z \cdot \left(x + y\right)}{a \cdot \left(t + \left(x + y\right)\right)}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \left(\left(-1 \cdot \frac{t + y}{t + \left(x + y\right)} + \frac{b \cdot y}{a \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{z \cdot \left(x + y\right)}{a \cdot \left(t + \left(x + y\right)\right)}\right)} \]
      3. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(\left(-1 \cdot \frac{t + y}{t + \left(x + y\right)} + \frac{b \cdot y}{a \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{z \cdot \left(x + y\right)}{a \cdot \left(t + \left(x + y\right)\right)}\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \color{blue}{\left(-a\right)} \cdot \left(\left(-1 \cdot \frac{t + y}{t + \left(x + y\right)} + \frac{b \cdot y}{a \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{z \cdot \left(x + y\right)}{a \cdot \left(t + \left(x + y\right)\right)}\right) \]
      5. lower--.f64N/A

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

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

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

Alternative 2: 88.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+235}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 6.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. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
      4. lower-*.f64N/A

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right)} \]
      3. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right) \]
      4. lower-neg.f64N/A

        \[\leadsto \color{blue}{\left(-z\right)} \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right) \]
      5. lower--.f64N/A

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

      \[\leadsto \color{blue}{\left(-z\right) \cdot \left(\mathsf{fma}\left(\frac{b}{z}, \frac{y}{t + \left(y + x\right)}, \frac{-\left(y + x\right)}{t + \left(y + x\right)}\right) - \frac{a}{z} \cdot \frac{t + y}{t + \left(y + x\right)}\right)} \]
    8. Step-by-step derivation
      1. Applied rewrites84.3%

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

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

      1. Initial program 99.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

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

      1. Initial program 8.8%

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

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
      4. Step-by-step derivation
        1. lower--.f64N/A

          \[\leadsto \color{blue}{\left(a + z\right) - b} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
        3. lower-+.f6475.1

          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      5. Applied rewrites75.1%

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

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

    Alternative 3: 88.3% accurate, 0.3× speedup?

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

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

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
      4. Step-by-step derivation
        1. lower--.f64N/A

          \[\leadsto \color{blue}{\left(a + z\right) - b} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
        3. lower-+.f6475.6

          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      5. Applied rewrites75.6%

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

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

      1. Initial program 99.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. Recombined 2 regimes into one program.
    4. Final simplification89.2%

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

    Alternative 4: 74.8% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + t\right) + y\\ t_2 := \left(a + z\right) - b\\ t_3 := \left(t + y\right) \cdot a\\ t_4 := \frac{\left(t\_3 + \left(x + y\right) \cdot z\right) - y \cdot b}{t\_1}\\ \mathbf{if}\;t\_4 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+139}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t\_3\right)}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (+ (+ x t) y))
            (t_2 (- (+ a z) b))
            (t_3 (* (+ t y) a))
            (t_4 (/ (- (+ t_3 (* (+ x y) z)) (* y b)) t_1)))
       (if (<= t_4 (- INFINITY))
         t_2
         (if (<= t_4 4e+139) (/ (fma (+ x y) z t_3) t_1) t_2))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = (x + t) + y;
    	double t_2 = (a + z) - b;
    	double t_3 = (t + y) * a;
    	double t_4 = ((t_3 + ((x + y) * z)) - (y * b)) / t_1;
    	double tmp;
    	if (t_4 <= -((double) INFINITY)) {
    		tmp = t_2;
    	} else if (t_4 <= 4e+139) {
    		tmp = fma((x + y), z, t_3) / t_1;
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(Float64(x + t) + y)
    	t_2 = Float64(Float64(a + z) - b)
    	t_3 = Float64(Float64(t + y) * a)
    	t_4 = Float64(Float64(Float64(t_3 + Float64(Float64(x + y) * z)) - Float64(y * b)) / t_1)
    	tmp = 0.0
    	if (t_4 <= Float64(-Inf))
    		tmp = t_2;
    	elseif (t_4 <= 4e+139)
    		tmp = Float64(fma(Float64(x + y), z, t_3) / t_1);
    	else
    		tmp = t_2;
    	end
    	return 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[(a + z), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$2, If[LessEqual[t$95$4, 4e+139], N[(N[(N[(x + y), $MachinePrecision] * z + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(x + t\right) + y\\
    t_2 := \left(a + z\right) - b\\
    t_3 := \left(t + y\right) \cdot a\\
    t_4 := \frac{\left(t\_3 + \left(x + y\right) \cdot z\right) - y \cdot b}{t\_1}\\
    \mathbf{if}\;t\_4 \leq -\infty:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+139}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t\_3\right)}{t\_1}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 4.00000000000000013e139 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

      1. Initial program 13.6%

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

        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
      4. Step-by-step derivation
        1. lower--.f64N/A

          \[\leadsto \color{blue}{\left(a + z\right) - b} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
        3. lower-+.f6474.7

          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
      5. Applied rewrites74.7%

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

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

      1. Initial program 99.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

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

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

          \[\leadsto \frac{\color{blue}{\left(x + y\right) \cdot z} + a \cdot \left(t + y\right)}{\left(x + t\right) + y} \]
        3. lower-fma.f64N/A

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x + y, z, a \cdot \left(t + y\right)\right)}}{\left(x + t\right) + y} \]
        4. lower-+.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + y}, z, a \cdot \left(t + y\right)\right)}{\left(x + t\right) + y} \]
        5. *-commutativeN/A

          \[\leadsto \frac{\mathsf{fma}\left(x + y, z, \color{blue}{\left(t + y\right) \cdot a}\right)}{\left(x + t\right) + y} \]
        6. lower-*.f64N/A

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

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

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

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

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

    Alternative 5: 88.2% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + y\right) + t\\ t_2 := \left(\frac{t + y}{t\_1} \cdot \frac{a}{z} - \mathsf{fma}\left(y, \frac{b}{t\_1 \cdot z}, \frac{-\left(x + y\right)}{t\_1}\right)\right) \cdot z\\ \mathbf{if}\;z \leq -4.8 \cdot 10^{-211}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-83}:\\ \;\;\;\;\left(\frac{\frac{\left(x + y\right) \cdot z}{a}}{t\_1} - \mathsf{fma}\left(\frac{b}{a}, \frac{y}{t\_1}, \frac{-\left(t + y\right)}{t\_1}\right)\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (+ (+ x y) t))
            (t_2
             (*
              (-
               (* (/ (+ t y) t_1) (/ a z))
               (fma y (/ b (* t_1 z)) (/ (- (+ x y)) t_1)))
              z)))
       (if (<= z -4.8e-211)
         t_2
         (if (<= z 1.45e-83)
           (*
            (-
             (/ (/ (* (+ x y) z) a) t_1)
             (fma (/ b a) (/ y t_1) (/ (- (+ t y)) t_1)))
            a)
           t_2))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = (x + y) + t;
    	double t_2 = ((((t + y) / t_1) * (a / z)) - fma(y, (b / (t_1 * z)), (-(x + y) / t_1))) * z;
    	double tmp;
    	if (z <= -4.8e-211) {
    		tmp = t_2;
    	} else if (z <= 1.45e-83) {
    		tmp = (((((x + y) * z) / a) / t_1) - fma((b / a), (y / t_1), (-(t + y) / t_1))) * a;
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(Float64(x + y) + t)
    	t_2 = Float64(Float64(Float64(Float64(Float64(t + y) / t_1) * Float64(a / z)) - fma(y, Float64(b / Float64(t_1 * z)), Float64(Float64(-Float64(x + y)) / t_1))) * z)
    	tmp = 0.0
    	if (z <= -4.8e-211)
    		tmp = t_2;
    	elseif (z <= 1.45e-83)
    		tmp = Float64(Float64(Float64(Float64(Float64(Float64(x + y) * z) / a) / t_1) - fma(Float64(b / a), Float64(y / t_1), Float64(Float64(-Float64(t + y)) / t_1))) * a);
    	else
    		tmp = t_2;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / N[(t$95$1 * z), $MachinePrecision]), $MachinePrecision] + N[((-N[(x + y), $MachinePrecision]) / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -4.8e-211], t$95$2, If[LessEqual[z, 1.45e-83], N[(N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] / a), $MachinePrecision] / t$95$1), $MachinePrecision] - N[(N[(b / a), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision] + N[((-N[(t + y), $MachinePrecision]) / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], t$95$2]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(x + y\right) + t\\
    t_2 := \left(\frac{t + y}{t\_1} \cdot \frac{a}{z} - \mathsf{fma}\left(y, \frac{b}{t\_1 \cdot z}, \frac{-\left(x + y\right)}{t\_1}\right)\right) \cdot z\\
    \mathbf{if}\;z \leq -4.8 \cdot 10^{-211}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;z \leq 1.45 \cdot 10^{-83}:\\
    \;\;\;\;\left(\frac{\frac{\left(x + y\right) \cdot z}{a}}{t\_1} - \mathsf{fma}\left(\frac{b}{a}, \frac{y}{t\_1}, \frac{-\left(t + y\right)}{t\_1}\right)\right) \cdot a\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -4.8000000000000004e-211 or 1.45e-83 < z

      1. Initial program 54.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. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
        3. div-invN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
        4. lower-*.f64N/A

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

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

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

          \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right)} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right)} \]
        3. mul-1-negN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right) \]
        4. lower-neg.f64N/A

          \[\leadsto \color{blue}{\left(-z\right)} \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right) \]
        5. lower--.f64N/A

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

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

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

        if -4.8000000000000004e-211 < z < 1.45e-83

        1. Initial program 75.2%

          \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-/.f64N/A

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

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
          3. div-invN/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
          4. lower-*.f64N/A

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

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

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

            \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \left(\left(-1 \cdot \frac{t + y}{t + \left(x + y\right)} + \frac{b \cdot y}{a \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{z \cdot \left(x + y\right)}{a \cdot \left(t + \left(x + y\right)\right)}\right)} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \left(\left(-1 \cdot \frac{t + y}{t + \left(x + y\right)} + \frac{b \cdot y}{a \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{z \cdot \left(x + y\right)}{a \cdot \left(t + \left(x + y\right)\right)}\right)} \]
          3. mul-1-negN/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(\left(-1 \cdot \frac{t + y}{t + \left(x + y\right)} + \frac{b \cdot y}{a \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{z \cdot \left(x + y\right)}{a \cdot \left(t + \left(x + y\right)\right)}\right) \]
          4. lower-neg.f64N/A

            \[\leadsto \color{blue}{\left(-a\right)} \cdot \left(\left(-1 \cdot \frac{t + y}{t + \left(x + y\right)} + \frac{b \cdot y}{a \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{z \cdot \left(x + y\right)}{a \cdot \left(t + \left(x + y\right)\right)}\right) \]
          5. lower--.f64N/A

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

          \[\leadsto \color{blue}{\left(-a\right) \cdot \left(\mathsf{fma}\left(\frac{b}{a}, \frac{y}{t + \left(y + x\right)}, \frac{-\left(t + y\right)}{t + \left(y + x\right)}\right) - \frac{\frac{z \cdot \left(y + x\right)}{a}}{t + \left(y + x\right)}\right)} \]
      9. Recombined 2 regimes into one program.
      10. Final simplification90.9%

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

      Alternative 6: 72.1% accurate, 1.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{+129}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{a - z}{x}, z\right)\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{+140}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x + y}{\left(x + y\right) + t} \cdot z\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (<= x -1.02e+129)
         (fma t (/ (- a z) x) z)
         (if (<= x 4.4e+140)
           (fma y (/ (- z b) (+ t y)) a)
           (* (/ (+ x y) (+ (+ x y) t)) z))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if (x <= -1.02e+129) {
      		tmp = fma(t, ((a - z) / x), z);
      	} else if (x <= 4.4e+140) {
      		tmp = fma(y, ((z - b) / (t + y)), a);
      	} else {
      		tmp = ((x + y) / ((x + y) + t)) * z;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if (x <= -1.02e+129)
      		tmp = fma(t, Float64(Float64(a - z) / x), z);
      	elseif (x <= 4.4e+140)
      		tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a);
      	else
      		tmp = Float64(Float64(Float64(x + y) / Float64(Float64(x + y) + t)) * z);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.02e+129], N[(t * N[(N[(a - z), $MachinePrecision] / x), $MachinePrecision] + z), $MachinePrecision], If[LessEqual[x, 4.4e+140], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(N[(x + y), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq -1.02 \cdot 10^{+129}:\\
      \;\;\;\;\mathsf{fma}\left(t, \frac{a - z}{x}, z\right)\\
      
      \mathbf{elif}\;x \leq 4.4 \cdot 10^{+140}:\\
      \;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x + y}{\left(x + y\right) + t} \cdot z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x < -1.01999999999999996e129

        1. Initial program 43.7%

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

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

            \[\leadsto \color{blue}{\left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) + \left(\mathsf{neg}\left(\frac{b \cdot y}{x + y}\right)\right)} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{b \cdot y}{x + y}\right)\right) + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right)} \]
          3. associate-/l*N/A

            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{b \cdot \frac{y}{x + y}}\right)\right) + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) \]
          4. distribute-lft-neg-inN/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(b\right)\right) \cdot \frac{y}{x + y}} + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) \]
          5. mul-1-negN/A

            \[\leadsto \color{blue}{\left(-1 \cdot b\right)} \cdot \frac{y}{x + y} + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) \]
          6. lower-fma.f64N/A

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

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

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

            \[\leadsto \mathsf{fma}\left(t, \color{blue}{\frac{a - z}{x}}, z\right) \]

          if -1.01999999999999996e129 < x < 4.3999999999999997e140

          1. Initial program 64.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 x around 0

            \[\leadsto \color{blue}{\frac{\left(a \cdot \left(t + y\right) + y \cdot z\right) - b \cdot y}{t + y}} \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

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

              \[\leadsto \frac{\color{blue}{a \cdot \left(t + y\right) + \left(y \cdot z - b \cdot y\right)}}{t + y} \]
            3. distribute-lft-inN/A

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

              \[\leadsto \frac{\color{blue}{a \cdot t + \left(a \cdot y + \left(y \cdot z - b \cdot y\right)\right)}}{t + y} \]
            5. *-commutativeN/A

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

              \[\leadsto \frac{t \cdot a + \left(\color{blue}{y \cdot a} + \left(y \cdot z - b \cdot y\right)\right)}{t + y} \]
            7. *-commutativeN/A

              \[\leadsto \frac{t \cdot a + \left(y \cdot a + \left(y \cdot z - \color{blue}{y \cdot b}\right)\right)}{t + y} \]
            8. distribute-lft-out--N/A

              \[\leadsto \frac{t \cdot a + \left(y \cdot a + \color{blue}{y \cdot \left(z - b\right)}\right)}{t + y} \]
            9. distribute-lft-inN/A

              \[\leadsto \frac{t \cdot a + \color{blue}{y \cdot \left(a + \left(z - b\right)\right)}}{t + y} \]
            10. associate--l+N/A

              \[\leadsto \frac{t \cdot a + y \cdot \color{blue}{\left(\left(a + z\right) - b\right)}}{t + y} \]
            11. lower-fma.f64N/A

              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(t, a, y \cdot \left(\left(a + z\right) - b\right)\right)}}{t + y} \]
            12. *-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right) \cdot y}\right)}{t + y} \]
            13. lower-*.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right) \cdot y}\right)}{t + y} \]
            14. lower--.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right)} \cdot y\right)}{t + y} \]
            15. +-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\color{blue}{\left(z + a\right)} - b\right) \cdot y\right)}{t + y} \]
            16. lower-+.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\color{blue}{\left(z + a\right)} - b\right) \cdot y\right)}{t + y} \]
            17. +-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\left(z + a\right) - b\right) \cdot y\right)}{\color{blue}{y + t}} \]
            18. lower-+.f6445.9

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

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

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

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

            if 4.3999999999999997e140 < x

            1. Initial program 62.4%

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

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

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

                \[\leadsto \color{blue}{\left(x + y\right) \cdot \frac{z}{t + \left(x + y\right)}} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(x + y\right) \cdot \frac{z}{t + \left(x + y\right)}} \]
              4. lower-+.f64N/A

                \[\leadsto \color{blue}{\left(x + y\right)} \cdot \frac{z}{t + \left(x + y\right)} \]
              5. lower-/.f64N/A

                \[\leadsto \left(x + y\right) \cdot \color{blue}{\frac{z}{t + \left(x + y\right)}} \]
              6. +-commutativeN/A

                \[\leadsto \left(x + y\right) \cdot \frac{z}{\color{blue}{\left(x + y\right) + t}} \]
              7. lower-+.f64N/A

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

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

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

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

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

            Alternative 7: 72.9% accurate, 1.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(t, \frac{a - z}{x}, z\right)\\ \mathbf{if}\;x \leq -1.02 \cdot 10^{+129}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.34 \cdot 10^{+132}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (let* ((t_1 (fma t (/ (- a z) x) z)))
               (if (<= x -1.02e+129)
                 t_1
                 (if (<= x 1.34e+132) (fma y (/ (- z b) (+ t y)) a) t_1))))
            double code(double x, double y, double z, double t, double a, double b) {
            	double t_1 = fma(t, ((a - z) / x), z);
            	double tmp;
            	if (x <= -1.02e+129) {
            		tmp = t_1;
            	} else if (x <= 1.34e+132) {
            		tmp = fma(y, ((z - b) / (t + y)), a);
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a, b)
            	t_1 = fma(t, Float64(Float64(a - z) / x), z)
            	tmp = 0.0
            	if (x <= -1.02e+129)
            		tmp = t_1;
            	elseif (x <= 1.34e+132)
            		tmp = fma(y, Float64(Float64(z - b) / Float64(t + y)), a);
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(N[(a - z), $MachinePrecision] / x), $MachinePrecision] + z), $MachinePrecision]}, If[LessEqual[x, -1.02e+129], t$95$1, If[LessEqual[x, 1.34e+132], N[(y * N[(N[(z - b), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \mathsf{fma}\left(t, \frac{a - z}{x}, z\right)\\
            \mathbf{if}\;x \leq -1.02 \cdot 10^{+129}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;x \leq 1.34 \cdot 10^{+132}:\\
            \;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -1.01999999999999996e129 or 1.34000000000000002e132 < x

              1. Initial program 51.7%

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

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

                  \[\leadsto \color{blue}{\left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) + \left(\mathsf{neg}\left(\frac{b \cdot y}{x + y}\right)\right)} \]
                2. +-commutativeN/A

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{b \cdot y}{x + y}\right)\right) + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right)} \]
                3. associate-/l*N/A

                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{b \cdot \frac{y}{x + y}}\right)\right) + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) \]
                4. distribute-lft-neg-inN/A

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(b\right)\right) \cdot \frac{y}{x + y}} + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) \]
                5. mul-1-negN/A

                  \[\leadsto \color{blue}{\left(-1 \cdot b\right)} \cdot \frac{y}{x + y} + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) \]
                6. lower-fma.f64N/A

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

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

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

                  \[\leadsto \mathsf{fma}\left(t, \color{blue}{\frac{a - z}{x}}, z\right) \]

                if -1.01999999999999996e129 < x < 1.34000000000000002e132

                1. Initial program 64.9%

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

                  \[\leadsto \color{blue}{\frac{\left(a \cdot \left(t + y\right) + y \cdot z\right) - b \cdot y}{t + y}} \]
                4. Step-by-step derivation
                  1. lower-/.f64N/A

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

                    \[\leadsto \frac{\color{blue}{a \cdot \left(t + y\right) + \left(y \cdot z - b \cdot y\right)}}{t + y} \]
                  3. distribute-lft-inN/A

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

                    \[\leadsto \frac{\color{blue}{a \cdot t + \left(a \cdot y + \left(y \cdot z - b \cdot y\right)\right)}}{t + y} \]
                  5. *-commutativeN/A

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

                    \[\leadsto \frac{t \cdot a + \left(\color{blue}{y \cdot a} + \left(y \cdot z - b \cdot y\right)\right)}{t + y} \]
                  7. *-commutativeN/A

                    \[\leadsto \frac{t \cdot a + \left(y \cdot a + \left(y \cdot z - \color{blue}{y \cdot b}\right)\right)}{t + y} \]
                  8. distribute-lft-out--N/A

                    \[\leadsto \frac{t \cdot a + \left(y \cdot a + \color{blue}{y \cdot \left(z - b\right)}\right)}{t + y} \]
                  9. distribute-lft-inN/A

                    \[\leadsto \frac{t \cdot a + \color{blue}{y \cdot \left(a + \left(z - b\right)\right)}}{t + y} \]
                  10. associate--l+N/A

                    \[\leadsto \frac{t \cdot a + y \cdot \color{blue}{\left(\left(a + z\right) - b\right)}}{t + y} \]
                  11. lower-fma.f64N/A

                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(t, a, y \cdot \left(\left(a + z\right) - b\right)\right)}}{t + y} \]
                  12. *-commutativeN/A

                    \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right) \cdot y}\right)}{t + y} \]
                  13. lower-*.f64N/A

                    \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right) \cdot y}\right)}{t + y} \]
                  14. lower--.f64N/A

                    \[\leadsto \frac{\mathsf{fma}\left(t, a, \color{blue}{\left(\left(a + z\right) - b\right)} \cdot y\right)}{t + y} \]
                  15. +-commutativeN/A

                    \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\color{blue}{\left(z + a\right)} - b\right) \cdot y\right)}{t + y} \]
                  16. lower-+.f64N/A

                    \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\color{blue}{\left(z + a\right)} - b\right) \cdot y\right)}{t + y} \]
                  17. +-commutativeN/A

                    \[\leadsto \frac{\mathsf{fma}\left(t, a, \left(\left(z + a\right) - b\right) \cdot y\right)}{\color{blue}{y + t}} \]
                  18. lower-+.f6446.2

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

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

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

                    \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{z - b}{t + y}}, a\right) \]
                8. Recombined 2 regimes into one program.
                9. Add Preprocessing

                Alternative 8: 61.7% accurate, 1.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(t, \frac{a - z}{x}, z\right)\\ \mathbf{if}\;x \leq -1.02 \cdot 10^{+129}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{+135}:\\ \;\;\;\;\left(a + z\right) - b\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                (FPCore (x y z t a b)
                 :precision binary64
                 (let* ((t_1 (fma t (/ (- a z) x) z)))
                   (if (<= x -1.02e+129) t_1 (if (<= x 9.2e+135) (- (+ a z) b) t_1))))
                double code(double x, double y, double z, double t, double a, double b) {
                	double t_1 = fma(t, ((a - z) / x), z);
                	double tmp;
                	if (x <= -1.02e+129) {
                		tmp = t_1;
                	} else if (x <= 9.2e+135) {
                		tmp = (a + z) - b;
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                function code(x, y, z, t, a, b)
                	t_1 = fma(t, Float64(Float64(a - z) / x), z)
                	tmp = 0.0
                	if (x <= -1.02e+129)
                		tmp = t_1;
                	elseif (x <= 9.2e+135)
                		tmp = Float64(Float64(a + z) - b);
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(N[(a - z), $MachinePrecision] / x), $MachinePrecision] + z), $MachinePrecision]}, If[LessEqual[x, -1.02e+129], t$95$1, If[LessEqual[x, 9.2e+135], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := \mathsf{fma}\left(t, \frac{a - z}{x}, z\right)\\
                \mathbf{if}\;x \leq -1.02 \cdot 10^{+129}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;x \leq 9.2 \cdot 10^{+135}:\\
                \;\;\;\;\left(a + z\right) - b\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x < -1.01999999999999996e129 or 9.2000000000000005e135 < x

                  1. Initial program 51.7%

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

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

                      \[\leadsto \color{blue}{\left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) + \left(\mathsf{neg}\left(\frac{b \cdot y}{x + y}\right)\right)} \]
                    2. +-commutativeN/A

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{b \cdot y}{x + y}\right)\right) + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right)} \]
                    3. associate-/l*N/A

                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{b \cdot \frac{y}{x + y}}\right)\right) + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) \]
                    4. distribute-lft-neg-inN/A

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(b\right)\right) \cdot \frac{y}{x + y}} + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) \]
                    5. mul-1-negN/A

                      \[\leadsto \color{blue}{\left(-1 \cdot b\right)} \cdot \frac{y}{x + y} + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) \]
                    6. lower-fma.f64N/A

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

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

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

                      \[\leadsto \mathsf{fma}\left(t, \color{blue}{\frac{a - z}{x}}, z\right) \]

                    if -1.01999999999999996e129 < x < 9.2000000000000005e135

                    1. Initial program 64.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

                      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                    4. Step-by-step derivation
                      1. lower--.f64N/A

                        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                      2. +-commutativeN/A

                        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                      3. lower-+.f6470.2

                        \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                    5. Applied rewrites70.2%

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

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

                  Alternative 9: 59.4% accurate, 2.2× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := -1 \cdot \left(-z\right)\\ \mathbf{if}\;x \leq -8.5 \cdot 10^{+227}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.06 \cdot 10^{+142}:\\ \;\;\;\;\left(a + z\right) - b\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                  (FPCore (x y z t a b)
                   :precision binary64
                   (let* ((t_1 (* -1.0 (- z))))
                     (if (<= x -8.5e+227) t_1 (if (<= x 1.06e+142) (- (+ a z) b) t_1))))
                  double code(double x, double y, double z, double t, double a, double b) {
                  	double t_1 = -1.0 * -z;
                  	double tmp;
                  	if (x <= -8.5e+227) {
                  		tmp = t_1;
                  	} else if (x <= 1.06e+142) {
                  		tmp = (a + z) - b;
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(x, y, z, t, a, b)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8), intent (in) :: a
                      real(8), intent (in) :: b
                      real(8) :: t_1
                      real(8) :: tmp
                      t_1 = (-1.0d0) * -z
                      if (x <= (-8.5d+227)) then
                          tmp = t_1
                      else if (x <= 1.06d+142) then
                          tmp = (a + z) - b
                      else
                          tmp = t_1
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a, double b) {
                  	double t_1 = -1.0 * -z;
                  	double tmp;
                  	if (x <= -8.5e+227) {
                  		tmp = t_1;
                  	} else if (x <= 1.06e+142) {
                  		tmp = (a + z) - b;
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t, a, b):
                  	t_1 = -1.0 * -z
                  	tmp = 0
                  	if x <= -8.5e+227:
                  		tmp = t_1
                  	elif x <= 1.06e+142:
                  		tmp = (a + z) - b
                  	else:
                  		tmp = t_1
                  	return tmp
                  
                  function code(x, y, z, t, a, b)
                  	t_1 = Float64(-1.0 * Float64(-z))
                  	tmp = 0.0
                  	if (x <= -8.5e+227)
                  		tmp = t_1;
                  	elseif (x <= 1.06e+142)
                  		tmp = Float64(Float64(a + z) - b);
                  	else
                  		tmp = t_1;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t, a, b)
                  	t_1 = -1.0 * -z;
                  	tmp = 0.0;
                  	if (x <= -8.5e+227)
                  		tmp = t_1;
                  	elseif (x <= 1.06e+142)
                  		tmp = (a + z) - b;
                  	else
                  		tmp = t_1;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-1.0 * (-z)), $MachinePrecision]}, If[LessEqual[x, -8.5e+227], t$95$1, If[LessEqual[x, 1.06e+142], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := -1 \cdot \left(-z\right)\\
                  \mathbf{if}\;x \leq -8.5 \cdot 10^{+227}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;x \leq 1.06 \cdot 10^{+142}:\\
                  \;\;\;\;\left(a + z\right) - b\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if x < -8.4999999999999995e227 or 1.06e142 < x

                    1. Initial program 54.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. Step-by-step derivation
                      1. lift-/.f64N/A

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

                        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
                      3. div-invN/A

                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\left(\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\right)\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(\left(x + t\right) + y\right)\right)}} \]
                      4. lower-*.f64N/A

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

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

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

                        \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right)} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\left(-1 \cdot z\right) \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right)} \]
                      3. mul-1-negN/A

                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right) \]
                      4. lower-neg.f64N/A

                        \[\leadsto \color{blue}{\left(-z\right)} \cdot \left(\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \frac{b \cdot y}{z \cdot \left(t + \left(x + y\right)\right)}\right) - \frac{a \cdot \left(t + y\right)}{z \cdot \left(t + \left(x + y\right)\right)}\right) \]
                      5. lower--.f64N/A

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

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

                      \[\leadsto \left(-z\right) \cdot -1 \]
                    9. Step-by-step derivation
                      1. Applied rewrites61.4%

                        \[\leadsto \left(-z\right) \cdot -1 \]

                      if -8.4999999999999995e227 < x < 1.06e142

                      1. Initial program 62.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 y around inf

                        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                      4. Step-by-step derivation
                        1. lower--.f64N/A

                          \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                        3. lower-+.f6466.8

                          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                      5. Applied rewrites66.8%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{+227}:\\ \;\;\;\;-1 \cdot \left(-z\right)\\ \mathbf{elif}\;x \leq 1.06 \cdot 10^{+142}:\\ \;\;\;\;\left(a + z\right) - b\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \left(-z\right)\\ \end{array} \]
                    12. Add Preprocessing

                    Alternative 10: 60.5% accurate, 2.4× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a + z\right) - b\\ \mathbf{if}\;y \leq -1 \cdot 10^{-38}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-34}:\\ \;\;\;\;a + z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                    (FPCore (x y z t a b)
                     :precision binary64
                     (let* ((t_1 (- (+ a z) b)))
                       (if (<= y -1e-38) t_1 (if (<= y 4e-34) (+ a z) t_1))))
                    double code(double x, double y, double z, double t, double a, double b) {
                    	double t_1 = (a + z) - b;
                    	double tmp;
                    	if (y <= -1e-38) {
                    		tmp = t_1;
                    	} else if (y <= 4e-34) {
                    		tmp = a + z;
                    	} else {
                    		tmp = t_1;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(x, y, z, t, a, b)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8), intent (in) :: a
                        real(8), intent (in) :: b
                        real(8) :: t_1
                        real(8) :: tmp
                        t_1 = (a + z) - b
                        if (y <= (-1d-38)) then
                            tmp = t_1
                        else if (y <= 4d-34) then
                            tmp = a + z
                        else
                            tmp = t_1
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double t, double a, double b) {
                    	double t_1 = (a + z) - b;
                    	double tmp;
                    	if (y <= -1e-38) {
                    		tmp = t_1;
                    	} else if (y <= 4e-34) {
                    		tmp = a + z;
                    	} else {
                    		tmp = t_1;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t, a, b):
                    	t_1 = (a + z) - b
                    	tmp = 0
                    	if y <= -1e-38:
                    		tmp = t_1
                    	elif y <= 4e-34:
                    		tmp = a + z
                    	else:
                    		tmp = t_1
                    	return tmp
                    
                    function code(x, y, z, t, a, b)
                    	t_1 = Float64(Float64(a + z) - b)
                    	tmp = 0.0
                    	if (y <= -1e-38)
                    		tmp = t_1;
                    	elseif (y <= 4e-34)
                    		tmp = Float64(a + z);
                    	else
                    		tmp = t_1;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t, a, b)
                    	t_1 = (a + z) - b;
                    	tmp = 0.0;
                    	if (y <= -1e-38)
                    		tmp = t_1;
                    	elseif (y <= 4e-34)
                    		tmp = a + z;
                    	else
                    		tmp = t_1;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1e-38], t$95$1, If[LessEqual[y, 4e-34], N[(a + z), $MachinePrecision], t$95$1]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \left(a + z\right) - b\\
                    \mathbf{if}\;y \leq -1 \cdot 10^{-38}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;y \leq 4 \cdot 10^{-34}:\\
                    \;\;\;\;a + z\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_1\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if y < -9.9999999999999996e-39 or 3.99999999999999971e-34 < y

                      1. Initial program 52.2%

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

                        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                      4. Step-by-step derivation
                        1. lower--.f64N/A

                          \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                        2. +-commutativeN/A

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

                          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                      5. Applied rewrites69.3%

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

                      if -9.9999999999999996e-39 < y < 3.99999999999999971e-34

                      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 y around inf

                        \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                      4. Step-by-step derivation
                        1. lower--.f64N/A

                          \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                        2. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                        3. lower-+.f6439.6

                          \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                      5. Applied rewrites39.6%

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

                        \[\leadsto a + \color{blue}{z} \]
                      7. Step-by-step derivation
                        1. Applied rewrites48.5%

                          \[\leadsto z + \color{blue}{a} \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification60.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-38}:\\ \;\;\;\;\left(a + z\right) - b\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-34}:\\ \;\;\;\;a + z\\ \mathbf{else}:\\ \;\;\;\;\left(a + z\right) - b\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 11: 53.5% accurate, 2.8× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{-19}:\\ \;\;\;\;a + z\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-66}:\\ \;\;\;\;a - b\\ \mathbf{else}:\\ \;\;\;\;a + z\\ \end{array} \end{array} \]
                      (FPCore (x y z t a b)
                       :precision binary64
                       (if (<= z -2.3e-19) (+ a z) (if (<= z 1.02e-66) (- a b) (+ a z))))
                      double code(double x, double y, double z, double t, double a, double b) {
                      	double tmp;
                      	if (z <= -2.3e-19) {
                      		tmp = a + z;
                      	} else if (z <= 1.02e-66) {
                      		tmp = a - b;
                      	} else {
                      		tmp = a + 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 <= (-2.3d-19)) then
                              tmp = a + z
                          else if (z <= 1.02d-66) then
                              tmp = a - b
                          else
                              tmp = a + 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 <= -2.3e-19) {
                      		tmp = a + z;
                      	} else if (z <= 1.02e-66) {
                      		tmp = a - b;
                      	} else {
                      		tmp = a + z;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t, a, b):
                      	tmp = 0
                      	if z <= -2.3e-19:
                      		tmp = a + z
                      	elif z <= 1.02e-66:
                      		tmp = a - b
                      	else:
                      		tmp = a + z
                      	return tmp
                      
                      function code(x, y, z, t, a, b)
                      	tmp = 0.0
                      	if (z <= -2.3e-19)
                      		tmp = Float64(a + z);
                      	elseif (z <= 1.02e-66)
                      		tmp = Float64(a - b);
                      	else
                      		tmp = Float64(a + z);
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t, a, b)
                      	tmp = 0.0;
                      	if (z <= -2.3e-19)
                      		tmp = a + z;
                      	elseif (z <= 1.02e-66)
                      		tmp = a - b;
                      	else
                      		tmp = a + z;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.3e-19], N[(a + z), $MachinePrecision], If[LessEqual[z, 1.02e-66], N[(a - b), $MachinePrecision], N[(a + z), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;z \leq -2.3 \cdot 10^{-19}:\\
                      \;\;\;\;a + z\\
                      
                      \mathbf{elif}\;z \leq 1.02 \cdot 10^{-66}:\\
                      \;\;\;\;a - b\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;a + z\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if z < -2.2999999999999998e-19 or 1.01999999999999996e-66 < z

                        1. Initial program 50.0%

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

                          \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                        4. Step-by-step derivation
                          1. lower--.f64N/A

                            \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                          2. +-commutativeN/A

                            \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                          3. lower-+.f6462.4

                            \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                        5. Applied rewrites62.4%

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

                          \[\leadsto a + \color{blue}{z} \]
                        7. Step-by-step derivation
                          1. Applied rewrites62.2%

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

                          if -2.2999999999999998e-19 < z < 1.01999999999999996e-66

                          1. Initial program 75.2%

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

                            \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                          4. Step-by-step derivation
                            1. lower--.f64N/A

                              \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                            2. +-commutativeN/A

                              \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                            3. lower-+.f6449.5

                              \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                          5. Applied rewrites49.5%

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

                            \[\leadsto a - \color{blue}{b} \]
                          7. Step-by-step derivation
                            1. Applied rewrites48.6%

                              \[\leadsto a - \color{blue}{b} \]
                          8. Recombined 2 regimes into one program.
                          9. Final simplification56.6%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{-19}:\\ \;\;\;\;a + z\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-66}:\\ \;\;\;\;a - b\\ \mathbf{else}:\\ \;\;\;\;a + z\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 12: 51.3% accurate, 11.3× speedup?

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

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

                            \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                          4. Step-by-step derivation
                            1. lower--.f64N/A

                              \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                            2. +-commutativeN/A

                              \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                            3. lower-+.f6457.1

                              \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                          5. Applied rewrites57.1%

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

                            \[\leadsto a + \color{blue}{z} \]
                          7. Step-by-step derivation
                            1. Applied rewrites53.0%

                              \[\leadsto z + \color{blue}{a} \]
                            2. Final simplification53.0%

                              \[\leadsto a + z \]
                            3. Add Preprocessing

                            Alternative 13: 14.3% accurate, 15.0× speedup?

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

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

                              \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                            4. Step-by-step derivation
                              1. lower--.f64N/A

                                \[\leadsto \color{blue}{\left(a + z\right) - b} \]
                              2. +-commutativeN/A

                                \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                              3. lower-+.f6457.1

                                \[\leadsto \color{blue}{\left(z + a\right)} - b \]
                            5. Applied rewrites57.1%

                              \[\leadsto \color{blue}{\left(z + a\right) - b} \]
                            6. Taylor expanded in b around inf

                              \[\leadsto -1 \cdot \color{blue}{b} \]
                            7. Step-by-step derivation
                              1. Applied rewrites12.5%

                                \[\leadsto -b \]
                              2. Add Preprocessing

                              Developer Target 1: 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 2024273 
                              (FPCore (x y z t a b)
                                :name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
                                :precision binary64
                              
                                :alt
                                (! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b))))
                              
                                (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))