MCPcopy Index your code
hub / github.com/clips/pattern / erfc

Function erfc

pattern/metrics.py:884–905  ·  view source on GitHub ↗

Complementary error function.

(x)

Source from the content-addressed store, hash-verified

882# Based on: http://www.johnkerl.org/python/sp_funcs_m.py.txt, Tom Loredo
883
884def erfc(x):
885 """ Complementary error function.
886 """
887 z = abs(x)
888 t = 1 / (1 + 0.5 * z)
889 r = 0
890 for y in [
891 0.17087277,
892 -0.82215223,
893 1.48851587,
894 -1.13520398,
895 0.27886807,
896 -0.18628806,
897 0.09678418,
898 0.37409196,
899 1.00002368,
900 -1.26551223]:
901 r = y + t * r
902 r = t * exp(-z*z + r)
903 if x >= 0:
904 return r
905 return 2 - r
906
907#--- PROBABILITY DISTRIBUTION ----------------------------------------------------------------------
908

Callers 1

cdfFunction · 0.85

Calls 1

absFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…