Hacker Newsnew | past | comments | ask | show | jobs | submit | joserr's commentslogin

Seeking work | Ciudad de México | Remote

More than 20 years of experience in multiple technologies.

  + Common Lisp
  + Java
  + JavaScript
  + Perl
  + Python
Portafolio: https://www.rufina.link/portafolio/


"This book should not have been published in its current form. It contains many instances of incorrect and inconsistent terminology, as well as many other errors."[1]

[1]http://metamodular.com/Books/land-of-lisp.html



SEEKING WORK | Mexico | REMOTE

Technologies: C, Common Lisp, C#, Perl, JavaScript, Java, Postscript, Scheme and TeX; MySQL, Oracle, PostgreSQL, and SQLite. web-page: https://parentesis.rufina.link email: See web-page

I am a programmer with over 20 years of experience in a variety of technologies.


SBCL on my AMD FX(tm)-8350 Eight-Core Processor:

   ~$ sbcl
   This is SBCL 1.4.11, an implementation of ANSI Common Lisp.
   More information about SBCL is available at <http://www.sbcl.org/>.

   SBCL is free software, provided as is, with absolutely no warranty.
   It is mostly in the public domain; some portions are provided under
   BSD-style licenses.  See the CREDITS and COPYING files in the
   distribution for more information.
   * (defun fibonacci-tail-recursive ( n &optional (a 1) (b 1))
           (declare (optimize (speed 3) (safety 0) (debug 0))
                    (type fixnum n a b))
           (if (< n 1)
               a
               (fibonacci-tail-recursive (- n 1) b (+ a b))))

   FIBONACCI-TAIL-RECURSIVE
   * (time (fibonacci-tail-recursive 46))

   Evaluation took:
     0.000 seconds of real time
     0.000001 seconds of total run time (0.000001 user, 0.000000 system)
     100.00% CPU
     2,513 processor cycles
     0 bytes consed
  
     2971215073
   *


Different machine and superior algorithm, where are you aiming with this?


It's true, I only read recursive Fibonacci. Now I see my mistake.


That being said, this one [0] gives correct results and runs slightly faster :)

[0] https://gist.github.com/codr4life/59f2c02403b27d551e706f673b...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: