\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:\\
\;\;\;\;\sqrt[3]{\frac{x \cdot x - y \cdot \left(4 \cdot y\right)}{y \cdot \left(4 \cdot y\right) + x \cdot x}} \cdot \left(\sqrt[3]{\frac{x \cdot x - y \cdot \left(4 \cdot y\right)}{y \cdot \left(4 \cdot y\right) + x \cdot x}} \cdot \sqrt[3]{\frac{x \cdot x - y \cdot \left(4 \cdot y\right)}{y \cdot \left(4 \cdot y\right) + x \cdot x}}\right)\\
\mathbf{elif}\;x \le -3.478057257589816580751045492937248447757 \cdot 10^{-17}:\\
\;\;\;\;\frac{1}{-1}\\
\mathbf{elif}\;x \le -5.393824270148449076708054055498132792438 \cdot 10^{-74}:\\
\;\;\;\;\sqrt[3]{\frac{x \cdot x - y \cdot \left(4 \cdot y\right)}{y \cdot \left(4 \cdot y\right) + x \cdot x}} \cdot \left(\sqrt[3]{\frac{x \cdot x - y \cdot \left(4 \cdot y\right)}{y \cdot \left(4 \cdot y\right) + x \cdot x}} \cdot \sqrt[3]{\frac{x \cdot x - y \cdot \left(4 \cdot y\right)}{y \cdot \left(4 \cdot y\right) + x \cdot x}}\right)\\
\mathbf{elif}\;x \le -8.64767432764635258433792673669348312331 \cdot 10^{-129}:\\
\;\;\;\;\frac{1}{-1}\\
\mathbf{elif}\;x \le -1.23992860779612800616268155128852493615 \cdot 10^{-180}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le 6.823576610928471937518681293595906800826 \cdot 10^{-152}:\\
\;\;\;\;\frac{1}{-1}\\
\mathbf{elif}\;x \le 6.357559912396233893317957556288536407725 \cdot 10^{53}:\\
\;\;\;\;\frac{1}{\frac{y \cdot \left(4 \cdot y\right) + x \cdot x}{x \cdot x - y \cdot \left(4 \cdot y\right)}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r570849 = x;
double r570850 = r570849 * r570849;
double r570851 = y;
double r570852 = 4.0;
double r570853 = r570851 * r570852;
double r570854 = r570853 * r570851;
double r570855 = r570850 - r570854;
double r570856 = r570850 + r570854;
double r570857 = r570855 / r570856;
return r570857;
}
double f(double x, double y) {
double r570858 = x;
double r570859 = -9.850726757232305e+116;
bool r570860 = r570858 <= r570859;
double r570861 = 1.0;
double r570862 = -2.1328351164470982e+17;
bool r570863 = r570858 <= r570862;
double r570864 = r570858 * r570858;
double r570865 = y;
double r570866 = 4.0;
double r570867 = r570866 * r570865;
double r570868 = r570865 * r570867;
double r570869 = r570864 - r570868;
double r570870 = r570868 + r570864;
double r570871 = r570869 / r570870;
double r570872 = cbrt(r570871);
double r570873 = r570872 * r570872;
double r570874 = r570872 * r570873;
double r570875 = -3.4780572575898166e-17;
bool r570876 = r570858 <= r570875;
double r570877 = -1.0;
double r570878 = r570861 / r570877;
double r570879 = -5.393824270148449e-74;
bool r570880 = r570858 <= r570879;
double r570881 = -8.647674327646353e-129;
bool r570882 = r570858 <= r570881;
double r570883 = -1.239928607796128e-180;
bool r570884 = r570858 <= r570883;
double r570885 = 6.823576610928472e-152;
bool r570886 = r570858 <= r570885;
double r570887 = 6.357559912396234e+53;
bool r570888 = r570858 <= r570887;
double r570889 = r570870 / r570869;
double r570890 = r570861 / r570889;
double r570891 = r570888 ? r570890 : r570861;
double r570892 = r570886 ? r570878 : r570891;
double r570893 = r570884 ? r570861 : r570892;
double r570894 = r570882 ? r570878 : r570893;
double r570895 = r570880 ? r570874 : r570894;
double r570896 = r570876 ? r570878 : r570895;
double r570897 = r570863 ? r570874 : r570896;
double r570898 = r570860 ? r570861 : r570897;
return r570898;
}




Bits error versus x




Bits error versus y
Results
| 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
rmApplied clear-num45.8
Simplified45.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
rmApplied clear-num26.0
Simplified26.0
Taylor expanded around 0 12.2
if 6.823576610928472e-152 < x < 6.357559912396234e+53Initial program 16.3
rmApplied clear-num16.3
Simplified16.3
Final simplification14.7
herbie shell --seed 2019194
(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))))