Skip to content

Commit

Permalink
Add Riemann xi function
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmasson committed Sep 10, 2023
1 parent 931ee02 commit 5b88ad5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -4411,6 +4411,14 @@ function zeta( x, tolerance=1e-10 ) {

function dirichletEta( x ) { return mul( zeta(x), sub( 1, pow( 2, sub(1,x) ) ) ); }

function riemannXi( x ) {

var half = div( x, 2 );

return mul( half, sub(x,1), pow( pi, neg(half) ), gamma(half), zeta(x) );

}


function bernoulli( n, x ) {

Expand Down
2 changes: 2 additions & 0 deletions docs/functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ <h1>Zeta Functions</h1>

<p><a href="functions/dirichletEta.html"><b>dirichletEta( <i>x</i> )</b></a> &mdash; Dirichlet eta function of a real or complex number</p>

<p><b>riemannXi( <i>n</i> )</b> &mdash; Riemman xi function of a real or complex number</p>

<p><b>bernoulli( <i>n</i> )</b> &mdash; Bernoulli number for index <i>n</i>. Returns a generalized value for fractional, negative or complex indices.</p>

<p><b>bernoulli( <i>n</i>, <i>x</i> )</b> &mdash; Bernoulli polynomial for real or complex index <i>n</i> of a real or complex number</p>
Expand Down
8 changes: 8 additions & 0 deletions src/functions/zeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ function zeta( x, tolerance=1e-10 ) {

function dirichletEta( x ) { return mul( zeta(x), sub( 1, pow( 2, sub(1,x) ) ) ); }

function riemannXi( x ) {

var half = div( x, 2 );

return mul( half, sub(x,1), pow( pi, neg(half) ), gamma(half), zeta(x) );

}


function bernoulli( n, x ) {

Expand Down

0 comments on commit 5b88ad5

Please sign in to comment.