!!------------------------------------------------------------
!! $Id: metric.f90,v 1.1 1997/12/19 19:37:59 scott Exp $
!! Scott McGuire
!! For multiple underliers, should have s1,s2 arrays
!!------------------------------------------------------------
real*8 function metric(max_params,params,covm,s1,t1,s2,t2)
use input_params
implicit none
integer,intent(IN)                             :: max_params
real*8,dimension(max_params),intent(IN)        :: params
real*8,dimension(:,:),intent(IN)               :: covm
real*8,intent(IN)                              :: s1,t1,s2,t2

   metric = (t2-t1)**2/covm(0,0) &
            +2*(t2-t1)*log(s2/s1)/covm(0,1) &
            +log(s2/s1)**2/covm(1,1)
   return
end function metric
