U
    ;qLe                     @   s  d Z ddlmZmZ ddlmZ ddlmZmZ ddl	m
Z
 ddlmZmZmZmZmZ ddlmZ ddlmZmZ dd	lmZ dd
lmZ ddlmZ ddlmZmZ ddlm Z m!Z!m"Z" ddl#m$Z$m%Z% ddl&m'Z'm(Z(m)Z)m*Z* ddl+m,Z, ddl-m.Z.m/Z/m0Z0 ddl1m2Z2 ddl3m4Z4m5Z5m6Z6m7Z7 ddl8m9Z9 ddl:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZAmBZB ddlCmDZD ddlEmFZFmGZGmHZHmIZImJZJ ddlKmLZL ddlMmNZNmOZO ddlPmQZQ ddlRmSZS ddlTmUZU G d d! d!eVZWG d"d# d#eZXd$d% ZYd&d' ZZeZd(Z[d)d* Z\e[e\d+fd,d-Z]G d.d/ d/eXZ^d0d1 Z_d2d3 Z`G d4d5 d5eaZbd6d7 ZceZd+dkd8d9Zdd:aeG d;d< d<eXZfd=d> ZgeZd+dld?d@ZhG dAdB dBeXZiG dCdD dDeiZjdEdF ZkG dGdH dHeiZldIdJ ZmeZd+dmdKdLZnG dMdN dNeXZoG dOdP dPeoZpdQdR ZqG dSdT dTeoZrdUdV ZsG dWdX dXeoZtdYdZ ZuG d[d\ d\eoZvd]d^ ZweZd+dnd_d`ZxG dadb dbeXZyG dcdd ddeyZzdedf Z{G dgdh dheyZ|didj Z}dd:l~m  mZ ejZejZejZejZd:S )oz Integral Transforms     )reducewraps)repeat)Spi)Add)AppliedUndef	count_opsexpand
expand_mulFunction)Mul)igcdilcm)default_sort_key)Dummy)postorder_traversal)	factorialrf)reargAbs)exp	exp_polar)coshcothsinhtanh)ceiling)MaxMinsqrt)piecewise_fold)coscotsintan)besselj)	Heaviside)gamma)meijerg)	integrateIntegral)_dummy)to_cnf	conjuncts	disjunctsOrAnd)roots)factorPoly)CRootOf)iterable)debugc                       s    e Zd ZdZ fddZ  ZS )IntegralTransformErrora  
    Exception raised in relation to problems computing transforms.

    Explanation
    ===========

    This class is mostly used internally; if integrals cannot be computed
    objects representing unevaluated transforms are usually returned.

    The hint ``needeval=True`` can be used to disable returning transform
    objects, and instead raise this exception if an integral cannot be
    computed.
    c                    s   t  d||f  || _d S )Nz'%s Transform could not be computed: %s.)super__init__function)self	transformr<   msg	__class__ q/home/p21-0144/sympy/latex2sympy2solve-back-end/sympyEq/lib/python3.8/site-packages/sympy/integrals/transforms.pyr;   6   s    
zIntegralTransformError.__init__)__name__
__module____qualname____doc__r;   __classcell__rB   rB   r@   rC   r9   (   s   r9   c                   @   s|   e Zd ZdZedd Zedd Zedd Zedd	 Zd
d Z	dd Z
dd Zdd Zdd Zedd Zdd ZdS )IntegralTransforma}  
    Base class for integral transforms.

    Explanation
    ===========

    This class represents unevaluated transforms.

    To implement a concrete transform, derive from this class and implement
    the ``_compute_transform(f, x, s, **hints)`` and ``_as_integral(f, x, s)``
    functions. If the transform cannot be computed, raise :obj:`IntegralTransformError`.

    Also set ``cls._name``. For instance,

    >>> from sympy import LaplaceTransform
    >>> LaplaceTransform._name
    'Laplace'

    Implement ``self._collapse_extra`` if your function returns more than just a
    number and possibly a convergence condition.
    c                 C   s
   | j d S )z! The function to be transformed. r   argsr=   rB   rB   rC   r<   S   s    zIntegralTransform.functionc                 C   s
   | j d S )z; The dependent variable of the function to be transformed.    rJ   rL   rB   rB   rC   function_variableX   s    z#IntegralTransform.function_variablec                 C   s
   | j d S )z% The independent transform variable.    rJ   rL   rB   rB   rC   transform_variable]   s    z$IntegralTransform.transform_variablec                 C   s   | j j| jh| jh S )zj
        This method returns the symbols that will exist when the transform
        is evaluated.
        )r<   free_symbolsunionrP   rN   rL   rB   rB   rC   rQ   b   s    zIntegralTransform.free_symbolsc                 K   s   t d S NNotImplementedErrorr=   fxshintsrB   rB   rC   _compute_transformk   s    z$IntegralTransform._compute_transformc                 C   s   t d S rS   rT   r=   rW   rX   rY   rB   rB   rC   _as_integraln   s    zIntegralTransform._as_integralc                 C   s$   t | }|dkr t| jjd d|S )NF )r2   r9   rA   name)r=   extracondrB   rB   rC   _collapse_extraq   s    z!IntegralTransform._collapse_extrac                    s   d }t  fdd jtD  }|rfz j j j jf|}W n  tk
rd   td d }Y nX  j}|j	szt
|}||fS )Nc                 3   s   | ]}|  jV  qd S rS   )hasrN   ).0funcrL   rB   rC   	<genexpr>y   s   z2IntegralTransform._try_directly.<locals>.<genexpr>z6[IT _try ] Caught IntegralTransformError, returns None)anyr<   atomsr   r[   rN   rP   r9   r8   is_Addr   )r=   rZ   TZtry_directlyfnrB   rL   rC   _try_directlyw   s&    

 
zIntegralTransform._try_directlyc                    s    dd}  dd}| d< jf  \}}|dk	r<|S |jr<| d<  fdd|jD }g }g }|D ]\}	t|	ts|	g}	||	d  t|	d	kr||	d
  qnt|	d	krn||	d
d g7 }qn|dkrt| 	 }nt| }|s|S z2
|}t|r|ft| W S ||fW S W n tk
r:   Y nX |rTtjjjd|j\}
}|
jt| gtjd
d    S )a  
        Try to evaluate the transform in closed form.

        Explanation
        ===========

        This general function handles linearity, but apart from that leaves
        pretty much everything to _compute_transform.

        Standard hints are the following:

        - ``simplify``: whether or not to simplify the result
        - ``noconds``: if True, do not return convergence conditions
        - ``needeval``: if True, raise IntegralTransformError instead of
                        returning IntegralTransform objects

        The default values of these hints depend on the concrete transform,
        usually the default is
        ``(simplify, noconds, needeval) = (True, False, False)``.
        needevalFsimplifyTNc                    s2   g | ]*}j |gtjd d   jf  qS )rM   N)rA   listrK   doitrd   rX   rZ   r=   rB   rC   
<listcomp>   s   z*IntegralTransform.doit.<locals>.<listcomp>r   rO   rM   )poprl   ri   rK   
isinstancetupleappendlenr   rn   rb   r7   r9   rA   _namer<   as_coeff_mulrN   r   ro   )r=   rZ   rm   rn   rk   rj   resr`   ressrX   coeffrestrB   rr   rC   rp      sR    


  zIntegralTransform.doitc                 C   s   |  | j| j| jS rS   )r]   r<   rN   rP   rL   rB   rB   rC   as_integral   s    zIntegralTransform.as_integralc                 O   s   | j S rS   )r   )r=   rK   kwargsrB   rB   rC   _eval_rewrite_as_Integral   s    z+IntegralTransform._eval_rewrite_as_IntegralN)rD   rE   rF   rG   propertyr<   rN   rP   rQ   r[   r]   rb   rl   rp   r   r   rB   rB   rB   rC   rI   <   s"   



G
rI   c                 C   s4   |r0ddl m} ddlm} ||t| ddS | S )Nr   )rn   )	powdenestT)polar)sympy.simplifyrn   sympy.simplify.powsimpr   r"   )exprrp   rn   r   rB   rB   rC   	_simplify   s
    r   c                    s    fdd}|S )aV  
    This is a decorator generator for dropping convergence conditions.

    Explanation
    ===========

    Suppose you define a function ``transform(*args)`` which returns a tuple of
    the form ``(result, cond1, cond2, ...)``.

    Decorating it ``@_noconds_(default)`` will add a new keyword argument
    ``noconds`` to it. If ``noconds=True``, the return value will be altered to
    be only ``result``, whereas if ``noconds=False`` the return value will not
    be altered.

    The default value of the ``noconds`` keyword will be ``default`` (i.e. the
    argument of this function).
    c                    s   t  d fdd
}|S )Nnocondsc                    s    ||}| r|d S |S Nr   rB   )r   rK   r   r{   re   rB   rC   wrapper   s    
z0_noconds_.<locals>.make_wrapper.<locals>.wrapper)r   )re   r   defaultr   rC   make_wrapper   s    z_noconds_.<locals>.make_wrapperrB   )r   r   rB   r   rC   	_noconds_   s    r   Fc                 C   s   t | |tjtjfS rS   )r+   r   ZeroInfinity)rW   rX   rB   rB   rC   _default_integrator  s    r   Tc                    s   t dd| ||d  |  |}|tsNt|||tjtjftjfS |j	s`t
d| d|jd \}}|trt
d| dfdd	  fd
dt|D }dd |D }|jdd d |st
d| d|d \}}	}
t|||||	f|
fS )z0 Backend function to compute Mellin transforms. rY   zmellin-transformrM   Mellincould not compute integralr   integral in unexpected formc                    sR  ddl m} tj}tj}tj}tt| }tddd}|D ]
}tj}tj}	g }
t	|D ]}|
tdd t |}|jr|jdks| s||s|
|g7 }
qX|||}|jr|jdkr|
|g7 }
qX|j|krt|j|	}	qXt|j|}qX|tjk	r||krt||}q:|	tjk	r8|	|kr8t|	|}q:t|t|
 }q:|||fS )	zN
        Turn ``cond`` into a strip (a, b), and auxiliary conditions.
        r   )_solve_inequalitytT)realc                 S   s   |   d S r   )as_real_imagrX   rB   rB   rC   <lambda>)      z:_mellin_transform.<locals>.process_conds.<locals>.<lambda>)z==z!=)sympy.solvers.inequalitiesr   r   NegativeInfinityr   truer/   r.   r   r0   replacer   subsis_Relationalrel_oprc   ltsr   gtsr    r2   r1   )ra   r   abauxcondsr   ca_b_Zaux_dZd_soln)rY   rB   rC   process_conds  sT    
  



z(_mellin_transform.<locals>.process_condsc                    s   g | ]} |qS rB   rB   rd   r   )r   rB   rC   rs   @  s     z%_mellin_transform.<locals>.<listcomp>c                 S   s   g | ]}|d  dkr|qS )rO   FrB   rq   rB   rB   rC   rs   A  s      c                 S   s   | d | d  t | d fS )Nr   rM   rO   )r	   r   rB   rB   rC   r   B  r   z#_mellin_transform.<locals>.<lambda>keyzno convergence found)r-   rc   r,   r   r   r   r   r   r   is_Piecewiser9   rK   r0   sort)rW   rX   s_
integratorrn   Fra   r   r   r   r   rB   )r   rY   rC   _mellin_transform  s*    
"
  'r   c                   @   s,   e Zd ZdZdZdd Zdd Zdd Zd	S )
MellinTransformz
    Class representing unevaluated Mellin transforms.

    For usage of this class, see the :class:`IntegralTransform` docstring.

    For how to compute Mellin transforms, see the :func:`mellin_transform`
    docstring.
    r   c                 K   s   t |||f|S rS   )r   rV   rB   rB   rC   r[   W  s    z"MellinTransform._compute_transformc                 C   s    t |||d   |tjtjfS NrM   )r,   r   r   r   r\   rB   rB   rC   r]   Z  s    zMellinTransform._as_integralc           	      C   s   g }g }g }|D ]*\\}}}||g7 }||g7 }||g7 }qt | t| ft| f}|d d |d d kdks||d dkrtdd d|S )Nr   rM   TFr   zno combined convergence.)r   r    r2   r9   )	r=   r`   r   r   ra   sasbr   r{   rB   rB   rC   rb   ]  s    

(  zMellinTransform._collapse_extraN)rD   rE   rF   rG   ry   r[   r]   rb   rB   rB   rB   rC   r   K  s
   	r   c                 K   s   t | ||jf |S )a  
    Compute the Mellin transform `F(s)` of `f(x)`,

    .. math :: F(s) = \int_0^\infty x^{s-1} f(x) \mathrm{d}x.

    For all "sensible" functions, this converges absolutely in a strip
      `a < \operatorname{Re}(s) < b`.

    Explanation
    ===========

    The Mellin transform is related via change of variables to the Fourier
    transform, and also to the (bilateral) Laplace transform.

    This function returns ``(F, (a, b), cond)``
    where ``F`` is the Mellin transform of ``f``, ``(a, b)`` is the fundamental strip
    (as above), and ``cond`` are auxiliary convergence conditions.

    If the integral cannot be computed in closed form, this function returns
    an unevaluated :class:`MellinTransform` object.

    For a description of possible hints, refer to the docstring of
    :func:`sympy.integrals.transforms.IntegralTransform.doit`. If ``noconds=False``,
    then only `F` will be returned (i.e. not ``cond``, and also not the strip
    ``(a, b)``).

    Examples
    ========

    >>> from sympy import mellin_transform, exp
    >>> from sympy.abc import x, s
    >>> mellin_transform(exp(-x), x, s)
    (gamma(s), (0, oo), True)

    See Also
    ========

    inverse_mellin_transform, laplace_transform, fourier_transform
    hankel_transform, inverse_hankel_transform
    )r   rp   )rW   rX   rY   rZ   rB   rB   rC   mellin_transforml  s    )r   c                 C   sp   | \}}t |t }t |t }t| | | d  }t|| | | td| | ||  d| t fS )a  
    Re-write the sine function ``sin(m*s + n)`` as gamma functions, compatible
    with the strip (a, b).

    Return ``(gamma1, gamma2, fac)`` so that ``f == fac/(gamma1 * gamma2)``.

    Examples
    ========

    >>> from sympy.integrals.transforms import _rewrite_sin
    >>> from sympy import pi, S
    >>> from sympy.abc import s
    >>> _rewrite_sin((pi, 0), s, 0, 1)
    (gamma(s), gamma(1 - s), pi)
    >>> _rewrite_sin((pi, 0), s, 1, 0)
    (gamma(s - 1), gamma(2 - s), -pi)
    >>> _rewrite_sin((pi, 0), s, -1, 0)
    (gamma(s + 1), gamma(-s), -pi)
    >>> _rewrite_sin((pi, pi/2), s, S(1)/2, S(3)/2)
    (gamma(s - 1/2), gamma(3/2 - s), -pi)
    >>> _rewrite_sin((pi, pi), s, 0, 1)
    (gamma(s), gamma(1 - s), -pi)
    >>> _rewrite_sin((2*pi, 0), s, 0, S(1)/2)
    (gamma(2*s), gamma(1 - 2*s), pi)
    >>> _rewrite_sin((2*pi, 0), s, S(1)/2, 1)
    (gamma(2*s - 1), gamma(2 - 2*s), -pi)
    r   rM   )r   r   r   r   r)   )Zm_nrY   r   r   mnrrB   rB   rC   _rewrite_sin  s
    %r   c                   @   s   e Zd ZdZdS )MellinTransformStripErrorzF
    Exception raised by _rewrite_gamma. Mainly for internal use.
    N)rD   rE   rF   rG   rB   rB   rB   rC   r     s   r   c           -         s  t ||g\  fdd}g }tD ]F}|s<q,|jd }|jrZ|d }|\}}	||g7 }q,tt	t
tD ]J}|sq|jd }|jr|d }|\}}	||t g7 }qdd |D }t j|D ]}
|
js|
 qqfdd|D }tdd	 |D r*js6td
ddttdd |D t j }|krt|dkrp}nttdd |D  }| t j| }t j| } dk	r |9  dk	rЈ|9  \}}t|}t|}tt|tdtt|td }g }g }g }g }g }fdd|r"| \r\|| }}|}n|| }}|}fdd}s|g7 }q4jstt rTjrj!}j }nt"d}j }|j#r}|dk r| }|||fgt$| 7 }q4nL|sH||\}}s*d| }||| g7 }||| g7 }nq4%rXt&}|' dkr|( d }t)|}t||' krt*+|}||g7 }|fdd|D 7 }q4|, \}}||g7 }||  }||r&|t j| d fg7 }|t j| fg7 }n.|dg7 }|t j-|d fg7 }|t j-|fg7 }q4ttr|jd \}}r|dkr|| | dks|dk r|| | dkrt.d|||fg7 }q4ttrTjd }rt|t td|t  t  } }!}"nt/|| \} }!}"||  f|! fg7 }||"g7 }ntt
rjd }|t|ddfttd | dd fg7 }ntt	rЈjd }|ttd | ddfg7 }nNttrjd }|ttd | ddft|dd fg7 }nq4|t| t|  9 }g g g g f\}#}$}%}&||#|%df||&|$dffD ]$\}'}(})|'rb|' \}}|dkr^|dkr^t$t |}|| }*|| }+|j#st0dt1|D ]},|'|*|+|,|  fg7 }'qʈr$|dt d| d  ||t j2   9 }||| g7 }n6|dt d| d  ||t j2    }|||  g7 }qp|dkrx|(3d|  n
|)3| qpqbt| }|#j4t5d |$j4t5d |%j4t5d |&j4t5d |#|$f|%|&f|||fS )a  
    Try to rewrite the product f(s) as a product of gamma functions,
    so that the inverse Mellin transform of f can be expressed as a meijer
    G function.

    Explanation
    ===========

    Return (an, ap), (bm, bq), arg, exp, fac such that
    G((an, ap), (bm, bq), arg/z**exp)*fac is the inverse Mellin transform of f(s).

    Raises IntegralTransformError or MellinTransformStripError on failure.

    It is asserted that f has no poles in the fundamental strip designated by
    (a, b). One of a and b is allowed to be None. The fundamental strip is
    important, because it determines the inversion contour.

    This function can handle exponentials, linear factors, trigonometric
    functions.

    This is a helper function for inverse_mellin_transform that will not
    attempt any transformations on f.

    Examples
    ========

    >>> from sympy.integrals.transforms import _rewrite_gamma
    >>> from sympy.abc import s
    >>> from sympy import oo
    >>> _rewrite_gamma(s*(s+3)*(s-1), s, -oo, oo)
    (([], [-3, 0, 1]), ([-2, 1, 2], []), 1, 1, -1)
    >>> _rewrite_gamma((s-1)**2, s, -oo, oo)
    (([], [1, 1]), ([2, 2], []), 1, 1, 1)

    Importance of the fundamental strip:

    >>> _rewrite_gamma(1/s, s, 0, oo)
    (([1], []), ([], [0]), 1, 1, 1)
    >>> _rewrite_gamma(1/s, s, None, oo)
    (([1], []), ([], [0]), 1, 1, 1)
    >>> _rewrite_gamma(1/s, s, 0, None)
    (([1], []), ([], [0]), 1, 1, 1)
    >>> _rewrite_gamma(1/s, s, -oo, 0)
    (([], [1]), ([0], []), 1, 1, -1)
    >>> _rewrite_gamma(1/s, s, None, 0)
    (([], [1]), ([0], []), 1, 1, -1)
    >>> _rewrite_gamma(1/s, s, -oo, None)
    (([], [1]), ([0], []), 1, 1, -1)

    >>> _rewrite_gamma(2**(-s+3), s, -oo, oo)
    (([], []), ([], []), 1/2, 1, 8)
    c                    s   t t| }  dkr"tjkr"dS  dkr2| k S dkrB|  kS | kdkrRdS |  kdkrbdS |rjdS  js|js|| jrdS tddS )zU
        Decide whether pole at c lies to the left of the fundamental strip.
        NTFzPole inside critical strip?)r
   r   r   r   rQ   r   )r   is_numer)r   r   rB   rC   left  s     z_rewrite_gamma.<locals>.leftr   rM   c                 S   s   g | ]}|j rt|n|qS rB   )is_extended_realr   rq   rB   rB   rC   rs   8  s     z"_rewrite_gamma.<locals>.<listcomp>c                    s   g | ]}|  qS rB   rB   rq   )common_coefficientrB   rC   rs   >  s     c                 s   s   | ]}|j V  qd S rS   )is_Rationalrq   rB   rB   rC   rf   ?  s     z!_rewrite_gamma.<locals>.<genexpr>GammaNzNonrational multiplierc                 S   s   g | ]}t |jqS rB   )r   qrq   rB   rB   rC   rs   B  s   c                 S   s   g | ]}t |jqS rB   )r   prq   rB   rB   rC   rs   I  s     TFc                    s   t d d|  S )NInverse MellinzUnrecognised form '%s'.)r9   )fact)rW   rB   rC   	exceptiona  s    z!_rewrite_gamma.<locals>.exceptionc                    s8   |  s t| }| dkr0 | S )z7 Test if arg is of form a*s+b, raise exception if not. rM   )is_polynomialr5   degree
all_coeffs)r   r   )r   r   rY   rB   rC   
linear_argl  s    

z"_rewrite_gamma.<locals>.linear_argc                    s   g | ]}|  fqS rB   rB   r   )r   rY   rB   rC   rs     s     r   z Gammas partially over the strip.)evaluaterO   za is not an integerr   )6r   rh   r)   rc   rK   ri   as_independentrz   r%   r#   r&   r$   r   Oner   allr   r9   r   r   rx   r   r   as_numer_denomr   	make_argsro   zipr   rt   is_Powru   r   baser   
is_Integerr   r   r5   r   LTr3   r6   	all_rootsr   NegativeOnerU   r   	TypeErrorrangeHalfrw   r   r   )-rW   rY   r   r   r   Zs_multipliersgr   r}   _rX   Zs_multiplierfacexponentnumerdenomrK   facsZdfacsZnumer_gammasZdenom_gammasexponentialsZugammasZlgammasZufacsr   r   Zexp_ra   r   rsr   Zgamma1Zgamma2fac_anapbmbqZgammasplusminusnewaZnewckrB   )r   r   r   r   rW   r   r   rY   rC   _rewrite_gamma  sR   ?










$










 
&

 


&&
r   c              	      sb  t dd| dd| t} t| t| t| fD ]}|jr fdd|jD }dd |D }dd |D }t| } st||	t
d	}||t| f  S z$t|d
 d \}	}
}}}W n tk
r   Y q0Y nX zt|	|
||  }W n tk
r   Y q0Y nX  r&|}nzd
dlm} ||}W n" tk
r`   td| dY nX |jrt|jdkrt
t| |jd
 jd
  t
t| |jd jd
   }tt|j|jt k g}|ttt|jt|jkd
t|jd ktt|j|jt kg7 }t| }|dkr:td| d|| ||f  S td| ddS )zs A helper for the real inverse_mellin_transform function, this one here
        assumes x to be real and positive. r   zinverse-mellin-transformT)positivec              
      s    g | ]}t | d dqS )Fr   )_inverse_mellin_transform)rd   G
as_meijergrY   striprX   rB   rC   rs     s   z-_inverse_mellin_transform.<locals>.<listcomp>c                 S   s   g | ]}|d  qS )rM   rB   rd   r   rB   rB   rC   rs     s     c                 S   s   g | ]}|d  qS )r   rB   r   rB   rB   rC   rs     s     )gensr   rM   )hyperexpandr   zCould not calculate integral   Fzdoes not converger^   N) r-   rewriter)   r4   r   r
   ri   rK   r   rh   r(   r   r2   r   r9   r*   
ValueErrorr   r   rU   r   rx   r   r   argumentdeltar   r1   r   r   r   nu)r   rY   x_r   r   r   r|   r   r{   r   r   Cer   r   hr   ra   rB   r   rC   r     sb    
$

  
*
  r   Nc                   @   sH   e Zd ZdZdZedZedZdd Ze	dd Z
d	d
 Zdd ZdS )InverseMellinTransformz
    Class representing unevaluated inverse Mellin transforms.

    For usage of this class, see the :class:`IntegralTransform` docstring.

    For how to compute inverse Mellin transforms, see the
    :func:`inverse_mellin_transform` docstring.
    r   Noner   c                 K   s4   |d krt j}|d krt j}tj| |||||f|S rS   )r  _none_sentinelrI   __new__)clsr   rY   rX   r   r   optsrB   rB   rC   r  C  s
    zInverseMellinTransform.__new__c                 C   s:   | j d | j d  }}|tjkr$d }|tjkr2d }||fS )Nr     )rK   r  r  )r=   r   r   rB   rB   rC   fundamental_stripJ  s    

z(InverseMellinTransform.fundamental_stripc                 K   s   | dd td kr0tttttttt	t
ttthat|D ].}|jr8||r8|jtkr8td|d| q8| j}t||||f|S )Nrn   Tr   zComponent %s not recognised.)rt   _allowedr   r)   r%   r#   r&   r$   r   r   r   r   r   r   r   is_Functionrc   re   r9   r  r   )r=   r   rY   rX   rZ   rW   r   rB   rB   rC   r[   S  s,              z)InverseMellinTransform._compute_transformc                 C   sJ   | j j}t|||   ||tjtj  |tjtj  fdtj tj  S NrO   )rA   _cr,   r   ImaginaryUnitr   Pi)r=   r   rY   rX   r   rB   rB   rC   r]   c  s     
z#InverseMellinTransform._as_integralN)rD   rE   rF   rG   ry   r   r  r  r  r   r  r[   r]   rB   rB   rB   rC   r  5  s   	
r  c                 K   s    t | |||d |d jf |S )a"  
    Compute the inverse Mellin transform of `F(s)` over the fundamental
    strip given by ``strip=(a, b)``.

    Explanation
    ===========

    This can be defined as

    .. math:: f(x) = \frac{1}{2\pi i} \int_{c - i\infty}^{c + i\infty} x^{-s} F(s) \mathrm{d}s,

    for any `c` in the fundamental strip. Under certain regularity
    conditions on `F` and/or `f`,
    this recovers `f` from its Mellin transform `F`
    (and vice versa), for positive real `x`.

    One of `a` or `b` may be passed as ``None``; a suitable `c` will be
    inferred.

    If the integral cannot be computed in closed form, this function returns
    an unevaluated :class:`InverseMellinTransform` object.

    Note that this function will assume x to be positive and real, regardless
    of the SymPy assumptions!

    For a description of possible hints, refer to the docstring of
    :func:`sympy.integrals.transforms.IntegralTransform.doit`.

    Examples
    ========

    >>> from sympy import inverse_mellin_transform, oo, gamma
    >>> from sympy.abc import x, s
    >>> inverse_mellin_transform(gamma(s), s, x, (0, oo))
    exp(-x)

    The fundamental strip matters:

    >>> f = 1/(s**2 - 1)
    >>> inverse_mellin_transform(f, s, x, (-oo, -1))
    x*(1 - 1/x**2)*Heaviside(x - 1)/2
    >>> inverse_mellin_transform(f, s, x, (-1, 1))
    -x*Heaviside(1 - x)/2 - Heaviside(x - 1)/(2*x)
    >>> inverse_mellin_transform(f, s, x, (1, oo))
    (1/2 - x**2/2)*Heaviside(1 - x)/x

    See Also
    ========

    mellin_transform
    hankel_transform, inverse_hankel_transform
    r   rM   )r  rp   )r   rY   rX   r   rZ   rB   rB   rC   inverse_mellin_transformi  s    5r  c           
      C   s   t ||  t|tj | |  |tjtjf}|tsHt||tj	fS t | |tjtjf}|tjtjtj
fksz|trt|| d|jst|| d|jd \}}	|trt|| dt|||	fS )z
    Compute a general Fourier-type transform

    .. math::

        F(k) = a \int_{-\infty}^{\infty} e^{bixk} f(x)\, dx.

    For suitable choice of *a* and *b*, this reduces to the standard Fourier
    and inverse Fourier transforms.
    z$function not integrable on real axisr   r   r   )r+   r   r   r  r   r   rc   r,   r   r   NaNr9   r   rK   )
rW   rX   r   r   r   r_   rn   r   Z
integral_fra   rB   rB   rC   _fourier_transform  s    .

r  c                   @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )FourierTypeTransformz# Base class for Fourier transforms.c                 C   s   t d| j d S Nz,Class %s must implement a(self) but does notrU   rA   rL   rB   rB   rC   r     s    zFourierTypeTransform.ac                 C   s   t d| j d S Nz,Class %s must implement b(self) but does notr  rL   rB   rB   rC   r     s    zFourierTypeTransform.bc                 K   s"   t ||||  |  | jjf|S rS   )r  r   r   rA   ry   r=   rW   rX   r   rZ   rB   rB   rC   r[     s     z'FourierTypeTransform._compute_transformc                 C   s>   |   }|  }t|| t|tj | |  |tjtjfS rS   )r   r   r,   r   r   r  r   r   )r=   rW   rX   r   r   r   rB   rB   rC   r]     s    z!FourierTypeTransform._as_integralNrD   rE   rF   rG   r   r   r[   r]   rB   rB   rB   rC   r    s
   r  c                   @   s$   e Zd ZdZdZdd Zdd ZdS )FourierTransformz
    Class representing unevaluated Fourier transforms.

    For usage of this class, see the :class:`IntegralTransform` docstring.

    For how to compute Fourier transforms, see the :func:`fourier_transform`
    docstring.
    ZFourierc                 C   s   dS r   rB   rL   rB   rB   rC   r     s    zFourierTransform.ac                 C   s
   dt j S )Nr   r  rL   rB   rB   rC   r     s    zFourierTransform.bNrD   rE   rF   rG   ry   r   r   rB   rB   rB   rC   r"    s   	r"  c                 K   s   t | ||jf |S )a  
    Compute the unitary, ordinary-frequency Fourier transform of ``f``, defined
    as

    .. math:: F(k) = \int_{-\infty}^\infty f(x) e^{-2\pi i x k} \mathrm{d} x.

    Explanation
    ===========

    If the transform cannot be computed in closed form, this
    function returns an unevaluated :class:`FourierTransform` object.

    For other Fourier transform conventions, see the function
    :func:`sympy.integrals.transforms._fourier_transform`.

    For a description of possible hints, refer to the docstring of
    :func:`sympy.integrals.transforms.IntegralTransform.doit`.
    Note that for this transform, by default ``noconds=True``.

    Examples
    ========

    >>> from sympy import fourier_transform, exp
    >>> from sympy.abc import x, k
    >>> fourier_transform(exp(-x**2), x, k)
    sqrt(pi)*exp(-pi**2*k**2)
    >>> fourier_transform(exp(-x**2), x, k, noconds=False)
    (sqrt(pi)*exp(-pi**2*k**2), True)

    See Also
    ========

    inverse_fourier_transform
    sine_transform, inverse_sine_transform
    cosine_transform, inverse_cosine_transform
    hankel_transform, inverse_hankel_transform
    mellin_transform, laplace_transform
    )r"  rp   rW   rX   r   rZ   rB   rB   rC   fourier_transform  s    'r'  c                   @   s$   e Zd ZdZdZdd Zdd ZdS )InverseFourierTransformz
    Class representing unevaluated inverse Fourier transforms.

    For usage of this class, see the :class:`IntegralTransform` docstring.

    For how to compute inverse Fourier transforms, see the
    :func:`inverse_fourier_transform` docstring.
    zInverse Fourierc                 C   s   dS r   rB   rL   rB   rB   rC   r   #  s    zInverseFourierTransform.ac                 C   s
   dt j S r  r$  rL   rB   rB   rC   r   &  s    zInverseFourierTransform.bNr%  rB   rB   rB   rC   r(    s   	r(  c                 K   s   t | ||jf |S )a  
    Compute the unitary, ordinary-frequency inverse Fourier transform of `F`,
    defined as

    .. math:: f(x) = \int_{-\infty}^\infty F(k) e^{2\pi i x k} \mathrm{d} k.

    Explanation
    ===========

    If the transform cannot be computed in closed form, this
    function returns an unevaluated :class:`InverseFourierTransform` object.

    For other Fourier transform conventions, see the function
    :func:`sympy.integrals.transforms._fourier_transform`.

    For a description of possible hints, refer to the docstring of
    :func:`sympy.integrals.transforms.IntegralTransform.doit`.
    Note that for this transform, by default ``noconds=True``.

    Examples
    ========

    >>> from sympy import inverse_fourier_transform, exp, sqrt, pi
    >>> from sympy.abc import x, k
    >>> inverse_fourier_transform(sqrt(pi)*exp(-(pi*k)**2), k, x)
    exp(-x**2)
    >>> inverse_fourier_transform(sqrt(pi)*exp(-(pi*k)**2), k, x, noconds=False)
    (exp(-x**2), True)

    See Also
    ========

    fourier_transform
    sine_transform, inverse_sine_transform
    cosine_transform, inverse_cosine_transform
    hankel_transform, inverse_hankel_transform
    mellin_transform, laplace_transform
    )r(  rp   r   r   rX   rZ   rB   rB   rC   inverse_fourier_transform*  s    'r*  c           
      C   s   t ||  ||| |  |tjtjf}|tsBt||tjfS |jsTt	|| d|j
d \}}	|trxt	|| dt|||	fS )a  
    Compute a general sine or cosine-type transform
        F(k) = a int_0^oo b*sin(x*k) f(x) dx.
        F(k) = a int_0^oo b*cos(x*k) f(x) dx.

    For suitable choice of a and b, this reduces to the standard sine/cosine
    and inverse sine/cosine transforms.
    r   r   r   )r+   r   r   r   rc   r,   r   r   r   r9   rK   )
rW   rX   r   r   r   Kr_   rn   r   ra   rB   rB   rC   _sine_cosine_transformX  s    
(

r,  c                   @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )SineCosineTypeTransformzK
    Base class for sine and cosine transforms.
    Specify cls._kern.
    c                 C   s   t d| j d S r  r  rL   rB   rB   rC   r   w  s    zSineCosineTypeTransform.ac                 C   s   t d| j d S r  r  rL   rB   rB   rC   r   {  s    zSineCosineTypeTransform.bc                 K   s(   t ||||  |  | jj| jjf|S rS   )r,  r   r   rA   _kernry   r   rB   rB   rC   r[     s     z*SineCosineTypeTransform._compute_transformc                 C   s@   |   }|  }| jj}t|| ||| |  |tjtjfS rS   )r   r   rA   r.  r,   r   r   r   )r=   rW   rX   r   r   r   r+  rB   rB   rC   r]     s    z$SineCosineTypeTransform._as_integralNr!  rB   rB   rB   rC   r-  q  s
   r-  c                   @   s(   e Zd ZdZdZeZdd Zdd ZdS )SineTransformz
    Class representing unevaluated sine transforms.

    For usage of this class, see the :class:`IntegralTransform` docstring.

    For how to compute sine transforms, see the :func:`sine_transform`
    docstring.
    ZSinec                 C   s   t dt t S r  r!   r   rL   rB   rB   rC   r     s    zSineTransform.ac                 C   s   t jS rS   r   r   rL   rB   rB   rC   r     s    zSineTransform.bN	rD   rE   rF   rG   ry   r%   r.  r   r   rB   rB   rB   rC   r/    s
   	r/  c                 K   s   t | ||jf |S )a1  
    Compute the unitary, ordinary-frequency sine transform of `f`, defined
    as

    .. math:: F(k) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty f(x) \sin(2\pi x k) \mathrm{d} x.

    Explanation
    ===========

    If the transform cannot be computed in closed form, this
    function returns an unevaluated :class:`SineTransform` object.

    For a description of possible hints, refer to the docstring of
    :func:`sympy.integrals.transforms.IntegralTransform.doit`.
    Note that for this transform, by default ``noconds=True``.

    Examples
    ========

    >>> from sympy import sine_transform, exp
    >>> from sympy.abc import x, k, a
    >>> sine_transform(x*exp(-a*x**2), x, k)
    sqrt(2)*k*exp(-k**2/(4*a))/(4*a**(3/2))
    >>> sine_transform(x**(-a), x, k)
    2**(1/2 - a)*k**(a - 1)*gamma(1 - a/2)/gamma(a/2 + 1/2)

    See Also
    ========

    fourier_transform, inverse_fourier_transform
    inverse_sine_transform
    cosine_transform, inverse_cosine_transform
    hankel_transform, inverse_hankel_transform
    mellin_transform, laplace_transform
    )r/  rp   r&  rB   rB   rC   sine_transform  s    $r3  c                   @   s(   e Zd ZdZdZeZdd Zdd ZdS )InverseSineTransformz
    Class representing unevaluated inverse sine transforms.

    For usage of this class, see the :class:`IntegralTransform` docstring.

    For how to compute inverse sine transforms, see the
    :func:`inverse_sine_transform` docstring.
    zInverse Sinec                 C   s   t dt t S r  r0  rL   rB   rB   rC   r     s    zInverseSineTransform.ac                 C   s   t jS rS   r1  rL   rB   rB   rC   r     s    zInverseSineTransform.bNr2  rB   rB   rB   rC   r4    s
   	r4  c                 K   s   t | ||jf |S )am  
    Compute the unitary, ordinary-frequency inverse sine transform of `F`,
    defined as

    .. math:: f(x) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty F(k) \sin(2\pi x k) \mathrm{d} k.

    Explanation
    ===========

    If the transform cannot be computed in closed form, this
    function returns an unevaluated :class:`InverseSineTransform` object.

    For a description of possible hints, refer to the docstring of
    :func:`sympy.integrals.transforms.IntegralTransform.doit`.
    Note that for this transform, by default ``noconds=True``.

    Examples
    ========

    >>> from sympy import inverse_sine_transform, exp, sqrt, gamma
    >>> from sympy.abc import x, k, a
    >>> inverse_sine_transform(2**((1-2*a)/2)*k**(a - 1)*
    ...     gamma(-a/2 + 1)/gamma((a+1)/2), k, x)
    x**(-a)
    >>> inverse_sine_transform(sqrt(2)*k*exp(-k**2/(4*a))/(4*sqrt(a)**3), k, x)
    x*exp(-a*x**2)

    See Also
    ========

    fourier_transform, inverse_fourier_transform
    sine_transform
    cosine_transform, inverse_cosine_transform
    hankel_transform, inverse_hankel_transform
    mellin_transform, laplace_transform
    )r4  rp   r)  rB   rB   rC   inverse_sine_transform  s    %r5  c                   @   s(   e Zd ZdZdZeZdd Zdd ZdS )CosineTransformz
    Class representing unevaluated cosine transforms.

    For usage of this class, see the :class:`IntegralTransform` docstring.

    For how to compute cosine transforms, see the :func:`cosine_transform`
    docstring.
    ZCosinec                 C   s   t dt t S r  r0  rL   rB   rB   rC   r     s    zCosineTransform.ac                 C   s   t jS rS   r1  rL   rB   rB   rC   r     s    zCosineTransform.bN	rD   rE   rF   rG   ry   r#   r.  r   r   rB   rB   rB   rC   r6    s
   	r6  c                 K   s   t | ||jf |S )a:  
    Compute the unitary, ordinary-frequency cosine transform of `f`, defined
    as

    .. math:: F(k) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty f(x) \cos(2\pi x k) \mathrm{d} x.

    Explanation
    ===========

    If the transform cannot be computed in closed form, this
    function returns an unevaluated :class:`CosineTransform` object.

    For a description of possible hints, refer to the docstring of
    :func:`sympy.integrals.transforms.IntegralTransform.doit`.
    Note that for this transform, by default ``noconds=True``.

    Examples
    ========

    >>> from sympy import cosine_transform, exp, sqrt, cos
    >>> from sympy.abc import x, k, a
    >>> cosine_transform(exp(-a*x), x, k)
    sqrt(2)*a/(sqrt(pi)*(a**2 + k**2))
    >>> cosine_transform(exp(-a*sqrt(x))*cos(a*sqrt(x)), x, k)
    a*exp(-a**2/(2*k))/(2*k**(3/2))

    See Also
    ========

    fourier_transform, inverse_fourier_transform,
    sine_transform, inverse_sine_transform
    inverse_cosine_transform
    hankel_transform, inverse_hankel_transform
    mellin_transform, laplace_transform
    )r6  rp   r&  rB   rB   rC   cosine_transform  s    $r8  c                   @   s(   e Zd ZdZdZeZdd Zdd ZdS )InverseCosineTransformz
    Class representing unevaluated inverse cosine transforms.

    For usage of this class, see the :class:`IntegralTransform` docstring.

    For how to compute inverse cosine transforms, see the
    :func:`inverse_cosine_transform` docstring.
    zInverse Cosinec                 C   s   t dt t S r  r0  rL   rB   rB   rC   r   L  s    zInverseCosineTransform.ac                 C   s   t jS rS   r1  rL   rB   rB   rC   r   O  s    zInverseCosineTransform.bNr7  rB   rB   rB   rC   r9  ?  s
   	r9  c                 K   s   t | ||jf |S )a(  
    Compute the unitary, ordinary-frequency inverse cosine transform of `F`,
    defined as

    .. math:: f(x) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty F(k) \cos(2\pi x k) \mathrm{d} k.

    Explanation
    ===========

    If the transform cannot be computed in closed form, this
    function returns an unevaluated :class:`InverseCosineTransform` object.

    For a description of possible hints, refer to the docstring of
    :func:`sympy.integrals.transforms.IntegralTransform.doit`.
    Note that for this transform, by default ``noconds=True``.

    Examples
    ========

    >>> from sympy import inverse_cosine_transform, sqrt, pi
    >>> from sympy.abc import x, k, a
    >>> inverse_cosine_transform(sqrt(2)*a/(sqrt(pi)*(a**2 + k**2)), k, x)
    exp(-a*x)
    >>> inverse_cosine_transform(1/sqrt(k), k, x)
    1/sqrt(x)

    See Also
    ========

    fourier_transform, inverse_fourier_transform,
    sine_transform, inverse_sine_transform
    cosine_transform
    hankel_transform, inverse_hankel_transform
    mellin_transform, laplace_transform
    )r9  rp   r)  rB   rB   rC   inverse_cosine_transformS  s    $r:  c                 C   s   t | t|||  | |tjtjf}|ts@t||tjfS |j	sRt
|| d|jd \}}|trvt
|| dt|||fS )zv
    Compute a general Hankel transform

    .. math:: F_\nu(k) = \int_{0}^\infty f(r) J_\nu(k r) r \mathrm{d} r.
    r   r   r   )r+   r'   r   r   r   rc   r,   r   r   r   r9   rK   )rW   r   r   r  r_   rn   r   ra   rB   rB   rC   _hankel_transform~  s    &

r;  c                   @   s4   e Zd ZdZdd Zdd Zdd Zedd	 Zd
S )HankelTypeTransformz+
    Base class for Hankel transforms.
    c                 K   s    | j | j| j| j| jd f|S Nr  )r[   r<   rN   rP   rK   )r=   rZ   rB   rB   rC   rp     s    zHankelTypeTransform.doitc                 K   s   t ||||| jf|S rS   )r;  ry   )r=   rW   r   r   r  rZ   rB   rB   rC   r[     s    z&HankelTypeTransform._compute_transformc                 C   s&   t |t|||  | |tjtjfS rS   )r,   r'   r   r   r   )r=   rW   r   r   r  rB   rB   rC   r]     s    z HankelTypeTransform._as_integralc                 C   s   |  | j| j| j| jd S r=  )r]   r<   rN   rP   rK   rL   rB   rB   rC   r     s
    zHankelTypeTransform.as_integralN)	rD   rE   rF   rG   rp   r[   r]   r   r   rB   rB   rB   rC   r<    s   r<  c                   @   s   e Zd ZdZdZdS )HankelTransformz
    Class representing unevaluated Hankel transforms.

    For usage of this class, see the :class:`IntegralTransform` docstring.

    For how to compute Hankel transforms, see the :func:`hankel_transform`
    docstring.
    ZHankelNrD   rE   rF   rG   ry   rB   rB   rB   rC   r>    s   	r>  c                 K   s   t | |||jf |S )a  
    Compute the Hankel transform of `f`, defined as

    .. math:: F_\nu(k) = \int_{0}^\infty f(r) J_\nu(k r) r \mathrm{d} r.

    Explanation
    ===========

    If the transform cannot be computed in closed form, this
    function returns an unevaluated :class:`HankelTransform` object.

    For a description of possible hints, refer to the docstring of
    :func:`sympy.integrals.transforms.IntegralTransform.doit`.
    Note that for this transform, by default ``noconds=True``.

    Examples
    ========

    >>> from sympy import hankel_transform, inverse_hankel_transform
    >>> from sympy import exp
    >>> from sympy.abc import r, k, m, nu, a

    >>> ht = hankel_transform(1/r**m, r, k, nu)
    >>> ht
    2*k**(m - 2)*gamma(-m/2 + nu/2 + 1)/(2**m*gamma(m/2 + nu/2))

    >>> inverse_hankel_transform(ht, k, r, nu)
    r**(-m)

    >>> ht = hankel_transform(exp(-a*r), r, k, 0)
    >>> ht
    a/(k**3*(a**2/k**2 + 1)**(3/2))

    >>> inverse_hankel_transform(ht, k, r, 0)
    exp(-a*r)

    See Also
    ========

    fourier_transform, inverse_fourier_transform
    sine_transform, inverse_sine_transform
    cosine_transform, inverse_cosine_transform
    inverse_hankel_transform
    mellin_transform, laplace_transform
    )r>  rp   )rW   r   r   r  rZ   rB   rB   rC   hankel_transform  s    .r@  c                   @   s   e Zd ZdZdZdS )InverseHankelTransformz
    Class representing unevaluated inverse Hankel transforms.

    For usage of this class, see the :class:`IntegralTransform` docstring.

    For how to compute inverse Hankel transforms, see the
    :func:`inverse_hankel_transform` docstring.
    zInverse HankelNr?  rB   rB   rB   rC   rA    s   	rA  c                 K   s   t | |||jf |S )a  
    Compute the inverse Hankel transform of `F` defined as

    .. math:: f(r) = \int_{0}^\infty F_\nu(k) J_\nu(k r) k \mathrm{d} k.

    Explanation
    ===========

    If the transform cannot be computed in closed form, this
    function returns an unevaluated :class:`InverseHankelTransform` object.

    For a description of possible hints, refer to the docstring of
    :func:`sympy.integrals.transforms.IntegralTransform.doit`.
    Note that for this transform, by default ``noconds=True``.

    Examples
    ========

    >>> from sympy import hankel_transform, inverse_hankel_transform
    >>> from sympy import exp
    >>> from sympy.abc import r, k, m, nu, a

    >>> ht = hankel_transform(1/r**m, r, k, nu)
    >>> ht
    2*k**(m - 2)*gamma(-m/2 + nu/2 + 1)/(2**m*gamma(m/2 + nu/2))

    >>> inverse_hankel_transform(ht, k, r, nu)
    r**(-m)

    >>> ht = hankel_transform(exp(-a*r), r, k, 0)
    >>> ht
    a/(k**3*(a**2/k**2 + 1)**(3/2))

    >>> inverse_hankel_transform(ht, k, r, 0)
    exp(-a*r)

    See Also
    ========

    fourier_transform, inverse_fourier_transform
    sine_transform, inverse_sine_transform
    cosine_transform, inverse_cosine_transform
    hankel_transform
    mellin_transform, laplace_transform
    )rA  rp   )r   r   r   r  rZ   rB   rB   rC   inverse_hankel_transform  s    .rB  )F)T)T)T)rG   	functoolsr   r   	itertoolsr   
sympy.corer   r   sympy.core.addr   sympy.core.functionr   r	   r
   r   r   sympy.core.mulr   sympy.core.numbersr   r   sympy.core.sortingr   sympy.core.symbolr   sympy.core.traversalr   (sympy.functions.combinatorial.factorialsr   r   $sympy.functions.elementary.complexesr   r   r   &sympy.functions.elementary.exponentialr   r   %sympy.functions.elementary.hyperbolicr   r   r   r   #sympy.functions.elementary.integersr   (sympy.functions.elementary.miscellaneousr   r    r!   $sympy.functions.elementary.piecewiser"   (sympy.functions.elementary.trigonometricr#   r$   r%   r&   sympy.functions.special.besselr'   'sympy.functions.special.delta_functionsr(   'sympy.functions.special.gamma_functionsr)   sympy.functions.special.hyperr*   sympy.integralsr+   r,   Zsympy.integrals.meijerintr-   sympy.logic.boolalgr.   r/   r0   r1   r2   sympy.polys.polyrootsr3   sympy.polys.polytoolsr4   r5   sympy.polys.rootoftoolsr6   sympy.utilities.iterablesr7   sympy.utilities.miscr8   rU   r9   rI   r   r   Z_nocondsr   r   r   r   r   r  r   r   r   r  r  r  r  r  r"  r'  r(  r*  r,  r-  r/  r3  r4  r5  r6  r8  r9  r:  r;  r<  r>  r@  rA  rB  Zsympy.integrals.laplace	integralsZlaplaceZ_laplaceLaplaceTransformlaplace_transformInverseLaplaceTransforminverse_laplace_transformrB   rB   rB   rC   <module>   s    D!,-  -:4<*.'('+16