update new files
[unres.git] / source / unres / src-5hdiag-tmp / mygauss.f
1       double precision function mygauss(x)
2       double precision x,xx
3 c Bell-like function with shorter tail than Gussian, C2 class
4       double precision a /0.12479628030882975000d0/,
5      &                 b /-0.02020459191080933333d0/,
6      &                 c /0.00193897131461287500d0/,
7      &                 a1 /0.10424745713810881250d0/,
8      &                 b1 /-0.02369260389502472656d0/,
9      &                 c1 /0.00177694529212685400d0/
10       if (x.lt.-1.0d0 .and. x.gt.-3.0d0) then
11         xx=(x+3.0d0)**2
12         mygauss=xx*xx*(a1+xx*(b1+c1*xx))
13       else if (x.ge.-1.0d0 .and. x.le.1.0d0) then
14         xx=x*x
15         mygauss=1.0d0+xx*(-0.5d0+xx*(a+xx*(b+xx*c)))
16       else if (x.gt.1.0d0 .and. x.lt.3.0d0) then
17         xx=(x-3.0d0)**2
18         mygauss=xx*xx*(a1+xx*(b1+c1*xx))
19       else
20         mygauss=0.0d0
21       endif
22       return
23       end
24 c------------------------------------------------------------
25       double precision function mygaussder(x)
26       double precision x,xx
27 c Bell-like function with shorter tail than Gussian, C2 class
28 c      double precision a /0.12479628030882975000d0/,
29 c     &                 b /-0.02020459191080933333d0/,
30 c     &                 c /0.00193897131461287500d0/,
31 c     &                 a1 /0.10424745713810881250d0/,
32 c     &                 b1 /-0.02369260389502472656d0/,
33 c     &                 c1 /0.00177694529212685400d0/
34       double precision a /0.49918512123531900000d0/,
35      &                 b /-0.12122755146485599998d0/,
36      &                 c /0.01551177051690300000d0/,
37      &                 a1 /0.41698982855243525000d0/,
38      &                 b1 /-0.14215562337014835936d0/,
39      &                 c1 /0.01421556233701483200d0/
40       if (x.lt.-1.0d0 .and. x.gt.-3.0d0) then
41         xx=(x+3.0d0)**2
42 c        mygaussder=(x+3.0d0)*xx*(4.0d0*a1+xx*(6.0d0*b1+8.0d0*c1*xx))
43         mygaussder=(x+3.0d0)*xx*(a1+xx*(b1+c1*xx))
44       else if (x.ge.-1.0d0 .and. x.le.1.0d0) then
45         xx=x*x
46 c        mygaussder=x*(-1.0d0+xx*(4.0d0*a+xx*(6.0d0*b+xx*8.0d0*c)))
47         mygaussder=x*(-1.0d0+xx*(a+xx*(b+xx*c)))
48       else if (x.gt.1.0d0 .and. x.lt.3.0d0) then
49         xx=(x-3.0d0)**2
50 c        mygaussder=(x-3.0d0)*xx*(4.0d0*a1+xx*(6.0d0*b1+8.0d0*c1*xx))
51         mygaussder=(x-3.0d0)*xx*(a1+xx*(b1+c1*xx))
52       else
53         mygaussder=0.0d0
54       endif
55       return
56       end