\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 -4.75486451228188590222826906220099481589 \cdot 10^{122}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -4.332313917220748901311195815363194649965 \cdot 10^{80}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le -9211266202426181632:\\
\;\;\;\;\sqrt[3]{\left(\left(\frac{x \cdot x}{\left(y \cdot 4\right) \cdot y + x \cdot x} - \frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}\right) \cdot \left(\frac{x \cdot x}{\left(y \cdot 4\right) \cdot y + x \cdot x} - \frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}\right)\right) \cdot \left(\frac{x \cdot x}{\left(y \cdot 4\right) \cdot y + x \cdot x} - \frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}\right)}\\
\mathbf{elif}\;x \le 2.139551810604105186057739335770012586275 \cdot 10^{-153}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 7.373518315070099961643182713875384049377 \cdot 10^{127}:\\
\;\;\;\;\sqrt[3]{\left(\left(\frac{x \cdot x}{\left(y \cdot 4\right) \cdot y + x \cdot x} - \frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}\right) \cdot \left(\frac{x \cdot x}{\left(y \cdot 4\right) \cdot y + x \cdot x} - \frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}\right)\right) \cdot \left(\frac{x \cdot x}{\left(y \cdot 4\right) \cdot y + x \cdot x} - \frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r27695880 = x;
double r27695881 = r27695880 * r27695880;
double r27695882 = y;
double r27695883 = 4.0;
double r27695884 = r27695882 * r27695883;
double r27695885 = r27695884 * r27695882;
double r27695886 = r27695881 - r27695885;
double r27695887 = r27695881 + r27695885;
double r27695888 = r27695886 / r27695887;
return r27695888;
}
double f(double x, double y) {
double r27695889 = x;
double r27695890 = -4.754864512281886e+122;
bool r27695891 = r27695889 <= r27695890;
double r27695892 = 1.0;
double r27695893 = -4.332313917220749e+80;
bool r27695894 = r27695889 <= r27695893;
double r27695895 = -1.0;
double r27695896 = -9.211266202426182e+18;
bool r27695897 = r27695889 <= r27695896;
double r27695898 = r27695889 * r27695889;
double r27695899 = y;
double r27695900 = 4.0;
double r27695901 = r27695899 * r27695900;
double r27695902 = r27695901 * r27695899;
double r27695903 = r27695902 + r27695898;
double r27695904 = r27695898 / r27695903;
double r27695905 = r27695902 / r27695903;
double r27695906 = r27695904 - r27695905;
double r27695907 = r27695906 * r27695906;
double r27695908 = r27695907 * r27695906;
double r27695909 = cbrt(r27695908);
double r27695910 = 2.1395518106041052e-153;
bool r27695911 = r27695889 <= r27695910;
double r27695912 = 7.3735183150701e+127;
bool r27695913 = r27695889 <= r27695912;
double r27695914 = r27695913 ? r27695909 : r27695892;
double r27695915 = r27695911 ? r27695895 : r27695914;
double r27695916 = r27695897 ? r27695909 : r27695915;
double r27695917 = r27695894 ? r27695895 : r27695916;
double r27695918 = r27695891 ? r27695892 : r27695917;
return r27695918;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.4 |
|---|---|
| Target | 31.1 |
| Herbie | 13.8 |
if x < -4.754864512281886e+122 or 7.3735183150701e+127 < x Initial program 56.1
Taylor expanded around inf 9.9
if -4.754864512281886e+122 < x < -4.332313917220749e+80 or -9.211266202426182e+18 < x < 2.1395518106041052e-153Initial program 24.5
Taylor expanded around 0 15.6
if -4.332313917220749e+80 < x < -9.211266202426182e+18 or 2.1395518106041052e-153 < x < 7.3735183150701e+127Initial program 15.3
rmApplied div-sub15.3
rmApplied add-cbrt-cube15.3
Final simplification13.8
herbie shell --seed 2019174 +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))))