Avoids dynamically changing type of variable in quadratic and cubic polynomial solvers.

Fixes #4