This gives you critical points, i.e. those x in the interval that the derivative is zero or they lie on the boundary of the interval. From this one should only evaluate and take min .
In [22]: p = numpy.poly1d([2,-4,-28,62,122,-256,-196,140,392,240,72]) In [23]: bounds = [-2.5, 2.5] In [24]: crit_points = bounds + [x for x in p.deriv().r if x.imag == 0 and bounds[0] < x.real < bounds[1]] In [25]: crit_points Out[25]: [-2.5, 2.5, (-2.0243100544390678+0j), (1.8753707038871632+0j), (1.2307367723613383+0j), (-0.41217268372324861+0j)]
From the graph in this case, it seems that min is the last.
source share