From 8896deae811e6ba823adeecdeff491c9bf902596 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Mon, 14 Oct 2024 10:43:27 +0300 Subject: [PATCH] rust: Unify Sm21 in the back --- crates/ekore/src/harmonics/w3.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/ekore/src/harmonics/w3.rs b/crates/ekore/src/harmonics/w3.rs index 4a0fe6e24..bc7286dcb 100644 --- a/crates/ekore/src/harmonics/w3.rs +++ b/crates/ekore/src/harmonics/w3.rs @@ -27,12 +27,15 @@ pub fn Sm3o(hS3: Complex, hS3mh: Complex) -> Complex { /// Analytic continuation of harmonic sum $S_{-2,1}(N)$ for even moments. pub fn Sm21e(N: Complex, hS1: Complex, hSm1: Complex) -> Complex { - let eta = 1.; - -eta * g3(N + 1., hS1 + 1. / (N + 1.)) + ZETA2 * hSm1 - 5. / 8. * ZETA3 + ZETA2 * LN_2 + Sm21(N, 1., hS1, hSm1) } /// Analytic continuation of harmonic sum $S_{-2,1}(N)$ for odd moments. pub fn Sm21o(N: Complex, hS1: Complex, hSm1: Complex) -> Complex { - let eta = -1.; + Sm21(N, -1., hS1, hSm1) +} + +/// Analytic continuation of harmonic sum $S_{-2,1}(N)$ for odd moments. +fn Sm21(N: Complex, eta: f64, hS1: Complex, hSm1: Complex) -> Complex { -eta * g3(N + 1., hS1 + 1. / (N + 1.)) + ZETA2 * hSm1 - 5. / 8. * ZETA3 + ZETA2 * LN_2 }