\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}\;\left(y \cdot 4\right) \cdot y \le 1.883987095627688634773256576903935146579 \cdot 10^{-179}:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 25951328951665387827625984:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + \left(y \cdot 4\right) \cdot y}{x \cdot x - \left(y \cdot 4\right) \cdot y}}\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 56309717854388472133950898176:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 7.251271519567312889559392701775878259286 \cdot 10^{285}:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + \left(y \cdot 4\right) \cdot y}{x \cdot x - \left(y \cdot 4\right) \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}double f(double x, double y) {
double r418875 = x;
double r418876 = r418875 * r418875;
double r418877 = y;
double r418878 = 4.0;
double r418879 = r418877 * r418878;
double r418880 = r418879 * r418877;
double r418881 = r418876 - r418880;
double r418882 = r418876 + r418880;
double r418883 = r418881 / r418882;
return r418883;
}
double f(double x, double y) {
double r418884 = y;
double r418885 = 4.0;
double r418886 = r418884 * r418885;
double r418887 = r418886 * r418884;
double r418888 = 1.8839870956276886e-179;
bool r418889 = r418887 <= r418888;
double r418890 = 1.0;
double r418891 = 2.5951328951665388e+25;
bool r418892 = r418887 <= r418891;
double r418893 = x;
double r418894 = r418893 * r418893;
double r418895 = r418894 + r418887;
double r418896 = r418894 - r418887;
double r418897 = r418895 / r418896;
double r418898 = r418890 / r418897;
double r418899 = 5.630971785438847e+28;
bool r418900 = r418887 <= r418899;
double r418901 = 7.251271519567313e+285;
bool r418902 = r418887 <= r418901;
double r418903 = -1.0;
double r418904 = r418902 ? r418898 : r418903;
double r418905 = r418900 ? r418890 : r418904;
double r418906 = r418892 ? r418898 : r418905;
double r418907 = r418889 ? r418890 : r418906;
return r418907;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.7 |
|---|---|
| Target | 31.4 |
| Herbie | 12.4 |
if (* (* y 4.0) y) < 1.8839870956276886e-179 or 2.5951328951665388e+25 < (* (* y 4.0) y) < 5.630971785438847e+28Initial program 26.3
rmApplied clear-num26.3
Taylor expanded around inf 11.7
if 1.8839870956276886e-179 < (* (* y 4.0) y) < 2.5951328951665388e+25 or 5.630971785438847e+28 < (* (* y 4.0) y) < 7.251271519567313e+285Initial program 15.7
rmApplied clear-num15.7
if 7.251271519567313e+285 < (* (* y 4.0) y) Initial program 61.2
Taylor expanded around 0 8.9
Final simplification12.4
herbie shell --seed 2019323
(FPCore (x y)
:name "Diagrams.TwoD.Arc:arcBetween from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(if (< (/ (- (* x x) (* (* y 4) y)) (+ (* x x) (* (* y 4) y))) 0.9743233849626781) (- (/ (* x x) (+ (* x x) (* (* y y) 4))) (/ (* (* y y) 4) (+ (* x x) (* (* y y) 4)))) (- (pow (/ x (sqrt (+ (* x x) (* (* y y) 4)))) 2) (/ (* (* y y) 4) (+ (* x x) (* (* y y) 4)))))
(/ (- (* x x) (* (* y 4) y)) (+ (* x x) (* (* y 4) y))))