Successfully reported this slideshow.

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

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

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
.