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

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


\end{array}

Error

Target

Original26.7
Target11.1
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 5.00000000000000009e305 < (/.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 + t, a, \mathsf{fma}\left(x, z, y \cdot \left(z - b\right)\right)\right)}{y + \left(x + t\right)}} \]
      Proof

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

      sub-neg [=>]63.9

      \[ \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 [=>]63.9

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

      associate-+l+ [=>]63.9

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

      fma-def [=>]63.9

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

      +-commutative [=>]63.9

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

      *-commutative [=>]63.9

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

      distribute-rgt-in [=>]63.9

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

      associate-+l+ [=>]63.9

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

      fma-def [=>]63.9

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

      sub-neg [<=]63.9

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

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

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

      +-commutative [=>]63.9

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

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

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

      [Start]63.9

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

      +-commutative [=>]63.9

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

      associate-+l+ [=>]63.9

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

      associate-/l* [=>]52.6

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

      associate-/r/ [=>]52.7

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

      associate-+r+ [=>]52.7

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

      +-commutative [=>]52.7

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

      +-commutative [=>]52.7

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

      associate-/l* [=>]32.0

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

      associate-/r/ [=>]32.1

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

      associate-+r+ [=>]32.1

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

      +-commutative [=>]32.1

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

      +-commutative [=>]32.1

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

      +-commutative [=>]32.1

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

      associate-/l* [=>]0.2

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

      associate-/r/ [=>]0.3

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

      associate-+r+ [=>]0.3

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

      +-commutative [=>]0.3

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

      +-commutative [=>]0.3

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

    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.3

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

Alternatives

Alternative 1
Error0.3
Cost4937
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 5 \cdot 10^{+305}\right):\\ \;\;\;\;x \cdot \frac{z}{t_1} + \left(\left(y + t\right) \cdot \frac{a}{t_1} + y \cdot \frac{z - b}{t_1}\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error2.6
Cost4297
\[\begin{array}{l} t_1 := x + \left(y + t\right)\\ t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 10^{+300}\right):\\ \;\;\;\;x \cdot \frac{z}{t_1} + \left(a + y \cdot \frac{z - b}{t_1}\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error8.0
Cost4169
\[\begin{array}{l} t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+286} \lor \neg \left(t_1 \leq 1.5 \cdot 10^{+207}\right):\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error27.6
Cost1500
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;t \leq -5.5 \cdot 10^{+138}:\\ \;\;\;\;\frac{a}{\frac{x + t}{t}}\\ \mathbf{elif}\;t \leq -1.95 \cdot 10^{+67}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2.9 \cdot 10^{-8}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq -5.8 \cdot 10^{-49}:\\ \;\;\;\;z \cdot \frac{x + y}{x + \left(y + t\right)}\\ \mathbf{elif}\;t \leq 1.68 \cdot 10^{-270}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{-198}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+210}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a + \frac{z - b}{\frac{t}{y}}\\ \end{array} \]
Alternative 5
Error27.4
Cost1500
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;t \leq -4.6 \cdot 10^{+141}:\\ \;\;\;\;\frac{a}{\frac{x + t}{t}}\\ \mathbf{elif}\;t \leq -3.3 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -8.5 \cdot 10^{-11}:\\ \;\;\;\;\frac{a}{\frac{y + \left(x + t\right)}{y + t}}\\ \mathbf{elif}\;t \leq -6.5 \cdot 10^{-51}:\\ \;\;\;\;z \cdot \frac{x + y}{x + \left(y + t\right)}\\ \mathbf{elif}\;t \leq 9.6 \cdot 10^{-270}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-198}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+210}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a + \frac{z - b}{\frac{t}{y}}\\ \end{array} \]
Alternative 6
Error27.6
Cost1372
\[\begin{array}{l} t_1 := \frac{z}{\frac{x + t}{x}}\\ t_2 := \left(z + a\right) - b\\ t_3 := \frac{a}{\frac{x + t}{t}}\\ \mathbf{if}\;y \leq -4 \cdot 10^{-58}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -5.1 \cdot 10^{-194}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3 \cdot 10^{-276}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-302}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-225}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-197}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-51}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error28.5
Cost1372
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;t \leq -3.05 \cdot 10^{+142}:\\ \;\;\;\;\frac{a}{\frac{x + t}{t}}\\ \mathbf{elif}\;t \leq -1.8 \cdot 10^{+67}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -6.6 \cdot 10^{-8}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq -7.1 \cdot 10^{-22}:\\ \;\;\;\;\frac{z}{\frac{y + t}{y}}\\ \mathbf{elif}\;t \leq 9.6 \cdot 10^{-270}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-198}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+219}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a - \frac{x}{\frac{t}{a}}\\ \end{array} \]
Alternative 8
Error28.6
Cost1372
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;t \leq -1.2 \cdot 10^{+141}:\\ \;\;\;\;\frac{a}{\frac{x + t}{t}}\\ \mathbf{elif}\;t \leq -3.5 \cdot 10^{+69}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1.55 \cdot 10^{+40}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq -7.1 \cdot 10^{-22}:\\ \;\;\;\;a + \frac{y \cdot \left(z - b\right)}{t}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-271}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.85 \cdot 10^{-198}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+219}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a - \frac{x}{\frac{t}{a}}\\ \end{array} \]
Alternative 9
Error24.4
Cost1364
\[\begin{array}{l} t_1 := \frac{x \cdot z + t \cdot a}{x + t}\\ t_2 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -170000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-133}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-145}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{-190}:\\ \;\;\;\;z + \frac{t \cdot \left(a - z\right)}{x}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-59}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error23.2
Cost1224
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;y \leq -3.1 \cdot 10^{+59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.36 \cdot 10^{-67}:\\ \;\;\;\;\frac{\left(y + t\right) \cdot a + y \cdot \left(z - b\right)}{y + t}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-58}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error26.1
Cost1104
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;t \leq -3.9 \cdot 10^{+138}:\\ \;\;\;\;\frac{a}{\frac{x + t}{t}}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-270}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-198}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+210}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a + \frac{z - b}{\frac{t}{y}}\\ \end{array} \]
Alternative 12
Error27.4
Cost976
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := a - \frac{x}{\frac{t}{a}}\\ \mathbf{if}\;t \leq -3.6 \cdot 10^{+151}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 9.6 \cdot 10^{-270}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-197}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{+219}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 13
Error27.1
Cost976
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;t \leq -2.45 \cdot 10^{+142}:\\ \;\;\;\;\frac{a}{\frac{x + t}{t}}\\ \mathbf{elif}\;t \leq 3.55 \cdot 10^{-270}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-198}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+219}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a - \frac{x}{\frac{t}{a}}\\ \end{array} \]
Alternative 14
Error27.4
Cost848
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ \mathbf{if}\;t \leq -1.05 \cdot 10^{+151}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-270}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-198}:\\ \;\;\;\;z\\ \mathbf{elif}\;t \leq 4.4 \cdot 10^{+219}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 15
Error36.6
Cost592
\[\begin{array}{l} \mathbf{if}\;z \leq -3.05 \cdot 10^{-6}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-111}:\\ \;\;\;\;a\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-142}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+182}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
Alternative 16
Error43.6
Cost64
\[a \]

Error

Reproduce

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