replace np by math function

7 jobs for 32-fix-nn-slice-algorithm in 8 minutes and 47 seconds (queued for 1 second)