Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

OUTPUT 1:

PS C:\Users\M-H\Desktop\1h2Ashowna> g++ .\p4_roots_secant.cpp


PS C:\Users\M-H\Desktop\1h2Ashowna> ./a.exe
To find the roots of the given equation,give the interval.
0.5 1.0
Give accuracy e
0.001
it x0 x1 fx0 fx1
x2 d
1 0.5 1 -0.375 1
0.636364 0.363636
2 1 0.636364 1 -0.105935
0.671196 0.034832
3 0.636364 0.671196 -0.105935 -0.0264283
0.682774 0.0115783
4 0.671196 0.682774 -0.0264283 0.00106954
0.682324 0.000450313
The solution of the equation is:0.682324
PS C:\Users\M-H\Desktop\1h2Ashowna>

OUTPUT 2:

PS C:\Users\M-H\Desktop\1h2Ashowna> g++ .\p4_roots_secant.cpp


PS C:\Users\M-H\Desktop\1h2Ashowna> ./a.exe
To find the roots of the given equation,give the interval.
2 3
Give accuracy e
0.001
it x0 x1 fx0 fx1
x2 d
1 2 3 9 29
1.55 1.45
2 3 1.55 29 4.27387
1.29937 0.25063
3 1.55 1.29937 4.27387 2.49317
0.94846 0.35091
4 1.29937 0.94846 2.49317 0.801671
0.782149 0.16631
5 0.94846 0.782149 0.801671 0.260636
0.702032 0.0801174
6 0.782149 0.702032 0.260636 0.0480279
0.683934 0.0180985
7 0.702032 0.683934 0.0480279 0.00385395
0.682355 0.00157899
8 0.683934 0.682355 0.00385395 6.42938e-005
0.682328 2.67625e-005
The solution of the equation is:0.682328
PS C:\Users\M-H\Desktop\1h2Ashowna>

You might also like