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

\mathbf{elif}\;t_3 \leq 4 \cdot 10^{+302}:\\
\;\;\;\;\frac{t_2 - y \cdot b}{t_1} + z \cdot \frac{x + y}{t_1}\\

\mathbf{else}:\\
\;\;\;\;t_5\\


\end{array}

Error

Target

Original26.4
Target11.5
Herbie0.3
\[\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.0000000000000003e302 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 63.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. Simplified63.9

      \[\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, 0 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 45.3

      \[\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. Simplified0.1

      \[\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))): 5 points increase in error, 22 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))): 70 points increase in error, 8 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))))): 18 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-/l*_binary64 (/.f64 (*.f64 x z) (+.f64 y (+.f64 t x)))))): 20 points increase in error, 15 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.0000000000000003e302

    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. Taylor expanded in z around inf 0.4

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

      \[\leadsto \color{blue}{\frac{a \cdot \left(y + t\right) - y \cdot b}{y + \left(t + x\right)} + \frac{y + x}{y + \left(t + x\right)} \cdot z} \]
      Proof
      (+.f64 (/.f64 (-.f64 (*.f64 a (+.f64 y t)) (*.f64 y b)) (+.f64 y (+.f64 t x))) (*.f64 (/.f64 (+.f64 y x) (+.f64 y (+.f64 t x))) z)): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (-.f64 (*.f64 a (+.f64 y t)) (*.f64 y b)) (+.f64 y (+.f64 t x))) (Rewrite<= associate-/r/_binary64 (/.f64 (+.f64 y x) (/.f64 (+.f64 y (+.f64 t x)) z)))): 22 points increase in error, 1 points decrease in error
      (+.f64 (/.f64 (-.f64 (*.f64 a (+.f64 y t)) (*.f64 y b)) (+.f64 y (+.f64 t x))) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (+.f64 y x) z) (+.f64 y (+.f64 t x))))): 31 points increase in error, 18 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 (+.f64 y x) z) (+.f64 y (+.f64 t x))) (/.f64 (-.f64 (*.f64 a (+.f64 y t)) (*.f64 y b)) (+.f64 y (+.f64 t x))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 (+.f64 y x) z) (+.f64 y (+.f64 t x))) (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))))): 0 points increase in error, 3 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (/.f64 (*.f64 (+.f64 y x) z) (+.f64 y (+.f64 t x))) (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x)))) (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x))))): 0 points increase in error, 0 points decrease in error
  3. Recombined 2 regimes into one program.
  4. Final simplification0.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(\left(y + t\right) \cdot a + \left(x + y\right) \cdot z\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(\left(y + t\right) \cdot a + \left(x + y\right) \cdot z\right) - y \cdot b}{y + \left(x + t\right)} \leq 4 \cdot 10^{+302}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{y + \left(x + t\right)} + z \cdot \frac{x + y}{y + \left(x + 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
Error8.1
Cost4552
\[\begin{array}{l} t_1 := y + \left(x + t\right)\\ t_2 := a + y \cdot \frac{z - b}{x + \left(y + t\right)}\\ t_3 := \left(y + t\right) \cdot a\\ t_4 := \frac{\left(t_3 + \left(x + y\right) \cdot z\right) - y \cdot b}{t_1}\\ \mathbf{if}\;t_4 \leq -\infty:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_4 \leq 4 \cdot 10^{+302}:\\ \;\;\;\;\frac{t_3 - y \cdot b}{t_1} + z \cdot \frac{x + y}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error8.0
Cost4168
\[\begin{array}{l} t_1 := \frac{\left(\left(y + t\right) \cdot a + \left(x + y\right) \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\ t_2 := a + y \cdot \frac{z - b}{x + \left(y + t\right)}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{+302}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error14.7
Cost2136
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := y \cdot \frac{z - b}{t_1}\\ t_3 := t_2 + \left(z + t \cdot \frac{a}{x + t}\right)\\ t_4 := a + t_2\\ \mathbf{if}\;x \leq -4.6028025338429196 \cdot 10^{+148}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -7.077814748144417 \cdot 10^{+105}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x \leq -8.084747546503652 \cdot 10^{+68}:\\ \;\;\;\;z + \frac{\left(y + t\right) \cdot \left(a - z\right) + y \cdot \left(z - b\right)}{x}\\ \mathbf{elif}\;x \leq -1.8775188450309817 \cdot 10^{+56}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;x \leq -1.7733788466466927 \cdot 10^{+43}:\\ \;\;\;\;\frac{z}{\frac{t_1}{x + y}}\\ \mathbf{elif}\;x \leq 8.342333153809134 \cdot 10^{+22}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error23.1
Cost2012
\[\begin{array}{l} t_1 := \frac{\left(x + y\right) \cdot z - y \cdot b}{y + \left(x + t\right)}\\ t_2 := a + y \cdot \frac{z - b}{x + \left(y + t\right)}\\ \mathbf{if}\;y \leq -3.958410498555102 \cdot 10^{-11}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -3.4001564479129817 \cdot 10^{-98}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.3884941303440495 \cdot 10^{-182}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.3288742663014216 \cdot 10^{-273}:\\ \;\;\;\;z - b \cdot \frac{y}{x + y}\\ \mathbf{elif}\;y \leq 1.2399517924953776 \cdot 10^{-269}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{elif}\;y \leq 1.2495391725116267 \cdot 10^{-167}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.204649020789475 \cdot 10^{-80}:\\ \;\;\;\;z + \frac{\left(y + t\right) \cdot \left(a - z\right) + y \cdot \left(z - b\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error22.4
Cost1888
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := z - b \cdot \frac{y}{x + y}\\ t_3 := a + y \cdot \frac{z - b}{t_1}\\ \mathbf{if}\;y \leq -3.958410498555102 \cdot 10^{-11}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -1.5509521607631243 \cdot 10^{-46}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.3884941303440495 \cdot 10^{-182}:\\ \;\;\;\;a + \frac{1}{\frac{t_1}{y \cdot \left(z - b\right)}}\\ \mathbf{elif}\;y \leq -4.5587621904876735 \cdot 10^{-267}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -3.9708972134228903 \cdot 10^{-283}:\\ \;\;\;\;a\\ \mathbf{elif}\;y \leq 2.020795814186083 \cdot 10^{-253}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{elif}\;y \leq 9.87322670298635 \cdot 10^{-127}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{elif}\;y \leq 1.13099151848894 \cdot 10^{-117}:\\ \;\;\;\;\frac{a}{\frac{x + t}{t}}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 6
Error22.9
Cost1884
\[\begin{array}{l} t_1 := a + y \cdot \frac{z - b}{x + \left(y + t\right)}\\ t_2 := y + \left(x + t\right)\\ t_3 := \frac{\left(x + y\right) \cdot z - y \cdot b}{t_2}\\ \mathbf{if}\;y \leq -3.958410498555102 \cdot 10^{-11}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.4001564479129817 \cdot 10^{-98}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -1.3884941303440495 \cdot 10^{-182}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.3288742663014216 \cdot 10^{-273}:\\ \;\;\;\;z - b \cdot \frac{y}{x + y}\\ \mathbf{elif}\;y \leq 1.2399517924953776 \cdot 10^{-269}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{elif}\;y \leq 9.87322670298635 \cdot 10^{-127}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 5.204649020789475 \cdot 10^{-80}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{t_2}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error29.6
Cost1764
\[\begin{array}{l} t_1 := a + \frac{y \cdot \left(z - b\right)}{t}\\ t_2 := \left(z + a\right) - b\\ t_3 := \frac{a}{\frac{x + t}{t}}\\ \mathbf{if}\;y \leq -1.6933731700948773 \cdot 10^{-80}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.3884941303440495 \cdot 10^{-182}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.5587621904876735 \cdot 10^{-267}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq -6.311610713004776 \cdot 10^{-292}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 1.1622875306614593 \cdot 10^{-275}:\\ \;\;\;\;\frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 2.2861640303432026 \cdot 10^{-216}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.287033807586165 \cdot 10^{-135}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 1.045569159909196 \cdot 10^{-16}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 9.766535065919194 \cdot 10^{+128}:\\ \;\;\;\;y \cdot \frac{z - b}{y + t}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error23.0
Cost1756
\[\begin{array}{l} t_1 := \frac{\left(x + y\right) \cdot z - y \cdot b}{y + \left(x + t\right)}\\ t_2 := a + y \cdot \frac{z - b}{x + \left(y + t\right)}\\ \mathbf{if}\;y \leq -3.958410498555102 \cdot 10^{-11}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -3.4001564479129817 \cdot 10^{-98}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.3884941303440495 \cdot 10^{-182}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.3288742663014216 \cdot 10^{-273}:\\ \;\;\;\;z - b \cdot \frac{y}{x + y}\\ \mathbf{elif}\;y \leq 1.2399517924953776 \cdot 10^{-269}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{elif}\;y \leq 9.87322670298635 \cdot 10^{-127}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.13099151848894 \cdot 10^{-117}:\\ \;\;\;\;\frac{a}{\frac{x + t}{t}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 9
Error28.6
Cost1504
\[\begin{array}{l} t_1 := a + \frac{y \cdot \left(z - b\right)}{t}\\ t_2 := \left(z + a\right) - b\\ t_3 := \frac{a}{\frac{x + t}{t}}\\ \mathbf{if}\;y \leq -1.6933731700948773 \cdot 10^{-80}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.3884941303440495 \cdot 10^{-182}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.5587621904876735 \cdot 10^{-267}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq -6.311610713004776 \cdot 10^{-292}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 1.1622875306614593 \cdot 10^{-275}:\\ \;\;\;\;\frac{x \cdot z}{x + t}\\ \mathbf{elif}\;y \leq 2.2861640303432026 \cdot 10^{-216}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.287033807586165 \cdot 10^{-135}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 3.1917320506399925 \cdot 10^{-48}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error28.4
Cost1500
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := \frac{a}{\frac{x + t}{t}}\\ \mathbf{if}\;y \leq -1.6933731700948773 \cdot 10^{-80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.3884941303440495 \cdot 10^{-182}:\\ \;\;\;\;a + \frac{y \cdot \left(z - b\right)}{t}\\ \mathbf{elif}\;y \leq -4.5587621904876735 \cdot 10^{-267}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq -6.311610713004776 \cdot 10^{-292}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 9.87322670298635 \cdot 10^{-127}:\\ \;\;\;\;\frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \mathbf{elif}\;y \leq 1.045569159909196 \cdot 10^{-16}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 9.766535065919194 \cdot 10^{+128}:\\ \;\;\;\;y \cdot \frac{z - b}{y + t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error28.0
Cost1300
\[\begin{array}{l} \mathbf{if}\;t \leq -2.3793438304703663 \cdot 10^{+87}:\\ \;\;\;\;\frac{a}{\frac{x + t}{t}}\\ \mathbf{elif}\;t \leq 1.460068514992454 \cdot 10^{-176}:\\ \;\;\;\;z - b \cdot \frac{y}{x + y}\\ \mathbf{elif}\;t \leq 7.14802731233514 \cdot 10^{+50}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t \leq 3.719793946218218 \cdot 10^{+131}:\\ \;\;\;\;\left(y + t\right) \cdot \frac{a}{x + \left(y + t\right)}\\ \mathbf{elif}\;t \leq 1.7982640607387343 \cdot 10^{+215}:\\ \;\;\;\;\frac{-b}{\frac{y + \left(x + t\right)}{y}}\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 12
Error19.8
Cost1228
\[\begin{array}{l} t_1 := a + y \cdot \frac{z - b}{x + \left(y + t\right)}\\ \mathbf{if}\;t \leq -3.8721794309083907 \cdot 10^{-109}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.460068514992454 \cdot 10^{-176}:\\ \;\;\;\;z - b \cdot \frac{y}{x + y}\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error28.4
Cost976
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := \frac{a}{\frac{x + t}{t}}\\ \mathbf{if}\;t \leq -1.8327016628534795 \cdot 10^{+93}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -9.383590541633152 \cdot 10^{-259}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.657301737059981 \cdot 10^{-193}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 7.14802731233514 \cdot 10^{+50}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 14
Error28.7
Cost848
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;t \leq -1.8327016628534795 \cdot 10^{+93}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq -9.383590541633152 \cdot 10^{-259}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.657301737059981 \cdot 10^{-193}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 9.948245168958527 \cdot 10^{+217}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 15
Error26.5
Cost844
\[\begin{array}{l} t_1 := \frac{a}{\frac{x + t}{t}}\\ \mathbf{if}\;t \leq -2.3793438304703663 \cdot 10^{+87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.460068514992454 \cdot 10^{-176}:\\ \;\;\;\;z - b \cdot \frac{y}{x + y}\\ \mathbf{elif}\;t \leq 7.14802731233514 \cdot 10^{+50}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error35.9
Cost328
\[\begin{array}{l} \mathbf{if}\;t \leq -2.3793438304703663 \cdot 10^{+87}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq 2.0034601918007795 \cdot 10^{-23}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 17
Error43.5
Cost64
\[a \]

Error

Reproduce

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