December 2017
Intermediate to advanced
386 pages
10h 42m
English
A notable rounding error due to cancellation has spread. It is possible to fix the situation, in this case, by multiplying the numerator and denominator of this formula by the conjugate of its denominator and using the resulting formula instead:
In [4]: 2*c / (-b + np.sqrt(b**2 - 4*a*c))Out[4]: 1.0
Read now
Unlock full access