Getting ready

Consider the quadratic equation ax2 + bx + c = 0, with a = 10–10b = –(1010 + 1)/1010, and c = 1. These are the coefficients of the expanded version of the polynomial p(x) = 10–10(x–1)(x–1010), with the obvious roots x = 1 and x = 1010. Notice the behavior of the quadratic formula in the following command:

In [1]: import numpy as np
In [2]: a, b, c = 1.0e-10, -(1.0e10 + 1.)/1.0e10, 1.
In [3]: (-b - np.sqrt(b**2 - 4*a*c))/(2*a)
Out[3]: 1.00000000082740371
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset