\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 1.1009678461595335 \cdot 10^{-279}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 2.3515556900183252 \cdot 10^{-150}:\\
\;\;\;\;\frac{x}{\frac{\mathsf{fma}\left(x, x, \left(y \cdot 4\right) \cdot y\right)}{x}} - \frac{y \cdot 4}{\frac{\mathsf{fma}\left(x, x, \left(y \cdot 4\right) \cdot y\right)}{y}}\\
\mathbf{elif}\;x \cdot x \le 5.9556908252936597 \cdot 10^{-131}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 7.1565475002938845 \cdot 10^{289}:\\
\;\;\;\;\frac{x}{\frac{\mathsf{fma}\left(x, x, \left(y \cdot 4\right) \cdot y\right)}{x}} - \frac{y \cdot 4}{\frac{\mathsf{fma}\left(x, x, \left(y \cdot 4\right) \cdot y\right)}{y}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r582272 = x;
double r582273 = r582272 * r582272;
double r582274 = y;
double r582275 = 4.0;
double r582276 = r582274 * r582275;
double r582277 = r582276 * r582274;
double r582278 = r582273 - r582277;
double r582279 = r582273 + r582277;
double r582280 = r582278 / r582279;
return r582280;
}
double f(double x, double y) {
double r582281 = x;
double r582282 = r582281 * r582281;
double r582283 = 1.1009678461595335e-279;
bool r582284 = r582282 <= r582283;
double r582285 = -1.0;
double r582286 = 2.3515556900183252e-150;
bool r582287 = r582282 <= r582286;
double r582288 = y;
double r582289 = 4.0;
double r582290 = r582288 * r582289;
double r582291 = r582290 * r582288;
double r582292 = fma(r582281, r582281, r582291);
double r582293 = r582292 / r582281;
double r582294 = r582281 / r582293;
double r582295 = r582292 / r582288;
double r582296 = r582290 / r582295;
double r582297 = r582294 - r582296;
double r582298 = 5.95569082529366e-131;
bool r582299 = r582282 <= r582298;
double r582300 = 7.1565475002938845e+289;
bool r582301 = r582282 <= r582300;
double r582302 = 1.0;
double r582303 = r582301 ? r582297 : r582302;
double r582304 = r582299 ? r582285 : r582303;
double r582305 = r582287 ? r582297 : r582304;
double r582306 = r582284 ? r582285 : r582305;
return r582306;
}




Bits error versus x




Bits error versus y
| Original | 31.8 |
|---|---|
| Target | 31.5 |
| Herbie | 12.3 |
if (* x x) < 1.1009678461595335e-279 or 2.3515556900183252e-150 < (* x x) < 5.95569082529366e-131Initial program 29.2
Taylor expanded around 0 10.2
if 1.1009678461595335e-279 < (* x x) < 2.3515556900183252e-150 or 5.95569082529366e-131 < (* x x) < 7.1565475002938845e+289Initial program 16.1
rmApplied div-sub16.1
Simplified16.2
Simplified15.7
if 7.1565475002938845e+289 < (* x x) Initial program 61.4
Taylor expanded around inf 8.9
Final simplification12.3
herbie shell --seed 2020062 +o rules:numerics
(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))))