File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,6 +104,12 @@ fn test_gamma_edge_cases() {
104104 99999999.42278434 ,
105105 max_relative = 1.5 * f64 :: EPSILON
106106 ) ;
107+ // Computed with WolframAlpha: https://www.wolframalpha.com/input?i=Gamma%281e-15%29
108+ assert_relative_eq ! (
109+ gamma( 1e-15 ) ,
110+ 999999999999999.4 ,
111+ max_relative = 2.0 * f64 :: EPSILON
112+ ) ;
107113 // Computed with WolframAlpha: https://www.wolframalpha.com/input?i=Gamma%5B2.2250738585072014E-308%5D.
108114 assert_relative_eq ! ( gamma( f64 :: MIN_POSITIVE ) , 4.4942328371557897e307 ) ;
109115
@@ -114,14 +120,6 @@ fn test_gamma_edge_cases() {
114120 // Test near-integer negative values
115121 assert_relative_eq ! ( gamma( -1.5 ) , 4.0 * sqrt_pi / 3.0 ) ;
116122
117- // Test value very close to 0 but positive
118- // Computed with WolframAlpha: https://www.wolframalpha.com/input?i=Gamma%281e-15%29
119- assert_relative_eq ! (
120- gamma( 1e-15 ) ,
121- 999999999999999.4 ,
122- max_relative = 2.0 * f64 :: EPSILON
123- ) ;
124-
125123 // Test integer factorials
126124 // Γ(6) = 5! = 120
127125 assert_eq ! ( gamma( 6.0 ) , 120.0 ) ;
You can’t perform that action at this time.
0 commit comments