+
    i                     n    ^ RI HtHtHtHt ^ RIHt ^ RIHt ^ RI	H
t
Ht ^ RIHt ^ RIHtHt R tR tR	# )
    )FunctionPowsympifyExpr)
Relational)S)Poly	decompose)	func_name)MinMaxc                   a \        V 4      p \        V \        4      '       d   \        V \        4      '       d   \	        R\        V 4      ,          4      hSV P                  9  d   V .# \        V \        \        34      '       d   V P                  '       d-   V P                  \        P                  8X  d   V P                  pMV P                  ^ ,          pVS8X  d   V .# V P                  VS4      .\!        VS4      ,           # \        V \"        \$        34      '       d   \'        V P                  4      pRp\)        V4       Fp  w  rVVP+                  S4      '       g   K  \!        VS4      p\-        V4      ^8X  d   S.V,           pVf   VR,          pMVR,          V8w  d   S.p MV^ ,          W5&   Kr  	  X^ ,          S8X  d   V .# V P.                  ! V!  .V,           # \1        V 4      p\'        \3        V3R lVP4                  4      4      p	\-        V	4      ^8X  dE   V	^ ,          S8w  d7   V P                  V	^ ,          S4      p
V	^ ,          pV
.\!        VS4      ,           #  \7        V 4      #   \8         d    T .u # i ; i)a  
Computes General functional decomposition of ``f``.
Given an expression ``f``, returns a list ``[f_1, f_2, ..., f_n]``,
where::
          f = f_1 o f_2 o ... f_n = f_1(f_2(... f_n))

Note: This is a General decomposition function. It also decomposes
Polynomials. For only Polynomial decomposition see ``decompose`` in polys.

Examples
========

>>> from sympy.abc import x
>>> from sympy import decompogen, sqrt, sin, cos
>>> decompogen(sin(cos(x)), x)
[sin(x), cos(x)]
>>> decompogen(sin(x)**2 + sin(x) + 1, x)
[x**2 + x + 1, sin(x)]
>>> decompogen(sqrt(6*x**2 - 5), x)
[sqrt(x), 6*x**2 - 5]
>>> decompogen(sin(sqrt(cos(x**2 + 1))), x)
[sin(x), sqrt(x), cos(x), x**2 + 1]
>>> decompogen(x**4 + 2*x**3 - x - 1, x)
[x**2 - x - 1, x**2 + x]

zexpecting Expr but got: `%s`N:   NNc                 "   < SV P                   9   # )N)free_symbols)xsymbols   &x/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/solvers/decompogen.py<lambda>decompogen.<locals>.<lambda>M   s    1>>!9    )r   
isinstancer   r   	TypeErrorr   r   r   r   is_Powbaser   Exp1expargssubs
decompogenr   r   list	enumeratehas_freelenfuncr	   filtergensr
   
ValueError)fr   argr   d0iadfpr'   f1f2s   &f          r   r    r    	   s   6 	
Aa*Q
";";61EFFQ^^#s
 !h_%%888!&&(%%C&&)C&=3JsF#$z#v'>>> !c3Z  AFF|dODA::f%%1f%A1v{HqLzrU2" HdDG $ Q46>3J## 
aB9277CDD
4yA~$q'V+VVDGV$!WtjV,,,| s
s   !
I, ,I=<I=c                    \        V 4      ^8X  d
   V ^ ,          # V ^ ,          P                  W^,          4      p\        V 4      ^8X  d   V# \        V.V R,          ,           V4      # )a  
Returns the composition of functions.
Given a list of functions ``g_s``, returns their composition ``f``,
where:
    f = g_1 o g_2 o .. o g_n

Note: This is a General composition function. It also composes Polynomials.
For only Polynomial composition see ``compose`` in polys.

Examples
========

>>> from sympy.solvers.decompogen import compogen
>>> from sympy.abc import x
>>> from sympy import sqrt, sin, cos
>>> compogen([sin(x), cos(x)], x)
sin(cos(x))
>>> compogen([x**2 + x + 1, sin(x)], x)
sin(x)**2 + sin(x) + 1
>>> compogen([sqrt(x), 6*x**2 - 5], x)
sqrt(6*x**2 - 5)
>>> compogen([sin(x), sqrt(x), cos(x), x**2 + 1], x)
sin(sqrt(cos(x**2 + 1)))
>>> compogen([x**2 - x - 1, x**2 + x], x)
-x**2 - x + (x**2 + x)**2 - 1
:   NN)r$   r   compogen)g_sr   foos   && r   r4   r4   [   sU    6 3x1}1v
a&++f!f
%C
3x1}
SECGOV,,r   N)
sympy.corer   r   r   r   sympy.core.relationalr   sympy.core.singletonr   sympy.polysr	   r
   sympy.utilities.miscr   (sympy.functions.elementary.miscellaneousr   r   r    r4    r   r   <module>r>      s&    5 5 , " ' * =Od#-r   