\frac{x \cdot x - \left(y \cdot 4.0\right) \cdot y}{x \cdot x + \left(y \cdot 4.0\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \cdot x \le 1.3643855637695705 \cdot 10^{-229}:\\
\;\;\;\;-1.0\\
\mathbf{elif}\;x \cdot x \le 1.0463855970660416 \cdot 10^{+213}:\\
\;\;\;\;\frac{1}{\sqrt{y \cdot \left(4.0 \cdot y\right) + x \cdot x}} \cdot \frac{x \cdot x - y \cdot \left(4.0 \cdot y\right)}{\sqrt{y \cdot \left(4.0 \cdot y\right) + x \cdot x}}\\
\mathbf{elif}\;x \cdot x \le 1.761554774712835 \cdot 10^{+268}:\\
\;\;\;\;-1.0\\
\mathbf{elif}\;x \cdot x \le 5.112886449152387 \cdot 10^{+290}:\\
\;\;\;\;\frac{\sqrt{x \cdot x - y \cdot \left(4.0 \cdot y\right)}}{\frac{y \cdot \left(4.0 \cdot y\right) + x \cdot x}{\sqrt{x \cdot x - y \cdot \left(4.0 \cdot y\right)}}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r31787972 = x;
double r31787973 = r31787972 * r31787972;
double r31787974 = y;
double r31787975 = 4.0;
double r31787976 = r31787974 * r31787975;
double r31787977 = r31787976 * r31787974;
double r31787978 = r31787973 - r31787977;
double r31787979 = r31787973 + r31787977;
double r31787980 = r31787978 / r31787979;
return r31787980;
}
double f(double x, double y) {
double r31787981 = x;
double r31787982 = r31787981 * r31787981;
double r31787983 = 1.3643855637695705e-229;
bool r31787984 = r31787982 <= r31787983;
double r31787985 = -1.0;
double r31787986 = 1.0463855970660416e+213;
bool r31787987 = r31787982 <= r31787986;
double r31787988 = 1.0;
double r31787989 = y;
double r31787990 = 4.0;
double r31787991 = r31787990 * r31787989;
double r31787992 = r31787989 * r31787991;
double r31787993 = r31787992 + r31787982;
double r31787994 = sqrt(r31787993);
double r31787995 = r31787988 / r31787994;
double r31787996 = r31787982 - r31787992;
double r31787997 = r31787996 / r31787994;
double r31787998 = r31787995 * r31787997;
double r31787999 = 1.761554774712835e+268;
bool r31788000 = r31787982 <= r31787999;
double r31788001 = 5.112886449152387e+290;
bool r31788002 = r31787982 <= r31788001;
double r31788003 = sqrt(r31787996);
double r31788004 = r31787993 / r31788003;
double r31788005 = r31788003 / r31788004;
double r31788006 = r31788002 ? r31788005 : r31787988;
double r31788007 = r31788000 ? r31787985 : r31788006;
double r31788008 = r31787987 ? r31787998 : r31788007;
double r31788009 = r31787984 ? r31787985 : r31788008;
return r31788009;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.5 |
|---|---|
| Target | 31.2 |
| Herbie | 13.4 |
if (* x x) < 1.3643855637695705e-229 or 1.0463855970660416e+213 < (* x x) < 1.761554774712835e+268Initial program 25.9
Taylor expanded around 0 13.6
if 1.3643855637695705e-229 < (* x x) < 1.0463855970660416e+213Initial program 15.7
rmApplied add-sqr-sqrt15.7
Applied *-un-lft-identity15.7
Applied times-frac15.9
if 1.761554774712835e+268 < (* x x) < 5.112886449152387e+290Initial program 14.7
rmApplied add-sqr-sqrt16.5
Applied associate-/l*16.5
if 5.112886449152387e+290 < (* x x) Initial program 61.2
Taylor expanded around inf 9.6
Final simplification13.4
herbie shell --seed 2019165
(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))))