_constants.py 793 B

12345678910111213141516171819202122232425262728293031323334
  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 floating value.
  13. _XMIN = np.finfo(float).tiny
  14. # -special.psi(1)
  15. _EULER = 0.577215664901532860606512090082402431042
  16. # special.zeta(3, 1) Apery's constant
  17. _ZETA3 = 1.202056903159594285399738161511449990765
  18. # sqrt(pi)
  19. _SQRT_PI = 1.772453850905516027298167483341145182798
  20. # sqrt(2/pi)
  21. _SQRT_2_OVER_PI = 0.7978845608028654
  22. # log(sqrt(2/pi))
  23. _LOG_SQRT_2_OVER_PI = -0.22579135264472744