Print this page




 231                                 return (sby == 0 ? y : zero);
 232                         else                    /* (|x|<1)**-,+inf = inf,0 */
 233                                 return (sby != 0 ? -y : zero);
 234                 }
 235                 if (ahy == 0x3ff00000) {        /* y is  +-1 */
 236                         if (sby != 0) { /* y is -1 */
 237                                 if (x == zero)  /* divided by zero */
 238                                         return (_SVID_libm_err(x, y, 23));
 239                                 else if (ahx < 0x40000 || ((ahx - 0x40000) |
 240                                         lx) == 0)       /* overflow */
 241                                         return (_SVID_libm_err(x, y, 21));
 242                                 else
 243                                         return (one / x);
 244                         } else
 245                                 return (x);
 246                 }
 247                 if (hy == 0x40000000) {         /* y is  2 */
 248                         if (ahx >= 0x5ff00000 && ahx < 0x7ff00000)
 249                                 return (_SVID_libm_err(x, y, 21));
 250                                                         /* x*x overflow */
 251                         else if (ahx < 0x1e56a09e && (ahx | lx) != 0 ||
 252                                 ahx == 0x1e56a09e && lx < 0x667f3bcd)
 253                                 return (_SVID_libm_err(x, y, 22));
 254                                                         /* x*x underflow */
 255                         else
 256                                 return (x * x);
 257                 }
 258                 if (hy == 0x3fe00000) {
 259                         if (!((ahx | lx) == 0 || ((ahx - 0x7ff00000) | lx) ==
 260                                 0 || sbx == 1))
 261                                 return (sqrt(x));       /* y is 0.5 and x > 0 */
 262                 }
 263         }
 264         /* special value of x */
 265         if (lx == 0) {
 266                 if (ahx == 0x7ff00000 || ahx == 0 || ahx == 0x3ff00000) {
 267                         /* x is +-0,+-inf,-1 */
 268                         z = ax;
 269                         if (sby == 1) {
 270                                 z = one / z;    /* z = |x|**y */
 271                                 if (ahx == 0)
 272                                         return (_SVID_libm_err(x, y, 23));




 231                                 return (sby == 0 ? y : zero);
 232                         else                    /* (|x|<1)**-,+inf = inf,0 */
 233                                 return (sby != 0 ? -y : zero);
 234                 }
 235                 if (ahy == 0x3ff00000) {        /* y is  +-1 */
 236                         if (sby != 0) { /* y is -1 */
 237                                 if (x == zero)  /* divided by zero */
 238                                         return (_SVID_libm_err(x, y, 23));
 239                                 else if (ahx < 0x40000 || ((ahx - 0x40000) |
 240                                         lx) == 0)       /* overflow */
 241                                         return (_SVID_libm_err(x, y, 21));
 242                                 else
 243                                         return (one / x);
 244                         } else
 245                                 return (x);
 246                 }
 247                 if (hy == 0x40000000) {         /* y is  2 */
 248                         if (ahx >= 0x5ff00000 && ahx < 0x7ff00000)
 249                                 return (_SVID_libm_err(x, y, 21));
 250                                                         /* x*x overflow */
 251                         else if ((ahx < 0x1e56a09e && (ahx | lx) != 0) ||
 252                                 (ahx == 0x1e56a09e && lx < 0x667f3bcd))
 253                                 return (_SVID_libm_err(x, y, 22));
 254                                                         /* x*x underflow */
 255                         else
 256                                 return (x * x);
 257                 }
 258                 if (hy == 0x3fe00000) {
 259                         if (!((ahx | lx) == 0 || ((ahx - 0x7ff00000) | lx) ==
 260                                 0 || sbx == 1))
 261                                 return (sqrt(x));       /* y is 0.5 and x > 0 */
 262                 }
 263         }
 264         /* special value of x */
 265         if (lx == 0) {
 266                 if (ahx == 0x7ff00000 || ahx == 0 || ahx == 0x3ff00000) {
 267                         /* x is +-0,+-inf,-1 */
 268                         z = ax;
 269                         if (sby == 1) {
 270                                 z = one / z;    /* z = |x|**y */
 271                                 if (ahx == 0)
 272                                         return (_SVID_libm_err(x, y, 23));