\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 3.222607567780329196681560572143104577428 \cdot 10^{-289}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 6.835592550358748008281275435772541106955 \cdot 10^{96}:\\
\;\;\;\;\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}\\
\mathbf{elif}\;x \cdot x \le 7.775826278762702186699010750865619056054 \cdot 10^{132}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \le 1.421420598341031269955175034568661498389 \cdot 10^{194}:\\
\;\;\;\;\frac{x \cdot x}{x \cdot x + \left(y \cdot 4\right) \cdot y} - \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 r28498283 = x;
double r28498284 = r28498283 * r28498283;
double r28498285 = y;
double r28498286 = 4.0;
double r28498287 = r28498285 * r28498286;
double r28498288 = r28498287 * r28498285;
double r28498289 = r28498284 - r28498288;
double r28498290 = r28498284 + r28498288;
double r28498291 = r28498289 / r28498290;
return r28498291;
}
double f(double x, double y) {
double r28498292 = x;
double r28498293 = r28498292 * r28498292;
double r28498294 = 3.222607567780329e-289;
bool r28498295 = r28498293 <= r28498294;
double r28498296 = -1.0;
double r28498297 = 6.835592550358748e+96;
bool r28498298 = r28498293 <= r28498297;
double r28498299 = y;
double r28498300 = 4.0;
double r28498301 = r28498299 * r28498300;
double r28498302 = r28498301 * r28498299;
double r28498303 = r28498293 - r28498302;
double r28498304 = r28498293 + r28498302;
double r28498305 = r28498303 / r28498304;
double r28498306 = 7.775826278762702e+132;
bool r28498307 = r28498293 <= r28498306;
double r28498308 = 1.4214205983410313e+194;
bool r28498309 = r28498293 <= r28498308;
double r28498310 = r28498293 / r28498304;
double r28498311 = r28498302 / r28498304;
double r28498312 = r28498310 - r28498311;
double r28498313 = 1.0;
double r28498314 = r28498309 ? r28498312 : r28498313;
double r28498315 = r28498307 ? r28498296 : r28498314;
double r28498316 = r28498298 ? r28498305 : r28498315;
double r28498317 = r28498295 ? r28498296 : r28498316;
return r28498317;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.7 |
|---|---|
| Target | 31.4 |
| Herbie | 12.8 |
if (* x x) < 3.222607567780329e-289 or 6.835592550358748e+96 < (* x x) < 7.775826278762702e+132Initial program 29.3
Taylor expanded around 0 11.4
if 3.222607567780329e-289 < (* x x) < 6.835592550358748e+96Initial program 15.7
if 7.775826278762702e+132 < (* x x) < 1.4214205983410313e+194Initial program 17.5
rmApplied div-sub17.5
if 1.4214205983410313e+194 < (* x x) Initial program 50.4
Taylor expanded around inf 10.5
Final simplification12.8
herbie shell --seed 2019168
(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.0) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))))
(/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))))