+
    LV-jw  ã                   óX   €  ^ RI t ^ RIHt R tR#   ] d     Li ; i  ] d     Li ; i)é    N©Úxc                óf  a € \        S 4      p\        V 3R l\        V4       4       4      p\        V,          P	                  \        ^ V4      P                  4       pV^ ,          .p\        V4       F0  pVP                  VR,          V,          P                  4       4       K2  	  \        P                  ! ^ 4      .p\        ^V4       F<  pVP                  WE,          P                  \        V^,
          4      V,          4       K>  	  V Uu. uF  p\        P                  ! V4      NK  	  ppV# u upi )at  Given a series

f(x) = a[1]*x + a[2]*x**2 + ... + a[n-1]*x**(n - 1),

use the Lagrange inversion formula to compute a series

g(x) = b[1]*x + b[2]*x**2 + ... + b[n-1]*x**(n - 1)

so that f(g(x)) = g(f(x)) = x mod x**n. We must have a[0] = 0, so
necessarily b[0] = 0 too.

The algorithm is naive and could be improved, but speed isn't an
issue here and it's easy to read.

c              3   óZ   <"  € T F   pSV,          \         V,          ,          x € K"  	  R # 5i)Nr   )Ú.0ÚiÚas   & €Úp/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/scipy/special/_precompute/utils.pyÚ	<genexpr>Ú%lagrange_inversion.<locals>.<genexpr>   s   øé € Ð(™x˜!ˆAˆa�D”�A•�IŠI›xùs   ƒ(+éÿÿÿÿ)ÚlenÚsumÚranger   ÚseriesÚremoveOÚappendÚexpandÚmpÚmpfÚcoeff)r	   ÚnÚfÚhÚhpowerÚkÚbr   s   f       r
   Úlagrange_inversionr      sÞ   ø€ ô  	ˆA‹€AÜÔ(œu QœxÓ(Ó(€AÜ	
ˆ1��‰”Q˜˜1Ó×%Ñ%Ó'€AØ��dˆV€FÜ�1ŽXˆØ�‰�v˜b•z !•|×+Ñ+Ó-Ö.ñ ä	�Š�‹ˆ€AÜ�1�aŽ[ˆØ	�‰�•—‘¤ A¨¥EÓ*¨1Õ,Ö-ñ áÓ™A�qŒ�Š�Ž™A€AÐØ€Hùò 	s   ÄD.)Úmpmathr   ÚImportErrorÚ	sympy.abcr   r   © ó    r
   Ú<module>r$      sA   ðð	Ûð	Ýô
øð ô 	Ùð	ûð
 ô 	Ùð	ús   ‚ ‡ ’›Ÿ)¨)