! Cu "polval" pt. polinoame
subroutine sub_Pol()
! met. Halley
use work

!real coef(0:n)
real coef_1(0:n-1)
real coef_2(0:n-2)

do i = n-1, 0, -1
coef_1(i) =coef(i+1)*(i+1)
enddo

do i = n-2, 0, -1
coef_2(i) =coef_1(i+1)*(i+1)
enddo

!f  =polval(n, coef, x)
!f1 =polval(n-1, coef_1, x)
!f2 =polval(n-2, coef_2, x)

END
! Rad tripla:
! f =(x-1)**3*(x-2) =x**4 -5*x**3 +9*x**2 -7*x +2
! n =4; coef(0:n) =(/1, -5, 9, -7, 2/);

! f =(x-1.1)**2*(x-2.1)
! n=3; coef(0:n) =(/1,	-4.3,	5.83,	-2.541/)

! Zeng 2003: Grad 10
!Zeng 2003: (x-3)^2*(x-2)^3*(x-1)^5
!1 -17 127 -549 1521 -2823 3557 -3007 1634 -516 72

!n =10
!coef(0:n) =(/72,  -516, 1634, -3007, 3557, -2823, 1521, -549, 127, -17, 1/)

!coef =(/1, -17, 127, -549, 1521, -2823, 3557, -3007, 1634, -516, 72/)
!coef(0:n) =coef(n:0:-1)

