PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
# Python Timing Lab of Andrey Smirnov
#
# Measuring floating point formula perfomance vs recursive call integer calculation vs iteration
# with Fibonacci squence
# to reduce floating point repeated
# calculatins we prepare some numbers
# - I'm not sure Phyton interpreter
# able to optimise it this way
sqr5 = 5**(1/2)
phi = (1+sqr5)/2
# Repeat counters
ti = 1 # Iteration
tr = 1 # Recursion
tf = 1 # Floating point formula
# Time of calculations measired in milliseconds
i_t = 0 # iteration
f_t = 0 # floating point
r_t = 0 # recursion
# Formula ( using integer powers, not fractional!)
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run