Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Quadratic equation
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Avoiding loss of significance=== Although the quadratic formula provides an exact solution, the result is not exact if [[real number]]s are approximated during the computation, as usual in [[numerical analysis]], where real numbers are approximated by [[floating point number]]s (called "reals" in many [[programming language]]s). In this context, the quadratic formula is not completely [[numerical stability|stable]]. This occurs when the roots have different [[order of magnitude]], or, equivalently, when {{math|''b''<sup>2</sup>}} and {{math|''b''<sup>2</sup> β 4''ac''}} are close in magnitude. In this case, the subtraction of two nearly equal numbers will cause [[loss of significance]] or [[catastrophic cancellation]] in the smaller root. To avoid this, the root that is smaller in magnitude, {{math|''r''}}, can be computed as <math>(c/a)/R</math> where {{math|''R''}} is the root that is bigger in magnitude. This is equivalent to using the formula <math display="block">x =\frac{-2c}{b \pm \sqrt {b^2-4ac}}</math> using the plus sign if <math>b>0</math> and the minus sign if <math>b<0.</math> A second form of cancellation can occur between the terms {{math|''b''<sup>2</sup>}} and {{math|4''ac''}} of the discriminant, that is when the two roots are very close. This can lead to loss of up to half of correct significant figures in the roots.<ref name="kahan"/><ref name="Higham2002">{{Citation |first=Nicholas |last=Higham |title=Accuracy and Stability of Numerical Algorithms |edition=2nd |publisher=SIAM |year=2002 |isbn=978-0-89871-521-7 |page=10 }}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Quadratic equation
(section)
Add topic