Average Error: 26.9 → 7.0
Time: 20.1s
Precision: binary64
Cost: 10440
\[\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 := \left(z + a\right) - b \cdot \frac{y}{x + y}\\ t_2 := a \cdot \left(y + t\right)\\ t_3 := \frac{\left(t_2 + \left(x + y\right) \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t_3 \leq -2 \cdot 10^{+194}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_3 \leq 2 \cdot 10^{+173}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t_2\right) - y \cdot b}{x + \left(y + t\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 a) (* b (/ y (+ x y)))))
        (t_2 (* a (+ y t)))
        (t_3 (/ (- (+ t_2 (* (+ x y) z)) (* y b)) (+ y (+ x t)))))
   (if (<= t_3 -2e+194)
     t_1
     (if (<= t_3 2e+173)
       (/ (- (fma (+ x y) z t_2) (* y b)) (+ x (+ y t)))
       t_1))))
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 + a) - (b * (y / (x + y)));
	double t_2 = a * (y + t);
	double t_3 = ((t_2 + ((x + y) * z)) - (y * b)) / (y + (x + t));
	double tmp;
	if (t_3 <= -2e+194) {
		tmp = t_1;
	} else if (t_3 <= 2e+173) {
		tmp = (fma((x + y), z, t_2) - (y * b)) / (x + (y + t));
	} else {
		tmp = t_1;
	}
	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(z + a) - Float64(b * Float64(y / Float64(x + y))))
	t_2 = Float64(a * Float64(y + t))
	t_3 = Float64(Float64(Float64(t_2 + Float64(Float64(x + y) * z)) - Float64(y * b)) / Float64(y + Float64(x + t)))
	tmp = 0.0
	if (t_3 <= -2e+194)
		tmp = t_1;
	elseif (t_3 <= 2e+173)
		tmp = Float64(Float64(fma(Float64(x + y), z, t_2) - Float64(y * b)) / Float64(x + Float64(y + t)));
	else
		tmp = t_1;
	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[(z + a), $MachinePrecision] - N[(b * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+194], t$95$1, If[LessEqual[t$95$3, 2e+173], N[(N[(N[(N[(x + y), $MachinePrecision] * z + t$95$2), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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 := \left(z + a\right) - b \cdot \frac{y}{x + y}\\
t_2 := a \cdot \left(y + t\right)\\
t_3 := \frac{\left(t_2 + \left(x + y\right) \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_3 \leq -2 \cdot 10^{+194}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_3 \leq 2 \cdot 10^{+173}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t_2\right) - y \cdot b}{x + \left(y + t\right)}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error

Target

Original26.9
Target11.4
Herbie7.0
\[\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)) < -1.99999999999999989e194 or 2e173 < (/.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.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. Taylor expanded in z around inf 53.7

      \[\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. Simplified39.3

      \[\leadsto \color{blue}{\frac{a}{y + \left(t + x\right)} \cdot \left(y + t\right) + \frac{z \cdot \left(y + x\right) - y \cdot b}{y + \left(t + x\right)}} \]
      Proof
      (+.f64 (*.f64 (/.f64 a (+.f64 y (+.f64 t x))) (+.f64 y t)) (/.f64 (-.f64 (*.f64 z (+.f64 y x)) (*.f64 y b)) (+.f64 y (+.f64 t x)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 a (Rewrite=> associate-+r+_binary64 (+.f64 (+.f64 y t) x))) (+.f64 y t)) (/.f64 (-.f64 (*.f64 z (+.f64 y x)) (*.f64 y b)) (+.f64 y (+.f64 t x)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 a (Rewrite<= +-commutative_binary64 (+.f64 x (+.f64 y t)))) (+.f64 y t)) (/.f64 (-.f64 (*.f64 z (+.f64 y x)) (*.f64 y b)) (+.f64 y (+.f64 t x)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-/r/_binary64 (/.f64 a (/.f64 (+.f64 x (+.f64 y t)) (+.f64 y t)))) (/.f64 (-.f64 (*.f64 z (+.f64 y x)) (*.f64 y b)) (+.f64 y (+.f64 t x)))): 3 points increase in error, 23 points decrease in error
      (+.f64 (/.f64 a (/.f64 (Rewrite=> +-commutative_binary64 (+.f64 (+.f64 y t) x)) (+.f64 y t))) (/.f64 (-.f64 (*.f64 z (+.f64 y x)) (*.f64 y b)) (+.f64 y (+.f64 t x)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 a (/.f64 (Rewrite<= associate-+r+_binary64 (+.f64 y (+.f64 t x))) (+.f64 y t))) (/.f64 (-.f64 (*.f64 z (+.f64 y x)) (*.f64 y b)) (+.f64 y (+.f64 t x)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x)))) (/.f64 (-.f64 (*.f64 z (+.f64 y x)) (*.f64 y b)) (+.f64 y (+.f64 t x)))): 31 points increase in error, 2 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (/.f64 (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 y x) z)) (*.f64 y b)) (+.f64 y (+.f64 t x)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (*.f64 (+.f64 y x) z) (+.f64 y (+.f64 t x))) (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (/.f64 (*.f64 (+.f64 y x) z) (+.f64 y (+.f64 t x)))) (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x))))): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= +-commutative_binary64 (+.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
    4. Taylor expanded in y around inf 40.6

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

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

      \[\leadsto \color{blue}{\left(z + a\right) - \frac{y}{y + x} \cdot b} \]
      Proof
      (-.f64 (+.f64 z a) (*.f64 (/.f64 y (+.f64 y x)) b)): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 a z)) (*.f64 (/.f64 y (+.f64 y x)) b)): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 a z) (Rewrite<= associate-/r/_binary64 (/.f64 y (/.f64 (+.f64 y x) b)))): 14 points increase in error, 5 points decrease in error
      (-.f64 (+.f64 a z) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 y b) (+.f64 y x)))): 44 points increase in error, 11 points decrease in error

    if -1.99999999999999989e194 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2e173

    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(x + y, z, \left(y + t\right) \cdot a\right) - y \cdot b}{x + \left(y + t\right)}} \]
      Proof
      (/.f64 (-.f64 (fma.f64 (+.f64 x y) z (*.f64 (+.f64 y t) a)) (*.f64 y b)) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (fma.f64 (+.f64 x y) z (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 t y)) a)) (*.f64 y b)) (+.f64 x (+.f64 y t))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a))) (*.f64 y b)) (+.f64 x (+.f64 y t))): 2 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 simplification7.0

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

Alternatives

Alternative 1
Error7.0
Cost4168
\[\begin{array}{l} t_1 := \frac{\left(a \cdot \left(y + t\right) + \left(x + y\right) \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\ t_2 := \left(z + a\right) - b \cdot \frac{y}{x + y}\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{+194}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+173}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error18.4
Cost2408
\[\begin{array}{l} t_1 := \left(x + y\right) \cdot z\\ t_2 := \left(z + a\right) - b \cdot \frac{y}{x + y}\\ t_3 := y + \left(x + t\right)\\ t_4 := z + \left(y + t\right) \cdot \frac{a}{t_3}\\ t_5 := a + \frac{t_1 - y \cdot b}{t_3}\\ \mathbf{if}\;y \leq -1 \cdot 10^{+150}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{-13}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-35}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-115}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-242}:\\ \;\;\;\;\frac{a \cdot \left(y + t\right) + t_1}{t_3}\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-264}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{-272}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-245}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-169}:\\ \;\;\;\;a + \frac{z}{\frac{x + t}{x}}\\ \mathbf{elif}\;y \leq 15000000000000:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error18.6
Cost2012
\[\begin{array}{l} t_1 := \left(z + a\right) - b \cdot \frac{y}{x + y}\\ t_2 := y + \left(x + t\right)\\ t_3 := z + \left(y + t\right) \cdot \frac{a}{t_2}\\ t_4 := a + \frac{\left(x + y\right) \cdot z - y \cdot b}{t_2}\\ \mathbf{if}\;y \leq -7 \cdot 10^{+148}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-13}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-268}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-272}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-246}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-168}:\\ \;\;\;\;a + \frac{z}{\frac{x + t}{x}}\\ \mathbf{elif}\;y \leq 14200000000000:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error23.5
Cost1500
\[\begin{array}{l} t_1 := z + a \cdot \frac{y}{x + y}\\ t_2 := \left(z + a\right) - b\\ t_3 := a + \frac{z}{\frac{x + t}{x}}\\ \mathbf{if}\;y \leq -4.8 \cdot 10^{+90}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{+40}:\\ \;\;\;\;a + \frac{z - b}{\frac{t}{y}}\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{+28}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-79}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -9.6 \cdot 10^{-116}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -4.1 \cdot 10^{-258}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+27}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error22.0
Cost1500
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := a + \frac{z}{\frac{x + t}{x}}\\ \mathbf{if}\;y \leq -5.5 \cdot 10^{+90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.15 \cdot 10^{+36}:\\ \;\;\;\;a + \frac{z - b}{\frac{t}{y}}\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{+29}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.55 \cdot 10^{-81}:\\ \;\;\;\;z + a \cdot \frac{y}{x + y}\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-116}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-141}:\\ \;\;\;\;z + \frac{a \cdot \left(y + t\right)}{x}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+17}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error22.9
Cost1500
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := a + \frac{z}{\frac{x + t}{x}}\\ \mathbf{if}\;y \leq -1.08 \cdot 10^{+143}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.56 \cdot 10^{+44}:\\ \;\;\;\;b \cdot \frac{-y}{y + \left(x + t\right)}\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{+29}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{-80}:\\ \;\;\;\;z + a \cdot \frac{y}{x + y}\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-116}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-141}:\\ \;\;\;\;z + \frac{a \cdot \left(y + t\right)}{x}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+21}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error19.9
Cost1364
\[\begin{array}{l} t_1 := \frac{y}{x + y}\\ t_2 := \left(z + a\right) - b \cdot t_1\\ \mathbf{if}\;t \leq -1.4 \cdot 10^{+156}:\\ \;\;\;\;a + \frac{z - b}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq -23000:\\ \;\;\;\;z + \left(y + t\right) \cdot \frac{a}{y + \left(x + t\right)}\\ \mathbf{elif}\;t \leq -1.1 \cdot 10^{-295}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-246}:\\ \;\;\;\;z + a \cdot t_1\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{+114}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;a + \frac{z}{\frac{x + t}{x}}\\ \end{array} \]
Alternative 8
Error19.8
Cost1232
\[\begin{array}{l} t_1 := \frac{y}{x + y}\\ t_2 := \left(z + a\right) - b \cdot t_1\\ \mathbf{if}\;t \leq -1.52 \cdot 10^{+156}:\\ \;\;\;\;a + \frac{z - b}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq -6.5 \cdot 10^{-298}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{-246}:\\ \;\;\;\;z + a \cdot t_1\\ \mathbf{elif}\;t \leq 3.3 \cdot 10^{+100}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;a + \frac{z}{\frac{x + t}{x}}\\ \end{array} \]
Alternative 9
Error19.9
Cost1232
\[\begin{array}{l} t_1 := a + \frac{z}{\frac{x + t}{x}}\\ t_2 := \left(z + a\right) - b \cdot \frac{y}{x + y}\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{+43}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -9.8 \cdot 10^{-116}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{-268}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-70}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error37.6
Cost856
\[\begin{array}{l} \mathbf{if}\;a \leq -5.4 \cdot 10^{-9}:\\ \;\;\;\;a\\ \mathbf{elif}\;a \leq -4.5 \cdot 10^{-149}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq -2.8 \cdot 10^{-239}:\\ \;\;\;\;-b\\ \mathbf{elif}\;a \leq 4.1 \cdot 10^{+40}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 1.02 \cdot 10^{+145}:\\ \;\;\;\;a\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{+207}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 11
Error27.3
Cost848
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -2.85 \cdot 10^{-46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{-306}:\\ \;\;\;\;\frac{z}{\frac{x + t}{x}}\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-269}:\\ \;\;\;\;\frac{t \cdot a}{x + t}\\ \mathbf{elif}\;y \leq 5.7 \cdot 10^{-86}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error21.2
Cost840
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -4.8 \cdot 10^{+90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+15}:\\ \;\;\;\;a + \frac{z}{\frac{x + t}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error27.2
Cost716
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -2.9 \cdot 10^{-46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-256}:\\ \;\;\;\;\frac{z}{\frac{x + t}{x}}\\ \mathbf{elif}\;y \leq 5.7 \cdot 10^{-83}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error26.0
Cost584
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -1.65 \cdot 10^{+28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-83}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error36.1
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+51}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-23}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
Alternative 16
Error30.5
Cost324
\[\begin{array}{l} \mathbf{if}\;x \leq 2 \cdot 10^{+203}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
Alternative 17
Error42.9
Cost64
\[a \]

Error

Reproduce

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