\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 \cdot x \le 2.474217005200442472341357463282609203046 \cdot 10^{-201}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 2.354236108762997383350198288921334328983 \cdot 10^{-102}:\\
\;\;\;\;\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\\
\mathbf{elif}\;x \cdot x \le 5.880877246270694688154653410666269919282 \cdot 10^{-9}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 5.631796052196258562903200319313186965612 \cdot 10^{278}:\\
\;\;\;\;\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \frac{\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 r30417066 = x;
double r30417067 = r30417066 * r30417066;
double r30417068 = y;
double r30417069 = 4.0;
double r30417070 = r30417068 * r30417069;
double r30417071 = r30417070 * r30417068;
double r30417072 = r30417067 - r30417071;
double r30417073 = r30417067 + r30417071;
double r30417074 = r30417072 / r30417073;
return r30417074;
}
double f(double x, double y) {
double r30417075 = x;
double r30417076 = r30417075 * r30417075;
double r30417077 = 2.4742170052004425e-201;
bool r30417078 = r30417076 <= r30417077;
double r30417079 = -1.0;
double r30417080 = 2.3542361087629974e-102;
bool r30417081 = r30417076 <= r30417080;
double r30417082 = y;
double r30417083 = 4.0;
double r30417084 = r30417082 * r30417083;
double r30417085 = r30417084 * r30417082;
double r30417086 = r30417076 + r30417085;
double r30417087 = r30417076 / r30417086;
double r30417088 = r30417085 / r30417086;
double r30417089 = r30417087 - r30417088;
double r30417090 = 5.880877246270695e-09;
bool r30417091 = r30417076 <= r30417090;
double r30417092 = 5.6317960521962586e+278;
bool r30417093 = r30417076 <= r30417092;
double r30417094 = 1.0;
double r30417095 = r30417093 ? r30417089 : r30417094;
double r30417096 = r30417091 ? r30417079 : r30417095;
double r30417097 = r30417081 ? r30417089 : r30417096;
double r30417098 = r30417078 ? r30417079 : r30417097;
return r30417098;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.1 |
|---|---|
| Target | 30.8 |
| Herbie | 13.3 |
if (* x x) < 2.4742170052004425e-201 or 2.3542361087629974e-102 < (* x x) < 5.880877246270695e-09Initial program 24.2
Taylor expanded around 0 13.7
if 2.4742170052004425e-201 < (* x x) < 2.3542361087629974e-102 or 5.880877246270695e-09 < (* x x) < 5.6317960521962586e+278Initial program 16.1
rmApplied div-sub16.1
if 5.6317960521962586e+278 < (* x x) Initial program 59.5
Taylor expanded around inf 9.3
Final simplification13.3
herbie shell --seed 2019172
(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))))