0% found this document useful (0 votes)
86 views1 page

Graeffe's Root-Squaring MTD

Uploaded by

Random Taste
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views1 page

Graeffe's Root-Squaring MTD

Uploaded by

Random Taste
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

GRAEFFE’S ROOT-SQUARING METHOD

program graeffe else if ((i+j)==6) then

implicit none a1=a1+matrix(i,j)

Integer,dimension(4)::matrix1,matrix2 else

Integer,dimension(4,4)::matrix a0=a0+matrix(i,j)

real::r1,r2,r3,a3,a2,a1,a0 end if

integer::i,j,k end do

end do

print*,"Enter the coefficents a3,a2,a1,a0 of the


cubic polynomial"
r1=exp(log(-a0/a1)/(2**k))
do i=1,4
r2=exp(log(-a1/a2)/(2**k))
read*,matrix1(i)
r3=exp(log(-a2/a3)/(2**k))
end do
print*,k,"Roots are:",r1,", ",r2,", ",r3

do k=1,3
matrix1(1)=a3
do i=1,4
matrix1(2)=a2
if (i==1) then
matrix1(3)=a1
matrix2(1)=-(matrix1(1))
matrix1(4)=a0
else if (i==3) then
end do
matrix2(3)=-(matrix1(3))
print*,"Then all set! XD"
else
end program
matrix2(i)=matrix1(i)

end if

end do

do i=1,4

do j=1,4

matrix(i,j)=matrix1(i)*(matrix2(j))

end do

end do

a3=0

a2=0

a1=0

a0=0

do i=1,4

do j=1,4

if ((i+j)==2) then

a3=a3+matrix(i,j)

else if ((i+j)==4) then

a2=a2+matrix(i,j)

You might also like