+
    i+0                        R t ^ RIHtHt ^ RI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Ht R t ! R	 R
]4      tR t ! R R]4      t]	! ^4      tR t ! R R]4      tR t ! R R]4      tR t ! R R]4      t]	! ^
4      tR t ! R R]4      t R t! ! R R]4      t"R t# ! R R]4      t$R  t% ! R! R"]4      t& ! R# R$]4      t' ! R% R&]4      t(R'# )(a#  
This module contains SymPy functions mathcin corresponding to special math functions in the
C standard library (since C99, also available in C++11).

The functions defined in this module allows the user to express functions such as ``expm1``
as a SymPy function for symbolic manipulation.

)ArgumentIndexErrorFunction)Rational)Pow)S)explog)sqrt)BooleanFunctiontruefalsec                 B    \        V 4      \        P                  ,
          # Nr   r   Onexs   &x/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/codegen/cfunctions.py_expm1r      s    q6AEE>    c                   ^   a  ] tR t^t o Rt^tR
R ltR tR t]t	]
R 4       tR tR tRtV tR	# )expm1a  
Represents the exponential function minus one.

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

The benefit of using ``expm1(x)`` over ``exp(x) - 1``
is that the latter is prone to cancellation under finite precision
arithmetic when x is close to zero.

Examples
========

>>> from sympy.abc import x
>>> from sympy.codegen.cfunctions import expm1
>>> '%.0e' % expm1(1e-99).evalf()
'1e-99'
>>> from math import exp
>>> exp(1e-99) - 1
0.0
>>> expm1(x).diff(x)
exp(x)

See Also
========

log1p
c                L    V^8X  d   \        V P                  !  # \        W4      h0
Returns the first derivative of this function.
)r   argsr   selfargindexs   &&r   fdiffexpm1.fdiff4   s$     q=		?"$T44r   c                (    \        V P                  !  # r   )r   r   r   hintss   &,r   _eval_expand_funcexpm1._eval_expand_func=       tyy!!r   c                B    \        V4      \        P                  ,
          # r   r   r   argkwargss   &&,r   _eval_rewrite_as_expexpm1._eval_rewrite_as_exp@   s    3x!%%r   c                h    \         P                  ! V4      pVe   V\        P                  ,
          # R # r   )r   evalr   r   )clsr)   exp_args   && r   r.   
expm1.evalE   s(    ((3-QUU?" r   c                <    V P                   ^ ,          P                  #     )r   is_realr   s   &r   _eval_is_realexpm1._eval_is_realK       yy|###r   c                <    V P                   ^ ,          P                  # r3   )r   	is_finiter6   s   &r   _eval_is_finiteexpm1._eval_is_finiteN   s    yy|%%%r    N   )__name__
__module____qualname____firstlineno____doc__nargsr   r$   r+   _eval_rewrite_as_tractableclassmethodr.   r7   r<   __static_attributes____classdictcell____classdict__s   @r   r   r      sI     8 E5"  "6# #
$& &r   r   c                 B    \        V \        P                  ,           4      # r   )r   r   r   r   s   &r   _log1prN   R   s    q155y>r   c                   p   a  ] tR t^Vt o Rt^tRR ltR tR t]t	]
R 4       tR tR tR tR	 tR
 tRtV tR# )log1pa  
Represents the natural logarithm of a number plus one.

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

The benefit of using ``log1p(x)`` over ``log(x + 1)``
is that the latter is prone to cancellation under finite precision
arithmetic when x is close to zero.

Examples
========

>>> from sympy.abc import x
>>> from sympy.codegen.cfunctions import log1p
>>> from sympy import expand_log
>>> '%.0e' % expand_log(log1p(1e-99)).evalf()
'1e-99'
>>> from math import log
>>> log(1 + 1e-99)
0.0
>>> log1p(x).diff(x)
1/(x + 1)

See Also
========

expm1
c                    V^8X  d>   \         P                  V P                  ^ ,          \         P                  ,           ,          # \        W4      hr   )r   r   r   r   r   s   &&r   r   log1p.fdiffw   s6     q=55$))A,.//$T44r   c                (    \        V P                  !  # r   )rN   r   r"   s   &,r   r$   log1p._eval_expand_func   r&   r   c                    \        V4      # r   )rN   r(   s   &&,r   _eval_rewrite_as_loglog1p._eval_rewrite_as_log       c{r   c                Z   VP                   '       d!   \        V\        P                  ,           4      # VP                  '       g,   \        P
                  ! V\        P                  ,           4      # VP                  '       d*   \        \        V4      \        P                  ,           4      # R # r   )is_Rationalr   r   r   is_Floatr.   	is_numberr   r/   r)   s   &&r   r.   
log1p.eval   sd    ???sQUU{##88C!%%K((]]]x}quu,-- r   c                f    V P                   ^ ,          \        P                  ,           P                  # r3   )r   r   r   is_nonnegativer6   s   &r   r7   log1p._eval_is_real   s    		!quu$444r   c                    V P                   ^ ,          \        P                  ,           P                  '       d   R# V P                   ^ ,          P                  # )r4   F)r   r   r   is_zeror;   r6   s   &r   r<   log1p._eval_is_finite   s6    IIaL155 )))yy|%%%r   c                <    V P                   ^ ,          P                  # r3   )r   is_positiver6   s   &r   _eval_is_positivelog1p._eval_is_positive   s    yy|'''r   c                <    V P                   ^ ,          P                  # r3   )r   rc   r6   s   &r   _eval_is_zerolog1p._eval_is_zero   r9   r   c                <    V P                   ^ ,          P                  # r3   )r   r`   r6   s   &r   _eval_is_nonnegativelog1p._eval_is_nonnegative   s    yy|***r   r>   Nr?   )rA   rB   rC   rD   rE   rF   r   r$   rV   rG   rH   r.   r7   r<   rg   rj   rm   rI   rJ   rK   s   @r   rP   rP   V   sX     : E5" "6. .5&
($+ +r   rP   c                 "    \        \        V 4      # r   )r   _Twor   s   &r   _exp2rq      s    tQ<r   c                   R   a  ] tR t^t o Rt^tRR ltR t]tR t	]
R 4       tRtV tR# )	exp2a  
Represents the exponential function with base two.

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

The benefit of using ``exp2(x)`` over ``2**x``
is that the latter is not as efficient under finite precision
arithmetic.

Examples
========

>>> from sympy.abc import x
>>> from sympy.codegen.cfunctions import exp2
>>> exp2(2).evalf() == 4.0
True
>>> exp2(x).diff(x)
log(2)*exp2(x)

See Also
========

log2
c                R    V^8X  d   V \        \        4      ,          # \        W4      hr   )r   rp   r   r   s   &&r   r   
exp2.fdiff   s$     q=D	>!$T44r   c                    \        V4      # r   )rq   r(   s   &&,r   _eval_rewrite_as_Powexp2._eval_rewrite_as_Pow       Szr   c                (    \        V P                  !  # r   )rq   r   r"   s   &,r   r$   exp2._eval_expand_func       dii  r   c                @    VP                   '       d   \        V4      # R # r   )r\   rq   r]   s   &&r   r.   	exp2.eval   s    ===: r   r>   Nr?   )rA   rB   rC   rD   rE   rF   r   rw   rG   r$   rH   r.   rI   rJ   rK   s   @r   rs   rs      s<     2 E5 "6!  r   rs   c                 @    \        V 4      \        \        4      ,          # r   )r   rp   r   s   &r   _log2r          q6#d)r   c                   X   a  ] tR t^t o Rt^tR	R lt]R 4       tR t	R t
R t]tRtV tR# )
log2a  
Represents the logarithm function with base two.

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

The benefit of using ``log2(x)`` over ``log(x)/log(2)``
is that the latter is not as efficient under finite precision
arithmetic.

Examples
========

>>> from sympy.abc import x
>>> from sympy.codegen.cfunctions import log2
>>> log2(4).evalf() == 2.0
True
>>> log2(x).diff(x)
1/(x*log(2))

See Also
========

exp2
log10
c                    V^8X  d=   \         P                  \        \        4      V P                  ^ ,          ,          ,          # \        W4      hr   )r   r   r   rp   r   r   r   s   &&r   r   
log2.fdiff   6     q=55#d)DIIaL011$T44r   c                    VP                   '       d3   \        P                  ! V\        R 7      pVP                  '       d   V# R# VP
                  '       d$   VP                  \        8X  d   VP                  # R# R# )baseN)r\   r   r.   rp   is_Atomis_Powr   r   r/   r)   results   && r   r.   	log2.eval  R    ===XXc-F~~~ ZZZCHH,77N -Zr   c                L    V P                  \        4      P                  ! V/ VB # r   )rewriter   evalf)r   r   r*   s   &*,r   _eval_evalflog2._eval_evalf  s!    ||C &&777r   c                (    \        V P                  !  # r   )r   r   r"   s   &,r   r$   log2._eval_expand_func  r|   r   c                    \        V4      # r   )r   r(   s   &&,r   rV   log2._eval_rewrite_as_log  ry   r   r>   Nr?   )rA   rB   rC   rD   rE   rF   r   rH   r.   r   r$   rV   rG   rI   rJ   rK   s   @r   r   r      sA     4 E5  8! "6r   r   c                      W,          V,           # r   r>   )r   yzs   &&&r   _fmar     s    37Nr   c                   B   a  ] tR tRt o Rt^tRR ltR tR	R ltRt	V t
R# )
fmai   a\  
Represents "fused multiply add".

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

The benefit of using ``fma(x, y, z)`` over ``x*y + z``
is that, under finite precision arithmetic, the former is
supported by special instructions on some CPUs.

Examples
========

>>> from sympy.abc import x, y, z
>>> from sympy.codegen.cfunctions import fma
>>> fma(x, y, z).diff(x)
y

c                    VR9   d   V P                   ^V,
          ,          # V^8X  d   \        P                  # \        W4      hr   )r@      )r   r   r   r   r   s   &&r   r   	fma.fdiff6  s:     v99Q\**]55L$T44r   c                (    \        V P                  !  # r   )r   r   r"   s   &,r   r$   fma._eval_expand_funcB  s    TYYr   Nc                    \        V4      # r   )r   )r   r)   limitvarr*   s   &&&,r   rG   fma._eval_rewrite_as_tractableE  s    Cyr   r>   r?   r   )rA   rB   rC   rD   rE   rF   r   r$   rG   rI   rJ   rK   s   @r   r   r      s%     & E	5  r   r   c                 @    \        V 4      \        \        4      ,          # r   )r   _Tenr   s   &r   _log10r   L  r   r   c                   R   a  ] tR tRt o Rt^tR	R lt]R 4       tR t	R t
]
tRtV tR# )
log10iP  z
Represents the logarithm function with base ten.

Examples
========

>>> from sympy.abc import x
>>> from sympy.codegen.cfunctions import log10
>>> log10(100).evalf() == 2.0
True
>>> log10(x).diff(x)
1/(x*log(10))

See Also
========

log2
c                    V^8X  d=   \         P                  \        \        4      V P                  ^ ,          ,          ,          # \        W4      hr   )r   r   r   r   r   r   r   s   &&r   r   log10.fdiffe  r   r   c                    VP                   '       d3   \        P                  ! V\        R 7      pVP                  '       d   V# R# VP
                  '       d$   VP                  \        8X  d   VP                  # R# R# r   )r\   r   r.   r   r   r   r   r   r   s   && r   r.   
log10.evalo  r   r   c                (    \        V P                  !  # r   )r   r   r"   s   &,r   r$   log10._eval_expand_funcx  r&   r   c                    \        V4      # r   )r   r(   s   &&,r   rV   log10._eval_rewrite_as_log{  rX   r   r>   Nr?   )rA   rB   rC   rD   rE   rF   r   rH   r.   r$   rV   rG   rI   rJ   rK   s   @r   r   r   P  s<     $ E5  " "6r   r   c                 6    \        V \        P                  4      # r   )r   r   Halfr   s   &r   _Sqrtr     s    q!&&>r   c                   B   a  ] tR tRt o Rt^tRR ltR tR t]t	Rt
V tR# )	Sqrti  a  
Represents the square root function.

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

The reason why one would use ``Sqrt(x)`` over ``sqrt(x)``
is that the latter is internally represented as ``Pow(x, S.Half)`` which
may not be what one wants when doing code-generation.

Examples
========

>>> from sympy.abc import x
>>> from sympy.codegen.cfunctions import Sqrt
>>> Sqrt(x)
Sqrt(x)
>>> Sqrt(x).diff(x)
1/(2*sqrt(x))

See Also
========

Cbrt
c                    V^8X  d3   \        V P                  ^ ,          \        R^4      4      \        ,          # \	        W4      h)r   r   r   r   rp   r   r   s   &&r   r   
Sqrt.fdiff  s6     q=tyy|Xb!_5d::$T44r   c                (    \        V P                  !  # r   )r   r   r"   s   &,r   r$   Sqrt._eval_expand_func  r|   r   c                    \        V4      # r   )r   r(   s   &&,r   rw   Sqrt._eval_rewrite_as_Pow  ry   r   r>   Nr?   rA   rB   rC   rD   rE   rF   r   r$   rw   rG   rI   rJ   rK   s   @r   r   r     s(     2 E5! "6r   r   c                 .    \        V \        ^^4      4      # r?   )r   r   r   s   &r   _Cbrtr     s    q(1a.!!r   c                   B   a  ] tR tRt o Rt^tRR ltR tR t]t	Rt
V tR# )	Cbrti  a  
Represents the cube root function.

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

The reason why one would use ``Cbrt(x)`` over ``cbrt(x)``
is that the latter is internally represented as ``Pow(x, Rational(1, 3))`` which
may not be what one wants when doing code-generation.

Examples
========

>>> from sympy.abc import x
>>> from sympy.codegen.cfunctions import Cbrt
>>> Cbrt(x)
Cbrt(x)
>>> Cbrt(x).diff(x)
1/(3*x**(2/3))

See Also
========

Sqrt
c                    V^8X  d:   \        V P                  ^ ,          \        \        ) ^,          4      4      ^,          # \	        W4      hr   r   r   s   &&r   r   
Cbrt.fdiff  s;     q=tyy|XteAg%6799$T44r   c                (    \        V P                  !  # r   )r   r   r"   s   &,r   r$   Cbrt._eval_expand_func  r|   r   c                    \        V4      # r   )r   r(   s   &&,r   rw   Cbrt._eval_rewrite_as_Pow  ry   r   r>   Nr?   r   rK   s   @r   r   r     s(     2 E5! "6r   r   c                 N    \        \        V ^4      \        V^4      ,           4      # )r   )r	   r   )r   r   s   &&r   _hypotr     s    Aq	C1I%&&r   c                   B   a  ] tR tRt o Rt^tRR ltR tR t]t	Rt
V tR# )	hypoti  a  
Represents the hypotenuse function.

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

The hypotenuse function is provided by e.g. the math library
in the C99 standard, hence one may want to represent the function
symbolically when doing code-generation.

Examples
========

>>> from sympy.abc import x, y
>>> from sympy.codegen.cfunctions import hypot
>>> hypot(3, 4).evalf() == 5.0
True
>>> hypot(x, y)
hypot(x, y)
>>> hypot(x, y).diff(x)
x/hypot(x, y)

c                    VR9   dL   ^V P                   V^,
          ,          ,          \        V P                  ! V P                   !  ,          ,          # \        W4      hr   )r   rp   funcr   r   s   &&r   r   hypot.fdiff  sF     vTYYxz**DDII1F,FGG$T44r   c                (    \        V P                  !  # r   )r   r   r"   s   &,r   r$   hypot._eval_expand_func  r&   r   c                    \        V4      # r   )r   r(   s   &&,r   rw   hypot._eval_rewrite_as_Pow  rX   r   r>   Nr?   r   rK   s   @r   r   r     s(     . E5" "6r   r   c                   4   a  ] tR tRt o ^t]R 4       tRtV tR# )isnani  c                j    V\         P                  J d   \        # VP                  '       d   \        # R # r   )r   NaNr   r\   r   r]   s   &&r   r.   
isnan.eval  s#    !%%<K]]]Lr   r>   N	rA   rB   rC   rD   rF   rH   r.   rI   rJ   rK   s   @r   r   r          E r   r   c                   4   a  ] tR tRt o ^t]R 4       tRtV tR# )isinfi$  c                f    VP                   '       d   \        # VP                  '       d   \        # R # r   )is_infiniter   r;   r   r]   s   &&r   r.   
isinf.eval'  s!    ???K]]]Lr   r>   Nr   rK   s   @r   r   r   $  r   r   r   N))rE   sympy.core.functionr   r   sympy.core.numbersr   sympy.core.powerr   sympy.core.singletonr   &sympy.functions.elementary.exponentialr   r   (sympy.functions.elementary.miscellaneousr	   sympy.logic.boolalgr
   r   r   r   r   rN   rP   rp   rq   rs   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r>   r   r   <module>r      s    = '   " ; 9 < <:&H :&zK+H K+Z 	t18 1h968 96x&( &R 	u.6H .6b+68 +6\",68 ,6^'*6H *6Z
O 

O 
r   