Skip to content

Commit

Permalink
rust: Unify Sm21 in the back
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Oct 14, 2024
1 parent 54d86d4 commit 8896dea
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/ekore/src/harmonics/w3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ pub fn Sm3o(hS3: Complex<f64>, hS3mh: Complex<f64>) -> Complex<f64> {

/// Analytic continuation of harmonic sum $S_{-2,1}(N)$ for even moments.
pub fn Sm21e(N: Complex<f64>, hS1: Complex<f64>, hSm1: Complex<f64>) -> Complex<f64> {
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<f64>, hS1: Complex<f64>, hSm1: Complex<f64>) -> Complex<f64> {
let eta = -1.;
Sm21(N, -1., hS1, hSm1)
}

/// Analytic continuation of harmonic sum $S_{-2,1}(N)$ for odd moments.
fn Sm21(N: Complex<f64>, eta: f64, hS1: Complex<f64>, hSm1: Complex<f64>) -> Complex<f64> {
-eta * g3(N + 1., hS1 + 1. / (N + 1.)) + ZETA2 * hSm1 - 5. / 8. * ZETA3 + ZETA2 * LN_2
}

0 comments on commit 8896dea

Please sign in to comment.