/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "libm.h"
#include "xpg6.h" /* __xpg6 */
#if defined(__sparc)
#define i0 0
extern const long double _TBL_logl_hi[], _TBL_logl_lo[];
static const long double
static long double
logl_x(long double x, long double *w) {
int *px = (int *) &x;
int *pz = (int *) &z;
int i, j, ix, n;
n = 0;
f = x - one;
z = f * f;
*w = zero;
return (zero); /* log(1)= +0 */
}
s = f * qn; /* |s|<2**-6 */
v = s * s;
h = (long double) (2.0 * (double) s);
f1 = (long double) ((double) f);
s = (long double) ((double) (h + t));
*w = t - (s - h);
return (s);
}
x *= two113;
n = -113;
}
/* LARGE_N */
i = ix + 0x200;
f = x - z;
s = f * qn;
f1 = (long double) ((double) f);
h = (long double) (2.0 * (double) s);
j = (i >> 10) & 0x3f;
v = s * s;
qn = (long double) n;
v * A7))))));
s = h + v;
t += (h - (s - v));
z = (long double) ((double) (s + t));
*w = t - (z - s);
return (z);
}
extern const long double _TBL_expl_hi[], _TBL_expl_lo[];
static const long double
long double
powl(long double x, long double y) {
long double z, ax;
int *pz = (int *) &z;
int *px = (int *) &x;
int *py = (int *) &y;
return (one); /* x**+-0 = 1 */
(__xpg6 & _C99SUSv3_pow) != 0)
return (one); /* C99: 1**anything = 1 */
return (x + y); /* +-NaN return x+y */
/* includes Sun: 1**NaN = NaN */
/*
* determine if y is an odd int when x < 0
* yisint = 0 ... y is not an integer
* yisint = 1 ... y is an odd int
* yisint = 2 ... y is an even int
*/
yisint = 0;
if (sbx) {
else if (ahy >= 0x3fff0000) {
if (k > 80) {
} else if (k > 48) {
} else if (k > 16) {
} else if (ly == 0) {
j = ahy >> (16 - k);
if ((j << (16 - k)) == ahy)
}
}
}
/* special value of y */
if (ly == 0) {
if ((__xpg6 & _C99SUSv3_pow) != 0)
return (one);
/* C99: (-1)**+-inf = 1 */
else
return (y - y);
/* Sun: (+-1)**+-inf = NaN */
} else if (ahx >= 0x3fff0000)
/* (|x|>1)**+,-inf = inf,0 */
else /* (|x|<1)**-,+inf = inf,0 */
if (sby != 0)
return (one / x);
else
return (x);
return (x * x);
0))
return (sqrtl(x));
}
}
/* special value of x */
if (lx == 0) {
/* x is +-0,+-inf,+-1 */
z = ax;
if (sby == 1)
z = one / z; /* z = 1/|x| if y is negative */
if (sbx == 1) {
/* (-1)**non-int is NaN */
else if (yisint == 1)
z = -z; /* (x<0)**odd = -(|x|**odd) */
}
return (z);
}
}
/* (x<0)**(non-int) is NaN */
/* Now ax is finite, y is finite */
/* first compute log(ax) = w1+w2, with 53 bits w1 */
/* split up y into y1+y2 and compute (y1+y2)*(w1+w2) */
} else {
y1 = (long double) ((double) y);
}
if ((unsigned) j >= 0xffff0000) { /* NaN or -inf */
return (one / z);
else
return (-one / z);
} else if ((j & ~0x80000000) < 0x3fc30000) { /* |x|<2^-60 */
return (-one - z);
else
return (one + z);
} else if (j > 0) {
if (j > 0x400d0000) {
else
}
} else {
if ((unsigned) j > 0xc00d0000) {
else
}
}
j = k & 0x1f;
m = k >> 5;
{
/* rational approximation coeffs for [-(ln2)/64,(ln2)/64] */
long double
long double t = (long double) k;
two;
_TBL_expl_lo[j]);
}
if (j && (unsigned) j < 0x7fff)
else
z = scalbnl(z, m);
z = -z; /* (-ve)**(odd int) */
return (z);
}
#else
#endif /* defined(__sparc) */