\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 r34444294 = x;
double r34444295 = r34444294 * r34444294;
double r34444296 = y;
double r34444297 = 4.0;
double r34444298 = r34444296 * r34444297;
double r34444299 = r34444298 * r34444296;
double r34444300 = r34444295 - r34444299;
double r34444301 = r34444295 + r34444299;
double r34444302 = r34444300 / r34444301;
return r34444302;
}
double f(double x, double y) {
double r34444303 = y;
double r34444304 = -1.7605595017089978e+165;
bool r34444305 = r34444303 <= r34444304;
double r34444306 = -1.0;
double r34444307 = -2.145414165595919e-133;
bool r34444308 = r34444303 <= r34444307;
double r34444309 = x;
double r34444310 = r34444309 * r34444309;
double r34444311 = 4.0;
double r34444312 = r34444303 * r34444311;
double r34444313 = r34444312 * r34444303;
double r34444314 = r34444310 + r34444313;
double r34444315 = r34444310 / r34444314;
double r34444316 = r34444313 / r34444314;
double r34444317 = r34444315 - r34444316;
double r34444318 = r34444317 * r34444317;
double r34444319 = r34444318 * r34444317;
double r34444320 = cbrt(r34444319);
double r34444321 = 1.047103978369638e-54;
bool r34444322 = r34444303 <= r34444321;
double r34444323 = 1.0;
double r34444324 = 6.692635626773783e+153;
bool r34444325 = r34444303 <= r34444324;
double r34444326 = r34444325 ? r34444317 : r34444306;
double r34444327 = r34444322 ? r34444323 : r34444326;
double r34444328 = r34444308 ? r34444320 : r34444327;
double r34444329 = r34444305 ? r34444306 : r34444328;
return r34444329;
}




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))))