| Server IP : 93.86.61.54 / Your IP : 216.73.216.156 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/sympy/series/__pycache__/ |
Upload File : |
o
�8Va�, � @ s� d dl mZmZmZmZmZmZmZ d dlm Z d dl
mZ d dlm
Z
d dlmZmZ d dlmZ d dlmZ d dlmZ d d
lmZ ddd
�Zdd� ZG dd� de�ZdS )� )�S�Symbol�Add�sympify�Expr� PoleError�Mul)�factor_terms)� factorial)�gamma)�PolynomialError�factor)�Order)�ratsimp)�together� )�gruntz�+c C s t | |||�jdd�S )aQ Computes the limit of ``e(z)`` at the point ``z0``.
Parameters
==========
e : expression, the limit of which is to be taken
z : symbol representing the variable in the limit.
Other symbols are treated as constants. Multivariate limits
are not supported.
z0 : the value toward which ``z`` tends. Can be any expression,
including ``oo`` and ``-oo``.
dir : string, optional (default: "+")
The limit is bi-directional if ``dir="+-"``, from the right
(z->z0+) if ``dir="+"``, and from the left (z->z0-) if
``dir="-"``. For infinite ``z0`` (``oo`` or ``-oo``), the ``dir``
argument is determined from the direction of the infinity
(i.e., ``dir="-"`` for ``oo``).
Examples
========
>>> from sympy import limit, sin, oo
>>> from sympy.abc import x
>>> limit(sin(x)/x, x, 0)
1
>>> limit(1/x, x, 0) # default dir='+'
oo
>>> limit(1/x, x, 0, dir="-")
-oo
>>> limit(1/x, x, 0, dir='+-')
zoo
>>> limit(1/x, x, oo)
0
Notes
=====
First we try some heuristics for easy and frequent cases like "x", "1/x",
"x**2" and similar, so that it's fast. For all other cases, we use the
Gruntz algorithm (see the gruntz() function).
See Also
========
limit_seq : returns the limit of a sequence.
F)�deep)�Limit�doit)�e�z�z0�dir� r �5/usr/lib/python3/dist-packages/sympy/series/limits.py�limit s 3r c s< ddl m� d}t|�tju r-t| �|d| �|tj|tju r!dnd�}t|t �r+dS |S | j
s:| js:| js:| j
�rg }| jD ]X}t||||�}|�tj�r�|jdu r�t| t�rt| �}t|t�set|�}t|t�snt| �}t|t�r|t||||� S dS dS t|t �r� dS |tju r� dS |�|� q?|�r| j|� }|tju r�| j
r�t� fdd�|D ��r�g } g }
tt|��D ]}t|| � �r�| �|| � q�|
�| j| � q�t|
�dkr�t|
� �� }t||||�}|t| � }|tju �rzt| �}
W n t�y Y dS w |
tju �s|
| k�rdS t|
|||�S |S ) a+ Computes the limit of an expression term-wise.
Parameters are the same as for the ``limit`` function.
Works with the arguments of expression ``e`` one by one, computing
the limit of each and then combining the results. This approach
works only for simple limits, but it is fast.
r ��AccumBoundsNr r �-c 3 s � | ]}t |� �V qd S �N)�
isinstance)�.0�rrr r r � <genexpr>f s � zheuristics.<locals>.<genexpr>) �sympy.calculus.utilr �absr �Infinityr �subs�Zeror"