\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 -3.678618962503878310745576389575152495213 \cdot 10^{116}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \le -8.91382032886151303081735495699643417157 \cdot 10^{-31}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x \cdot x - \left(4 \cdot y\right) \cdot y}{\left(4 \cdot y\right) \cdot y + x \cdot x}\right)}^{3}}\\
\mathbf{elif}\;x \le 2.212351303084648640066472729364795186343 \cdot 10^{-67}:\\
\;\;\;\;\sqrt[3]{{-1}^{3}}\\
\mathbf{elif}\;x \le 3.163054238082631393165515878127431023232 \cdot 10^{87}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x \cdot x - \left(4 \cdot y\right) \cdot y}{\left(4 \cdot y\right) \cdot y + x \cdot x}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r515154 = x;
double r515155 = r515154 * r515154;
double r515156 = y;
double r515157 = 4.0;
double r515158 = r515156 * r515157;
double r515159 = r515158 * r515156;
double r515160 = r515155 - r515159;
double r515161 = r515155 + r515159;
double r515162 = r515160 / r515161;
return r515162;
}
double f(double x, double y) {
double r515163 = x;
double r515164 = -3.678618962503878e+116;
bool r515165 = r515163 <= r515164;
double r515166 = 1.0;
double r515167 = -8.913820328861513e-31;
bool r515168 = r515163 <= r515167;
double r515169 = r515163 * r515163;
double r515170 = 4.0;
double r515171 = y;
double r515172 = r515170 * r515171;
double r515173 = r515172 * r515171;
double r515174 = r515169 - r515173;
double r515175 = r515173 + r515169;
double r515176 = r515174 / r515175;
double r515177 = 3.0;
double r515178 = pow(r515176, r515177);
double r515179 = cbrt(r515178);
double r515180 = 2.2123513030846486e-67;
bool r515181 = r515163 <= r515180;
double r515182 = -1.0;
double r515183 = pow(r515182, r515177);
double r515184 = cbrt(r515183);
double r515185 = 3.1630542380826314e+87;
bool r515186 = r515163 <= r515185;
double r515187 = r515186 ? r515179 : r515166;
double r515188 = r515181 ? r515184 : r515187;
double r515189 = r515168 ? r515179 : r515188;
double r515190 = r515165 ? r515166 : r515189;
return r515190;
}




Bits error versus x




Bits error versus y
Results
| Original | 31.3 |
|---|---|
| Target | 31.0 |
| Herbie | 13.1 |
if x < -3.678618962503878e+116 or 3.1630542380826314e+87 < x Initial program 52.1
Simplified52.1
Taylor expanded around inf 11.4
if -3.678618962503878e+116 < x < -8.913820328861513e-31 or 2.2123513030846486e-67 < x < 3.1630542380826314e+87Initial program 14.9
Simplified14.9
rmApplied add-cbrt-cube39.9
Applied add-cbrt-cube40.4
Applied cbrt-undiv40.4
Simplified14.9
if -8.913820328861513e-31 < x < 2.2123513030846486e-67Initial program 24.8
Simplified24.8
rmApplied add-cbrt-cube52.0
Applied add-cbrt-cube52.1
Applied cbrt-undiv52.1
Simplified24.8
Taylor expanded around 0 13.3
Final simplification13.1
herbie shell --seed 2019195
(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))))