Skip to content

Computing roots of certain equations in C with the Bisection Method, Newton's Method, Fixed Point Iteration, and the Secant Method

Notifications You must be signed in to change notification settings

kgerot/root-methods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Output from functions

Input

Newton's

p0 : 1

Secant

p0 : 0

p1 : 1

Fixed Point

p0 : -1

g_a(p) = p = (-3x^3 + 2x^2 + 2e^x + 1)/5

g_b(p) = p = sqrt((x^4 - 2)/3)

g_c(p) = p = sqrt(3x - e^x - 2)

Equation A

 i      Bisection   Newton's   Secant    Fixed Point
 1      0.000000    0.657399   0.390101
 2      0.500000    0.484328   0.436927
 3      0.250000    0.459865   0.459927
 4      0.375000    0.459652   0.459650
 5      0.437500    0.459652   
 6      0.468750    
 7      0.453125
 8      0.460938
 9      0.457031
10      0.458984
11      0.459961
12      0.459473
13      0.459717
14      0.459595
15      0.459656

Equation B

 i      Bisection   Newton's   Secant    Fixed Point
 1      1.000000    0.800000   0.500000
 2      0.500000    0.751869   0.686275
 3      0.750000    0.749375   0.769025
 4      0.625000    0.749368   0.748059
 5      0.687500               0.749342
 6      0.718750               0.749368
 7      0.734375               
 8      0.742188               
 9      0.746094               
10      0.748047
11      0.749023
12      0.749512
13      0.749268
14      0.749390
15      0.749329

Equation C

 i      Bisection   Newton's   Secant    Fixed Point
 1      0.000000    0.268941   0.268941
 2      1.000000    0.257518   0.257171
 3      0.500000    0.257530   0.257531
 4      0.250000    
 5      0.375000    
 6      0.312500    
 7      0.281250    
 8      0.265625
 9      0.257812
10      0.253906
11      0.255859
12      0.256836
13      0.257324
14      0.257568
15      0.257446
16      0.257507

About

Computing roots of certain equations in C with the Bisection Method, Newton's Method, Fixed Point Iteration, and the Secant Method

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages