Average Error: 26.2 → 7.6
Time: 17.9s
Precision: binary64
Cost: 16712
\[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
\[\begin{array}{l} t_1 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\ t_2 := x + \left(y + t\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{z - b}{\frac{t_2}{y}} + \left(z + a\right)\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+260}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y + t, a, \mathsf{fma}\left(x, z, y \cdot \left(z - b\right)\right)\right)}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) (+ y (+ x t))))
        (t_2 (+ x (+ y t))))
   (if (<= t_1 (- INFINITY))
     (+ (/ (- z b) (/ t_2 y)) (+ z a))
     (if (<= t_1 5e+260)
       (/ (fma (+ y t) a (fma x z (* y (- z b)))) t_2)
       (- (+ z a) b)))))
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);
}
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t));
	double t_2 = x + (y + t);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = ((z - b) / (t_2 / y)) + (z + a);
	} else if (t_1 <= 5e+260) {
		tmp = fma((y + t), a, fma(x, z, (y * (z - b)))) / t_2;
	} else {
		tmp = (z + a) - b;
	}
	return tmp;
}
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 code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t)))
	t_2 = Float64(x + Float64(y + t))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(Float64(z - b) / Float64(t_2 / y)) + Float64(z + a));
	elseif (t_1 <= 5e+260)
		tmp = Float64(fma(Float64(y + t), a, fma(x, z, Float64(y * Float64(z - b)))) / t_2);
	else
		tmp = Float64(Float64(z + a) - b);
	end
	return tmp
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]
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$2 / y), $MachinePrecision]), $MachinePrecision] + N[(z + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+260], N[(N[(N[(y + t), $MachinePrecision] * a + N[(x * z + N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\begin{array}{l}
t_1 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := x + \left(y + t\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\frac{z - b}{\frac{t_2}{y}} + \left(z + a\right)\\

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+260}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + t, a, \mathsf{fma}\left(x, z, y \cdot \left(z - b\right)\right)\right)}{t_2}\\

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


\end{array}

Error

Target

Original26.2
Target11.1
Herbie7.6
\[\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} < -3.5813117084150564 \cdot 10^{+153}:\\ \;\;\;\;\left(z + a\right) - b\\ \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} < 1.2285964308315609 \cdot 10^{+82}:\\ \;\;\;\;\frac{1}{\frac{\left(x + t\right) + y}{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]

Derivation

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y + t, a, \mathsf{fma}\left(x, z, y \cdot \left(z - b\right)\right)\right)}{x + \left(y + t\right)}} \]
      Proof
      (/.f64 (fma.f64 (+.f64 y t) a (fma.f64 x z (*.f64 y (-.f64 z b)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (Rewrite<= +-commutative_binary64 (+.f64 t y)) a (fma.f64 x z (*.f64 y (-.f64 z b)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (fma.f64 x z (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 y z) (*.f64 y b))))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (fma.f64 x z (Rewrite<= unsub-neg_binary64 (+.f64 (*.f64 y z) (neg.f64 (*.f64 y b)))))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x z) (+.f64 (*.f64 y z) (neg.f64 (*.f64 y b)))))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 (*.f64 x z) (*.f64 y z)) (neg.f64 (*.f64 y b))))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (+.f64 (Rewrite<= distribute-rgt-in_binary64 (*.f64 z (+.f64 x y))) (neg.f64 (*.f64 y b)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 x y) z)) (neg.f64 (*.f64 y b)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (+.f64 t y) a) (+.f64 (*.f64 (+.f64 x y) z) (neg.f64 (*.f64 y b))))) (+.f64 x (+.f64 y t))): 1 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 (*.f64 (+.f64 t y) a) (*.f64 (+.f64 x y) z)) (neg.f64 (*.f64 y b)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a))) (neg.f64 (*.f64 y b))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= sub-neg_binary64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 x (Rewrite<= +-commutative_binary64 (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x t) y))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in a around inf 64.0

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

      \[\leadsto \color{blue}{\frac{z - b}{\frac{x + \left(t + y\right)}{y}} + \left(\frac{z \cdot x}{x + \left(t + y\right)} + \frac{a}{x + \left(t + y\right)} \cdot \left(t + y\right)\right)} \]
      Proof
      (+.f64 (/.f64 (-.f64 z b) (/.f64 (+.f64 x (+.f64 t y)) y)) (+.f64 (/.f64 (*.f64 z x) (+.f64 x (+.f64 t y))) (*.f64 (/.f64 a (+.f64 x (+.f64 t y))) (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (-.f64 z b) (/.f64 (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x t) y)) y)) (+.f64 (/.f64 (*.f64 z x) (+.f64 x (+.f64 t y))) (*.f64 (/.f64 a (+.f64 x (+.f64 t y))) (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (-.f64 z b) (/.f64 (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 t x)) y) y)) (+.f64 (/.f64 (*.f64 z x) (+.f64 x (+.f64 t y))) (*.f64 (/.f64 a (+.f64 x (+.f64 t y))) (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (-.f64 z b) (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 y (+.f64 t x))) y)) (+.f64 (/.f64 (*.f64 z x) (+.f64 x (+.f64 t y))) (*.f64 (/.f64 a (+.f64 x (+.f64 t y))) (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x)))) (+.f64 (/.f64 (*.f64 z x) (+.f64 x (+.f64 t y))) (*.f64 (/.f64 a (+.f64 x (+.f64 t y))) (+.f64 t y)))): 46 points increase in error, 10 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x t) y))) (*.f64 (/.f64 a (+.f64 x (+.f64 t y))) (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 t x)) y)) (*.f64 (/.f64 a (+.f64 x (+.f64 t y))) (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (Rewrite<= +-commutative_binary64 (+.f64 y (+.f64 t x)))) (*.f64 (/.f64 a (+.f64 x (+.f64 t y))) (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (*.f64 (/.f64 a (+.f64 x (Rewrite<= +-commutative_binary64 (+.f64 y t)))) (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (*.f64 (/.f64 a (Rewrite<= +-commutative_binary64 (+.f64 (+.f64 y t) x))) (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (*.f64 (/.f64 a (+.f64 (Rewrite=> +-commutative_binary64 (+.f64 t y)) x)) (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (*.f64 (/.f64 a (Rewrite<= associate-+r+_binary64 (+.f64 t (+.f64 y x)))) (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (*.f64 (/.f64 a (+.f64 t (+.f64 y x))) (Rewrite<= +-commutative_binary64 (+.f64 y t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (Rewrite<= associate-/r/_binary64 (/.f64 a (/.f64 (+.f64 t (+.f64 y x)) (+.f64 y t)))))): 5 points increase in error, 26 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (/.f64 a (/.f64 (Rewrite=> associate-+r+_binary64 (+.f64 (+.f64 t y) x)) (+.f64 y t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (/.f64 a (/.f64 (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 y t)) x) (+.f64 y t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (/.f64 a (/.f64 (Rewrite<= associate-+r+_binary64 (+.f64 y (+.f64 t x))) (+.f64 y t))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x)))))): 44 points increase in error, 4 points decrease in error
    5. Taylor expanded in x around 0 22.0

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y + t, a, \mathsf{fma}\left(x, z, y \cdot \left(z - b\right)\right)\right)}{x + \left(y + t\right)}} \]
      Proof
      (/.f64 (fma.f64 (+.f64 y t) a (fma.f64 x z (*.f64 y (-.f64 z b)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (Rewrite<= +-commutative_binary64 (+.f64 t y)) a (fma.f64 x z (*.f64 y (-.f64 z b)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (fma.f64 x z (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 y z) (*.f64 y b))))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (fma.f64 x z (Rewrite<= unsub-neg_binary64 (+.f64 (*.f64 y z) (neg.f64 (*.f64 y b)))))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (Rewrite<= fma-def_binary64 (+.f64 (*.f64 x z) (+.f64 (*.f64 y z) (neg.f64 (*.f64 y b)))))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 (*.f64 x z) (*.f64 y z)) (neg.f64 (*.f64 y b))))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (+.f64 (Rewrite<= distribute-rgt-in_binary64 (*.f64 z (+.f64 x y))) (neg.f64 (*.f64 y b)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 (+.f64 t y) a (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 x y) z)) (neg.f64 (*.f64 y b)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (+.f64 t y) a) (+.f64 (*.f64 (+.f64 x y) z) (neg.f64 (*.f64 y b))))) (+.f64 x (+.f64 y t))): 1 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 (*.f64 (+.f64 t y) a) (*.f64 (+.f64 x y) z)) (neg.f64 (*.f64 y b)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a))) (neg.f64 (*.f64 y b))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= sub-neg_binary64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 x (Rewrite<= +-commutative_binary64 (+.f64 t y)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x t) y))): 0 points increase in error, 0 points decrease in error

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

    1. Initial program 61.3

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

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

      \[\leadsto \color{blue}{\left(z + a\right) - b} \]
      Proof
      (-.f64 (+.f64 z a) b): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 a z)) b): 0 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification7.6

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

Alternatives

Alternative 1
Error7.6
Cost4168
\[\begin{array}{l} t_1 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{z - b}{\frac{x + \left(y + t\right)}{y}} + \left(z + a\right)\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+260}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
Alternative 2
Error23.4
Cost2280
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := \frac{z - b}{\frac{x + \left(y + t\right)}{y}} + \left(z + a\right)\\ t_3 := y \cdot \frac{z - b}{t} + \left(a + \frac{x}{\frac{t}{z}}\right)\\ t_4 := y + \left(x + t\right)\\ t_5 := a - \frac{b}{\frac{t_4}{y}}\\ \mathbf{if}\;t \leq -1.1 \cdot 10^{+153}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq -6.9 \cdot 10^{+89}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -1.7 \cdot 10^{+78}:\\ \;\;\;\;a + z \cdot \frac{x}{t}\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{-271}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-228}:\\ \;\;\;\;\frac{y \cdot t_1}{t_4}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-160}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-155}:\\ \;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{t_4}\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{-147}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{+110}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+145}:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 3
Error22.7
Cost1884
\[\begin{array}{l} t_1 := \frac{z - b}{\frac{x + \left(y + t\right)}{y}} + \left(z + a\right)\\ t_2 := y \cdot \frac{z - b}{t} + \left(a + \frac{x}{\frac{t}{z}}\right)\\ \mathbf{if}\;t \leq -2.6 \cdot 10^{+155}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -6.9 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.35 \cdot 10^{+82}:\\ \;\;\;\;a + z \cdot \frac{x}{t}\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{-282}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-148}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+105}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{+145}:\\ \;\;\;\;a - \frac{b}{\frac{y + \left(x + t\right)}{y}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error27.7
Cost1364
\[\begin{array}{l} t_1 := y + \left(x + t\right)\\ t_2 := \left(x + y\right) \cdot \frac{z}{t_1}\\ \mathbf{if}\;z \leq -4.3 \cdot 10^{+102}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-284}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-122}:\\ \;\;\;\;\left(y + t\right) \cdot \frac{a}{t_1}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+67}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+294}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;z + a\\ \end{array} \]
Alternative 5
Error23.1
Cost1364
\[\begin{array}{l} t_1 := y + \left(x + t\right)\\ t_2 := \left(x + y\right) \cdot \frac{z}{t_1}\\ t_3 := a - \frac{b}{\frac{t_1}{y}}\\ \mathbf{if}\;z \leq -2.8 \cdot 10^{+84}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-122}:\\ \;\;\;\;a + \frac{y \cdot \left(z - b\right)}{y + t}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-95}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{+91}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{+138}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error25.2
Cost1364
\[\begin{array}{l} t_1 := a + \frac{y \cdot \left(z - b\right)}{y + t}\\ t_2 := y + \left(x + t\right)\\ t_3 := \left(x + y\right) \cdot \frac{z}{t_2}\\ \mathbf{if}\;z \leq -1.35 \cdot 10^{+91}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-121}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-230}:\\ \;\;\;\;a - \frac{b}{\frac{t_2}{y}}\\ \mathbf{elif}\;z \leq 0.00026:\\ \;\;\;\;\frac{a}{\frac{t + \left(x + y\right)}{y + t}}\\ \mathbf{elif}\;z \leq 1.42 \cdot 10^{+136}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 7
Error25.2
Cost1364
\[\begin{array}{l} t_1 := a + \frac{y \cdot \left(z - b\right)}{y + t}\\ t_2 := y + \left(x + t\right)\\ \mathbf{if}\;z \leq -1 \cdot 10^{+83}:\\ \;\;\;\;\left(x + y\right) \cdot \frac{z}{t_2}\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-121}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-232}:\\ \;\;\;\;a - \frac{b}{\frac{t_2}{y}}\\ \mathbf{elif}\;z \leq 0.00017:\\ \;\;\;\;\frac{a}{\frac{t + \left(x + y\right)}{y + t}}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+135}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x + y}{\frac{x + \left(y + t\right)}{z}}\\ \end{array} \]
Alternative 8
Error26.5
Cost1232
\[\begin{array}{l} t_1 := a + \frac{y \cdot \left(z - b\right)}{y + t}\\ t_2 := y + \left(x + t\right)\\ t_3 := \left(x + y\right) \cdot \frac{z}{t_2}\\ \mathbf{if}\;z \leq -6.8 \cdot 10^{+83}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{-284}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-151}:\\ \;\;\;\;\left(y + t\right) \cdot \frac{a}{t_2}\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+135}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 9
Error26.7
Cost1112
\[\begin{array}{l} t_1 := a + z \cdot \frac{x}{t}\\ t_2 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -5.5 \cdot 10^{+26}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-121}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;y \leq -1.26 \cdot 10^{-203}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-273}:\\ \;\;\;\;z + a\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{-165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8.6 \cdot 10^{+159}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error26.3
Cost584
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -1.05 \cdot 10^{+32}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8.6 \cdot 10^{+159}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error35.9
Cost328
\[\begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{-30}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+135}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
Alternative 12
Error30.5
Cost324
\[\begin{array}{l} \mathbf{if}\;x \leq 3 \cdot 10^{+246}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
Alternative 13
Error42.9
Cost64
\[a \]

Error

Reproduce

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

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

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