_constants.py 1002 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. """
  2. Statistics-related constants.
  3. """
  4. import numpy as np
  5. # The smallest representable positive number such that 1.0 + _EPS != 1.0.
  6. _EPS = np.finfo(float).eps
  7. # The largest [in magnitude] usable floating value.
  8. _XMAX = np.finfo(float).max
  9. # The log of the largest usable floating value; useful for knowing
  10. # when exp(something) will overflow
  11. _LOGXMAX = np.log(_XMAX)
  12. # The smallest [in magnitude] usable (i.e. not subnormal) double precision
  13. # floating value.
  14. _XMIN = np.finfo(float).tiny
  15. # The log of the smallest [in magnitude] usable (i.e not subnormal)
  16. # double precision floating value.
  17. _LOGXMIN = np.log(_XMIN)
  18. # -special.psi(1)
  19. _EULER = 0.577215664901532860606512090082402431042
  20. # special.zeta(3, 1) Apery's constant
  21. _ZETA3 = 1.202056903159594285399738161511449990765
  22. # sqrt(pi)
  23. _SQRT_PI = 1.772453850905516027298167483341145182798
  24. # sqrt(2/pi)
  25. _SQRT_2_OVER_PI = 0.7978845608028654
  26. # log(pi)
  27. _LOG_PI = 1.1447298858494002
  28. # log(sqrt(2/pi))
  29. _LOG_SQRT_2_OVER_PI = -0.22579135264472744