Skip to content

Instantly share code, notes, and snippets.

View tcibinan's full-sized avatar

Andrei Tcibin tcibinan

View GitHub Profile
@tcibinan
tcibinan / findExtremums.py
Last active September 3, 2021 18:51
Find extremum of a function using sympy
from sympy.solvers import solve
from sympy.abc import x
def getDeepDotQuality(func, arg, val, n = 3):
dy = func.diff(arg)
dyn = dy.subs(arg, val)
if (dyn == 0):
return getDeepDotQuality(dy, arg, val, n+1)
elif (n % 2 == 1):
return 'has an inflection point'