Compare commits

...

2 Commits

Author SHA1 Message Date
Palash Tyagi
2cd2e24f57 Add test for gamma_cdf_func to validate behavior for negative input 2025-07-08 23:21:59 +01:00
Palash Tyagi
61aeedbf76 Simplify assertion in lower_incomplete_gamma test for clarity 2025-07-08 23:18:16 +01:00

View File

@ -360,6 +360,7 @@ mod tests {
// <0 case
assert_eq!(gamma_pdf_func(-1.0, 1.0, 1.0), 0.0);
assert_eq!(gamma_cdf_func(-1.0, 1.0, 1.0), 0.0);
}
#[test]
fn test_gamma_matrix() {
@ -376,11 +377,6 @@ mod tests {
let x = Matrix::filled(5, 5, 1.0);
let expected = lower_incomplete_gamma_func(2.0, 1.0);
let result = lower_incomplete_gamma(s, x);
assert!(
(result.data()[0] - expected).abs() < 1e-7,
"Expected: {}, Got: {}",
expected,
result.data()[0]
);
assert!((result.data()[0] - expected).abs() < 1e-7);
}
}