\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}\;\left(y \cdot 4\right) \cdot y \le 6.44495446490974234 \cdot 10^{-285}:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 1427194724.89060712:\\
\;\;\;\;\log \left(\sqrt{e^{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}}\right) + \log \left(\sqrt{e^{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}}\right)\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 7.34707069111200962 \cdot 10^{62}:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 2.3872178848098573 \cdot 10^{156}:\\
\;\;\;\;\log \left(e^{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right)\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 1.357033785550347 \cdot 10^{219}:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 5.92606420407618166 \cdot 10^{228}:\\
\;\;\;\;\log \left(\sqrt{e^{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}}\right) + \log \left(\sqrt{e^{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{-1}\right)\\
\end{array}double f(double x, double y) {
double r691488 = x;
double r691489 = r691488 * r691488;
double r691490 = y;
double r691491 = 4.0;
double r691492 = r691490 * r691491;
double r691493 = r691492 * r691490;
double r691494 = r691489 - r691493;
double r691495 = r691489 + r691493;
double r691496 = r691494 / r691495;
return r691496;
}
double f(double x, double y) {
double r691497 = y;
double r691498 = 4.0;
double r691499 = r691497 * r691498;
double r691500 = r691499 * r691497;
double r691501 = 6.444954464909742e-285;
bool r691502 = r691500 <= r691501;
double r691503 = 1.0;
double r691504 = 1427194724.890607;
bool r691505 = r691500 <= r691504;
double r691506 = x;
double r691507 = r691506 * r691506;
double r691508 = r691507 - r691500;
double r691509 = r691507 + r691500;
double r691510 = r691508 / r691509;
double r691511 = exp(r691510);
double r691512 = sqrt(r691511);
double r691513 = log(r691512);
double r691514 = r691513 + r691513;
double r691515 = 7.34707069111201e+62;
bool r691516 = r691500 <= r691515;
double r691517 = 2.3872178848098573e+156;
bool r691518 = r691500 <= r691517;
double r691519 = log(r691511);
double r691520 = 1.357033785550347e+219;
bool r691521 = r691500 <= r691520;
double r691522 = 5.9260642040761817e+228;
bool r691523 = r691500 <= r691522;
double r691524 = -1.0;
double r691525 = exp(r691524);
double r691526 = log(r691525);
double r691527 = r691523 ? r691514 : r691526;
double r691528 = r691521 ? r691503 : r691527;
double r691529 = r691518 ? r691519 : r691528;
double r691530 = r691516 ? r691503 : r691529;
double r691531 = r691505 ? r691514 : r691530;
double r691532 = r691502 ? r691503 : r691531;
return r691532;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.5 |
|---|---|
| Target | 31.2 |
| Herbie | 14.1 |
if (* (* y 4.0) y) < 6.444954464909742e-285 or 1427194724.890607 < (* (* y 4.0) y) < 7.34707069111201e+62 or 2.3872178848098573e+156 < (* (* y 4.0) y) < 1.357033785550347e+219Initial program 25.9
Taylor expanded around inf 16.4
if 6.444954464909742e-285 < (* (* y 4.0) y) < 1427194724.890607 or 1.357033785550347e+219 < (* (* y 4.0) y) < 5.9260642040761817e+228Initial program 15.9
rmApplied add-log-exp15.9
rmApplied add-sqr-sqrt15.9
Applied log-prod15.9
if 7.34707069111201e+62 < (* (* y 4.0) y) < 2.3872178848098573e+156Initial program 16.1
rmApplied add-log-exp16.1
if 5.9260642040761817e+228 < (* (* y 4.0) y) Initial program 53.2
rmApplied add-log-exp53.2
Taylor expanded around 0 9.7
Final simplification14.1
herbie shell --seed 2020003
(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))))