示例#1
0
    def eval(cls, z):
        if z == 0:
            return cls._atzero
        elif z is S.Infinity:
            return cls._atinf
        elif z is S.NegativeInfinity:
            return cls._atneginf

        nz = z.extract_multiplicatively(polar_lift(I))
        if nz is None and cls._trigfunc(0) == 0:
            nz = z.extract_multiplicatively(I)
        if nz is not None:
            return cls._Ifactor(nz, 1)
        nz = z.extract_multiplicatively(polar_lift(-I))
        if nz is not None:
            return cls._Ifactor(nz, -1)

        nz = z.extract_multiplicatively(polar_lift(-1))
        if nz is None and cls._trigfunc(0) == 0:
            nz = z.extract_multiplicatively(-1)
        if nz is not None:
            return cls._minusfactor(nz)

        nz, n = z.extract_branch_factor()
        if n == 0 and nz == z:
            return
        return 2*pi*I*n*cls._trigfunc(0) + cls(nz)
示例#2
0
 def eval(cls, z):
     if not z.is_polar and z.is_negative:
         # Note: is this a good idea?
         return Ei(polar_lift(z)) - pi*I
     nz, n = z.extract_branch_factor()
     if n:
         return Ei(nz) + 2*I*pi*n
示例#3
0
 def _eval_rewrite_as_expint(self, z):
     return -(E1(polar_lift(I)*z) + E1(polar_lift(-I)*z))/2
示例#4
0
 def _eval_rewrite_as_expint(self, z):
     # XXX should we polarify z?
     return pi/2 + (E1(polar_lift(I)*z) - E1(polar_lift(-I)*z))/2/I
示例#5
0
 def _eval_rewrite_as_expint(self, z):
     return -expint(1, polar_lift(-1)*z) - I*pi
示例#6
0
 def _eval_rewrite_as_uppergamma(self, z):
     from sympy import uppergamma
     # XXX this does not currently work usefully because uppergamma
     #     immediately turns into expint
     return -uppergamma(0, polar_lift(-1)*z) - I*pi
示例#7
0
 def _eval_evalf(self, prec):
     if (self.args[0]/polar_lift(-1)).is_positive:
         return Function._eval_evalf(self, prec) + (I*pi)._eval_evalf(prec)
     return Function._eval_evalf(self, prec)
示例#8
0
 def _eval_rewrite_as_expint(self, z):
     # XXX should we polarify z?
     return pi/2 + (E1(polar_lift(I)*z) - E1(polar_lift(-I)*z))/2/I
示例#9
0
 def _eval_rewrite_as_expint(self, z):
     return -(E1(polar_lift(I)*z) + E1(polar_lift(-I)*z))/2
示例#10
0
 def _eval_rewrite_as_expint(self, z):
     return -expint(1, polar_lift(-1)*z) - I*pi
示例#11
0
 def _eval_rewrite_as_uppergamma(self, z):
     from sympy import uppergamma
     # XXX this does not currently work usefully because uppergamma
     #     immediately turns into expint
     return -uppergamma(0, polar_lift(-1)*z) - I*pi
示例#12
0
 def _eval_evalf(self, prec):
     if (self.args[0]/polar_lift(-1)).is_positive:
         return Function._eval_evalf(self, prec) + (I*pi)._eval_evalf(prec)
     return Function._eval_evalf(self, prec)
示例#13
0
文件: test_args.py 项目: Kimay/sympy
def test_sympy__functions__elementary__complexes__polar_lift():
    from sympy.functions.elementary.complexes import polar_lift
    assert _test_args(polar_lift(x))
示例#14
0
def test_sympy__functions__elementary__complexes__polar_lift():
    from sympy.functions.elementary.complexes import polar_lift
    assert _test_args(polar_lift(x))