1 | initial version |
If one just wants to test whether a given polynomial $f(x)$ is positive for all real $x$, this can be done without representing $f(x)$ as the sum of squares, using the following function:
def is_pol_positive(f):
return f.leading_coefficient() > 0 and f.number_of_real_roots() == 0