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

Percentage Accurate: 61.6% → 92.9%
Time: 9.4s
Alternatives: 16
Speedup: 0.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 16 alternatives:

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

Initial Program: 61.6% 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.9% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t\_2} + \frac{x}{t\_2}, z, \frac{\mathsf{fma}\left(-b, y, t\_1\right)}{t\_2}\right)\\


\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.0000000000000004e301 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 5.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. 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. lift--.f64N/A

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

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

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

        \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y \cdot \frac{b}{\left(x + t\right) + y}} \]
      6. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

    1. Initial program 99.6%

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

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

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

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

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

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

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

Alternative 2: 76.4% accurate, 0.2× speedup?

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

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

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

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

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


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

    1. Initial program 21.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. 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. lift--.f64N/A

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

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

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

        \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y \cdot \frac{b}{\left(x + t\right) + y}} \]
      6. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

    if -5.00000000000000008e99 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.99999999999999976e-178

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(z, x, y \cdot z - \color{blue}{y \cdot b}\right)}{\left(x + t\right) + y} \]
      6. distribute-lft-out--N/A

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

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

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

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

    if -4.99999999999999976e-178 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000004e301

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 72.6% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-49}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -5.00000000000000008e99 or 4.9999999999999999e-49 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 42.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. 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. lift--.f64N/A

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

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

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

        \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y \cdot \frac{b}{\left(x + t\right) + y}} \]
      6. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

    if -5.00000000000000008e99 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.99999999999999976e-178

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(z, x, y \cdot z - \color{blue}{y \cdot b}\right)}{\left(x + t\right) + y} \]
      6. distribute-lft-out--N/A

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

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

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

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

    if -4.99999999999999976e-178 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999999e-49

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

      \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
      2. lower-fma.f64N/A

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

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

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

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

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

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

Alternative 4: 69.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + t\right) + y\\ t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+99}:\\ \;\;\;\;\left(z + a\right) - y \cdot \frac{b}{y + t}\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+36}:\\ \;\;\;\;\frac{\left(\left(a + z\right) - b\right) \cdot y}{t\_1}\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+157}:\\ \;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - y \cdot \frac{b}{x + y}\\ \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_1)))
   (if (<= t_2 -5e+99)
     (- (+ z a) (* y (/ b (+ y t))))
     (if (<= t_2 -2e+36)
       (/ (* (- (+ a z) b) y) t_1)
       (if (<= t_2 2e+157)
         (/ (fma a t (* z x)) (+ t x))
         (- (+ z a) (* y (/ b (+ x y)))))))))
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)) / t_1;
	double tmp;
	if (t_2 <= -5e+99) {
		tmp = (z + a) - (y * (b / (y + t)));
	} else if (t_2 <= -2e+36) {
		tmp = (((a + z) - b) * y) / t_1;
	} else if (t_2 <= 2e+157) {
		tmp = fma(a, t, (z * x)) / (t + x);
	} else {
		tmp = (z + a) - (y * (b / (x + y)));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(x + t) + y)
	t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1)
	tmp = 0.0
	if (t_2 <= -5e+99)
		tmp = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(y + t))));
	elseif (t_2 <= -2e+36)
		tmp = Float64(Float64(Float64(Float64(a + z) - b) * y) / t_1);
	elseif (t_2 <= 2e+157)
		tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x));
	else
		tmp = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(x + y))));
	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[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+99], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e+36], N[(N[(N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision] * y), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+157], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+157}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\

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


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

    1. Initial program 38.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. lift--.f64N/A

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

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

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

        \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y \cdot \frac{b}{\left(x + t\right) + y}} \]
      6. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000008e99 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.00000000000000008e36

    1. Initial program 99.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 \frac{\color{blue}{y \cdot \left(\left(a + z\right) - b\right)}}{\left(x + t\right) + y} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

    if -2.00000000000000008e36 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999997e157

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
      2. lower-fma.f64N/A

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

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

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

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

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

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

    1. Initial program 18.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. 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. lift--.f64N/A

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

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

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

        \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y \cdot \frac{b}{\left(x + t\right) + y}} \]
      6. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 93.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + t\right) + y\\ t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\ \mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 5 \cdot 10^{+301}\right):\\ \;\;\;\;\left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(a + z\right) - b, y, \mathsf{fma}\left(a, t, z \cdot x\right)\right)}{t\_1}\\ \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_1)))
   (if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+301)))
     (- (+ z a) (* y (/ b (+ (+ t x) y))))
     (/ (fma (- (+ a z) b) y (fma a t (* z x))) t_1))))
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)) / t_1;
	double tmp;
	if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+301)) {
		tmp = (z + a) - (y * (b / ((t + x) + y)));
	} else {
		tmp = fma(((a + z) - b), y, fma(a, t, (z * x))) / t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(x + t) + y)
	t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1)
	tmp = 0.0
	if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+301))
		tmp = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y))));
	else
		tmp = Float64(fma(Float64(Float64(a + z) - b), y, fma(a, t, Float64(z * x))) / t_1);
	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[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+301]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision] * y + N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}

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

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


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

    1. Initial program 5.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. 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. lift--.f64N/A

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

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

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

        \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y \cdot \frac{b}{\left(x + t\right) + y}} \]
      6. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 72.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-138} \lor \neg \left(t\_1 \leq 5 \cdot 10^{-49}\right):\\ \;\;\;\;\left(z + a\right) - y \cdot \frac{b}{\left(t + x\right) + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
   (if (or (<= t_1 -2e-138) (not (<= t_1 5e-49)))
     (- (+ z a) (* y (/ b (+ (+ t x) y))))
     (/ (fma a t (* z x)) (+ t x)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
	double tmp;
	if ((t_1 <= -2e-138) || !(t_1 <= 5e-49)) {
		tmp = (z + a) - (y * (b / ((t + x) + y)));
	} else {
		tmp = fma(a, t, (z * x)) / (t + x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y))
	tmp = 0.0
	if ((t_1 <= -2e-138) || !(t_1 <= 5e-49))
		tmp = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(Float64(t + x) + y))));
	else
		tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-138], N[Not[LessEqual[t$95$1, 5e-49]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(N[(t + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\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)) < -2.00000000000000013e-138 or 4.9999999999999999e-49 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 53.5%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. 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. lift--.f64N/A

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

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

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

        \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y \cdot \frac{b}{\left(x + t\right) + y}} \]
      6. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

    if -2.00000000000000013e-138 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999999e-49

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

      \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
      2. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(a, t, \color{blue}{z \cdot x}\right)}{t + x} \]
      5. lower-+.f6478.6

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

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

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

Alternative 7: 69.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+51} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+157}\right):\\ \;\;\;\;\left(z + a\right) - y \cdot \frac{b}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
   (if (or (<= t_1 -4e+51) (not (<= t_1 2e+157)))
     (- (+ z a) (* y (/ b (+ x y))))
     (/ (fma a t (* z x)) (+ t x)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
	double tmp;
	if ((t_1 <= -4e+51) || !(t_1 <= 2e+157)) {
		tmp = (z + a) - (y * (b / (x + y)));
	} else {
		tmp = fma(a, t, (z * x)) / (t + x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y))
	tmp = 0.0
	if ((t_1 <= -4e+51) || !(t_1 <= 2e+157))
		tmp = Float64(Float64(z + a) - Float64(y * Float64(b / Float64(x + y))));
	else
		tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e+51], N[Not[LessEqual[t$95$1, 2e+157]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - N[(y * N[(b / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\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)) < -4e51 or 1.99999999999999997e157 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 32.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. lift--.f64N/A

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

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

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

        \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y \cdot \frac{b}{\left(x + t\right) + y}} \]
      6. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

    if -4e51 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999997e157

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
      2. lower-fma.f64N/A

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

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

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

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

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

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

Alternative 8: 66.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+47} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+157}\right):\\ \;\;\;\;\left(a + z\right) - b\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
   (if (or (<= t_1 -5e+47) (not (<= t_1 2e+157)))
     (- (+ a z) b)
     (/ (fma a t (* z x)) (+ t x)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
	double tmp;
	if ((t_1 <= -5e+47) || !(t_1 <= 2e+157)) {
		tmp = (a + z) - b;
	} else {
		tmp = fma(a, t, (z * x)) / (t + x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y))
	tmp = 0.0
	if ((t_1 <= -5e+47) || !(t_1 <= 2e+157))
		tmp = Float64(Float64(a + z) - b);
	else
		tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+47], N[Not[LessEqual[t$95$1, 2e+157]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\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)) < -5.00000000000000022e47 or 1.99999999999999997e157 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 32.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. lower-+.f6470.3

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

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

    if -5.00000000000000022e47 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999997e157

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
      2. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(a, t, \color{blue}{z \cdot x}\right)}{t + x} \]
      5. lower-+.f6464.6

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

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

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

Alternative 9: 69.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+157}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\

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


\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)) < -2.00000000000000008e36

    1. Initial program 48.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. 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. lift--.f64N/A

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

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

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

        \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y \cdot \frac{b}{\left(x + t\right) + y}} \]
      6. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000008e36 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999997e157

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{a \cdot t + x \cdot z}{t + x}} \]
      2. lower-fma.f64N/A

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

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

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

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

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

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

    1. Initial program 18.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. 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. lift--.f64N/A

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

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

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

        \[\leadsto \frac{\left(x + y\right) \cdot z + \left(t + y\right) \cdot a}{\left(x + t\right) + y} - \color{blue}{y \cdot \frac{b}{\left(x + t\right) + y}} \]
      6. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 59.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+20} \lor \neg \left(x \leq 1.25 \cdot 10^{+183}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{-b}{x}, y, z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + z\right) - b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= x -1.3e+20) (not (<= x 1.25e+183)))
   (fma (/ (- b) x) y z)
   (- (+ a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x <= -1.3e+20) || !(x <= 1.25e+183)) {
		tmp = fma((-b / x), y, z);
	} else {
		tmp = (a + z) - b;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((x <= -1.3e+20) || !(x <= 1.25e+183))
		tmp = fma(Float64(Float64(-b) / x), y, z);
	else
		tmp = Float64(Float64(a + z) - b);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.3e+20], N[Not[LessEqual[x, 1.25e+183]], $MachinePrecision]], N[(N[((-b) / x), $MachinePrecision] * y + z), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{+20} \lor \neg \left(x \leq 1.25 \cdot 10^{+183}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{-b}{x}, y, z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3e20 or 1.25000000000000002e183 < x

    1. Initial program 61.1%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(a, y, z \cdot \left(x + y\right) - b \cdot y\right)}}{x + y} \]
      4. distribute-rgt-inN/A

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \color{blue}{\left(x \cdot z + y \cdot z\right)} - b \cdot y\right)}{x + y} \]
      5. associate--l+N/A

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, y \cdot z - \color{blue}{y \cdot b}\right)\right)}{x + y} \]
      9. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{b}{x}, y, z\right) \]
      3. Step-by-step derivation
        1. Applied rewrites61.9%

          \[\leadsto \mathsf{fma}\left(\frac{-b}{x}, y, z\right) \]

        if -1.3e20 < x < 1.25000000000000002e183

        1. Initial program 59.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. lower-+.f6464.9

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+20} \lor \neg \left(x \leq 1.25 \cdot 10^{+183}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{-b}{x}, y, z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a + z\right) - b\\ \end{array} \]
      6. Add Preprocessing

      Alternative 11: 58.3% accurate, 1.4× speedup?

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

        1. Initial program 61.1%

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

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

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

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

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(a, y, z \cdot \left(x + y\right) - b \cdot y\right)}}{x + y} \]
          4. distribute-rgt-inN/A

            \[\leadsto \frac{\mathsf{fma}\left(a, y, \color{blue}{\left(x \cdot z + y \cdot z\right)} - b \cdot y\right)}{x + y} \]
          5. associate--l+N/A

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

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

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

            \[\leadsto \frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, y \cdot z - \color{blue}{y \cdot b}\right)\right)}{x + y} \]
          9. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

            \[\leadsto z + -1 \cdot \color{blue}{\frac{b \cdot y}{x}} \]
          3. Step-by-step derivation
            1. Applied rewrites58.5%

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

            if -1.3e20 < x < 1.25000000000000002e183

            1. Initial program 59.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. lower-+.f6464.9

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

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

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

          Alternative 12: 56.0% accurate, 1.9× speedup?

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

            1. Initial program 65.9%

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

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

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

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

                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(a, y, z \cdot \left(x + y\right) - b \cdot y\right)}}{x + y} \]
              4. distribute-rgt-inN/A

                \[\leadsto \frac{\mathsf{fma}\left(a, y, \color{blue}{\left(x \cdot z + y \cdot z\right)} - b \cdot y\right)}{x + y} \]
              5. associate--l+N/A

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

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

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

                \[\leadsto \frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, y \cdot z - \color{blue}{y \cdot b}\right)\right)}{x + y} \]
              9. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

                \[\leadsto z + \frac{a \cdot y}{\color{blue}{x}} \]
              3. Step-by-step derivation
                1. Applied rewrites51.6%

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

                if -1.3e20 < x

                1. Initial program 57.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. lower-+.f6462.6

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

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

              Alternative 13: 48.1% accurate, 2.8× speedup?

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

                1. Initial program 49.5%

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

                  \[\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. lower-+.f6461.9

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

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

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

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

                  if -2.15e101 < a < 6.5000000000000003e65

                  1. Initial program 65.4%

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

                    \[\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. lower-+.f6452.0

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

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

                    \[\leadsto z - \color{blue}{b} \]
                  7. Step-by-step derivation
                    1. Applied rewrites51.3%

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.15 \cdot 10^{+101} \lor \neg \left(a \leq 6.5 \cdot 10^{+65}\right):\\ \;\;\;\;a - b\\ \mathbf{else}:\\ \;\;\;\;z - b\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 14: 53.2% accurate, 3.5× speedup?

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

                    1. Initial program 65.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. lower-+.f6435.3

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

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

                      \[\leadsto z - \color{blue}{b} \]
                    7. Step-by-step derivation
                      1. Applied rewrites41.7%

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

                      if -1.3e20 < x

                      1. Initial program 57.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. lower-+.f6462.6

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

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

                    Alternative 15: 37.4% accurate, 11.3× speedup?

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

                      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
                    2. 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. lower-+.f6455.5

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

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

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

                        \[\leadsto a - \color{blue}{b} \]
                      2. Add Preprocessing

                      Alternative 16: 12.6% 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 59.9%

                        \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
                      2. 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. lower-+.f6455.5

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

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

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

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

                        Developer Target 1: 82.8% 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 2024296 
                        (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)))