File tree Expand file tree Collapse file tree 4 files changed +11
-8
lines changed
lib/node_modules/@stdlib/math/base/special/riemann-zeta
include/stdlib/math/base/special Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ extern "C" {
2929/**
3030* Evaluates the Riemann zeta function.
3131*/
32- double stdlib_base_zeta ( const double x );
32+ double stdlib_base_zeta ( const double s );
3333
3434#ifdef __cplusplus
3535}
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ var TWO_PI = require( '@stdlib/constants/float64/two-pi' );
4949var SQRT_EPSILON = require ( '@stdlib/constants/float64/sqrt-eps' ) ;
5050var LN_SQRT_TWO_PI = require ( '@stdlib/constants/float64/ln-sqrt-two-pi' ) ;
5151var MAX_SAFE_NTH_FACTORIAL = require ( '@stdlib/constants/float64/max-safe-nth-factorial' ) ;
52+ var FLOAT64_MAX_LN = require ( '@stdlib/constants/float64/max-ln' ) ;
5253var ODD_POSITIVE_INTEGERS = require ( './odd_positive_integers.json' ) ;
5354var EVEN_NONNEGATIVE_INTEGERS = require ( './even_nonnegative_integers.json' ) ;
5455var BERNOULLI = require ( './bernoulli.json' ) ;
@@ -63,7 +64,6 @@ var rateval6 = require( './rational_p6q6.js' );
6364// VARIABLES //
6465
6566var MAX_BERNOULLI_2N = 129 ;
66- var MAX_LN = 709 ; // TODO: consider making external constant
6767var Y1 = 1.2433929443359375 ;
6868var Y3 = 0.6986598968505859375 ;
6969
@@ -265,7 +265,7 @@ function zeta( s ) {
265265 tmp = sinpi ( 0.5 * sc ) * 2.0 * zeta ( s ) ;
266266 r = gammaln ( s ) ;
267267 r -= s * ln ( TWO_PI ) ;
268- if ( r > MAX_LN ) {
268+ if ( r > floor ( FLOAT64_MAX_LN ) ) {
269269 return ( tmp < 0.0 ) ? NINF : PINF ;
270270 }
271271 return tmp * exp ( r ) ;
Original file line number Diff line number Diff line change 5252 " @stdlib/constants/float64/two-pi" ,
5353 " @stdlib/constants/float64/sqrt-eps" ,
5454 " @stdlib/constants/float64/ln-sqrt-two-pi" ,
55- " @stdlib/constants/float64/max-safe-nth-factorial"
55+ " @stdlib/constants/float64/max-safe-nth-factorial" ,
56+ " @stdlib/constants/float64/max-ln"
5657 ]
5758 },
5859 {
8182 " @stdlib/constants/float64/two-pi" ,
8283 " @stdlib/constants/float64/sqrt-eps" ,
8384 " @stdlib/constants/float64/ln-sqrt-two-pi" ,
84- " @stdlib/constants/float64/max-safe-nth-factorial"
85+ " @stdlib/constants/float64/max-safe-nth-factorial" ,
86+ " @stdlib/constants/float64/max-ln"
8587 ]
8688 },
8789 {
110112 " @stdlib/constants/float64/two-pi" ,
111113 " @stdlib/constants/float64/sqrt-eps" ,
112114 " @stdlib/constants/float64/ln-sqrt-two-pi" ,
113- " @stdlib/constants/float64/max-safe-nth-factorial"
115+ " @stdlib/constants/float64/max-safe-nth-factorial" ,
116+ " @stdlib/constants/float64/max-ln"
114117 ]
115118 }
116119 ]
Original file line number Diff line number Diff line change 4747#include "stdlib/constants/float64/sqrt_eps.h"
4848#include "stdlib/constants/float64/ln_sqrt_two_pi.h"
4949#include "stdlib/constants/float64/max_safe_nth_factorial.h"
50+ #include "stdlib/constants/float64/max_ln.h"
5051#include <stdint.h>
5152
5253static const int32_t MAX_BERNOULLI_2N = 129 ;
53- static const double MAX_LN = 709.0 ;
5454static const double Y1 = 1.2433929443359375 ;
5555static const double Y3 = 0.6986598968505859375 ;
5656
@@ -772,7 +772,7 @@ double stdlib_base_zeta( const double s ) {
772772 tmp = stdlib_base_sinpi ( 0.5 * sc ) * 2.0 * stdlib_base_zeta ( scc );
773773 r = stdlib_base_gammaln ( scc );
774774 r -= scc * stdlib_base_ln ( STDLIB_CONSTANT_FLOAT64_TWO_PI );
775- if ( r > MAX_LN ) {
775+ if ( r > stdlib_base_floor ( STDLIB_CONSTANT_FLOAT64_MAX_LN ) ) {
776776 return ( tmp < 0.0 ) ? STDLIB_CONSTANT_FLOAT64_NINF : STDLIB_CONSTANT_FLOAT64_PINF ;
777777 }
778778 return tmp * stdlib_base_exp ( r );
You can’t perform that action at this time.
0 commit comments