Guv
Jul 31st, 2005, 12:41 AM
A while ago I wrote a VB program to find the roots of polynomials. It easily found all the roots for polynomials of order 20-40, and I think might handle order 100 and beyond.
Recently I discovered a polynomial for which it determined one of the roots to about 15 digits of precision (the practical limit for a PC). When evaluated for that root, the result was over 100,000 instead of being a close approximation to zero.
At first I thought there was a bug in the program. After doing a lot of analysis and testing of the code, I realized that the anomaly was due to numerical calculation problems. The following special polynomial is an example which might cause this anomaly.x50 - 1051 = 0
The derivative of P(x) = x50 - 1051 is 50*x49
This polynomial has a root at approximately 10.47
Near that root the derivative is incredibly large, indicating an almost vertical slope near the root.
The error when you evaluate the polynomial could be 50*x49 times the error in the calculation of the root. An error in the root of 10-20 could result in an error greater than 1025the precision of the polynomial evaluation is not predictable, but can be many orders of magnitude greater than the error in the precision of the root for high order polynomials.
Recently I discovered a polynomial for which it determined one of the roots to about 15 digits of precision (the practical limit for a PC). When evaluated for that root, the result was over 100,000 instead of being a close approximation to zero.
At first I thought there was a bug in the program. After doing a lot of analysis and testing of the code, I realized that the anomaly was due to numerical calculation problems. The following special polynomial is an example which might cause this anomaly.x50 - 1051 = 0
The derivative of P(x) = x50 - 1051 is 50*x49
This polynomial has a root at approximately 10.47
Near that root the derivative is incredibly large, indicating an almost vertical slope near the root.
The error when you evaluate the polynomial could be 50*x49 times the error in the calculation of the root. An error in the root of 10-20 could result in an error greater than 1025the precision of the polynomial evaluation is not predictable, but can be many orders of magnitude greater than the error in the precision of the root for high order polynomials.