mirror of
https://github.com/nanoy42/coope
synced 2024-09-17 12:13:08 +00:00
8 lines
171 B
Python
8 lines
171 B
Python
|
import math
|
||
|
|
||
|
def compute_price(price, a, b, c, alpha):
|
||
|
if price < a:
|
||
|
return price * (a + b * math.exp(-c/(price-alpha)**2))
|
||
|
else:
|
||
|
return price * a
|