      subroutine submaxima_muly3(x,y,z,a,f,df,df2,df3) 
      implicit none 
      double precision x,y,z,a,f,df(3),df2(3*4/2),df3(3*4*5/6) 
      f = a*sin(x)*sin(y)*sin(z)
      df(1) = a*cos(x)*sin(y)*sin(z)
      df(2) = a*sin(x)*cos(y)*sin(z)
      df(3) = a*sin(x)*sin(y)*cos(z)
      df2(1) = -a*sin(x)*sin(y)*sin(z)
      df2(2) = a*cos(x)*cos(y)*sin(z)
      df2(3) = -a*sin(x)*sin(y)*sin(z)
      df2(4) = a*cos(x)*sin(y)*cos(z)
      df2(5) = a*sin(x)*cos(y)*cos(z)
      df2(6) = -a*sin(x)*sin(y)*sin(z)
      df3(1) = -a*cos(x)*sin(y)*sin(z)
      df3(2) = -a*sin(x)*cos(y)*sin(z)
      df3(3) = -a*cos(x)*sin(y)*sin(z)
      df3(4) = -a*sin(x)*cos(y)*sin(z)
      df3(5) = -a*sin(x)*sin(y)*cos(z)
      df3(6) = a*cos(x)*cos(y)*cos(z)
      df3(7) = -a*sin(x)*sin(y)*cos(z)
      df3(8) = -a*cos(x)*sin(y)*sin(z)
      df3(9) = -a*sin(x)*cos(y)*sin(z)
      df3(10) = -a*sin(x)*sin(y)*cos(z)
      end 
