\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le -9.850726757232304656097215039461175225007 \cdot 10^{116}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -213283511644709824:\\
\;\;\;\;\left(\sqrt[3]{\frac{\mathsf{fma}\left(4 \cdot y, -y, x \cdot x\right)}{\mathsf{fma}\left(y, 4 \cdot y, x \cdot x\right)}} \cdot \sqrt[3]{\frac{\mathsf{fma}\left(4 \cdot y, -y, x \cdot x\right)}{\mathsf{fma}\left(y, 4 \cdot y, x \cdot x\right)}}\right) \cdot \sqrt[3]{\frac{\mathsf{fma}\left(4 \cdot y, -y, x \cdot x\right)}{\mathsf{fma}\left(y, 4 \cdot y, x \cdot x\right)}}\\
\mathbf{elif}\;x \le -3.478057257589816580751045492937248447757 \cdot 10^{-17}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le -5.393824270148449076708054055498132792438 \cdot 10^{-74}:\\
\;\;\;\;\left(\sqrt[3]{\frac{\mathsf{fma}\left(4 \cdot y, -y, x \cdot x\right)}{\mathsf{fma}\left(y, 4 \cdot y, x \cdot x\right)}} \cdot \sqrt[3]{\frac{\mathsf{fma}\left(4 \cdot y, -y, x \cdot x\right)}{\mathsf{fma}\left(y, 4 \cdot y, x \cdot x\right)}}\right) \cdot \sqrt[3]{\frac{\mathsf{fma}\left(4 \cdot y, -y, x \cdot x\right)}{\mathsf{fma}\left(y, 4 \cdot y, x \cdot x\right)}}\\
\mathbf{elif}\;x \le -8.64767432764635258433792673669348312331 \cdot 10^{-129}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le -1.23992860779612800616268155128852493615 \cdot 10^{-180}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le 6.823576610928471937518681293595906800826 \cdot 10^{-152}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 6.357559912396233893317957556288536407725 \cdot 10^{53}:\\
\;\;\;\;\frac{x \cdot x - y \cdot \left(4 \cdot y\right)}{\mathsf{fma}\left(x, x, y \cdot \left(4 \cdot y\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r1414714 = x;
double r1414715 = r1414714 * r1414714;
double r1414716 = y;
double r1414717 = 4.0;
double r1414718 = r1414716 * r1414717;
double r1414719 = r1414718 * r1414716;
double r1414720 = r1414715 - r1414719;
double r1414721 = r1414715 + r1414719;
double r1414722 = r1414720 / r1414721;
return r1414722;
}
double f(double x, double y) {
double r1414723 = x;
double r1414724 = -9.850726757232305e+116;
bool r1414725 = r1414723 <= r1414724;
double r1414726 = 1.0;
double r1414727 = -2.1328351164470982e+17;
bool r1414728 = r1414723 <= r1414727;
double r1414729 = 4.0;
double r1414730 = y;
double r1414731 = r1414729 * r1414730;
double r1414732 = -r1414730;
double r1414733 = r1414723 * r1414723;
double r1414734 = fma(r1414731, r1414732, r1414733);
double r1414735 = fma(r1414730, r1414731, r1414733);
double r1414736 = r1414734 / r1414735;
double r1414737 = cbrt(r1414736);
double r1414738 = r1414737 * r1414737;
double r1414739 = r1414738 * r1414737;
double r1414740 = -3.4780572575898166e-17;
bool r1414741 = r1414723 <= r1414740;
double r1414742 = -1.0;
double r1414743 = -5.393824270148449e-74;
bool r1414744 = r1414723 <= r1414743;
double r1414745 = -8.647674327646353e-129;
bool r1414746 = r1414723 <= r1414745;
double r1414747 = -1.239928607796128e-180;
bool r1414748 = r1414723 <= r1414747;
double r1414749 = 6.823576610928472e-152;
bool r1414750 = r1414723 <= r1414749;
double r1414751 = 6.357559912396234e+53;
bool r1414752 = r1414723 <= r1414751;
double r1414753 = r1414730 * r1414731;
double r1414754 = r1414733 - r1414753;
double r1414755 = fma(r1414723, r1414723, r1414753);
double r1414756 = r1414754 / r1414755;
double r1414757 = r1414752 ? r1414756 : r1414726;
double r1414758 = r1414750 ? r1414742 : r1414757;
double r1414759 = r1414748 ? r1414726 : r1414758;
double r1414760 = r1414746 ? r1414742 : r1414759;
double r1414761 = r1414744 ? r1414739 : r1414760;
double r1414762 = r1414741 ? r1414742 : r1414761;
double r1414763 = r1414728 ? r1414739 : r1414762;
double r1414764 = r1414725 ? r1414726 : r1414763;
return r1414764;
}




Bits error versus x




Bits error versus y
| Original | 31.0 |
|---|---|
| Target | 30.7 |
| Herbie | 14.7 |
if x < -9.850726757232305e+116 or -8.647674327646353e-129 < x < -1.239928607796128e-180 or 6.357559912396234e+53 < x Initial program 45.8
Taylor expanded around inf 15.8
if -9.850726757232305e+116 < x < -2.1328351164470982e+17 or -3.4780572575898166e-17 < x < -5.393824270148449e-74Initial program 15.0
rmApplied add-cube-cbrt15.0
Simplified15.0
Simplified15.0
if -2.1328351164470982e+17 < x < -3.4780572575898166e-17 or -5.393824270148449e-74 < x < -8.647674327646353e-129 or -1.239928607796128e-180 < x < 6.823576610928472e-152Initial program 26.0
Taylor expanded around 0 12.2
if 6.823576610928472e-152 < x < 6.357559912396234e+53Initial program 16.3
rmApplied fma-def16.3
Final simplification14.7
herbie shell --seed 2019194 +o rules:numerics
(FPCore (x y)
:name "Diagrams.TwoD.Arc:arcBetween from diagrams-lib-1.3.0.3"
:herbie-target
(if (< (/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))) 0.9743233849626781) (- (/ (* x x) (+ (* x x) (* (* y y) 4.0))) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))) (- (pow (/ x (sqrt (+ (* x x) (* (* y y) 4.0)))) 2.0) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))))
(/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))))