\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}\;y \le -1.7605595017089978 \cdot 10^{+165}:\\
\;\;\;\;-1.0\\
\mathbf{elif}\;y \le -2.145414165595919 \cdot 10^{-133}:\\
\;\;\;\;\sqrt[3]{\left(\left(\frac{x \cdot x}{x \cdot x + \left(y \cdot 4.0\right) \cdot y} - \frac{\left(y \cdot 4.0\right) \cdot y}{x \cdot x + \left(y \cdot 4.0\right) \cdot y}\right) \cdot \left(\frac{x \cdot x}{x \cdot x + \left(y \cdot 4.0\right) \cdot y} - \frac{\left(y \cdot 4.0\right) \cdot y}{x \cdot x + \left(y \cdot 4.0\right) \cdot y}\right)\right) \cdot \left(\frac{x \cdot x}{x \cdot x + \left(y \cdot 4.0\right) \cdot y} - \frac{\left(y \cdot 4.0\right) \cdot y}{x \cdot x + \left(y \cdot 4.0\right) \cdot y}\right)}\\
\mathbf{elif}\;y \le 1.047103978369638 \cdot 10^{-54}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \le 6.692635626773783 \cdot 10^{+153}:\\
\;\;\;\;\frac{x \cdot x}{x \cdot x + \left(y \cdot 4.0\right) \cdot y} - \frac{\left(y \cdot 4.0\right) \cdot y}{x \cdot x + \left(y \cdot 4.0\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;-1.0\\
\end{array}double f(double x, double y) {
double r35446306 = x;
double r35446307 = r35446306 * r35446306;
double r35446308 = y;
double r35446309 = 4.0;
double r35446310 = r35446308 * r35446309;
double r35446311 = r35446310 * r35446308;
double r35446312 = r35446307 - r35446311;
double r35446313 = r35446307 + r35446311;
double r35446314 = r35446312 / r35446313;
return r35446314;
}
double f(double x, double y) {
double r35446315 = y;
double r35446316 = -1.7605595017089978e+165;
bool r35446317 = r35446315 <= r35446316;
double r35446318 = -1.0;
double r35446319 = -2.145414165595919e-133;
bool r35446320 = r35446315 <= r35446319;
double r35446321 = x;
double r35446322 = r35446321 * r35446321;
double r35446323 = 4.0;
double r35446324 = r35446315 * r35446323;
double r35446325 = r35446324 * r35446315;
double r35446326 = r35446322 + r35446325;
double r35446327 = r35446322 / r35446326;
double r35446328 = r35446325 / r35446326;
double r35446329 = r35446327 - r35446328;
double r35446330 = r35446329 * r35446329;
double r35446331 = r35446330 * r35446329;
double r35446332 = cbrt(r35446331);
double r35446333 = 1.047103978369638e-54;
bool r35446334 = r35446315 <= r35446333;
double r35446335 = 1.0;
double r35446336 = 6.692635626773783e+153;
bool r35446337 = r35446315 <= r35446336;
double r35446338 = r35446337 ? r35446329 : r35446318;
double r35446339 = r35446334 ? r35446335 : r35446338;
double r35446340 = r35446320 ? r35446332 : r35446339;
double r35446341 = r35446317 ? r35446318 : r35446340;
return r35446341;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.0 |
|---|---|
| Target | 31.1 |
| Herbie | 13.2 |
if y < -1.7605595017089978e+165 or 6.692635626773783e+153 < y Initial program 63.4
Taylor expanded around 0 7.8
if -1.7605595017089978e+165 < y < -2.145414165595919e-133Initial program 17.9
rmApplied div-sub17.9
rmApplied add-cbrt-cube17.9
if -2.145414165595919e-133 < y < 1.047103978369638e-54Initial program 25.7
Taylor expanded around inf 12.0
if 1.047103978369638e-54 < y < 6.692635626773783e+153Initial program 16.2
rmApplied div-sub16.2
Final simplification13.2
herbie shell --seed 2019162
(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))))