! Structura:
! f(i) = expresie; i =1,n;
subroutine fcn(n, w, f)
dimension w(n),f(n)

real sum2(4)

! For Broyden banded
!f1(u) =u*(2+5*u*u) +1
!f2(u) =u*(u+1)

f =0.
x =w(1)
y =w(2)
if(n >=3) z =w(3)


! Ex. curs:
f(1) =x*x+ y*y -5.
f(2) =y -exp(x) -1.

! 15/III
!f(1) =(x-y)*(sqrt(x+y)) -3.
!f(2) =x -log(x-y)-1.

! 19/I E: (2,1,-1)
!f(1) =x*x ++y*y +z*z-6.4; f(2) =x*y*z +2.2; 
!f(3) =x +y-z*z-2.4

!Miel
!f(1) =2*x*x*x -y*y -1
!f(2) =x*y*y*y -y -4

! Vahidi 2012:(0.5,0,-pi/6)
!x1 =w(1); x2 =w(2); x3 =w(3);
!pi =2*asin(1.)
!f(1) =3*x1 -cos(x2*x3)- 1/2. 
!f(2) =x1*x1 -81*(x2 + 0.1)**2 +sin(x3) + 1.06
!f(3) =exp(-x1*x2) + 20*x3 + (10*pi-3)/3

! Vahidi 2012: mod_2: 1.06-->1.0
!x1 =w(1); x2 =w(2); x3 =w(3);
!pi =2*asin(1.)
!f(1) =3*x1 -cos(x2*x3)- 0.5
!f(2) =x1*x1 -81*(x2 + 0.1)**2 +sin(x3) + 1.05
!f(3) =exp(-x1*x2) + 20*x3 + 10*pi/3. -1


! Vah-modified:
!f(1) =3*x1 -cos(x2*x3)- 0.5 
!f(2) =x1*x1 -81*x2**2 +sin(x3) + 1
!f(3) =exp(-x1*x2) + 20*x3 + 9.5


! 14-I
!f(1) =x*y -z*z -2
!f(2) =-x*y*z -x*x +y*y -4
!f(3) =exp(x) -exp(y) -z -7

! 14-I mod
!f(1) =x*y -z*z -1
!f(2) =x*y*z -x*x +y*y -3
!f(3) =exp(x) -exp(y) +z -5

! Hirsch et al. 2006 - modif-1 ~19-1
! x: [1/4, 1]; y: [1.5/pi, 2]~[0.5,2];
!pi =2*asin(1.); a =1-0.25/pi;

!f(1) =sin(pi*x*y) -.5*y -x
!f(2) =a*(exp(2*x-1)-1) +y -2*x

! Hirsch - modif.-2
! x,y in [0.25,1]
!pi =2*asin(1.); a =1-0.25/pi;
!f(1) =sin(pi/2*x*y) -0.5*y -0.5*x
!f(2) =a*(exp(x-1)-1) +y -x

!Freudenstein and Roth 1963: x=(15,-2); (4, 5);
!f1 = -13 + x1 +((-x2 + 5)x2-2)x2,
!f2 = -29 + x1 + ((X2 + 1)x2 - 14)x2.

!f(1) = -13 + x +((-y + 5)*y-2)*y
!f(2) = -29 + x + ((y + 1)*y - 14)*y


! Powell 1964: x= -1.2, x2= 1.0.
!fl = 1O(x2 -X1*x1 )
!f2 = 1 -x1
!f(1) =10*(y -x*x)
!f(2) =1 -x

! Broyden banded; n =4
!sum2(1) =f2(w(2))
!sum2(2) =f2(w(1)) +f2(w(3))
!sum2(3) =f2(w(1)) +f2(w(2)) +f2(w(4))
!sum2(4) =f2(w(1)) +f2(w(2)) +f2(w(3))

!do i=1,4
!f(i) =f1(w(i)) -sum2(i)
!enddo

end


