Question: MeijerG simplifications and numerics

It seems that simplify uses some transformations that aren't generically valid, and evalf relies on those transformations too:

 

nint := (fz, zrng) -> evalf(add(
  int(fz, op(1, zrng) = op([2, i], zrng) .. op([2, i+1], zrng)),
  i = 1 .. nops(op(2, zrng))-1));
f1 := z -> MeijerG([[1/2], []], [[], []], z);

simplify(f1(z));
                       sqrt(1/z) exp(-1/z)

evalf(f1(-1));
                              -9                
               -1.672586379 10   + 2.718281828 I

f1(-1.);
                              -9                
               -1.672586379 10   - 2.718281828 I

nint(GAMMA(1/2+y)*(-1)^y, y = [-infinity-I, -I, I, -infinity+I])/(2*Pi*I);
                             -11                
               6.652676619 10    - 2.718281828 I

So it seems that evalf uses the simplified form, but that form doesn't agree with the definition of MeijerG for negative z. The form that does would be 1/sqrt(z)*exp(-1/z).

 

f2 := z -> MeijerG([[], [1]], [[0, 2], []], z);

simplify(f2(z));
                    exp(-z) z + exp(-z) - 1

evalf(f2(1));
                         -0.2642411177

f2(1.);
                          0.7357588823

nint(GAMMA(-y)*GAMMA(2-y)/GAMMA(1-y), y = [infinity-I, -1-I, -1+I, infinity+I])/(2*Pi*I);
                      0.7357588823 - 0. I

The result of simplify is off by -1. Just evaluating f2(1) doesn't use that transformation rule, but evalf apparently does.

 

Please Wait...