Average Error: 27.2 → 0.3
Time: 15.1s
Precision: binary64
Cost: 4936
\[\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 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{t_1}\\ t_3 := x + \left(y + t\right)\\ t_4 := \left(y + t\right) \cdot \frac{a}{t_3} + \left(\frac{z - b}{\frac{t_3}{y}} + x \cdot \frac{z}{t_3}\right)\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+299}:\\ \;\;\;\;\frac{x \cdot z + \left(y \cdot \left(\left(z + a\right) - b\right) + t \cdot a\right)}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \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 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) t_1))
        (t_3 (+ x (+ y t)))
        (t_4
         (+ (* (+ y t) (/ a t_3)) (+ (/ (- z b) (/ t_3 y)) (* x (/ z t_3))))))
   (if (<= t_2 (- INFINITY))
     t_4
     (if (<= t_2 2e+299)
       (/ (+ (* x z) (+ (* y (- (+ z a) b)) (* t a))) t_1)
       t_4))))
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 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_1;
	double t_3 = x + (y + t);
	double t_4 = ((y + t) * (a / t_3)) + (((z - b) / (t_3 / y)) + (x * (z / t_3)));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_4;
	} else if (t_2 <= 2e+299) {
		tmp = ((x * z) + ((y * ((z + a) - b)) + (t * a))) / t_1;
	} else {
		tmp = t_4;
	}
	return tmp;
}
public static 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);
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y + (x + t);
	double t_2 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_1;
	double t_3 = x + (y + t);
	double t_4 = ((y + t) * (a / t_3)) + (((z - b) / (t_3 / y)) + (x * (z / t_3)));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_4;
	} else if (t_2 <= 2e+299) {
		tmp = ((x * z) + ((y * ((z + a) - b)) + (t * a))) / t_1;
	} else {
		tmp = t_4;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
def code(x, y, z, t, a, b):
	t_1 = y + (x + t)
	t_2 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_1
	t_3 = x + (y + t)
	t_4 = ((y + t) * (a / t_3)) + (((z - b) / (t_3 / y)) + (x * (z / t_3)))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_4
	elif t_2 <= 2e+299:
		tmp = ((x * z) + ((y * ((z + a) - b)) + (t * a))) / t_1
	else:
		tmp = t_4
	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(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / t_1)
	t_3 = Float64(x + Float64(y + t))
	t_4 = Float64(Float64(Float64(y + t) * Float64(a / t_3)) + Float64(Float64(Float64(z - b) / Float64(t_3 / y)) + Float64(x * Float64(z / t_3))))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_4;
	elseif (t_2 <= 2e+299)
		tmp = Float64(Float64(Float64(x * z) + Float64(Float64(y * Float64(Float64(z + a) - b)) + Float64(t * a))) / t_1);
	else
		tmp = t_4;
	end
	return tmp
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = y + (x + t);
	t_2 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / t_1;
	t_3 = x + (y + t);
	t_4 = ((y + t) * (a / t_3)) + (((z - b) / (t_3 / y)) + (x * (z / t_3)));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_4;
	elseif (t_2 <= 2e+299)
		tmp = ((x * z) + ((y * ((z + a) - b)) + (t * a))) / t_1;
	else
		tmp = t_4;
	end
	tmp_2 = 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[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(y + t), $MachinePrecision] * N[(a / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$3 / y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(z / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$4, If[LessEqual[t$95$2, 2e+299], N[(N[(N[(x * z), $MachinePrecision] + N[(N[(y * N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$4]]]]]]
\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 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{t_1}\\
t_3 := x + \left(y + t\right)\\
t_4 := \left(y + t\right) \cdot \frac{a}{t_3} + \left(\frac{z - b}{\frac{t_3}{y}} + x \cdot \frac{z}{t_3}\right)\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;\frac{x \cdot z + \left(y \cdot \left(\left(z + a\right) - b\right) + t \cdot a\right)}{t_1}\\

\mathbf{else}:\\
\;\;\;\;t_4\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original27.2
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 2.0000000000000001e299 < (/.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.8

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

      \[\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))): 0 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))): 0 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))): 1 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))): 1 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 b around 0 63.8

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

      \[\leadsto \color{blue}{\frac{a}{x + \left(t + y\right)} \cdot \left(t + y\right) + \left(\frac{z - b}{\frac{x + \left(t + y\right)}{y}} + \frac{z}{x + \left(t + y\right)} \cdot x\right)} \]
      Proof
      (+.f64 (*.f64 (/.f64 a (+.f64 x (+.f64 t y))) (+.f64 t y)) (+.f64 (/.f64 (-.f64 z b) (/.f64 (+.f64 x (+.f64 t y)) y)) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 a (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x t) y))) (+.f64 t y)) (+.f64 (/.f64 (-.f64 z b) (/.f64 (+.f64 x (+.f64 t y)) y)) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 a (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 t x)) y)) (+.f64 t y)) (+.f64 (/.f64 (-.f64 z b) (/.f64 (+.f64 x (+.f64 t y)) y)) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 a (Rewrite<= +-commutative_binary64 (+.f64 y (+.f64 t x)))) (+.f64 t y)) (+.f64 (/.f64 (-.f64 z b) (/.f64 (+.f64 x (+.f64 t y)) y)) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 a (+.f64 y (+.f64 t x))) (Rewrite<= +-commutative_binary64 (+.f64 y t))) (+.f64 (/.f64 (-.f64 z b) (/.f64 (+.f64 x (+.f64 t y)) y)) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-/r/_binary64 (/.f64 a (/.f64 (+.f64 y (+.f64 t x)) (+.f64 y t)))) (+.f64 (/.f64 (-.f64 z b) (/.f64 (+.f64 x (+.f64 t y)) y)) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 5 points increase in error, 25 points decrease in error
      (+.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x)))) (+.f64 (/.f64 (-.f64 z b) (/.f64 (+.f64 x (+.f64 t y)) y)) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 58 points increase in error, 6 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (-.f64 z b) (/.f64 (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x t) y)) y)) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (-.f64 z b) (/.f64 (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 t x)) y) y)) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (-.f64 z b) (/.f64 (Rewrite<= +-commutative_binary64 (+.f64 y (+.f64 t x))) y)) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (Rewrite=> div-sub_binary64 (-.f64 (/.f64 z (/.f64 (+.f64 y (+.f64 t x)) y)) (/.f64 b (/.f64 (+.f64 y (+.f64 t x)) y)))) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (-.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 z y) (+.f64 y (+.f64 t x)))) (/.f64 b (/.f64 (+.f64 y (+.f64 t x)) y))) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 17 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (-.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 y z)) (+.f64 y (+.f64 t x))) (/.f64 b (/.f64 (+.f64 y (+.f64 t x)) y))) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (-.f64 (/.f64 (*.f64 y z) (+.f64 y (+.f64 t x))) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 b y) (+.f64 y (+.f64 t x))))) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 23 points increase in error, 4 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (-.f64 (/.f64 (*.f64 y z) (+.f64 y (+.f64 t x))) (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 y b)) (+.f64 y (+.f64 t x)))) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (/.f64 (*.f64 y z) (+.f64 y (+.f64 t x))) (neg.f64 (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))))) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (+.f64 (/.f64 (*.f64 y z) (+.f64 y (+.f64 t x))) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))))) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))) (/.f64 (*.f64 y z) (+.f64 y (+.f64 t x))))) (*.f64 (/.f64 z (+.f64 x (+.f64 t y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))) (/.f64 (*.f64 y z) (+.f64 y (+.f64 t x)))) (*.f64 (/.f64 z (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 x t) y))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))) (/.f64 (*.f64 y z) (+.f64 y (+.f64 t x)))) (*.f64 (/.f64 z (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 t x)) y)) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))) (/.f64 (*.f64 y z) (+.f64 y (+.f64 t x)))) (*.f64 (/.f64 z (Rewrite<= +-commutative_binary64 (+.f64 y (+.f64 t x)))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))) (/.f64 (*.f64 y z) (+.f64 y (+.f64 t x)))) (Rewrite<= associate-/r/_binary64 (/.f64 z (/.f64 (+.f64 y (+.f64 t x)) x))))): 4 points increase in error, 14 points decrease in error
      (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (+.f64 (*.f64 -1 (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))) (/.f64 (*.f64 y z) (+.f64 y (+.f64 t x)))) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x)))))): 27 points increase in error, 3 points decrease in error
      (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (*.f64 -1 (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))) (/.f64 (*.f64 y z) (+.f64 y (+.f64 t x))))) (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (/.f64 (*.f64 z x) (+.f64 y (+.f64 t x))) (+.f64 (/.f64 (*.f64 a (+.f64 y t)) (+.f64 y (+.f64 t x))) (+.f64 (*.f64 -1 (/.f64 (*.f64 y b) (+.f64 y (+.f64 t x)))) (/.f64 (*.f64 y z) (+.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)) < 2.0000000000000001e299

    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. Taylor expanded in y around 0 0.3

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

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

Alternatives

Alternative 1
Error2.9
Cost4296
\[\begin{array}{l} t_1 := y + \left(x + t\right)\\ t_2 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{t_1}\\ t_3 := x + \left(y + t\right)\\ t_4 := a + \left(\frac{z - b}{\frac{t_3}{y}} + x \cdot \frac{z}{t_3}\right)\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+240}:\\ \;\;\;\;\frac{x \cdot z + \left(y \cdot \left(\left(z + a\right) - b\right) + t \cdot a\right)}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 2
Error8.2
Cost4168
\[\begin{array}{l} t_1 := y + \left(x + t\right)\\ t_2 := \left(z + a\right) - b\\ t_3 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{t_1}\\ \mathbf{if}\;t_3 \leq -2 \cdot 10^{+262}:\\ \;\;\;\;a + \left(z + \frac{z - b}{\frac{x + \left(y + t\right)}{y}}\right)\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{+240}:\\ \;\;\;\;\frac{x \cdot z + \left(y \cdot t_2 + t \cdot a\right)}{t_1}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error26.1
Cost1496
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := \frac{a}{\frac{x + \left(y + t\right)}{y + t}}\\ \mathbf{if}\;a \leq -1.1 \cdot 10^{+218}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -6.4 \cdot 10^{+143}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -3.35 \cdot 10^{+84}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -8 \cdot 10^{-90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.16 \cdot 10^{-73}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{+119}:\\ \;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error22.3
Cost1496
\[\begin{array}{l} t_1 := y + \left(x + t\right)\\ t_2 := x + \left(y + t\right)\\ t_3 := a + \left(z + \frac{z - b}{\frac{t_2}{y}}\right)\\ \mathbf{if}\;z \leq -2.55 \cdot 10^{+76}:\\ \;\;\;\;\frac{x + y}{\frac{t_2}{z}}\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{-252}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-302}:\\ \;\;\;\;\frac{y + t}{\frac{t_1}{a}}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-22}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+51}:\\ \;\;\;\;\frac{a}{\frac{t_2}{y + t}}\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+199}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{t_1}\\ \end{array} \]
Alternative 5
Error26.6
Cost1364
\[\begin{array}{l} t_1 := \left(z + a\right) - b\\ t_2 := \frac{a}{\frac{x + \left(y + t\right)}{y + t}}\\ \mathbf{if}\;a \leq -1.05 \cdot 10^{+218}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -5 \cdot 10^{+143}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -3.55 \cdot 10^{+84}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -4.5 \cdot 10^{-86}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{-65}:\\ \;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error27.3
Cost1168
\[\begin{array}{l} t_1 := a \cdot \frac{t}{x + t}\\ t_2 := y + \left(x + t\right)\\ \mathbf{if}\;t \leq -3.8 \cdot 10^{+119}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+83}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{+156}:\\ \;\;\;\;z \cdot \frac{x + y}{t_2}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{+214}:\\ \;\;\;\;\frac{y}{t_2} \cdot \left(-b\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error26.0
Cost712
\[\begin{array}{l} t_1 := a \cdot \frac{t}{x + t}\\ \mathbf{if}\;t \leq -1.35 \cdot 10^{+119}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.9 \cdot 10^{+84}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error26.3
Cost584
\[\begin{array}{l} \mathbf{if}\;t \leq -2.1 \cdot 10^{+122}:\\ \;\;\;\;a\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{+222}:\\ \;\;\;\;\left(z + a\right) - b\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \]
Alternative 9
Error35.8
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{+115}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 1.5:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
Alternative 10
Error43.4
Cost64
\[a \]

Error

Reproduce

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