Timeline for Project Euler #2 (Fibonacci Sequence)
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 10, 2015 at 22:01 | comment | added | bowmore | @ChristianHujer actually my output varied from 601 to 1501 nanos on a Intel Core i7-3770 CPU @ 3.40Ghz 3.40GHz on Oracle's 1.8.0_25 JVM. The b<<2 looks a little faster than b+b+b+b+a on average but not much. Both are around 1201. 4*b+a is around 3603 as I said before the edit. | |
Jan 10, 2015 at 14:50 | comment | added | Christian Hujer | BTW I admire your multiply solution. I didn't find that one myself. | |
Jan 10, 2015 at 14:49 | comment | added | Christian Hujer |
Just out of curiosity, were you using 4 * b or b << 2 in the source code for comparing 4 * b + a with b + b + b + b + a ? And looking at your numbers, I'm curious what CPU you used for the measurement, and how often did you measure? I always got quite different results, in a range that varies +/- 70% - which is no surprise at all on today's multitasking operating systems.
|
|
Jan 10, 2015 at 8:49 | history | edited | bowmore | CC BY-SA 3.0 |
added 163 characters in body
|
Jan 9, 2015 at 21:31 | history | answered | bowmore | CC BY-SA 3.0 |