Successfully reported this slideshow.
Your SlideShare is downloading. ×

Hello- I am writing a program that uses the secant method to search fo.docx

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 1 Ad

Hello- I am writing a program that uses the secant method to search fo.docx

Download to read offline

Hello, I am writing a program that uses the secant method to search for a root of f(x) = 3x^2 + sin(x) - e^x, given two values (a and b)
Why is it that every time I run the program the \"non existent slope\" failure runs, is there something wrong with that if loop? It always seems to execute even if fabs(a-b) is NOT .00001.
Here is the code (c++) :
Any suggestions or possibly the solution to fix or improve this code would be great.
Solution
Look it would be better if you place your code inside the try catch block because by doing so you can get the actual error, and if the try catch does\'nt give any error then the problem is in your logic.
here the code which is more prone to error is in the non-existent slope if condition
.

Hello, I am writing a program that uses the secant method to search for a root of f(x) = 3x^2 + sin(x) - e^x, given two values (a and b)
Why is it that every time I run the program the \"non existent slope\" failure runs, is there something wrong with that if loop? It always seems to execute even if fabs(a-b) is NOT .00001.
Here is the code (c++) :
Any suggestions or possibly the solution to fix or improve this code would be great.
Solution
Look it would be better if you place your code inside the try catch block because by doing so you can get the actual error, and if the try catch does\'nt give any error then the problem is in your logic.
here the code which is more prone to error is in the non-existent slope if condition
.

Advertisement
Advertisement

More Related Content

More from rtodd588 (20)

Recently uploaded (20)

Advertisement

Hello- I am writing a program that uses the secant method to search fo.docx

  1. 1. Hello, I am writing a program that uses the secant method to search for a root of f(x) = 3x^2 + sin(x) - e^x, given two values (a and b) Why is it that every time I run the program the "non existent slope" failure runs, is there something wrong with that if loop? It always seems to execute even if fabs(a-b) is NOT .00001. Here is the code (c++) : Any suggestions or possibly the solution to fix or improve this code would be great. Solution Look it would be better if you place your code inside the try catch block because by doing so you can get the actual error, and if the try catch does'nt give any error then the problem is in your logic. here the code which is more prone to error is in the non-existent slope if condition

×