Each table row shows performance measurements for this Pyston program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|
Read the ↓ make, command line, and program output logs to see how this program was run.
Read fibonacci benchmark to see what this program should do.
import sys
def powLF(n):
if n == 1:
return (1, 1)
L, F = powLF(n//2)
L, F = (L**2 + 5*F**2) >> 1, L*F
if n & 1:
return ((L + 5*F) >> 1, (L + F) >> 1)
else:
return (L, F)
def fib(n):
if n & 1:
return powLF(n)[1]
else:
L, F = powLF(n // 2)
return L * F
print fib(int(sys.argv[1]))
Wed, 28 Sep 2022 09:04:24 GMT
COMMAND LINE:
/usr/bin/pyston fibonacci.pyston-3.pyston 1000000
PROGRAM FAILED
PROGRAM OUTPUT:
File "fibonacci.pyston-3.pyston", line 22
print fib(int(sys.argv[1]))
^
SyntaxError: invalid syntax