Commit 8f8fa918 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Import y0 implementation from musl.

parent c739e222
...@@ -19662,7 +19662,6 @@ for ac_func in \ ...@@ -19662,7 +19662,6 @@ for ac_func in \
tgammaf \ tgammaf \
trunc \ trunc \
truncf \ truncf \
y0 \
y1 \ y1 \
yn yn
......
...@@ -2706,7 +2706,6 @@ AC_CHECK_FUNCS(\ ...@@ -2706,7 +2706,6 @@ AC_CHECK_FUNCS(\
tgammaf \ tgammaf \
trunc \ trunc \
truncf \ truncf \
y0 \
y1 \ y1 \
yn yn
) )
......
...@@ -2696,18 +2696,50 @@ double CDECL _jn(int n, double num) ...@@ -2696,18 +2696,50 @@ double CDECL _jn(int n, double num)
/********************************************************************* /*********************************************************************
* _y0 (MSVCRT.@) * _y0 (MSVCRT.@)
*/ */
double CDECL _y0(double num) double CDECL _y0(double x)
{ {
double retval; static const double tpi = 6.36619772367581382433e-01,
u00 = -7.38042951086872317523e-02,
u01 = 1.76666452509181115538e-01,
u02 = -1.38185671945596898896e-02,
u03 = 3.47453432093683650238e-04,
u04 = -3.81407053724364161125e-06,
u05 = 1.95590137035022920206e-08,
u06 = -3.98205194132103398453e-11,
v01 = 1.27304834834123699328e-02,
v02 = 7.60068627350353253702e-05,
v03 = 2.59150851840457805467e-07,
v04 = 4.41110311332675467403e-10;
double z, u, v;
unsigned int ix, lx;
if (!isfinite(num)) *_errno() = EDOM; ix = *(ULONGLONG*)&x >> 32;
retval = unix_funcs->y0( num ); lx = *(ULONGLONG*)&x;
if (_fpclass(retval) == _FPCLASS_NINF)
{ /* y0(nan)=nan, y0(<0)=nan, y0(0)=-inf, y0(inf)=0 */
*_errno() = EDOM; if ((ix << 1 | lx) == 0)
retval = NAN; return math_error(_OVERFLOW, "_y0", x, 0, -INFINITY);
} if (isnan(x))
return retval; return x;
if (ix >> 31)
return math_error(_DOMAIN, "_y0", x, 0, 0 / (x - x));
if (ix >= 0x7ff00000)
return 1 / x;
if (ix >= 0x40000000) { /* x >= 2 */
/* large ulp errors near zeros: 3.958, 7.086,.. */
return j0_y0_approx(ix, x, TRUE);
}
if (ix >= 0x3e400000) { /* x >= 2**-27 */
/* large ulp error near the first zero, x ~= 0.89 */
z = x * x;
u = u00 + z * (u01 + z * (u02 + z * (u03 + z * (u04 + z * (u05 + z * u06)))));
v = 1.0 + z * (v01 + z * (v02 + z * (v03 + z * v04)));
return u / v + tpi * (j0(x) * log(x));
}
return u00 + tpi * log(x);
} }
/********************************************************************* /*********************************************************************
......
...@@ -966,19 +966,6 @@ static float CDECL unix_tgammaf(float x) ...@@ -966,19 +966,6 @@ static float CDECL unix_tgammaf(float x)
} }
/********************************************************************* /*********************************************************************
* y0
*/
static double CDECL unix_y0(double num)
{
#ifdef HAVE_Y0
return y0(num);
#else
FIXME("not implemented\n");
return 0;
#endif
}
/*********************************************************************
* y1 * y1
*/ */
static double CDECL unix_y1(double num) static double CDECL unix_y1(double num)
...@@ -1093,7 +1080,6 @@ static const struct unix_funcs funcs = ...@@ -1093,7 +1080,6 @@ static const struct unix_funcs funcs =
unix_tgammaf, unix_tgammaf,
unix_trunc, unix_trunc,
unix_truncf, unix_truncf,
unix_y0,
unix_y1, unix_y1,
unix_yn unix_yn
}; };
......
...@@ -110,7 +110,6 @@ struct unix_funcs ...@@ -110,7 +110,6 @@ struct unix_funcs
float (CDECL *tgammaf)(float x); float (CDECL *tgammaf)(float x);
double (CDECL *trunc)(double x); double (CDECL *trunc)(double x);
float (CDECL *truncf)(float x); float (CDECL *truncf)(float x);
double (CDECL *y0)(double num);
double (CDECL *y1)(double num); double (CDECL *y1)(double num);
double (CDECL *yn)(int order, double num); double (CDECL *yn)(int order, double num);
}; };
......
...@@ -1172,9 +1172,6 @@ ...@@ -1172,9 +1172,6 @@
/* Define if Xrandr has the XRRGetProviderResources function */ /* Define if Xrandr has the XRRGetProviderResources function */
#undef HAVE_XRRGETPROVIDERRESOURCES #undef HAVE_XRRGETPROVIDERRESOURCES
/* Define to 1 if you have the `y0' function. */
#undef HAVE_Y0
/* Define to 1 if you have the `y1' function. */ /* Define to 1 if you have the `y1' function. */
#undef HAVE_Y1 #undef HAVE_Y1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment