\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.4667592323261061 \cdot 10^{131}:\\
\;\;\;\;\sqrt[3]{1}\\
\mathbf{elif}\;x \le -8.0114334775173874 \cdot 10^{-117}:\\
\;\;\;\;\left(\sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \cdot \sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right) \cdot \sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\\
\mathbf{elif}\;x \le 1.9644387956096076 \cdot 10^{-169}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \le 1.06815270095652453 \cdot 10^{-15}:\\
\;\;\;\;\left(\sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}} \cdot \sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\right) \cdot \sqrt[3]{\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}}\\
\mathbf{elif}\;x \le 2.0459804393047752 \cdot 10^{46}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{1}\\
\end{array}double f(double x, double y) {
double r583194 = x;
double r583195 = r583194 * r583194;
double r583196 = y;
double r583197 = 4.0;
double r583198 = r583196 * r583197;
double r583199 = r583198 * r583196;
double r583200 = r583195 - r583199;
double r583201 = r583195 + r583199;
double r583202 = r583200 / r583201;
return r583202;
}
double f(double x, double y) {
double r583203 = x;
double r583204 = -1.4667592323261061e+131;
bool r583205 = r583203 <= r583204;
double r583206 = 1.0;
double r583207 = cbrt(r583206);
double r583208 = -8.011433477517387e-117;
bool r583209 = r583203 <= r583208;
double r583210 = r583203 * r583203;
double r583211 = y;
double r583212 = 4.0;
double r583213 = r583211 * r583212;
double r583214 = r583213 * r583211;
double r583215 = r583210 - r583214;
double r583216 = r583210 + r583214;
double r583217 = r583215 / r583216;
double r583218 = cbrt(r583217);
double r583219 = r583218 * r583218;
double r583220 = r583219 * r583218;
double r583221 = 1.9644387956096076e-169;
bool r583222 = r583203 <= r583221;
double r583223 = -1.0;
double r583224 = 1.0681527009565245e-15;
bool r583225 = r583203 <= r583224;
double r583226 = 2.0459804393047752e+46;
bool r583227 = r583203 <= r583226;
double r583228 = r583227 ? r583223 : r583207;
double r583229 = r583225 ? r583220 : r583228;
double r583230 = r583222 ? r583223 : r583229;
double r583231 = r583209 ? r583220 : r583230;
double r583232 = r583205 ? r583207 : r583231;
return r583232;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.8 |
|---|---|
| Target | 31.5 |
| Herbie | 13.4 |
if x < -1.4667592323261061e+131 or 2.0459804393047752e+46 < x Initial program 51.0
rmApplied add-cbrt-cube63.2
Applied add-cbrt-cube63.6
Applied cbrt-undiv63.6
Simplified51.0
Taylor expanded around inf 12.1
if -1.4667592323261061e+131 < x < -8.011433477517387e-117 or 1.9644387956096076e-169 < x < 1.0681527009565245e-15Initial program 15.6
rmApplied add-cube-cbrt15.6
if -8.011433477517387e-117 < x < 1.9644387956096076e-169 or 1.0681527009565245e-15 < x < 2.0459804393047752e+46Initial program 27.4
Taylor expanded around 0 12.6
Final simplification13.4
herbie shell --seed 2020027 +o rules:numerics
(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))))