Use Normalized values in pow(). Replace double with long doubles.