improve hypot() for #3101