Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmasson committed Jan 16, 2024
1 parent 5a511b6 commit cc2cca1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -4502,6 +4502,11 @@ function hurwitzZeta( x, a, tolerance=1e-10 ) {
x = arbitrary(x), a = arbitrary(a);
var arbN = arbitrary(n), arb3 = arbitrary(3);

// at first sight including the factor (a+N)**x in this sum
// appears to be unnecessary calculational overhead
// turns out to be more accurate by keeping it on a comparable
// level of numerical precision as the other two terms

var S = 0n;
for ( var i = 0 ; i < n ; i++ )
S = add( S, pow( div( add(a,arbN), add(a,arbitrary(i)) ), x ) );
Expand Down
5 changes: 5 additions & 0 deletions src/functions/zeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ function hurwitzZeta( x, a, tolerance=1e-10 ) {
x = arbitrary(x), a = arbitrary(a);
var arbN = arbitrary(n), arb3 = arbitrary(3);

// at first sight including the factor (a+N)**x in this sum
// appears to be unnecessary calculational overhead
// turns out to be more accurate by keeping it on a comparable
// level of numerical precision as the other two terms

var S = 0n;
for ( var i = 0 ; i < n ; i++ )
S = add( S, pow( div( add(a,arbN), add(a,arbitrary(i)) ), x ) );
Expand Down

0 comments on commit cc2cca1

Please sign in to comment.