fix incorrect results for catanf and catanl with some inputs