File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
lib/node_modules/@stdlib/math/base/special/fibonaccif Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ var pow = require( '@stdlib/math/base/special/pow' );
3030var isnanf = require ( '@stdlib/math/base/assert/is-nanf' ) ;
3131var PHI = require ( '@stdlib/constants/float32/phi' ) ;
3232var pkg = require ( './../package.json' ) . name ;
33- var FIBONACCI = require ( './../lib/fibonacci .json' ) ;
33+ var FIBONACCIF = require ( './../lib/fibonaccif .json' ) ;
3434var fibonaccif = require ( './../lib' ) ;
3535
3636
@@ -80,7 +80,7 @@ bench( pkg+'::analytic', function benchmark( b ) {
8080 }
8181 }
8282 b . toc ( ) ;
83- if ( isnan ( y ) ) {
83+ if ( isnanf ( y ) ) {
8484 b . fail ( 'should not return NaN' ) ;
8585 }
8686 b . pass ( 'benchmark finished' ) ;
@@ -95,13 +95,13 @@ bench( pkg+'::table', function benchmark( b ) {
9595 b . tic ( ) ;
9696 for ( i = 0 ; i < b . iterations ; i ++ ) {
9797 x = floorf ( randu ( ) * 37.0 ) ;
98- y = FIBONACCI [ x ] ;
98+ y = FIBONACCIF [ x ] ;
9999 if ( isnanf ( y ) ) {
100100 b . fail ( 'should not return NaN' ) ;
101101 }
102102 }
103103 b . toc ( ) ;
104- if ( isnan ( y ) ) {
104+ if ( isnanf ( y ) ) {
105105 b . fail ( 'should not return NaN' ) ;
106106 }
107107 b . pass ( 'benchmark finished' ) ;
@@ -129,13 +129,13 @@ bench( pkg+'::naive_recursion', function benchmark( b ) {
129129 }
130130 }
131131 b . toc ( ) ;
132- if ( isnan ( y ) ) {
132+ if ( isnanf ( y ) ) {
133133 b . fail ( 'should not return NaN' ) ;
134134 }
135135 b . pass ( 'benchmark finished' ) ;
136136 b . end ( ) ;
137137} ) ;
138- f
138+
139139bench ( pkg + '::recursion_memoized' , function benchmark ( b ) {
140140 var arr ;
141141 var N ;
Original file line number Diff line number Diff line change 11
22{{alias}}( n )
3- Computes the nth Fibonacci number as a single-precision floating-point number.
3+ Computes the nth Fibonacci number as a single-precision
4+ floating-point number.
45
56 Fibonacci numbers follow the recurrence relation
67
7- F_n = F_{n-1} + F_{n-2}
8+ F_n = F_{n-1} + F_{n-2}
89
910 with seed values F_0 = 0 and F_1 = 1.
1011
You can’t perform that action at this time.
0 commit comments