\sqrt{x \cdot x + y \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -2.8884266593894412 \cdot 10^{145}:\\
\;\;\;\;-1 \cdot y\\
\mathbf{elif}\;y \le -8.59044981858877489 \cdot 10^{-223}:\\
\;\;\;\;\sqrt{x \cdot x + y \cdot y}\\
\mathbf{elif}\;y \le 3.3111519867076028 \cdot 10^{-267}:\\
\;\;\;\;-1 \cdot x\\
\mathbf{elif}\;y \le 4.35781193024123746 \cdot 10^{99}:\\
\;\;\;\;\sqrt{x \cdot x + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}double f(double x, double y) {
double r771457 = x;
double r771458 = r771457 * r771457;
double r771459 = y;
double r771460 = r771459 * r771459;
double r771461 = r771458 + r771460;
double r771462 = sqrt(r771461);
return r771462;
}
double f(double x, double y) {
double r771463 = y;
double r771464 = -2.888426659389441e+145;
bool r771465 = r771463 <= r771464;
double r771466 = -1.0;
double r771467 = r771466 * r771463;
double r771468 = -8.590449818588775e-223;
bool r771469 = r771463 <= r771468;
double r771470 = x;
double r771471 = r771470 * r771470;
double r771472 = r771463 * r771463;
double r771473 = r771471 + r771472;
double r771474 = sqrt(r771473);
double r771475 = 3.311151986707603e-267;
bool r771476 = r771463 <= r771475;
double r771477 = r771466 * r771470;
double r771478 = 4.3578119302412375e+99;
bool r771479 = r771463 <= r771478;
double r771480 = r771479 ? r771474 : r771463;
double r771481 = r771476 ? r771477 : r771480;
double r771482 = r771469 ? r771474 : r771481;
double r771483 = r771465 ? r771467 : r771482;
return r771483;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.4 |
|---|---|
| Target | 17.6 |
| Herbie | 17.4 |
if y < -2.888426659389441e+145Initial program 61.0
rmApplied flip-+64.0
Simplified64.0
Taylor expanded around -inf 7.4
if -2.888426659389441e+145 < y < -8.590449818588775e-223 or 3.311151986707603e-267 < y < 4.3578119302412375e+99Initial program 19.3
if -8.590449818588775e-223 < y < 3.311151986707603e-267Initial program 30.2
Taylor expanded around -inf 32.4
if 4.3578119302412375e+99 < y Initial program 50.7
Taylor expanded around 0 10.2
Final simplification17.4
herbie shell --seed 2020003
(FPCore (x y)
:name "Data.Octree.Internal:octantDistance from Octree-0.5.4.2"
:precision binary64
:herbie-target
(if (< x -1.123695082659983e+145) (- x) (if (< x 1.116557621183362e+93) (sqrt (+ (* x x) (* y y))) x))
(sqrt (+ (* x x) (* y y))))