Question: Write a Python code consisting of a function ( call it quadroots ) that calculates the roots of the quadratic equation using the expressions given

Write a Python code consisting of a function (call it quadroots) that calculates the
roots of the quadratic equation using the expressions given by (3). Show that your code
works for a few values of a, b, c.
However, in some cases, the roots when computed by equation (3) can lead to round-off
errors. To see this, consider the case when b >0 and b2>>4ac. In this case, the two
terms in the numerator in the expression for x1 are close to each other and the numerator
may suffer from round-off errors. A similar situation arises in the expression for x2 when
b <0.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!