\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 5.5059358999267487 \cdot 10^{-179}:\\
\;\;\;\;1\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 6.0996771267235233 \cdot 10^{98}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{\mathsf{fma}\left(x, x, \left(y \cdot 4\right) \cdot y\right)}\right)}^{3}}\\
\mathbf{elif}\;\left(y \cdot 4\right) \cdot y \le 2.69891227082106497 \cdot 10^{230}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{-1}^{3}}\\
\end{array}double f(double x, double y) {
double r749992 = x;
double r749993 = r749992 * r749992;
double r749994 = y;
double r749995 = 4.0;
double r749996 = r749994 * r749995;
double r749997 = r749996 * r749994;
double r749998 = r749993 - r749997;
double r749999 = r749993 + r749997;
double r750000 = r749998 / r749999;
return r750000;
}
double f(double x, double y) {
double r750001 = y;
double r750002 = 4.0;
double r750003 = r750001 * r750002;
double r750004 = r750003 * r750001;
double r750005 = 5.505935899926749e-179;
bool r750006 = r750004 <= r750005;
double r750007 = 1.0;
double r750008 = 6.099677126723523e+98;
bool r750009 = r750004 <= r750008;
double r750010 = x;
double r750011 = r750010 * r750010;
double r750012 = r750011 - r750004;
double r750013 = fma(r750010, r750010, r750004);
double r750014 = r750012 / r750013;
double r750015 = 3.0;
double r750016 = pow(r750014, r750015);
double r750017 = cbrt(r750016);
double r750018 = 2.698912270821065e+230;
bool r750019 = r750004 <= r750018;
double r750020 = -1.0;
double r750021 = pow(r750020, r750015);
double r750022 = cbrt(r750021);
double r750023 = r750019 ? r750007 : r750022;
double r750024 = r750009 ? r750017 : r750023;
double r750025 = r750006 ? r750007 : r750024;
return r750025;
}




Bits error versus x




Bits error versus y
| Original | 31.8 |
|---|---|
| Target | 31.5 |
| Herbie | 15.1 |
if (* (* y 4.0) y) < 5.505935899926749e-179 or 6.099677126723523e+98 < (* (* y 4.0) y) < 2.698912270821065e+230Initial program 23.8
Taylor expanded around inf 17.9
if 5.505935899926749e-179 < (* (* y 4.0) y) < 6.099677126723523e+98Initial program 16.5
rmApplied add-cbrt-cube34.6
Applied add-cbrt-cube34.5
Applied cbrt-undiv34.5
Simplified16.5
if 2.698912270821065e+230 < (* (* y 4.0) y) Initial program 53.9
rmApplied add-cbrt-cube63.7
Applied add-cbrt-cube64.0
Applied cbrt-undiv64.0
Simplified53.9
Taylor expanded around 0 10.2
Final simplification15.1
herbie shell --seed 2020018 +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))))