subroutine sub(x, f, f1)
! met. Newton
common p

!f =exp(x) -p*x*x
!f1 =exp(x) -2*p*x

!f =exp(x) -3.7*x**1.5
!f1 =exp(x) -5.55*x**0.5

!f =exp(x) -3.7*(x*x)**(1./3.)
!f1 =exp(x) -7.4/3./x**(1./3.)

!f =exp(x) -3*(x*x)**(1./3.)
!f1 =exp(x) -2./x**(1./3.)


! Stationar:
!f =7*x -5*x*cos(x)+3*sin(x)
!f1=7-2*cos(x)+5*x*sin(x)       !7-5*cos(x)+5*x*sin(x)+3*cos(x)

!f =tan(x)-(8-x)/(x+0.2)
!f1 =1/(cos(x))**2 +8.2/(x+0.2)**2

!f =tan(x)-(1.8-x)/(x+0.2)
!f1 =1/(cos(x))**2 +2./(x+0.2)**2

!f =1.58 +0.99*cos(x) -x
!f1 =-0.99*sin(x) -1

!f =1.58 +0.99*sin(x) -x
!f1 =0.99*cos(x) -1

!f =x +exp(-p*x*x)*cos(x)
!f1 =1-2*p*x*exp(-p*x*x)*cos(x) -exp(-p*x*x)*sin(x)

!f =-x +exp(-p*x*x*x)*cos(x)
!f1 =-1-3*p*x*x*exp(-p*x*x*x)*cos(x) -exp(-p*x*x*x)*sin(x)

!pi =3.141593
!f =3*(pi+2*x) +5*(pi +2*x)*cos(2*x) - 2*sin(2*x)
!f1 =6 +10*cos(2*x)-10*(pi +2*x)*sin(2*x) - 4*cos(2*x)

! ~ f_q:
!f =3*x +5*(p+x)*cos(x) -2*sin(x)
!f1 =3 -5*(x+p)*sin(x) +3*cos(x)

! 3-1
!f =2 +x*(-7 +x*(9 +x*(-5 +x)))
!f1 =-7 +x*(18 +x*(-15 +4*x))

 !f  =1.5 -0.9*cos(x) -0.1*sin(x) +x
 !f1 =0.9*sin(x) -0.1*cos(x) +1

! Ozban 2004:
!sin2(x) - x2 + 1 =0; alfa = 1.404491648215341
!f =sin(x)*sin(x) - x*x + 1
!f1 =2*sin(x)*cos(x) -2*x

! S&S - Ex.3: 2x cos(x) + x - 3; alfa =-3.034664306974045...
!f =2*x*cos(x) +x -3
!f1 =2*cos(x) -2*x*sin(x) +1

! S&S - Ex.2: 2.331967655883964
f  =sqrt(x*x +2*x+5) -2*sin(x) -x*x +3
f1 =(x+1)/sqrt(x*x +2*x+5) -2*cos(x) -2*x

! 2014 - 16/I
!f =x +x*x -(sin(x))**2 -1
!f1 =1 +2*x -2*sin(x)*cos(x)
END
