\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 3.222607567780329196681560572143104577428 \cdot 10^{-289}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 6.835592550358748008281275435772541106955 \cdot 10^{96}:\\
\;\;\;\;\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\\
\mathbf{elif}\;x \cdot x \le 7.775826278762702186699010750865619056054 \cdot 10^{132}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 1.421420598341031269955175034568661498389 \cdot 10^{194}:\\
\;\;\;\;\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 r30574491 = x;
double r30574492 = r30574491 * r30574491;
double r30574493 = y;
double r30574494 = 4.0;
double r30574495 = r30574493 * r30574494;
double r30574496 = r30574495 * r30574493;
double r30574497 = r30574492 - r30574496;
double r30574498 = r30574492 + r30574496;
double r30574499 = r30574497 / r30574498;
return r30574499;
}
double f(double x, double y) {
double r30574500 = x;
double r30574501 = r30574500 * r30574500;
double r30574502 = 3.222607567780329e-289;
bool r30574503 = r30574501 <= r30574502;
double r30574504 = -1.0;
double r30574505 = 6.835592550358748e+96;
bool r30574506 = r30574501 <= r30574505;
double r30574507 = y;
double r30574508 = 4.0;
double r30574509 = r30574507 * r30574508;
double r30574510 = r30574509 * r30574507;
double r30574511 = r30574501 - r30574510;
double r30574512 = r30574501 + r30574510;
double r30574513 = r30574511 / r30574512;
double r30574514 = 7.775826278762702e+132;
bool r30574515 = r30574501 <= r30574514;
double r30574516 = 1.4214205983410313e+194;
bool r30574517 = r30574501 <= r30574516;
double r30574518 = r30574501 / r30574512;
double r30574519 = r30574510 / r30574512;
double r30574520 = r30574518 - r30574519;
double r30574521 = 1.0;
double r30574522 = r30574517 ? r30574520 : r30574521;
double r30574523 = r30574515 ? r30574504 : r30574522;
double r30574524 = r30574506 ? r30574513 : r30574523;
double r30574525 = r30574503 ? r30574504 : r30574524;
return r30574525;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.7 |
|---|---|
| Target | 31.4 |
| Herbie | 12.8 |
if (* x x) < 3.222607567780329e-289 or 6.835592550358748e+96 < (* x x) < 7.775826278762702e+132Initial program 29.3
Taylor expanded around 0 11.4
if 3.222607567780329e-289 < (* x x) < 6.835592550358748e+96Initial program 15.7
if 7.775826278762702e+132 < (* x x) < 1.4214205983410313e+194Initial program 17.5
rmApplied div-sub17.5
if 1.4214205983410313e+194 < (* x x) Initial program 50.4
Taylor expanded around inf 10.5
Final simplification12.8
herbie shell --seed 2019168 +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))))