@stdlib/math-base-special-riemann-zeta
v0.3.1
Published
Riemann Zeta function.
Readme
Riemann Zeta Function
Riemann zeta function.
The Riemann zeta function is the analytic continuation of the infinite series
where s is a complex variable equal to σ + ti. The series is only convergent when the real part of s, σ, is greater than 1.
Installation
npm install @stdlib/math-base-special-riemann-zetaUsage
var zeta = require( '@stdlib/math-base-special-riemann-zeta' );zeta( s )
Evaluates the Riemann zeta function as a function of a real variable s (i.e., t = 0).
var v = zeta( 1.1 );
// returns ~10.584
v = zeta( -4.0 );
// returns 0.0
v = zeta( 70.0 );
// returns 1.0
v = zeta( 0.5 );
// returns ~-1.46
v = zeta( 1.0 ); // pole
// returns NaN
v = zeta( NaN );
// returns NaNExamples
var uniform = require( '@stdlib/random-array-uniform' );
var logEachMap = require( '@stdlib/console-log-each-map' );
var zeta = require( '@stdlib/math-base-special-riemann-zeta' );
var opts = {
'dtype': 'float64'
};
var s = uniform( 200, -50.0, 50.0, opts );
logEachMap( 's: %0.4f, ζ(s): %0.4f', s, zeta );C APIs
Usage
#include "stdlib/math/base/special/riemann_zeta.h"stdlib_base_zeta( s )
Evaluates the Riemann zeta function as a function of a real variable s (i.e., t = 0).
double out = stdlib_base_zeta( 1.1 );
// returns ~10.584The function accepts the following arguments:
- s:
[in] doubleinput value.
double stdlib_base_zeta( const double s );Examples
#include "stdlib/math/base/special/riemann_zeta.h"
#include <stdio.h>
int main( void ) {
const double s[] = { -50.0, -38.9, -27.8, -16.7, -5.6, 5.6, 16.7, 27.8, 38.9, 50.0 };
double v;
int i;
for ( i = 0; i < 10; i++ ) {
v = stdlib_base_zeta( s[ i ] );
printf( "zeta(%lf) = %lf\n", s[ i ], v );
}
}Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
Copyright
Copyright © 2016-2026. The Stdlib Authors.
