thursday/tinytweaks.py

51 lines
689 B
Python

import numpy as np
def IV(i):
fib = (0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597)
inv = tuple(range(-2, 16))
return 1 / max(3, max(b for a, b in zip(fib, inv) if i >= a))
def T2(i):
return IV(i) * 2
def T3(i):
return IV(i) * 3
def D2(i):
return IV(i) / 2
def D3(i):
return IV(i) / 3
def P3(i):
return IV(i) ** 3
def X3(i):
return i * 3
def C2(i): # crude workaround for my own broken interface
return 2.0
def H2(i): # throwaway
return 0.5 if i >= 65 // 5 else 1.0
def II(i):
return 1 / (i + 1)
def S2(i):
return 1 / (2 * np.sqrt(i + 2))
def S3(i):
return 1 / (3 * np.sqrt(i + 3))