atan2 nan/inf fixed