Average Error: 26.4 → 0.7
Time: 23.4s
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(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\ t_2 := x + \left(y + t\right)\\ t_3 := y \cdot \frac{z - b}{t_2} + \mathsf{fma}\left(a, \frac{y}{t_2} + \frac{t}{t_2}, z \cdot \frac{x}{t_2}\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+246}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, z - b, \mathsf{fma}\left(y + t, a, x \cdot z\right)\right)}{t_2}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \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 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) (+ y (+ x t))))
        (t_2 (+ x (+ y t)))
        (t_3
         (+
          (* y (/ (- z b) t_2))
          (fma a (+ (/ y t_2) (/ t t_2)) (* z (/ x t_2))))))
   (if (<= t_1 (- INFINITY))
     t_3
     (if (<= t_1 5e+246)
       (/ (fma y (- z b) (fma (+ y t) a (* x z))) t_2)
       t_3))))
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 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
	double t_2 = x + (y + t);
	double t_3 = (y * ((z - b) / t_2)) + fma(a, ((y / t_2) + (t / t_2)), (z * (x / t_2)));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t_3;
	} else if (t_1 <= 5e+246) {
		tmp = fma(y, (z - b), fma((y + t), a, (x * z))) / t_2;
	} else {
		tmp = t_3;
	}
	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(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t)))
	t_2 = Float64(x + Float64(y + t))
	t_3 = Float64(Float64(y * Float64(Float64(z - b) / t_2)) + fma(a, Float64(Float64(y / t_2) + Float64(t / t_2)), Float64(z * Float64(x / t_2))))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = t_3;
	elseif (t_1 <= 5e+246)
		tmp = Float64(fma(y, Float64(z - b), fma(Float64(y + t), a, Float64(x * z))) / t_2);
	else
		tmp = t_3;
	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[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $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]}, Block[{t$95$3 = N[(N[(y * N[(N[(z - b), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(y / t$95$2), $MachinePrecision] + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$3, If[LessEqual[t$95$1, 5e+246], N[(N[(y * N[(z - b), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a + N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$3]]]]]
\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(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := x + \left(y + t\right)\\
t_3 := y \cdot \frac{z - b}{t_2} + \mathsf{fma}\left(a, \frac{y}{t_2} + \frac{t}{t_2}, z \cdot \frac{x}{t_2}\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_3\\

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

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}

Error

Target

Original26.4
Target11.4
Herbie0.7
\[\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 2 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 4.99999999999999976e246 < (/.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.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. Simplified61.6

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

      \[\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)} + a \cdot \left(\frac{y}{y + \left(t + x\right)} + \frac{t}{y + \left(t + x\right)}\right)\right)} \]
    4. Simplified1.3

      \[\leadsto \color{blue}{\frac{z - b}{x + \left(t + y\right)} \cdot y + \mathsf{fma}\left(a, \frac{y}{x + \left(t + y\right)} + \frac{t}{x + \left(t + y\right)}, \frac{x}{x + \left(t + y\right)} \cdot z\right)} \]
      Proof
      (+.f64 (*.f64 (/.f64 (-.f64 z b) (+.f64 x (+.f64 t y))) y) (fma.f64 a (+.f64 (/.f64 y (+.f64 x (+.f64 t y))) (/.f64 t (+.f64 x (+.f64 t y)))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 (-.f64 z b) (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x t) y))) y) (fma.f64 a (+.f64 (/.f64 y (+.f64 x (+.f64 t y))) (/.f64 t (+.f64 x (+.f64 t y)))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 (-.f64 z b) (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 t x)) y)) y) (fma.f64 a (+.f64 (/.f64 y (+.f64 x (+.f64 t y))) (/.f64 t (+.f64 x (+.f64 t y)))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 (-.f64 z b) (Rewrite<= +-commutative_binary64 (+.f64 y (+.f64 t x)))) y) (fma.f64 a (+.f64 (/.f64 y (+.f64 x (+.f64 t y))) (/.f64 t (+.f64 x (+.f64 t y)))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-/r/_binary64 (/.f64 (-.f64 z b) (/.f64 (+.f64 y (+.f64 t x)) y))) (fma.f64 a (+.f64 (/.f64 y (+.f64 x (+.f64 t y))) (/.f64 t (+.f64 x (+.f64 t y)))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 13 points increase in error, 20 points decrease in error
      (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x)))) (fma.f64 a (+.f64 (/.f64 y (+.f64 x (+.f64 t y))) (/.f64 t (+.f64 x (+.f64 t y)))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 62 points increase in error, 10 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x t) y))) (/.f64 t (+.f64 x (+.f64 t y)))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 t x)) y)) (/.f64 t (+.f64 x (+.f64 t y)))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (Rewrite<= +-commutative_binary64 (+.f64 y (+.f64 t x)))) (/.f64 t (+.f64 x (+.f64 t y)))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (+.f64 y (+.f64 t x))) (/.f64 t (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x t) y)))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (+.f64 y (+.f64 t x))) (/.f64 t (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 t x)) y))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (+.f64 y (+.f64 t x))) (/.f64 t (Rewrite<= +-commutative_binary64 (+.f64 y (+.f64 t x))))) (*.f64 (/.f64 x (+.f64 x (+.f64 t y))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (+.f64 y (+.f64 t x))) (/.f64 t (+.f64 y (+.f64 t x)))) (*.f64 (/.f64 x (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x t) y))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (+.f64 y (+.f64 t x))) (/.f64 t (+.f64 y (+.f64 t x)))) (*.f64 (/.f64 x (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 t x)) y)) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (+.f64 y (+.f64 t x))) (/.f64 t (+.f64 y (+.f64 t x)))) (*.f64 (/.f64 x (Rewrite<= +-commutative_binary64 (+.f64 y (+.f64 t x)))) z))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (+.f64 y (+.f64 t x))) (/.f64 t (+.f64 y (+.f64 t x)))) (Rewrite<= associate-/r/_binary64 (/.f64 x (/.f64 (+.f64 y (+.f64 t x)) z))))): 20 points increase in error, 4 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (+.f64 y (+.f64 t x))) (/.f64 t (+.f64 y (+.f64 t x)))) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 x z) (+.f64 y (+.f64 t x)))))): 22 points increase in error, 19 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (fma.f64 a (+.f64 (/.f64 y (+.f64 y (+.f64 t x))) (/.f64 t (+.f64 y (+.f64 t x)))) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 z x)) (+.f64 y (+.f64 t x))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 a (+.f64 (/.f64 y (+.f64 y (+.f64 t x))) (/.f64 t (+.f64 y (+.f64 t x))))) (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (-.f64 z b) y) (+.f64 y (+.f64 t x))) (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (*.f64 a (+.f64 (/.f64 y (+.f64 y (+.f64 t x))) (/.f64 t (+.f64 y (+.f64 t x)))))))): 0 points increase in error, 0 points decrease in error

    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.99999999999999976e246

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, z - b, \mathsf{fma}\left(y + t, a, x \cdot z\right)\right)}{x + \left(y + t\right)}} \]
      Proof
      (/.f64 (fma.f64 y (-.f64 z b) (fma.f64 (+.f64 y t) a (*.f64 x z))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 y (-.f64 z b) (fma.f64 (Rewrite<= +-commutative_binary64 (+.f64 t y)) a (*.f64 x z))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 y (-.f64 z b) (fma.f64 (+.f64 t y) a (Rewrite<= *-commutative_binary64 (*.f64 z x)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 y (-.f64 z b) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (+.f64 t y) a) (*.f64 z x)))) (+.f64 x (+.f64 y t))): 1 points increase in error, 0 points decrease in error
      (/.f64 (fma.f64 y (-.f64 z b) (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 z x) (*.f64 (+.f64 t y) a)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 y (-.f64 z b)) (+.f64 (*.f64 z x) (*.f64 (+.f64 t y) a)))) (+.f64 x (+.f64 y t))): 1 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 y z) (*.f64 y b))) (+.f64 (*.f64 z x) (*.f64 (+.f64 t y) a))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (*.f64 y z) (neg.f64 (*.f64 y b)))) (+.f64 (*.f64 z x) (*.f64 (+.f64 t y) a))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite=> +-commutative_binary64 (+.f64 (neg.f64 (*.f64 y b)) (*.f64 y z))) (+.f64 (*.f64 z x) (*.f64 (+.f64 t y) a))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= associate-+r+_binary64 (+.f64 (neg.f64 (*.f64 y b)) (+.f64 (*.f64 y z) (+.f64 (*.f64 z x) (*.f64 (+.f64 t y) a))))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (neg.f64 (*.f64 y b)) (+.f64 (*.f64 y z) (+.f64 (Rewrite=> *-commutative_binary64 (*.f64 x z)) (*.f64 (+.f64 t y) a)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (neg.f64 (*.f64 y b)) (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 (*.f64 y z) (*.f64 x z)) (*.f64 (+.f64 t y) a)))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (neg.f64 (*.f64 y b)) (+.f64 (Rewrite<= distribute-rgt-in_binary64 (*.f64 z (+.f64 y x))) (*.f64 (+.f64 t y) a))) (+.f64 x (+.f64 y t))): 0 points increase in error, 1 points decrease in error
      (/.f64 (+.f64 (neg.f64 (*.f64 y b)) (+.f64 (*.f64 z (Rewrite<= +-commutative_binary64 (+.f64 x y))) (*.f64 (+.f64 t y) a))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (neg.f64 (*.f64 y b)) (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 x y) z)) (*.f64 (+.f64 t y) a))) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 (+.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. Recombined 2 regimes into one program.
  4. Final simplification0.7

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

Alternatives

Alternative 1
Error0.7
Cost11592
\[\begin{array}{l} t_1 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\ t_2 := x + \left(y + t\right)\\ t_3 := y \cdot \frac{z - b}{t_2} + \mathsf{fma}\left(a, \frac{y}{t_2} + \frac{t}{t_2}, z \cdot \frac{x}{t_2}\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+246}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 2
Error8.1
Cost4168
\[\begin{array}{l} t_1 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;a + y \cdot \frac{z - b}{x + \left(y + t\right)}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+246}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
Alternative 3
Error17.4
Cost2004
\[\begin{array}{l} t_1 := a + y \cdot \frac{z - b}{x + \left(y + t\right)}\\ t_2 := \frac{a}{x} - \frac{z}{x}\\ t_3 := \left(z + \left(z - b\right) \cdot \frac{y}{x}\right) + \left(y + t\right) \cdot t_2\\ \mathbf{if}\;x \leq -8.368580453621191 \cdot 10^{+122}:\\ \;\;\;\;z + t \cdot t_2\\ \mathbf{elif}\;x \leq -282150278.22397727:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;x \leq 4.7233495681839363 \cdot 10^{+82}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.9901235372307916 \cdot 10^{+136}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 2.6204877418423273 \cdot 10^{+190}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error28.7
Cost1892
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := a + x \cdot \left(\frac{z}{t} - \frac{a}{t}\right)\\ t_3 := z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\\ \mathbf{if}\;y \leq -2.308505705319376 \cdot 10^{-157}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.0146604229612955 \cdot 10^{-225}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.644700358417518 \cdot 10^{-249}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.0345715945995036 \cdot 10^{-305}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 7.043776489121805 \cdot 10^{-298}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 3.4703963223151456 \cdot 10^{-213}:\\ \;\;\;\;a + \frac{y \cdot \left(z - b\right)}{t}\\ \mathbf{elif}\;y \leq 3.517225297324273 \cdot 10^{-174}:\\ \;\;\;\;\frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 4.5650308148254516 \cdot 10^{-145}:\\ \;\;\;\;a + y \cdot \frac{z - b}{t}\\ \mathbf{elif}\;y \leq 7.207091479943091 \cdot 10^{-34}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error27.2
Cost1760
\[\begin{array}{l} t_1 := y + \left(x + t\right)\\ t_2 := z \cdot \frac{x + y}{t_1}\\ t_3 := \left(z + a\right) - b\\ t_4 := a + \frac{y \cdot \left(z - b\right)}{t}\\ \mathbf{if}\;y \leq -5.252917950395401 \cdot 10^{-137}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -3.4155681674507346 \cdot 10^{-252}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.0345715945995036 \cdot 10^{-305}:\\ \;\;\;\;a + x \cdot \left(\frac{z}{t} - \frac{a}{t}\right)\\ \mathbf{elif}\;y \leq 7.043776489121805 \cdot 10^{-298}:\\ \;\;\;\;z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\\ \mathbf{elif}\;y \leq 3.4703963223151456 \cdot 10^{-213}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 3.517225297324273 \cdot 10^{-174}:\\ \;\;\;\;\frac{z \cdot \left(x + y\right)}{t_1}\\ \mathbf{elif}\;y \leq 1.8842865478438727 \cdot 10^{-120}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 1.6521734866230077 \cdot 10^{-51}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 6
Error28.7
Cost1496
\[\begin{array}{l} t_1 := \frac{z \cdot \left(x + y\right)}{y + \left(x + t\right)}\\ t_2 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -5.252917950395401 \cdot 10^{-137}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.4260899991143836 \cdot 10^{-249}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.4703963223151456 \cdot 10^{-213}:\\ \;\;\;\;a + \frac{y \cdot \left(z - b\right)}{t}\\ \mathbf{elif}\;y \leq 3.517225297324273 \cdot 10^{-174}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.5650308148254516 \cdot 10^{-145}:\\ \;\;\;\;a + y \cdot \frac{z - b}{t}\\ \mathbf{elif}\;y \leq 7.207091479943091 \cdot 10^{-34}:\\ \;\;\;\;z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error25.6
Cost1496
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\\ \mathbf{if}\;x \leq -8.368580453621191 \cdot 10^{+122}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.220741340670358 \cdot 10^{-168}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.6396191842515624 \cdot 10^{-120}:\\ \;\;\;\;a + y \cdot \frac{z - b}{t}\\ \mathbf{elif}\;x \leq 3.1961033778970084 \cdot 10^{+66}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.048080469345029 \cdot 10^{+112}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{elif}\;x \leq 4.506844363389677 \cdot 10^{+210}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error18.4
Cost1492
\[\begin{array}{l} t_1 := z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\\ t_2 := a + y \cdot \frac{z - b}{x + \left(y + t\right)}\\ \mathbf{if}\;x \leq -8.368580453621191 \cdot 10^{+122}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -282150278.22397727:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;x \leq 3.1961033778970084 \cdot 10^{+66}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.9901235372307916 \cdot 10^{+136}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{elif}\;x \leq 2.6204877418423273 \cdot 10^{+190}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error25.4
Cost1232
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\\ \mathbf{if}\;x \leq -8.368580453621191 \cdot 10^{+122}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.220741340670358 \cdot 10^{-168}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.6396191842515624 \cdot 10^{-120}:\\ \;\;\;\;a + y \cdot \frac{z - b}{t}\\ \mathbf{elif}\;x \leq 4.506844363389677 \cdot 10^{+210}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error27.8
Cost1036
\[\begin{array}{l} t_1 := y + \left(x + t\right)\\ \mathbf{if}\;b \leq -2.8470941408647307 \cdot 10^{+246}:\\ \;\;\;\;\frac{-b}{\frac{t_1}{y}}\\ \mathbf{elif}\;b \leq -2.7606582595522713 \cdot 10^{+210}:\\ \;\;\;\;t \cdot \frac{a}{x + t}\\ \mathbf{elif}\;b \leq 6.0080785338414055 \cdot 10^{+149}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-b}{t_1}\\ \end{array} \]
Alternative 11
Error28.6
Cost976
\[\begin{array}{l} t_1 := t \cdot \frac{a}{x + t}\\ t_2 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -5.396783917294667 \cdot 10^{-298}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3.4703963223151456 \cdot 10^{-213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.517225297324273 \cdot 10^{-174}:\\ \;\;\;\;\frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 9.70807024430843 \cdot 10^{-120}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 12
Error36.1
Cost856
\[\begin{array}{l} \mathbf{if}\;z \leq -1104787.2093494297:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 3.0668112239154187 \cdot 10^{-26}:\\ \;\;\;\;a\\ \mathbf{elif}\;z \leq 5.883493712795739:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 3.4437319821674193 \cdot 10^{+103}:\\ \;\;\;\;a\\ \mathbf{elif}\;z \leq 5.824061549351253 \cdot 10^{+141}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 1.603341767455567 \cdot 10^{+185}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
Alternative 13
Error27.9
Cost716
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;x \leq -8.368580453621191 \cdot 10^{+122}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 1.9893701421524756 \cdot 10^{-172}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.6396191842515624 \cdot 10^{-120}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error26.5
Cost708
\[\begin{array}{l} \mathbf{if}\;t \leq 9.822826646216223 \cdot 10^{+119}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a + y \cdot \frac{z - b}{t}\\ \end{array} \]
Alternative 15
Error42.7
Cost64
\[z \]

Error

Reproduce

herbie shell --seed 2022295 
(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)))