Refactored hp_to_double to use ldexp() once again, added some short cuts for avoiding uneccessary computation.