@@ -74,7 +74,7 @@ v = polygamma( 2, -1.0 );
7474If ` x ` on the other hand is a negative even ` integer ` , the function returns ` NaN ` .
7575
7676``` javascript
77- v = polygamma ( 2 , - 4.0 );
77+ var v = polygamma ( 2 , - 4.0 );
7878// returns NaN
7979
8080v = polygamma ( 2 , - 2.0 );
@@ -105,21 +105,18 @@ v = polygamma( NaN, NaN );
105105<!-- eslint no-undef: "error" -->
106106
107107``` javascript
108- var randu = require ( ' @stdlib/random/base/randu' );
109- var round = require ( ' @stdlib/math/base/special/round' );
108+ var discreteUniform = require ( ' @stdlib/random/array/discrete-uniform' );
109+ var uniform = require ( ' @stdlib/random/array/uniform' );
110+ var logEachMap = require ( ' @stdlib/console/log-each-map' );
110111var polygamma = require ( ' @stdlib/math/base/special/polygamma' );
111112
112- var n;
113- var x;
114- var v;
115- var i;
116-
117- for ( i = 0 ; i < 100 ; i++ ) {
118- x = (randu ()* 100.0 ) - 50.0 ;
119- n = round ( randu ()* 50.0 );
120- v = polygamma ( x, n );
121- console .log ( ' x: %d, ψ^(%d)(x): %d' , x, n, v );
122- }
113+ var opts = {
114+ ' dtype' : ' float64'
115+ };
116+ var x = uniform ( 100 , - 50.0 , 50.0 , opts );
117+ var n = discreteUniform ( 100 , 0 , 50 , opts );
118+
119+ logEachMap ( ' x: %0.4f, ψ^(%d)(x): %0.4f' , x, n, polygamma );
123120```
124121
125122</section >
0 commit comments