\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}\;x \cdot x \le 3.222607567780329 \cdot 10^{-289}:\\
\;\;\;\;-1.0\\
\mathbf{elif}\;x \cdot x \le 6.835592550358748 \cdot 10^{+96}:\\
\;\;\;\;\frac{x \cdot x - \left(y \cdot 4.0\right) \cdot y}{x \cdot x + \left(y \cdot 4.0\right) \cdot y}\\
\mathbf{elif}\;x \cdot x \le 7.775826278762702 \cdot 10^{+132}:\\
\;\;\;\;-1.0\\
\mathbf{elif}\;x \cdot x \le 1.4214205983410313 \cdot 10^{+194}:\\
\;\;\;\;\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\\
\end{array}double f(double x, double y) {
double r34032188 = x;
double r34032189 = r34032188 * r34032188;
double r34032190 = y;
double r34032191 = 4.0;
double r34032192 = r34032190 * r34032191;
double r34032193 = r34032192 * r34032190;
double r34032194 = r34032189 - r34032193;
double r34032195 = r34032189 + r34032193;
double r34032196 = r34032194 / r34032195;
return r34032196;
}
double f(double x, double y) {
double r34032197 = x;
double r34032198 = r34032197 * r34032197;
double r34032199 = 3.222607567780329e-289;
bool r34032200 = r34032198 <= r34032199;
double r34032201 = -1.0;
double r34032202 = 6.835592550358748e+96;
bool r34032203 = r34032198 <= r34032202;
double r34032204 = y;
double r34032205 = 4.0;
double r34032206 = r34032204 * r34032205;
double r34032207 = r34032206 * r34032204;
double r34032208 = r34032198 - r34032207;
double r34032209 = r34032198 + r34032207;
double r34032210 = r34032208 / r34032209;
double r34032211 = 7.775826278762702e+132;
bool r34032212 = r34032198 <= r34032211;
double r34032213 = 1.4214205983410313e+194;
bool r34032214 = r34032198 <= r34032213;
double r34032215 = r34032198 / r34032209;
double r34032216 = r34032207 / r34032209;
double r34032217 = r34032215 - r34032216;
double r34032218 = 1.0;
double r34032219 = r34032214 ? r34032217 : r34032218;
double r34032220 = r34032212 ? r34032201 : r34032219;
double r34032221 = r34032203 ? r34032210 : r34032220;
double r34032222 = r34032200 ? r34032201 : r34032221;
return r34032222;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.1 |
|---|---|
| Target | 31.1 |
| Herbie | 12.7 |
if (* x x) < 3.222607567780329e-289 or 6.835592550358748e+96 < (* x x) < 7.775826278762702e+132Initial program 29.0
Taylor expanded around 0 11.4
if 3.222607567780329e-289 < (* x x) < 6.835592550358748e+96Initial program 15.6
if 7.775826278762702e+132 < (* x x) < 1.4214205983410313e+194Initial program 17.4
rmApplied div-sub17.4
if 1.4214205983410313e+194 < (* x x) Initial program 49.1
Taylor expanded around inf 10.5
Final simplification12.7
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) (/ (* (* y y) 4.0) (+ (* x x) (* (* y y) 4.0)))))
(/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))))