\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}\;\left(y \cdot 4\right) \cdot y \le 1.883987095627688634773256576903935146579 \cdot 10^{-179}:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 25951328951665387827625984:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + \left(y \cdot 4\right) \cdot y}{x \cdot x - \left(y \cdot 4\right) \cdot y}}\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 56309717854388472133950898176:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 7.251271519567312889559392701775878259286 \cdot 10^{285}:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + \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 r543270 = x;
double r543271 = r543270 * r543270;
double r543272 = y;
double r543273 = 4.0;
double r543274 = r543272 * r543273;
double r543275 = r543274 * r543272;
double r543276 = r543271 - r543275;
double r543277 = r543271 + r543275;
double r543278 = r543276 / r543277;
return r543278;
}
double f(double x, double y) {
double r543279 = y;
double r543280 = 4.0;
double r543281 = r543279 * r543280;
double r543282 = r543281 * r543279;
double r543283 = 1.8839870956276886e-179;
bool r543284 = r543282 <= r543283;
double r543285 = 1.0;
double r543286 = 2.5951328951665388e+25;
bool r543287 = r543282 <= r543286;
double r543288 = x;
double r543289 = r543288 * r543288;
double r543290 = r543289 + r543282;
double r543291 = r543289 - r543282;
double r543292 = r543290 / r543291;
double r543293 = r543285 / r543292;
double r543294 = 5.630971785438847e+28;
bool r543295 = r543282 <= r543294;
double r543296 = 7.251271519567313e+285;
bool r543297 = r543282 <= r543296;
double r543298 = -1.0;
double r543299 = r543297 ? r543293 : r543298;
double r543300 = r543295 ? r543285 : r543299;
double r543301 = r543287 ? r543293 : r543300;
double r543302 = r543284 ? r543285 : r543301;
return r543302;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.7 |
|---|---|
| Target | 31.4 |
| Herbie | 12.4 |
if (* (* y 4.0) y) < 1.8839870956276886e-179 or 2.5951328951665388e+25 < (* (* y 4.0) y) < 5.630971785438847e+28Initial program 26.3
rmApplied clear-num26.3
Taylor expanded around inf 11.7
if 1.8839870956276886e-179 < (* (* y 4.0) y) < 2.5951328951665388e+25 or 5.630971785438847e+28 < (* (* y 4.0) y) < 7.251271519567313e+285Initial program 15.7
rmApplied clear-num15.7
if 7.251271519567313e+285 < (* (* y 4.0) y) Initial program 61.2
Taylor expanded around 0 8.9
Final simplification12.4
herbie shell --seed 2019323
(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))))