?

Average Error: 26.9 → 0.8
Time: 27.4s
Precision: binary64
Cost: 10441

?

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

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


\end{array}

Error?

Target

Original26.9
Target11.5
Herbie0.8
\[\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 2e-14 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 44.2

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Simplified44.2

      \[\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

      [Start]44.2

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

      sub-neg [=>]44.2

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

      +-commutative [=>]44.2

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

      *-commutative [=>]44.2

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

      +-commutative [=>]44.2

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

      distribute-rgt-in [=>]44.2

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

      associate-+l+ [=>]44.2

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

      associate-+r+ [=>]44.2

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

      +-commutative [<=]44.2

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

      sub-neg [<=]44.2

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

      distribute-lft-out-- [=>]44.2

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

      fma-def [=>]44.2

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

      +-commutative [=>]44.2

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

      fma-def [=>]44.2

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

      +-commutative [=>]44.2

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

      associate-+l+ [=>]44.2

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

      +-commutative [=>]44.2

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

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

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

      [Start]44.2

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

      +-commutative [=>]44.2

      \[ \color{blue}{\left(\frac{a \cdot \left(y + t\right)}{y + \left(t + x\right)} + -1 \cdot \frac{y \cdot b}{y + \left(t + x\right)}\right) + \frac{\left(y + x\right) \cdot z}{y + \left(t + x\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)) < 2e-14

    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}{y + \left(x + t\right)}} \]
      Proof

      [Start]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} \]

      cancel-sign-sub [<=]0.3

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

      distribute-lft-neg-in [<=]0.3

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

      fma-neg [=>]0.3

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

      remove-double-neg [=>]0.3

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

      +-commutative [=>]0.3

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

      +-commutative [=>]0.3

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

    \[\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 \lor \neg \left(\frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)} \leq 2 \cdot 10^{-14}\right):\\ \;\;\;\;\left(\frac{a}{x + \left(y + t\right)} \cdot \left(y + t\right) - \frac{b}{\frac{x + \left(y + t\right)}{y}}\right) + \frac{z}{\frac{x + \left(y + t\right)}{x + y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x + y, z, a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\ \end{array} \]

Alternatives

Alternative 1
Error0.6
Cost4937
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := \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_2 \leq -\infty \lor \neg \left(t_2 \leq 5 \cdot 10^{+279}\right):\\ \;\;\;\;\frac{a}{t_1} \cdot \left(y + t\right) + \left(x \cdot \frac{z}{t_1} + y \cdot \frac{z - b}{t_1}\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error0.8
Cost4937
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := \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_2 \leq -\infty \lor \neg \left(t_2 \leq 2 \cdot 10^{-14}\right):\\ \;\;\;\;\left(\frac{a}{t_1} \cdot \left(y + t\right) - \frac{b}{\frac{t_1}{y}}\right) + \frac{z}{\frac{t_1}{x + y}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error2.6
Cost4808
\[\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)\\ t_3 := \frac{z}{\frac{t_2}{x + y}}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_3 + \left(a - \frac{b}{\frac{t_2}{y}}\right)\\ \mathbf{elif}\;t_1 \leq 10^{+237}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3 + \left(\frac{a}{t_2} \cdot \left(y + t\right) - \frac{y}{\frac{y + t}{b}}\right)\\ \end{array} \]
Alternative 4
Error2.6
Cost4297
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := \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_2 \leq -\infty \lor \neg \left(t_2 \leq 10^{+237}\right):\\ \;\;\;\;\frac{z}{\frac{t_1}{x + y}} + \left(a - \frac{b}{\frac{t_1}{y}}\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error3.1
Cost4296
\[\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)\\ t_3 := \frac{b}{\frac{t_2}{y}}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{z}{\frac{t_2}{x + y}} + \left(a - t_3\right)\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+238}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z + \left(\frac{a}{t_2} \cdot \left(y + t\right) - t_3\right)\\ \end{array} \]
Alternative 6
Error5.1
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)}\\ t_2 := x + \left(y + t\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;z + \left(a - \frac{b}{\frac{t_2}{y}}\right)\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+238}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;z + \left(\frac{a}{t_2} \cdot \left(y + t\right) - \frac{y}{\frac{y + t}{b}}\right)\\ \end{array} \]
Alternative 7
Error20.3
Cost2801
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := z + \left(a - \frac{b}{\frac{t_1}{y}}\right)\\ t_3 := \frac{a}{t_1} \cdot \left(y + t\right)\\ t_4 := z + \left(t_3 - b\right)\\ t_5 := z + \left(t_3 - \frac{y \cdot b}{x}\right)\\ t_6 := \frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{if}\;x \leq -5 \cdot 10^{+175}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{+109}:\\ \;\;\;\;t_6\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{+19}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x \leq -3 \cdot 10^{-114}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -5.2 \cdot 10^{-153}:\\ \;\;\;\;t_6\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{-132}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-62}:\\ \;\;\;\;t_6\\ \mathbf{elif}\;x \leq 6 \cdot 10^{-26}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-6}:\\ \;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{elif}\;x \leq 3.7 \cdot 10^{+42}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{+153} \lor \neg \left(x \leq 1.95 \cdot 10^{+198}\right):\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error27.1
Cost2024
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := \frac{a}{\frac{t_1}{y + t}}\\ t_3 := t + \left(x + y\right)\\ t_4 := z \cdot \frac{x + y}{t_3}\\ t_5 := \frac{a - b}{\frac{x + y}{y}}\\ \mathbf{if}\;z \leq -2.7 \cdot 10^{+73}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{+51}:\\ \;\;\;\;\frac{a}{t_1} \cdot \left(y + t\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-8}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-181}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-276}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-261}:\\ \;\;\;\;\frac{y}{\frac{t_3}{-b}}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-215}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;z \leq 3.55 \cdot 10^{-73}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 0.00045:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+39}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 9
Error26.5
Cost2024
\[\begin{array}{l} t_1 := \frac{a}{\frac{x + \left(y + t\right)}{y + t}}\\ t_2 := \left(z + a\right) - b\\ t_3 := \frac{a - b}{\frac{x + y}{y}}\\ t_4 := t + \left(x + y\right)\\ t_5 := z \cdot \frac{x + y}{t_4}\\ \mathbf{if}\;z \leq -7.8 \cdot 10^{+67}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-179}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 10^{-275}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-261}:\\ \;\;\;\;\frac{y}{\frac{t_4}{-b}}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-223}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-113}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-5}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+99}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_5\\ \end{array} \]
Alternative 10
Error20.5
Cost1884
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := z + \left(a - \frac{b}{\frac{t_1}{y}}\right)\\ t_3 := z + \left(\frac{a}{t_1} \cdot \left(y + t\right) - b\right)\\ \mathbf{if}\;a \leq -155000000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq -1.06 \cdot 10^{-299}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 7.8 \cdot 10^{-141}:\\ \;\;\;\;z \cdot \frac{x + y}{t + \left(x + y\right)}\\ \mathbf{elif}\;a \leq 5.6 \cdot 10^{+75}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{+136}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 2.05 \cdot 10^{+150}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{+218}:\\ \;\;\;\;\frac{a - b}{\frac{x + y}{y}}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 11
Error19.8
Cost1884
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := z + \left(a - \frac{b}{\frac{t_1}{y}}\right)\\ t_3 := z + \left(\frac{a}{t_1} \cdot \left(y + t\right) - b\right)\\ \mathbf{if}\;a \leq -16000000000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{-307}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 2.45 \cdot 10^{-154}:\\ \;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{elif}\;a \leq 6.4 \cdot 10^{+75}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{+136}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{+151}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{+218}:\\ \;\;\;\;\frac{a - b}{\frac{x + y}{y}}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 12
Error13.7
Cost1872
\[\begin{array}{l} t_1 := \frac{y}{\frac{y + t}{b}}\\ t_2 := x + \left(y + t\right)\\ t_3 := \frac{a}{t_2} \cdot \left(y + t\right)\\ t_4 := z + \left(t_3 - t_1\right)\\ t_5 := \frac{z}{\frac{t_2}{x + y}} + \left(a - t_1\right)\\ \mathbf{if}\;a \leq -2.9 \cdot 10^{+99}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \leq 10^{+46}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{+161}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \leq 6.6 \cdot 10^{+218}:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;z + \left(t_3 - \frac{y \cdot b}{x}\right)\\ \end{array} \]
Alternative 13
Error11.6
Cost1745
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := z + \left(\frac{a}{t_1} \cdot \left(y + t\right) - \frac{y \cdot b}{x}\right)\\ \mathbf{if}\;x \leq -5.9 \cdot 10^{+186}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{+80}:\\ \;\;\;\;\frac{z}{\frac{t_1}{x + y}} + \left(a - \frac{y}{\frac{y + t}{b}}\right)\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{+150} \lor \neg \left(x \leq 2.1 \cdot 10^{+198}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;z + \left(a - \frac{b}{\frac{t_1}{y}}\right)\\ \end{array} \]
Alternative 14
Error29.9
Cost1628
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := \frac{a}{x + \left(y + t\right)} \cdot \left(y + t\right)\\ \mathbf{if}\;a \leq -3.3 \cdot 10^{+99}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -6.8 \cdot 10^{-177}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{-282}:\\ \;\;\;\;\frac{-b}{\frac{y + \left(x + t\right)}{y}}\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{-209}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{-161}:\\ \;\;\;\;\frac{a - b}{\frac{x + y}{y}}\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-152}:\\ \;\;\;\;z\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{-34}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 15
Error27.3
Cost1496
\[\begin{array}{l} t_1 := z \cdot \frac{x + y}{t + \left(x + y\right)}\\ \mathbf{if}\;z \leq -9 \cdot 10^{+72}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{+51}:\\ \;\;\;\;\frac{a}{x + \left(y + t\right)} \cdot \left(y + t\right)\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-9}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 140:\\ \;\;\;\;\frac{a - b}{\frac{x + y}{y}}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+39}:\\ \;\;\;\;\frac{a}{\frac{x + t}{t}}\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{+66}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error43.8
Cost1448
\[\begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{+248}:\\ \;\;\;\;-b\\ \mathbf{elif}\;y \leq -2.45 \cdot 10^{+169}:\\ \;\;\;\;a\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{+121}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq -8.8 \cdot 10^{+42}:\\ \;\;\;\;-b\\ \mathbf{elif}\;y \leq -8.2 \cdot 10^{-181}:\\ \;\;\;\;a\\ \mathbf{elif}\;y \leq 3.55 \cdot 10^{-283}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 10^{-242}:\\ \;\;\;\;a\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-58}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+48}:\\ \;\;\;\;a\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{+162}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;-b\\ \end{array} \]
Alternative 17
Error20.5
Cost1228
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := z + \left(a - \frac{b}{\frac{t_1}{y}}\right)\\ \mathbf{if}\;y \leq -9.5 \cdot 10^{+75}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.36 \cdot 10^{-115}:\\ \;\;\;\;\frac{a}{\frac{t_1}{y + t}}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-70}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 18
Error43.0
Cost1120
\[\begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+164}:\\ \;\;\;\;a\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{+48}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{-181}:\\ \;\;\;\;a\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-284}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 10^{-241}:\\ \;\;\;\;a\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{-55}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+47}:\\ \;\;\;\;a\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+117}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 19
Error27.9
Cost976
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := \frac{a}{\frac{x + t}{t}}\\ \mathbf{if}\;t \leq -4 \cdot 10^{+54}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -4.4 \cdot 10^{-262}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-175}:\\ \;\;\;\;\frac{a - b}{\frac{x + y}{y}}\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{+145}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 20
Error26.3
Cost713
\[\begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{+54} \lor \neg \left(t \leq 3.7 \cdot 10^{+145}\right):\\ \;\;\;\;\frac{a}{\frac{x + t}{t}}\\ \mathbf{else}:\\ \;\;\;\;\left(z + a\right) - b\\ \end{array} \]
Alternative 21
Error27.2
Cost584
\[\begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{+54}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq 4.9 \cdot 10^{+145}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 22
Error43.2
Cost64
\[a \]

Error

Reproduce?

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