Search for question

0. Test your function on a couple of examples. 2. Stability of an algorithm. Use your function from problem 1 to compute the roots of teh quadratic expression x - (10-° + 10°) x + 1. This equation can be factored as (x - 10-6) (x- 10°), so the roots are 10- and 10°. Is this what you see as the output of your function? The difference between the actual solution and the computed solution that your function gives is caused by the fact that the arithmetic done by a computer is not exact. To overcome this issue, an alternate form of the quadratic equation can be written: x=\frac{2 c}{-b \pm \sqrt{b^{2}-4 a c}} = 0. Find the roots of our Write a function that solves a quadratic equation using this alternative form. Test the function on the quadratic equation x"problem" quadratic above. 3. An even better quadratic method. Even the method above is not optimal in finding the roots of a quadratic. Instead, you can compute the largest root by using the formula Write a function that solves a quadratic equation using this alternative form. Test the function on the quadratic equation x2 – 1 = 0. Find the roots of our"problem" quadratic above. 3. An even better quadratic method. Even the method above is not optimal in finding the roots of a quadratic. Instead, you can compute the largest root by using the formula x_{1}=\frac{-b-\operatorname{sign}(b) \sqrt{b^{2}-4 a c}}{2 a} and then use the fact that x X2 = cla (where does this come from?). Here sign(b) is a function that returns -1 if b < 0 and 1 if b > 0. Type help sign for more information. Write a function that implements this method of solving the quadratic equation, and then test it on the quadratic quesitonx² – 2x + 1 = (x – 1)(x – 1) = 0. Now test it on x - 1 = 0, and explain the output. Finally, test it on oưt "problem quadratic" from problem 2.

Fig: 1

Fig: 2

Fig: 3

Fig: 4

Fig: 5

Fig: 6

Fig: 7

Fig: 8

Fig: 9

Fig: 10