\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 r30470188 = x;
double r30470189 = r30470188 * r30470188;
double r30470190 = y;
double r30470191 = 4.0;
double r30470192 = r30470190 * r30470191;
double r30470193 = r30470192 * r30470190;
double r30470194 = r30470189 - r30470193;
double r30470195 = r30470189 + r30470193;
double r30470196 = r30470194 / r30470195;
return r30470196;
}
double f(double x, double y) {
double r30470197 = x;
double r30470198 = r30470197 * r30470197;
double r30470199 = 3.222607567780329e-289;
bool r30470200 = r30470198 <= r30470199;
double r30470201 = -1.0;
double r30470202 = 6.835592550358748e+96;
bool r30470203 = r30470198 <= r30470202;
double r30470204 = y;
double r30470205 = 4.0;
double r30470206 = r30470204 * r30470205;
double r30470207 = r30470206 * r30470204;
double r30470208 = r30470198 - r30470207;
double r30470209 = r30470198 + r30470207;
double r30470210 = r30470208 / r30470209;
double r30470211 = 7.775826278762702e+132;
bool r30470212 = r30470198 <= r30470211;
double r30470213 = 1.4214205983410313e+194;
bool r30470214 = r30470198 <= r30470213;
double r30470215 = r30470198 / r30470209;
double r30470216 = r30470207 / r30470209;
double r30470217 = r30470215 - r30470216;
double r30470218 = 1.0;
double r30470219 = r30470214 ? r30470217 : r30470218;
double r30470220 = r30470212 ? r30470201 : r30470219;
double r30470221 = r30470203 ? r30470210 : r30470220;
double r30470222 = r30470200 ? r30470201 : r30470221;
return r30470222;
}




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 +o rules:numerics
(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))))