Update corr2 function to support precision
Fix isnan function
Rename median2 function to median_ for naming consistency
Add template function specialization for saturate_cast