\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 1.51233920017420984 \cdot 10^{-184}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 259753368901583.88:\\
\;\;\;\;\log \left(e^{\left(\sqrt{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}} + \sqrt{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right) \cdot \left(\sqrt{\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y}} - \sqrt{\frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right)}\right)\\
\mathbf{elif}\;x \cdot x \le 4.9513109421031689 \cdot 10^{37}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 1.4348180576052783 \cdot 10^{267}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r781240 = x;
double r781241 = r781240 * r781240;
double r781242 = y;
double r781243 = 4.0;
double r781244 = r781242 * r781243;
double r781245 = r781244 * r781242;
double r781246 = r781241 - r781245;
double r781247 = r781241 + r781245;
double r781248 = r781246 / r781247;
return r781248;
}
double f(double x, double y) {
double r781249 = x;
double r781250 = r781249 * r781249;
double r781251 = 1.5123392001742098e-184;
bool r781252 = r781250 <= r781251;
double r781253 = 1.0;
double r781254 = -r781253;
double r781255 = 259753368901583.88;
bool r781256 = r781250 <= r781255;
double r781257 = y;
double r781258 = 4.0;
double r781259 = r781257 * r781258;
double r781260 = r781259 * r781257;
double r781261 = r781250 + r781260;
double r781262 = r781250 / r781261;
double r781263 = sqrt(r781262);
double r781264 = r781260 / r781261;
double r781265 = sqrt(r781264);
double r781266 = r781263 + r781265;
double r781267 = r781263 - r781265;
double r781268 = r781266 * r781267;
double r781269 = exp(r781268);
double r781270 = log(r781269);
double r781271 = 4.951310942103169e+37;
bool r781272 = r781250 <= r781271;
double r781273 = 1.4348180576052783e+267;
bool r781274 = r781250 <= r781273;
double r781275 = r781250 - r781260;
double r781276 = r781275 / r781261;
double r781277 = exp(r781276);
double r781278 = log(r781277);
double r781279 = 1.0;
double r781280 = r781274 ? r781278 : r781279;
double r781281 = r781272 ? r781254 : r781280;
double r781282 = r781256 ? r781270 : r781281;
double r781283 = r781252 ? r781254 : r781282;
return r781283;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.9 |
|---|---|
| Target | 31.6 |
| Herbie | 12.8 |
if (* x x) < 1.5123392001742098e-184 or 259753368901583.88 < (* x x) < 4.951310942103169e+37Initial program 25.9
rmApplied add-log-exp25.9
rmApplied div-sub25.9
Taylor expanded around 0 11.9
if 1.5123392001742098e-184 < (* x x) < 259753368901583.88Initial program 16.1
rmApplied add-log-exp16.1
rmApplied div-sub16.1
rmApplied add-sqr-sqrt16.1
Applied add-sqr-sqrt16.1
Applied difference-of-squares16.1
if 4.951310942103169e+37 < (* x x) < 1.4348180576052783e+267Initial program 16.4
rmApplied add-log-exp16.5
if 1.4348180576052783e+267 < (* x x) Initial program 58.6
Taylor expanded around inf 9.8
Final simplification12.8
herbie shell --seed 2020025
(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))))