\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.688721359903120564949235071844216306814 \cdot 10^{100}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -7.394329418796278633272453346909757071051 \cdot 10^{-66}:\\
\;\;\;\;\frac{x \cdot x}{\left(y \cdot 4\right) \cdot y + x \cdot x} - \sqrt[3]{\left(\frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x} \cdot \frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}\right) \cdot \frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\\
\mathbf{elif}\;x \le 8.394176110344906536659390600257739023023 \cdot 10^{-193}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 5.306478096987979835000926393717769469618 \cdot 10^{92}:\\
\;\;\;\;\frac{x \cdot x}{\left(y \cdot 4\right) \cdot y + x \cdot x} - \log \left(e^{\frac{\left(y \cdot 4\right) \cdot y}{\left(y \cdot 4\right) \cdot y + x \cdot x}}\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r37339184 = x;
double r37339185 = r37339184 * r37339184;
double r37339186 = y;
double r37339187 = 4.0;
double r37339188 = r37339186 * r37339187;
double r37339189 = r37339188 * r37339186;
double r37339190 = r37339185 - r37339189;
double r37339191 = r37339185 + r37339189;
double r37339192 = r37339190 / r37339191;
return r37339192;
}
double f(double x, double y) {
double r37339193 = x;
double r37339194 = -1.6887213599031206e+100;
bool r37339195 = r37339193 <= r37339194;
double r37339196 = 1.0;
double r37339197 = -7.394329418796279e-66;
bool r37339198 = r37339193 <= r37339197;
double r37339199 = r37339193 * r37339193;
double r37339200 = y;
double r37339201 = 4.0;
double r37339202 = r37339200 * r37339201;
double r37339203 = r37339202 * r37339200;
double r37339204 = r37339203 + r37339199;
double r37339205 = r37339199 / r37339204;
double r37339206 = r37339203 / r37339204;
double r37339207 = r37339206 * r37339206;
double r37339208 = r37339207 * r37339206;
double r37339209 = cbrt(r37339208);
double r37339210 = r37339205 - r37339209;
double r37339211 = 8.394176110344907e-193;
bool r37339212 = r37339193 <= r37339211;
double r37339213 = -1.0;
double r37339214 = 5.30647809698798e+92;
bool r37339215 = r37339193 <= r37339214;
double r37339216 = exp(r37339206);
double r37339217 = log(r37339216);
double r37339218 = r37339205 - r37339217;
double r37339219 = r37339215 ? r37339218 : r37339196;
double r37339220 = r37339212 ? r37339213 : r37339219;
double r37339221 = r37339198 ? r37339210 : r37339220;
double r37339222 = r37339195 ? r37339196 : r37339221;
return r37339222;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.8 |
|---|---|
| Target | 31.5 |
| Herbie | 12.9 |
if x < -1.6887213599031206e+100 or 5.30647809698798e+92 < x Initial program 50.9
Taylor expanded around inf 11.0
if -1.6887213599031206e+100 < x < -7.394329418796279e-66Initial program 16.4
rmApplied div-sub16.4
rmApplied add-cbrt-cube16.4
if -7.394329418796279e-66 < x < 8.394176110344907e-193Initial program 27.5
Taylor expanded around 0 10.8
if 8.394176110344907e-193 < x < 5.30647809698798e+92Initial program 16.5
rmApplied div-sub16.5
rmApplied add-log-exp16.5
Final simplification12.9
herbie shell --seed 2019171
(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))))