\frac{x \cdot x - \left(y \cdot 4.0\right) \cdot y}{x \cdot x + \left(y \cdot 4.0\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \cdot x \le 7.1088010196971 \cdot 10^{-314}:\\
\;\;\;\;-1.0\\
\mathbf{elif}\;x \cdot x \le 9.758857908001147 \cdot 10^{+18}:\\
\;\;\;\;\frac{1}{\frac{y \cdot \left(4.0 \cdot y\right) + x \cdot x}{x \cdot x - y \cdot \left(4.0 \cdot y\right)}}\\
\mathbf{elif}\;x \cdot x \le 6.296502919195928 \cdot 10^{+44}:\\
\;\;\;\;-1.0\\
\mathbf{elif}\;x \cdot x \le 3.1031769081973586 \cdot 10^{+257}:\\
\;\;\;\;\frac{1}{\frac{y \cdot \left(4.0 \cdot y\right) + x \cdot x}{x \cdot x - y \cdot \left(4.0 \cdot y\right)}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r32634531 = x;
double r32634532 = r32634531 * r32634531;
double r32634533 = y;
double r32634534 = 4.0;
double r32634535 = r32634533 * r32634534;
double r32634536 = r32634535 * r32634533;
double r32634537 = r32634532 - r32634536;
double r32634538 = r32634532 + r32634536;
double r32634539 = r32634537 / r32634538;
return r32634539;
}
double f(double x, double y) {
double r32634540 = x;
double r32634541 = r32634540 * r32634540;
double r32634542 = 7.1088010196971e-314;
bool r32634543 = r32634541 <= r32634542;
double r32634544 = -1.0;
double r32634545 = 9.758857908001147e+18;
bool r32634546 = r32634541 <= r32634545;
double r32634547 = 1.0;
double r32634548 = y;
double r32634549 = 4.0;
double r32634550 = r32634549 * r32634548;
double r32634551 = r32634548 * r32634550;
double r32634552 = r32634551 + r32634541;
double r32634553 = r32634541 - r32634551;
double r32634554 = r32634552 / r32634553;
double r32634555 = r32634547 / r32634554;
double r32634556 = 6.296502919195928e+44;
bool r32634557 = r32634541 <= r32634556;
double r32634558 = 3.1031769081973586e+257;
bool r32634559 = r32634541 <= r32634558;
double r32634560 = r32634559 ? r32634555 : r32634547;
double r32634561 = r32634557 ? r32634544 : r32634560;
double r32634562 = r32634546 ? r32634555 : r32634561;
double r32634563 = r32634543 ? r32634544 : r32634562;
return r32634563;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.1 |
|---|---|
| Target | 31.2 |
| Herbie | 12.6 |
if (* x x) < 7.1088010196971e-314 or 9.758857908001147e+18 < (* x x) < 6.296502919195928e+44Initial program 29.3
Taylor expanded around 0 10.1
if 7.1088010196971e-314 < (* x x) < 9.758857908001147e+18 or 6.296502919195928e+44 < (* x x) < 3.1031769081973586e+257Initial program 16.1
rmApplied clear-num16.1
if 3.1031769081973586e+257 < (* x x) Initial program 56.4
Taylor expanded around inf 9.6
Final simplification12.6
herbie shell --seed 2019163
(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) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))))
(/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))))