crosperf: Remove benchmark scipy dependency

At present, we use scipy.norm's isf function (inverse survival
function). This commit introduces a hand-rolled replacement
that uses a numerical interpolation technique to compute the
inverse survival function.

Testing this automatically is not easy if we wish to remove
scipy, but with 0.01 pitch, we see about 4 digits of accuracy.
Mind you, we do not handle the infinite cases, but this is
not a problem for the use case presented in this function.

BUG=b:284489250
TEST=doctest
TEST=check scipy.norm.isf(xs) - CachedISF().isf(xs)

Change-Id: I90bda8929a4034052c1457ae9f51f162eeaa5bc3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4585444
Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
Reviewed-by: George Burgess <gbiv@chromium.org>
Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com>
1 file changed