INNER CODE UNIT · Python
eps_a
sdv-dev/Copulas · copulas/optimize/__init__.py:89
eps_a = 2 * eps
iterations = 0
terminate = False
while maxiter > 0:
maxiter -= 1
# use t to linearly interpolate between a and b,
# and evaluate this function as our newest estimate xt
xt = np.clip(a + t * (b - a), xmin, xmax)
ft = f(xt)
# update our history of the last few points so that
# - a is the newest estimate (we're going to update it from xt)
# - c and b get the preceding two estimates
# - a and b maintain opposite signs for f(a) and f(b)
samesign = np.sign(ft) == np.sign(fa)
c = np.choose(samesign, [b, a])