\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 \le -1.10209323570294511 \cdot 10^{154}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -7.05570383594217736 \cdot 10^{-134}:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + \left(y \cdot 4\right) \cdot y}{x \cdot x}} - \frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\\
\mathbf{elif}\;x \le 3.30957855650517974 \cdot 10^{-97}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 2.70835173311075 \cdot 10^{105}:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + \left(y \cdot 4\right) \cdot y}{x \cdot x}} - \frac{\left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r778407 = x;
double r778408 = r778407 * r778407;
double r778409 = y;
double r778410 = 4.0;
double r778411 = r778409 * r778410;
double r778412 = r778411 * r778409;
double r778413 = r778408 - r778412;
double r778414 = r778408 + r778412;
double r778415 = r778413 / r778414;
return r778415;
}
double f(double x, double y) {
double r778416 = x;
double r778417 = -1.1020932357029451e+154;
bool r778418 = r778416 <= r778417;
double r778419 = 1.0;
double r778420 = -7.055703835942177e-134;
bool r778421 = r778416 <= r778420;
double r778422 = r778416 * r778416;
double r778423 = y;
double r778424 = 4.0;
double r778425 = r778423 * r778424;
double r778426 = r778425 * r778423;
double r778427 = r778422 + r778426;
double r778428 = r778427 / r778422;
double r778429 = r778419 / r778428;
double r778430 = r778426 / r778427;
double r778431 = r778429 - r778430;
double r778432 = 3.3095785565051797e-97;
bool r778433 = r778416 <= r778432;
double r778434 = -1.0;
double r778435 = 2.70835173311075e+105;
bool r778436 = r778416 <= r778435;
double r778437 = r778436 ? r778431 : r778419;
double r778438 = r778433 ? r778434 : r778437;
double r778439 = r778421 ? r778431 : r778438;
double r778440 = r778418 ? r778419 : r778439;
return r778440;
}




Bits error versus x




Bits error versus y
Results
| Original | 32.4 |
|---|---|
| Target | 32.1 |
| Herbie | 12.2 |
if x < -1.1020932357029451e+154 or 2.70835173311075e+105 < x Initial program 57.5
Taylor expanded around inf 9.0
if -1.1020932357029451e+154 < x < -7.055703835942177e-134 or 3.3095785565051797e-97 < x < 2.70835173311075e+105Initial program 16.4
rmApplied div-sub16.4
rmApplied clear-num16.4
if -7.055703835942177e-134 < x < 3.3095785565051797e-97Initial program 28.8
Taylor expanded around 0 10.0
Final simplification12.2
herbie shell --seed 2020046
(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))))