mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Minor cleanup to math constants
This commit is contained in:
@@ -68,17 +68,17 @@ package math
|
||||
@(private="file")
|
||||
stirling :: proc "contextless" (x: f64) -> (f64, f64) {
|
||||
@(static) gamS := [?]f64{
|
||||
7.87311395793093628397e-04,
|
||||
+7.87311395793093628397e-04,
|
||||
-2.29549961613378126380e-04,
|
||||
-2.68132617805781232825e-03,
|
||||
3.47222221605458667310e-03,
|
||||
8.33333333333482257126e-02,
|
||||
+3.47222221605458667310e-03,
|
||||
+8.33333333333482257126e-02,
|
||||
}
|
||||
|
||||
if x > 200 {
|
||||
return inf_f64(1), 1
|
||||
}
|
||||
SQRT_TWO_PI :: 2.506628274631000502417
|
||||
SQRT_TWO_PI :: 0h40040d931ff62706 // 2.506628274631000502417
|
||||
MAX_STIRLING :: 143.01608
|
||||
w := 1 / x
|
||||
w = 1 + w*((((gamS[0]*w+gamS[1])*w+gamS[2])*w+gamS[3])*w+gamS[4])
|
||||
@@ -113,13 +113,13 @@ gamma_f64 :: proc "contextless" (x: f64) -> f64 {
|
||||
}
|
||||
@(static) gamQ := [?]f64{
|
||||
-2.31581873324120129819e-05,
|
||||
5.39605580493303397842e-04,
|
||||
+5.39605580493303397842e-04,
|
||||
-4.45641913851797240494e-03,
|
||||
1.18139785222060435552e-02,
|
||||
3.58236398605498653373e-02,
|
||||
+1.18139785222060435552e-02,
|
||||
+3.58236398605498653373e-02,
|
||||
-2.34591795718243348568e-01,
|
||||
7.14304917030273074085e-02,
|
||||
1.00000000000000000320e+00,
|
||||
+7.14304917030273074085e-02,
|
||||
+1.00000000000000000320e+00,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user