@@ -24,6 +24,7 @@ public function getMean(): float
2424 {
2525 return $ this ->mu ;
2626 }
27+
2728 public function getMeanRounded (int $ precision = 3 ): float
2829 {
2930 return round ($ this ->getMean (), $ precision );
@@ -34,6 +35,7 @@ public function getSigma(): float
3435 {
3536 return $ this ->sigma ;
3637 }
38+
3739 public function getSigmaRounded (int $ precision = 3 ): float
3840 {
3941 return round ($ this ->getSigma (), $ precision );
@@ -44,6 +46,7 @@ public function getMedian(): float
4446 {
4547 return $ this ->mu ;
4648 }
49+
4750 public function getMedianRounded (int $ precision = 3 ): float
4851 {
4952 return round ($ this ->getMedian (), $ precision );
@@ -54,6 +57,7 @@ public function getMode(): float
5457 {
5558 return $ this ->mu ;
5659 }
60+
5761 public function getModeRounded (int $ precision = 3 ): float
5862 {
5963 return round ($ this ->getMode (), $ precision );
@@ -64,6 +68,7 @@ public function getVariance(): float
6468 {
6569 return $ this ->sigma ** 2 ;
6670 }
71+
6772 public function getVarianceRounded (int $ precision = 3 ): float
6873 {
6974 return round ($ this ->getVariance (), $ precision );
@@ -187,7 +192,6 @@ private function erf(float $z): float
187192 return $ z >= 0 ? 1 - $ tau : $ tau - 1 ;
188193 }
189194
190-
191195 // A utility function to calculate the cumulative density function (CDF)
192196 public function cdf (float $ x ): float
193197 {
@@ -284,7 +288,6 @@ public function invCdfRounded(float $p, int $precision = 3): float
284288 return round ($ this ->invCdf ($ p ), $ precision );
285289 }
286290
287-
288291 /**
289292 * Divides the normal distribution into n continuous intervals
290293 * with equal probability.
@@ -385,7 +388,6 @@ public function add(float|NormalDist $x2): NormalDist
385388 return new NormalDist ($ this ->mu + $ x2 , $ this ->sigma );
386389 }
387390
388-
389391 /**
390392 * Subtracts a constant or another NormalDist instance from this distribution.
391393 *
@@ -408,7 +410,6 @@ public function subtract(float|NormalDist $x2): NormalDist
408410 return new NormalDist ($ this ->mu - $ x2 , $ this ->sigma );
409411 }
410412
411-
412413 /**
413414 * Multiplies both the mean (mu) and standard deviation (sigma) by a constant.
414415 *
@@ -427,8 +428,6 @@ public function multiply(float $constant): NormalDist
427428 );
428429 }
429430
430-
431-
432431 /**
433432 * Divides both the mean (mu) and standard deviation (sigma) by a constant.
434433 *
0 commit comments