time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (946B)


      1 
      2 {{alias}}( n )
      3     Computes the nth Tribonacci number.
      4 
      5     Tribonacci numbers follow the recurrence relation
      6 
      7       F_n = F_{n-1} + F_{n-2} + F_{n-3}
      8 
      9     with seed values F_0 = 0, F_1 = 0, and F_2 = 1.
     10 
     11     If `n` is greater than `63`, the function returns `NaN`, as larger
     12     Tribonacci numbers cannot be accurately represented due to limitations of
     13     double-precision floating-point format.
     14 
     15     If not provided a nonnegative integer value, the function returns `NaN`.
     16 
     17     If provided `NaN`, the function returns `NaN`.
     18 
     19     Parameters
     20     ----------
     21     n: integer
     22         Input value.
     23 
     24     Returns
     25     -------
     26     y: integer
     27         Tribonacci number.
     28 
     29     Examples
     30     --------
     31     > var y = {{alias}}( 0 )
     32     0
     33     > y = {{alias}}( 1 )
     34     0
     35     > y = {{alias}}( 2 )
     36     1
     37     > y = {{alias}}( 3 )
     38     1
     39     > y = {{alias}}( 4 )
     40     2
     41     > y = {{alias}}( 64 )
     42     NaN
     43     > y = {{alias}}( NaN )
     44     NaN
     45 
     46     See Also
     47     --------
     48