Source: https://users.tricity.wsu.edu/~hudson/Teaching/EE221/Text/08 Root finding II.pdf