In SciPy 1.0.0, according to [its documentation](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.line_search.html), `scipy.optimize.line_search` has an optional parameter `amax` which determines the "Maximum step size".

As such, I would expect that the first return value, `alpha`, would always be less than the given `amax`, but this is not the case, as the following example illustrates:

```
from scipy.optimize import line_search

def f(x):
    return x[0]**2 + x[1]**2

def df(x):
    return 2*x

x = np.array([4, 5])
line_search(f, df, x, -df(x), amax=0.001)
# Returns (0.5, 3, 1, 0.0, 41.0, array([ 0.,  0.]))

```

In this, the value of `alpha` is 0.5 but the value of `amax` is 0.001, which is less than 0.5.

Another interpretation might be that `amax` limits the distance between the output values `x_new` and `x0`, but this is also not the case.

Am I misinterpreting the documentation, or is this a bug in SciPy? And, if it is working as intended, what is the correct interpretation of `amax`, and is there some other way to limit the range of alphas in which to perform the line search?