\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 1.3643855637695705 \cdot 10^{-229}:\\
\;\;\;\;-1.0\\
\mathbf{elif}\;x \cdot x \le 1.0463855970660416 \cdot 10^{+213}:\\
\;\;\;\;\frac{1}{\sqrt{y \cdot \left(4.0 \cdot y\right) + x \cdot x}} \cdot \frac{x \cdot x - y \cdot \left(4.0 \cdot y\right)}{\sqrt{y \cdot \left(4.0 \cdot y\right) + x \cdot x}}\\
\mathbf{elif}\;x \cdot x \le 1.761554774712835 \cdot 10^{+268}:\\
\;\;\;\;-1.0\\
\mathbf{elif}\;x \cdot x \le 5.112886449152387 \cdot 10^{+290}:\\
\;\;\;\;\frac{\sqrt{x \cdot x - y \cdot \left(4.0 \cdot y\right)}}{\frac{y \cdot \left(4.0 \cdot y\right) + x \cdot x}{\sqrt{x \cdot x - y \cdot \left(4.0 \cdot y\right)}}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r34475844 = x;
double r34475845 = r34475844 * r34475844;
double r34475846 = y;
double r34475847 = 4.0;
double r34475848 = r34475846 * r34475847;
double r34475849 = r34475848 * r34475846;
double r34475850 = r34475845 - r34475849;
double r34475851 = r34475845 + r34475849;
double r34475852 = r34475850 / r34475851;
return r34475852;
}
double f(double x, double y) {
double r34475853 = x;
double r34475854 = r34475853 * r34475853;
double r34475855 = 1.3643855637695705e-229;
bool r34475856 = r34475854 <= r34475855;
double r34475857 = -1.0;
double r34475858 = 1.0463855970660416e+213;
bool r34475859 = r34475854 <= r34475858;
double r34475860 = 1.0;
double r34475861 = y;
double r34475862 = 4.0;
double r34475863 = r34475862 * r34475861;
double r34475864 = r34475861 * r34475863;
double r34475865 = r34475864 + r34475854;
double r34475866 = sqrt(r34475865);
double r34475867 = r34475860 / r34475866;
double r34475868 = r34475854 - r34475864;
double r34475869 = r34475868 / r34475866;
double r34475870 = r34475867 * r34475869;
double r34475871 = 1.761554774712835e+268;
bool r34475872 = r34475854 <= r34475871;
double r34475873 = 5.112886449152387e+290;
bool r34475874 = r34475854 <= r34475873;
double r34475875 = sqrt(r34475868);
double r34475876 = r34475865 / r34475875;
double r34475877 = r34475875 / r34475876;
double r34475878 = r34475874 ? r34475877 : r34475860;
double r34475879 = r34475872 ? r34475857 : r34475878;
double r34475880 = r34475859 ? r34475870 : r34475879;
double r34475881 = r34475856 ? r34475857 : r34475880;
return r34475881;
}




Bits error versus x




Bits error versus y
Results
| Original | 30.9 |
|---|---|
| Target | 30.9 |
| Herbie | 13.4 |
if (* x x) < 1.3643855637695705e-229 or 1.0463855970660416e+213 < (* x x) < 1.761554774712835e+268Initial program 25.6
Taylor expanded around 0 13.6
if 1.3643855637695705e-229 < (* x x) < 1.0463855970660416e+213Initial program 15.6
rmApplied add-sqr-sqrt15.6
Applied *-un-lft-identity15.6
Applied times-frac15.8
if 1.761554774712835e+268 < (* x x) < 5.112886449152387e+290Initial program 14.6
rmApplied add-sqr-sqrt16.4
Applied associate-/l*16.4
if 5.112886449152387e+290 < (* x x) Initial program 59.5
Taylor expanded around inf 9.6
Final simplification13.4
herbie shell --seed 2019165
(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))))