\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}
\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} = -\infty \lor \neg \left(\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \le 7.898361285701560830746917301273604408641 \cdot 10^{198}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r899646 = x;
double r899647 = y;
double r899648 = r899646 + r899647;
double r899649 = z;
double r899650 = r899648 * r899649;
double r899651 = t;
double r899652 = r899651 + r899647;
double r899653 = a;
double r899654 = r899652 * r899653;
double r899655 = r899650 + r899654;
double r899656 = b;
double r899657 = r899647 * r899656;
double r899658 = r899655 - r899657;
double r899659 = r899646 + r899651;
double r899660 = r899659 + r899647;
double r899661 = r899658 / r899660;
return r899661;
}
double f(double x, double y, double z, double t, double a, double b) {
double r899662 = x;
double r899663 = y;
double r899664 = r899662 + r899663;
double r899665 = z;
double r899666 = r899664 * r899665;
double r899667 = t;
double r899668 = r899667 + r899663;
double r899669 = a;
double r899670 = r899668 * r899669;
double r899671 = r899666 + r899670;
double r899672 = b;
double r899673 = r899663 * r899672;
double r899674 = r899671 - r899673;
double r899675 = r899662 + r899667;
double r899676 = r899675 + r899663;
double r899677 = r899674 / r899676;
double r899678 = -inf.0;
bool r899679 = r899677 <= r899678;
double r899680 = 7.898361285701561e+198;
bool r899681 = r899677 <= r899680;
double r899682 = !r899681;
bool r899683 = r899679 || r899682;
double r899684 = r899669 + r899665;
double r899685 = r899684 - r899672;
double r899686 = r899683 ? r899685 : r899677;
return r899686;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 26.5 |
|---|---|
| Target | 11.1 |
| Herbie | 7.8 |
if (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < -inf.0 or 7.898361285701561e+198 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) Initial program 59.3
rmApplied clear-num59.4
Taylor expanded around 0 17.2
if -inf.0 < (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) < 7.898361285701561e+198Initial program 0.3
Final simplification7.8
herbie shell --seed 2019362
(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 (/ (+ (+ 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)))