]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-132893: Minor edits to the statistics module PR (gh-133106)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Tue, 29 Apr 2025 04:05:37 +0000 (23:05 -0500)
committerGitHub <noreply@github.com>
Tue, 29 Apr 2025 04:05:37 +0000 (23:05 -0500)
Lib/statistics.py
Misc/NEWS.d/next/Library/2025-04-24-21-22-46.gh-issue-132893.KFuxZ2.rst

index 9dcb20d2a485eb770b04ef81e77c3777d7d03688..3d805cb073987d8c70628f408ee8df61dbeeaf76 100644 (file)
@@ -810,8 +810,7 @@ def register(*kernels):
 @register('normal', 'gauss')
 def normal_kernel():
     sqrt2pi = sqrt(2 * pi)
-    sqrt2 = sqrt(2)
-    neg_sqrt2 = -sqrt2
+    neg_sqrt2 = -sqrt(2)
     pdf = lambda t: exp(-1/2 * t * t) / sqrt2pi
     cdf = lambda t: 1/2 * erfc(t / neg_sqrt2)
     invcdf = lambda t: _normal_dist_inv_cdf(t, 0.0, 1.0)
index 1ef651188e04bcfb9cac26d89afbf712d95a79be..1f5a48982635c0b1c251e3763f43e980710a8d5a 100644 (file)
@@ -1 +1 @@
-Improved the accuracy of ``statistics.NormalDist.cdf`` for negative inputs.
+Improved :meth:`statistics.NormalDist.cdf` accuracy for inputs smaller than the mean.