> restart:
> Digits:=20:
> with(Statistics):
> X1:=RandomVariable(Uniform(-1,2)):
> CDF1:=CDF(X1,x1);
> X2:=RandomVariable(Gamma(1/2,2)):
> CDF2:=CDF(X2,x2);
> X3:=RandomVariable(Beta(r,t-r)):
> CDF3:=subs(t3=((x3+1)/3),r=2,t=5,CDF(X3,t3));
> 

                        {     0              x1 < -1
                        {
                        {        x1
                CDF1 := { 1/3 + ----         x1 < 2
                        {        3
                        {
                        {     1             otherwise


              {                 0                        x2 <= 0
      CDF2 := {
              { -exp(-2 x2) - 2 exp(-2 x2) x2 + 1        0 < x2


          {
          {
  CDF3 := {      x3
          { 0 , ---- < -1/3
          {      3

            / x3       \2                          x3
            |---- + 1/3|  hypergeom([2, -2], [3], ---- + 1/3)
            \ 3        /                           3
        1/2 ------------------------------------------------- ,
                               Beta(2, 3)

         x3
        ---- < 2/3
         3

        1 , otherwise

> PHIInv:=Quantile(Normal(0,1),u);

                                                    1/2
              PHIInv := RootOf(-erf(_Z) - 1 + 2 u) 2

> vars:=x1,x2,x3:
> fcns:=T1,T2,T3:
> T:=array(1..3):
> U:=[CDF1,CDF2,CDF3]:
> DT:=array(1..3,1..3):
> D2T:=array(1..3,1..3,1..3):
> T1:=evalf(subs(u=CDF1,PHIInv)):
> T2:=evalf(subs(u=CDF2,PHIInv)):
> T3:=evalf(subs(u=CDF3,PHIInv)):
> for i from 1 to 3 do
>   T[i] := fcns[i]:
> od:
> for i from 1 to 3 do
>   for j from 1 to 3 do
>     DT[i, j] := diff(fcns[j], vars[i]):
>   od:
> od:
> for i from 1 to 3 do
>   for j from 1 to 3 do
>     for k from 1 to 3 do
>       D2T[i, j, k] := diff(diff(fcns[k],vars[j]), vars[i]):
>     od:
>   od:
> od:
> print(map(_x->evalf(subs(x1=1.0,x2=1.0,x3=1.0,_x)),U));
> print(map(_x->evalf(subs(x1=1.0,x2=1.0,x3=1.0,_x)),T));
> print(map(_x->evalf(subs(x1=1.0,x2=1.0,x3=1.0,_x)),DT));
> print(map(_x->evalf(subs(x1=1.0,x2=1.0,x3=1.0,_x)),D2T));
> evalf(subs(x3=1,diff(CDF3,x3$2)));

  [0.66666666666666666666, 0.59399415029016192433,

        0.88888888888888888888]


  [0.43072729929545749018, 0.23783161172327289982,

        1.2206403488473496984]


                  [0.91675891062085696982 , 0. , 0.]
                  [                                ]
                  [0. ,  1.3958657499972168874 , 0.]
                  [                                ]
                  [0. ,  0. , 1.5644348483337176127]


  array(1 .. 3, 1 .. 3, 1 .. 3, [

        (1, 1, 1) = 0.36200342352556526451

        (1, 1, 2) = 0.

        (1, 1, 3) = 0.

        (1, 2, 1) = 0.

        (1, 2, 2) = 0.

        (1, 2, 3) = 0.

        (1, 3, 1) = 0.

        (1, 3, 2) = 0.

        (1, 3, 3) = 0.

        (2, 1, 1) = 0.

        (2, 1, 2) = 0.

        (2, 1, 3) = 0.

        (2, 2, 1) = 0.

        (2, 2, 2) = -0.93246484095220475381

        (2, 2, 3) = 0.

        (2, 3, 1) = 0.

        (2, 3, 2) = 0.

        (2, 3, 3) = 0.

        (3, 1, 1) = 0.

        (3, 1, 2) = 0.

        (3, 1, 3) = 0.

        (3, 2, 1) = 0.

        (3, 2, 2) = 0.

        (3, 2, 3) = 0.

        (3, 3, 1) = 0.

        (3, 3, 2) = 0.

        (3, 3, 3) = 0.6408117548914454467

        ])


                       -0.44444444444444444447

> 
