\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 7.1088010196971 \cdot 10^{-314}:\\
\;\;\;\;-1.0\\
\mathbf{elif}\;x \cdot x \le 9.758857908001147 \cdot 10^{+18}:\\
\;\;\;\;\sqrt[3]{\left(\left(\frac{x \cdot x}{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)} - \frac{y}{\frac{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)}{y \cdot 4.0}}\right) \cdot \left(\frac{x \cdot x}{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)} - \frac{y}{\frac{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)}{y \cdot 4.0}}\right)\right) \cdot \left(\frac{x \cdot x}{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)} - \frac{y}{\frac{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)}{y \cdot 4.0}}\right)}\\
\mathbf{elif}\;x \cdot x \le 6.296502919195928 \cdot 10^{+44}:\\
\;\;\;\;-1.0\\
\mathbf{elif}\;x \cdot x \le 2.524624859163763 \cdot 10^{+295}:\\
\;\;\;\;\sqrt[3]{\left(\left(\frac{x \cdot x}{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)} - \frac{y}{\frac{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)}{y \cdot 4.0}}\right) \cdot \left(\frac{x \cdot x}{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)} - \frac{y}{\frac{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)}{y \cdot 4.0}}\right)\right) \cdot \left(\frac{x \cdot x}{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)} - \frac{y}{\frac{\mathsf{fma}\left(y, y \cdot 4.0, x \cdot x\right)}{y \cdot 4.0}}\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r29521659 = x;
double r29521660 = r29521659 * r29521659;
double r29521661 = y;
double r29521662 = 4.0;
double r29521663 = r29521661 * r29521662;
double r29521664 = r29521663 * r29521661;
double r29521665 = r29521660 - r29521664;
double r29521666 = r29521660 + r29521664;
double r29521667 = r29521665 / r29521666;
return r29521667;
}
double f(double x, double y) {
double r29521668 = x;
double r29521669 = r29521668 * r29521668;
double r29521670 = 7.1088010196971e-314;
bool r29521671 = r29521669 <= r29521670;
double r29521672 = -1.0;
double r29521673 = 9.758857908001147e+18;
bool r29521674 = r29521669 <= r29521673;
double r29521675 = y;
double r29521676 = 4.0;
double r29521677 = r29521675 * r29521676;
double r29521678 = fma(r29521675, r29521677, r29521669);
double r29521679 = r29521669 / r29521678;
double r29521680 = r29521678 / r29521677;
double r29521681 = r29521675 / r29521680;
double r29521682 = r29521679 - r29521681;
double r29521683 = r29521682 * r29521682;
double r29521684 = r29521683 * r29521682;
double r29521685 = cbrt(r29521684);
double r29521686 = 6.296502919195928e+44;
bool r29521687 = r29521669 <= r29521686;
double r29521688 = 2.524624859163763e+295;
bool r29521689 = r29521669 <= r29521688;
double r29521690 = 1.0;
double r29521691 = r29521689 ? r29521685 : r29521690;
double r29521692 = r29521687 ? r29521672 : r29521691;
double r29521693 = r29521674 ? r29521685 : r29521692;
double r29521694 = r29521671 ? r29521672 : r29521693;
return r29521694;
}




Bits error versus x




Bits error versus y
| Original | 31.1 |
|---|---|
| Target | 31.2 |
| Herbie | 12.4 |
if (* x x) < 7.1088010196971e-314 or 9.758857908001147e+18 < (* x x) < 6.296502919195928e+44Initial program 29.3
Taylor expanded around 0 10.1
if 7.1088010196971e-314 < (* x x) < 9.758857908001147e+18 or 6.296502919195928e+44 < (* x x) < 2.524624859163763e+295Initial program 16.3
rmApplied add-cbrt-cube46.9
Applied add-cbrt-cube47.0
Applied cbrt-undiv47.0
Simplified15.9
if 2.524624859163763e+295 < (* x x) Initial program 60.2
Taylor expanded around inf 8.4
Final simplification12.4
herbie shell --seed 2019163 +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))))