\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}\;y \le -1.301374440507404895907194560242418600608 \cdot 10^{46}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le -1.325487455469303882090057398488652321276 \cdot 10^{-118}:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + y \cdot \left(4 \cdot y\right)}{x \cdot x - y \cdot \left(4 \cdot y\right)}}\\
\mathbf{elif}\;y \le 4.25620766706611866924466504395368552162 \cdot 10^{-88}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \le 224508924829977781598467292686974976:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + y \cdot \left(4 \cdot y\right)}{x \cdot x - y \cdot \left(4 \cdot y\right)}}\\
\mathbf{elif}\;y \le 1.385619300047896001176212011534409289571 \cdot 10^{55}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \le 1.721661522519145467939207901613782215678 \cdot 10^{119}:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + y \cdot \left(4 \cdot y\right)}{x \cdot x - y \cdot \left(4 \cdot y\right)}}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}double f(double x, double y) {
double r28385506 = x;
double r28385507 = r28385506 * r28385506;
double r28385508 = y;
double r28385509 = 4.0;
double r28385510 = r28385508 * r28385509;
double r28385511 = r28385510 * r28385508;
double r28385512 = r28385507 - r28385511;
double r28385513 = r28385507 + r28385511;
double r28385514 = r28385512 / r28385513;
return r28385514;
}
double f(double x, double y) {
double r28385515 = y;
double r28385516 = -1.301374440507405e+46;
bool r28385517 = r28385515 <= r28385516;
double r28385518 = -1.0;
double r28385519 = -1.3254874554693039e-118;
bool r28385520 = r28385515 <= r28385519;
double r28385521 = 1.0;
double r28385522 = x;
double r28385523 = r28385522 * r28385522;
double r28385524 = 4.0;
double r28385525 = r28385524 * r28385515;
double r28385526 = r28385515 * r28385525;
double r28385527 = r28385523 + r28385526;
double r28385528 = r28385523 - r28385526;
double r28385529 = r28385527 / r28385528;
double r28385530 = r28385521 / r28385529;
double r28385531 = 4.2562076670661187e-88;
bool r28385532 = r28385515 <= r28385531;
double r28385533 = 2.245089248299778e+35;
bool r28385534 = r28385515 <= r28385533;
double r28385535 = 1.385619300047896e+55;
bool r28385536 = r28385515 <= r28385535;
double r28385537 = 1.7216615225191455e+119;
bool r28385538 = r28385515 <= r28385537;
double r28385539 = r28385538 ? r28385530 : r28385518;
double r28385540 = r28385536 ? r28385521 : r28385539;
double r28385541 = r28385534 ? r28385530 : r28385540;
double r28385542 = r28385532 ? r28385521 : r28385541;
double r28385543 = r28385520 ? r28385530 : r28385542;
double r28385544 = r28385517 ? r28385518 : r28385543;
return r28385544;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.9 |
|---|---|
| Target | 31.6 |
| Herbie | 13.2 |
if y < -1.301374440507405e+46 or 1.7216615225191455e+119 < y Initial program 48.7
Taylor expanded around 0 11.9
if -1.301374440507405e+46 < y < -1.3254874554693039e-118 or 4.2562076670661187e-88 < y < 2.245089248299778e+35 or 1.385619300047896e+55 < y < 1.7216615225191455e+119Initial program 16.0
rmApplied clear-num16.0
if -1.3254874554693039e-118 < y < 4.2562076670661187e-88 or 2.245089248299778e+35 < y < 1.385619300047896e+55Initial program 27.4
Taylor expanded around inf 12.2
Final simplification13.2
herbie shell --seed 2019169
(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))))