>>107110484
>Fuck, I knew Python was slow but that is just horrible.
Truth.
#CPU: Intel i5-6300U (4) @ 3.000GHz
#Memory: 6951MiB / 15874MiB
#real 1m22.677s
#user 1m22.636s
#sys 0m0.022s
>>107110531
Why is your rapberry pi faster than my thinkpad?
def mult(c1,c2):
x1, y1 = c1
x2, y2 = c2
return [x1 * x2 - y1 * y2, x1 * y2 + y1 * x2]
def add(c1,c2):
x1, y1 = c1
x2, y2 = c2
return [x1 + x2, y1 + y2]
def div(c1,c2):
x1, y1 = c1
x2, y2 = c2
return [int(x1 / x2), int(y1 / y2)]
a=[35300,-64910] # 406954
r = [0,0]
res = 0
for y in range(0,1001):
for x in range(0,1001):
r = [0,0]
included = True
for _ in range(100):
r = mult(r,r)
r = div(r,[100000,100000])
r = add(r, add(a,[x,y]))
if not (-1000000 < r[0] < 1000000 and -1000000 < r[1] < 1000000):
included = False
break
if included:
res += 1
print(res)