public static double pow_hi(double x,double y) {
    if (x < 0)
      return Double.NaN;
    else if (x == 0.0)
      return 0.0;
    else if (y > 0) {
      if (x >= 1)
        return  exp_hi(mul_hi(y,log_hi(x)));
      else if (x==1)
        return 1.0;
      else 
        return  exp_hi(mul_hi(y,log_lo(x)));
    } 
    else if (y == 0) 
        return 1.0;
    else {
      if (x >= 1)
        return  exp_lo(mul_hi(y,log_lo(x)));
      else if (x==1)
        return 1.0;
      else 
        return  exp_lo(mul_hi(y,log_hi(x)));
    }
  }