@@ -154,169 +154,6 @@ tape( 'the function evaluates the pdf for `x` given large `k` and `lambda`', opt
154154 t . end ( ) ;
155155} ) ;
156156
157- tape ( 'the function evaluates the pdf for `x` given large shape parameter `k`' , opts , function test ( t ) {
158- var expected ;
159- var lambda ;
160- var delta ;
161- var tol ;
162- var i ;
163- var k ;
164- var x ;
165- * @license Apache - 2.0
166- *
167- * Copyright ( c ) 2026 The Stdlib Authors .
168- *
169- * Licensed under the Apache License , Version 2.0 ( the "License" ) ;
170- * you may not use this file except in compliance with the License .
171- * You may obtain a copy of the License at
172- *
173- * http :/ / www . apache . org / licenses / LICENSE - 2.0
174- *
175- * Unless required by applicable law or agreed to in writing , software
176- * distributed under the License is distributed on an "AS IS" BASIS ,
177- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied .
178- * See the License for the specific language governing permissions and
179- * limitations under the License .
180- * /
181-
182- 'use strict' ;
183-
184- // MODULES //
185-
186- var resolve = require ( 'path' ) . resolve ;
187- var tape = require ( 'tape' ) ;
188- var tryRequire = require ( '@stdlib/utils/try-require' ) ;
189- var isnan = require ( '@stdlib/math/base/assert/is-nan' ) ;
190- var abs = require ( '@stdlib/math/base/special/abs' ) ;
191- var PINF = require ( '@stdlib/constants/float64/pinf' ) ;
192- var NINF = require ( '@stdlib/constants/float64/ninf' ) ;
193- var EPS = require ( '@stdlib/constants/float64/eps' ) ;
194-
195-
196- // FIXTURES //
197-
198- var largeRate = require ( './fixtures/julia/large_rate.json' ) ;
199- var largeShape = require ( './fixtures/julia/large_shape.json' ) ;
200- var bothLarge = require ( './fixtures/julia/both_large.json' ) ;
201-
202-
203- // VARIABLES //
204-
205- var pdf = tryRequire ( resolve ( __dirname , './../lib/native.js' ) ) ;
206- var opts = {
207- 'skip' : ( pdf instanceof Error )
208- } ;
209-
210-
211- // TESTS //
212-
213- tape ( 'main export is a function' , opts , function test ( t ) {
214- t . ok ( true , __filename ) ;
215- t . strictEqual ( typeof pdf , 'function' , 'main export is a function' ) ;
216- t . end ( ) ;
217- } ) ;
218-
219- tape ( 'if provided `NaN` for any parameter, the function returns `NaN`' , opts , function test ( t ) {
220- var y = pdf ( NaN , 1.0 , 1.0 ) ;
221- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
222-
223- y = pdf ( 0.0 , NaN , 1.0 ) ;
224- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
225-
226- y = pdf ( 0.0 , 1.0 , NaN ) ;
227- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
228-
229- t . end ( ) ;
230- } ) ;
231-
232- tape ( 'if provided `+infinity` for `x` and a finite `k` and `lambda`, the function returns `0`' , opts , function test ( t ) {
233- var y = pdf ( PINF , 1.0 , 1.0 ) ;
234- t . strictEqual ( y , 0.0 , 'returns expected value' ) ;
235- t . end ( ) ;
236- } ) ;
237-
238- tape ( 'if provided `-infinity` for `x` and a finite `k` and `lambda`, the function returns `0`' , opts , function test ( t ) {
239- var y = pdf ( NINF , 1.0 , 1.0 ) ;
240- t . strictEqual ( y , 0.0 , 'returns expected value' ) ;
241- t . end ( ) ;
242- } ) ;
243-
244- tape ( 'if provided `k <= 0`, the function returns `NaN`' , opts , function test ( t ) {
245- var y ;
246-
247- y = pdf ( 2.0 , - 1.0 , 2.0 ) ;
248- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
249-
250- y = pdf ( 0.0 , - 1.0 , 2.0 ) ;
251- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
252-
253- y = pdf ( 2.0 , NINF , 1.0 ) ;
254- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
255-
256- y = pdf ( 2.0 , NINF , PINF ) ;
257- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
258-
259- y = pdf ( 2.0 , NINF , NINF ) ;
260- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
261-
262- y = pdf ( 2.0 , NINF , NaN ) ;
263- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
264-
265- t . end ( ) ;
266- } ) ;
267-
268- tape ( 'if provided `lambda <= 0`, the function returns `NaN`' , opts , function test ( t ) {
269- var y ;
270-
271- y = pdf ( 2.0 , 2.0 , - 1.0 ) ;
272- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
273-
274- y = pdf ( 0.0 , 2.0 , - 1.0 ) ;
275- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
276-
277- y = pdf ( 2.0 , 1.0 , NINF ) ;
278- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
279-
280- y = pdf ( 2.0 , PINF , NINF ) ;
281- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
282-
283- y = pdf ( 2.0 , NINF , NINF ) ;
284- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
285-
286- y = pdf ( 2.0 , NaN , NINF ) ;
287- t . strictEqual ( isnan ( y ) , true , 'returns expected value' ) ;
288-
289- t . end ( ) ;
290- } ) ;
291-
292- tape ( 'the function evaluates the pdf for `x` given large `k` and `lambda`' , opts , function test ( t ) {
293- var expected ;
294- var lambda ;
295- var delta ;
296- var tol ;
297- var i ;
298- var k ;
299- var x ;
300- var y ;
301-
302- expected = bothLarge . expected ;
303- x = bothLarge . x ;
304- k = bothLarge . k ;
305- lambda = bothLarge . lambda ;
306-
307- for ( i = 0 ; i < x . length ; i ++ ) {
308- y = pdf ( x [ i ] , k [ i ] , lambda [ i ] ) ;
309- if ( y === expected [ i ] ) {
310- t . strictEqual ( y , expected [ i ] , 'x: ' + x [ i ] + ', k: ' + k [ i ] + ', lambda: ' + lambda [ i ] + ', y: ' + y + ', expected: ' + expected [ i ] ) ;
311- } else {
312- delta = abs ( y - expected [ i ] ) ;
313- tol = 180.0 * EPS * abs ( expected [ i ] ) ;
314- t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. k: ' + k [ i ] + '. lambda: ' + lambda [ i ] + '. y: ' + y + '. E: ' + expected [ i ] + '. Δ: ' + delta + '. tol: ' + tol + '.' ) ;
315- }
316- }
317- t . end ( ) ;
318- } ) ;
319-
320157tape ( 'the function evaluates the pdf for `x` given large shape parameter `k`' , opts , function test ( t ) {
321158 var expected ;
322159 var lambda ;
0 commit comments