+
    LV-j¬N  ã                   ó^  € ^ RI t^ RIt^ RIHu Ht ^ RIH	t	 ^€t
]P                  ! ]P                  ! ^4      ]
4      t]P                  ! ]P                  ! ^4      ]
) 4      t]P                  ! ^]P                   ,          4      t]P$                  ! ^]P                   ,          4      tRt]P                  ! ^4      t]P                   ^,          t]P                   ^,          t]P                   ^,          t. ROtR tR tRR ltRR ltR tRR ltRR	 lt RR
 lt!R t"R t#RR lt$R t%RR lt&R# )é    N)Ú_derivativec                 óÚ   € R V ,          p\         P                  ! V 4      ^,          V ,
          \        ^,          ,           V\         P                  ! \        W,          4      ,          ,           # )ç      ð?)ÚnpÚlogÚ_LOG_2PIÚpolyvalÚ_STIRLING_COEFFS)ÚnÚrns   & Úe/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/scipy/stats/_ksstats.pyÚ_log_nfactorial_div_n_pow_nr   ]   sD   € ð 
ˆQ�€BÜ�6Š6�!‹9�Q�;˜�?œX a�ZÕ'¨"¬r¯zªzÔ:JÈBÍDÓ/QÕ*QÕQÐQó    c                ó2   € \         P                  ! V RR4      # )z%clips a probability to range 0<=p<=1.ç        r   )r   Úclip)Úps   &r   Ú
_clip_probr   g   s   € ä�7Š7�1�c˜3ÓÐr   c                óF   € \         P                  ! W V4      p\        V4      # )z>Selects either the CDF or SF, and then clips to range 0<=p<=1.)r   Úwherer   )ÚcdfprobÚsfprobÚcdfr   s   &&& r   Ú_select_and_clip_probr   l   s   € ä
�Š�˜vÓ&€AÜ�a‹=Ðr   c                óP  € VR8¼  d   \        RRV4      # W,          pVR8:  d   \        RRV4      # \        \        P                  ! V4      4      pWC,
          p^V,          ^,
          p\        P                  ! Wf.4      p\        P
                  ! ^V^,           4      pRWX,          ,
          p	\        P                  ! V4      p
RpV F1  pWºV^,
          &   W¼,          pWœ^,
          ;;,          V,          uu&   K3  	  \        ^V,          R,
          ^ 4      V,          ^WV,          ,          ,
          pRV,           V,          V	R&   \        ^V4       F"  pV
RWn,
          ^,            W~^,
          R1V3&   K$  	  W—R&   \        P                  ! V	^ R7      VR&   \        P                  ! \        P                  ! V4      ^ ,          4      pT p^ p^ pV^ 8”  d¨   V^,          '       d    \        P                  ! W÷4      pVV,          p\        P                  ! Ww4      pV^,          p\        P                  ! Wt^,
          V^,
          3,          4      \        8”  d   V\        ,          pV\        ,          pV^,          pK®  Wô^,
          V^,
          3,          p\        ^V ^,           4       FN  pVV,          V ,          p\        P                  ! V4      \         8  g   K4  V\        ,          pV\        ,          pKP  	  V^ 8w  d   \        P"                  ! VV4      p\        VRV,
          V4      # )	z›Computes the Kolmogorov CDF:  Pr(D_n <= d) using the MTW approach to
the Durbin matrix algorithm.

Durbin (1968); Marsaglia, Tsang, Wang (2003). [1], [3].
r   r   ç      à?N)Úaxiséÿÿÿÿ)ºNNNr   )r   r   )r   Úintr   ÚceilÚzerosÚarangeÚemptyÚmaxÚrangeÚflipÚeyeÚshapeÚmatmulÚabsÚ_EP128Ú_E128Ú_EM128Úldexp)r   Údr   ÚndÚkÚhÚmÚHÚintmÚvÚwÚfacÚjÚttÚiÚHpwrÚnnÚexpntÚHexpntr   s   &&&                 r   Ú_kolmogn_DMTWrA   r   sp  € ð 	ˆC„xÜ$ S¨#¨sÓ3Ð3Ø	
�€BØ	ˆS„yÜ$ S¨#¨sÓ3Ð3ÜŒB�GŠG�B‹KÓ€AØ	�€AØ	ˆA���	€Aä
�Š�!�Ó€Aô �9Š9�Q˜˜A�Ó€DØˆa�i�€AÜ
�Š�‹€AØ
€CÛˆØˆ!ˆa�%‰Ø�ˆØ	ˆa�%��C��ñ ô 
ˆQ��U�S�[˜!Ó	˜aÕ	 ! A¥D¥&Õ	(€BØ�2�X˜Õ€A€b�Eä�1�aŽ[ˆØ˜˜!�% !�)�}ˆˆa�%‰&�!ˆ)‹ñ à€d�GÜ�wŠw�q˜qÔ!€A€e�Hä�6Š6”"—(’(˜1“+˜a•.Ó!€DØ	
€BØ€EØ€FØ
ˆqŒ&Ø��6Œ6Ü—9’9˜TÓ%ˆDØ�V�OˆEÜ�IŠI�a‹OˆØ�!�ˆä�6Š6�!˜•E˜1˜q�5�L•/Ó"¤VÔ+Ø”�KˆAØ”e�OˆFØ�1�WŠà��U�A˜•Eˆ\Õ€Aô �1�a˜!•eŽ_ˆØ��E�A�IˆÜ�6Š6�!‹9”vÖØ”�KˆAØ”U�NŠEñ	 ð �„zÜ�HŠH�Q˜Óˆä   C¨¥E¨3Ó/Ð/r   c                ó  € V ^ 8X  d!   V) V,
          ^,
          W#,           ^,
          reM¼\        V ^,           ^4      w  rxV^ 8X  du   Wq^,           8X  d-   W,
          V,
          ^,
          W,           V,           ^,
          reMgV^,
          V,
          V,
          ^,
          Wr,           ^,
          V,           ^,
          reM,V^,
          V,
          ^,
          Wr,           V,           ^,
          re\        V^,           ^ 4      \        Wa4      3# )z0Compute the endpoints of the interval for row i.)Údivmodr%   Úmin)	r<   r   ÚllÚceilfÚroundfÚj1Új2Úip1div2Úip1mod2s	   &&&&&    r   Ú_pomeranz_compute_j1j2rL   ½   sÉ   € àˆA„vØ��u•˜q• "¥*¨q¥.‰Bô " ! a¥%¨Ó+ÑˆØ�aŒ<Ø˜a�%ÔØ� %�¨!Õ+¨Q­V°e­^¸aÕ-?‘Bà  1� rÕ)¨FÕ2°QÕ6¸½ÀqÕ8HÈ5Õ8PÐSTÕ8T‘Bà˜q•[ 2Õ%¨Õ)¨7­<¸&Õ+@À1Õ+D�äˆr�A�v�q‹>œ3˜r›:Ð%Ð%r   c                ó*  € W,          p\        \        P                  ! V4      4      pRW4,
          ,          p\        VRV,
          4      pV^ 8”  d   ^M^ pVR8”  d   ^M^ p^V^,           ,          p	\        P                  ! V	4      p
\        P                  ! V	4      p\        P                  ! V	4      pRV
^ &   RV^ &   RV^ &   ^ pW`,          ^V,          V ,          ^^V,          ,
          V ,          prþ\        ^V	4       Ff  pV
V^,
          ,          V,          V,          V
V&   VV^,
          ,          V,          V,          VV&   VV^,
          ,          V,          V,          VV&   Kh  	  \        P                  ! V	.4      p\        P                  ! V	.4      p^V^ &   ^ ^ pp\        ^ WWx4      w  pp\        ^^V ,          ^,           4       EF(  pTpTTppTTppVP                  R4       \        VWWx4      w  ppV^8X  g   V^V ,          ^,           8X  d   T
pMV^,          '       d   TMTpVV,
          ^,           pV^ 8”  g   Kz  \        P                  ! VVV,
          VV,
          V,            VRV 4      pVV,
          pVV,
          ^,           pVVVV,            VRV% ^ \        P                  ! V4      u;8  d   \        8  d   M MV\        ,          pV\        ,          pVV,           V,
          pEK+  	  VV V,
          ,          p\        ^V ^,           4       FE  p\        P                  ! V4      \        8”  d   V\        ,          pV\        ,          pVV,          pKG  	  V^ 8w  d   \        P                  ! VV4      p\!        VRV,
          V4      pV# )zSComputes Pr(D_n <= d) using the Pomeranz recursion algorithm.

Pomeranz (1974) [2]
r   r   r   N)r    r   ÚfloorrD   r$   r&   r"   rL   ÚfillÚconvolver%   r.   r,   r-   r+   r/   r   ) r   Úxr   ÚtrE   ÚfÚgrF   rG   ÚnpwrsÚgpowerÚ	twogpowerÚonem2gpowerr?   Úg_over_nÚtwo_g_over_nÚone_minus_two_g_over_nr4   ÚV0ÚV1ÚV0sÚV1srH   rI   r<   Úk1ÚpwrsÚln2ÚconvÚ
conv_startÚconv_lenÚanss    &&&                             r   Ú_kolmogn_Pomeranzrg   Ï   s  € ð$ 	
�€AÜ	ŒR�XŠX�a‹[Ó	€BØˆq�v�€AÜˆAˆs�Q�w‹€AØ�a”%‰Q˜Q€EØ�s”7‰a €FØ��a•�L€EÜ�XŠX�e‹_€FÜ—’˜“€IÜ—(’(˜5“/€Kð €Fˆ1�IØ€Iˆa�LØ€K��NØ€EØ56µS¸!¸A½#¸a½%À!ÀaÈÅcÅ'È1ÅÐ2ˆlÜ�1�eŽ_ˆØ˜1˜q�5•M HÕ,¨qÕ0ˆˆq‰	Ø   Q¥Õ'¨,Õ6¸Õ:ˆ	�!‰Ø$ Q¨¥UÕ+Ð.DÕDÀqÕHˆ�A‹ñ ô
 
�Š�5�'Ó	€BÜ	�Š�5�'Ó	€BØ€B€q�EØ�!ˆ€Cä# A q¨eÓ<�F€BˆÜ�1�a˜!•e˜a•i× ˆàˆØ�RˆBˆØ˜ˆSˆØ
�‰�ŒÜ'¨¨1°%Ó@‰ˆˆBØ�Œ6�Q˜!˜a�% !�)”^Ø‰Dà!" Q§¤‘I¨KˆDØ�2�g˜�kˆØ�Ž7Ü—;’;˜r " s¥(¨2°­8°c­>Ð:¸DÀÀ#¸JÓGˆDØ˜b�ˆJØ˜B•w •{ˆHØ  ¨J¸Õ,AÐBˆBˆy�ˆMà”2—6’6˜"“:Ö&¤×&Ø”f•�Øœ•�Ø˜•(˜R•-‹Cñ+ !ð0 ˆQ��W�+€CÜ�1�a˜!•eŽ_ˆÜ�6Š6�#‹;œÔØ”6�MˆCØ”U�NˆEØˆq�Šñ	 ð �„zÜ�hŠh�s˜EÓ"ˆÜ
  S¨3¥Y°Ó
4€CØ€Jr   c           	     óø	  € VR8:  d   \        RRVR7      # VR8¼  d   \        RRVR7      # \        P                  ! V 4      V,          pV^,          V^,          V^,          V^,          3w  rErg\        ) ^,          V,          pV\        8  d   \        RRVR7      # \        P
                  ! V4      p	V) p
\        ^,          p^V,          ^V,          ,           p^V,          ^V,          ,
          \        ,          ^,          p\        ^^V,          ,
          ,          ^,          p\        ^^V,          ,
          ,          ^@,          p\        RV,          ^ÔV,          ,           ,          ^,          p\        ^‡V,          ^`V,          ,
          ,          ^,          pRV,          ^ZV^,          ,          ,
          p\        P                  ! ^4      p\        \        P                  ! ^V,          \        P                  ,          4      4      p\        V^ R4       FÊ  p^V,          ^,
          pV^,          V^,          V^,          ppp\        P                  ! V	^V,          4      p\        P                  ! RW«V,          ,           WÍV,          ,           VV,          ,           VVV,          ,           VV,          ,           VV,          ,           .4      pVV,          pVV,          pKÌ  	  VV	,          pV\        ,          pV\        P                  ! V^V,          ^HV^,          ,          RV^
,          ,          .4      ,          p\        P
                  ! \        ) ^,          V,          4      p	\        P                   ! V^ R4      pV^,          p\"        V,          p\        P                  V,          pV	V,          p \        P$                  ! VV ,          4      p!V!\        \        ,          R	V,          ,          ,          p!V^;;,          V!,          uu&   \        P$                  ! VV,           VV,
          ,          V,          V ,          4      p"V"\        \        ,          ^ØV,          ,          ,          p"V^;;,          V",          uu&   \        P                  ! V R,          \        P                   ! \'        V4      4      R,          4      p#VV#,          pV'       g   VR,          pV^ ;;,          ^,          uu&   \%        V4      p$V$# )
a4  Computes the Pelz-Good approximation to Prob(Dn <= x) with 0<=x<=1.

Start with Li-Chien, Korolyuk approximation:
    Prob(Dn <= x) ~ K0(z) + K1(z)/sqrt(n) + K2(z)/n + K3(z)/n**1.5
where z = x*sqrt(n).
Transform each K_(z) using Jacobi theta functions into a form suitable
for small z.
Pelz-Good (1976). [6]
r   r   ©r   iP  ç       @iÄÿÿÿiâÿÿÿr   iÜÿÿÿ)r   r   ÚsqrtÚ_PI_SQUAREDÚ_MIN_LOGÚexpÚ_PI_FOURÚ_PI_SIXr"   r    r!   Úpir&   ÚpowerÚarrayÚ_SQRT2PIr#   Ú_SQRT3ÚsumÚlen)%r   rQ   r   ÚzÚzsquaredÚzthreeÚzfourÚzsixÚqlogÚqÚk1aÚk1bÚk2aÚk2bÚk2cÚk3dÚk3cÚk3bÚk3aÚK0to3Úmaxkr2   r4   ÚmsquaredÚmfourÚmsixÚqpowerÚcoeffsÚksÚksquaredÚsqrt3zÚkspiÚqpwersÚk2extraÚk3extraÚpowers_of_nÚKsums%   &&&                                  r   Ú_kolmogn_PelzGoodr˜   #  s­  € ð 	ˆC„xÜ$ S¨#°3Ô7Ð7ØˆC„xÜ$ S¨#°3Ô7Ð7ä
�Š�‹
�Q�€AØ$% q¥D¨!¨Q­$°°1µ°a¸µdÐ$:Ñ!€H�eäˆ<˜!Õ˜hÕ&€DØŒh„Ü$ S¨#°3Ô7Ð7ä
�Šˆt‹€Að ˆ)€CÜ
˜�/€Cà
ˆd�(�Q˜•YÕ
€CØˆu�9�q˜8•|Õ#¤{Õ
2°QÕ
6€CÜ
�a˜!˜h�,Õ&Õ
'¨"Õ
,€Cä
�Q˜˜h�Õ&Õ
'¨"Õ
,€CÜ
�c˜H•n s¨U¥{Õ2Õ
3°bÕ
8€CÜ
˜˜u� r¨D¥yÕ0Õ
1°AÕ
5€CØ
��*�r˜A˜q�D•yÕ
 €Cä�HŠH�Q‹K€Eô Œr�wŠw�r˜A•v¤§¡•~Ó&Ó'€DÜ�4˜˜BÖˆØ��E�A�IˆØ ! 1¥ a¨¥d¨A¨q­D˜�%ˆÜ—’˜!˜Q �UÓ#ˆÜ—’˜3Ø X¥Õ-Ø X¥Õ-°°Eµ	Õ9Ø  X¥Õ-°°Eµ	Õ9¸CÀ½HÕDðFó Gˆð 	��ˆØ��Šñ  ð 
ˆQ…J€EØ	ŒXÕ€Eà	ŒR�XŠX�q˜!˜e�) R¨!¨Q­$¥Y°°q¸"µuµÐ=Ó>Õ>€Eô 	�Š”ˆ|˜aÕ (Õ*Ó+€AÜ	�Š�4˜˜BÓ	€BØ�Q�w€HÜ�a�Z€FÜ�5‰5�2�:€DØ�(�]€FÜ�fŠf�X Õ&Ó'€GØŒ{œXÕ% s¨V¥|Õ4Õ4€GØ	ˆ!‡H�ÕƒHÜ�fŠf�f˜t•m¨°­Õ6¸ÕAÀFÕJÓK€GØŒ{œXÕ% s¨T¥zÕ2Õ2€GØ	ˆ!‡H�ÕƒHÜ—(’(˜1˜s�7¤B§I¢I¬c°%«jÓ$9¸CÕ$?Ó@€KØ	ˆ[Õ€EçØ��ˆØˆa��A�‹äˆu‹:€DØ€Kr   c                ó  € \         P                  ! V 4      '       d   V # \        V 4      V 8w  g   V ^ 8:  d   \         P                  # VR8¼  d   \	        RRVR7      # VR8:  d   \	        RRVR7      # W,          pVR8:  d×   VR8:  d   \	        RRVR7      # V ^Œ8:  dW   \         P
                  ! \         P                  ! ^V ^,           4      RV ,          ,          ^V,          ^,
          ,          4      pMO\         P                  ! \        V 4      V \         P                  ! ^V,          ^,
          4      ,          ,           4      p\	        VRV,
          VR7      # W0^,
          8¼  d,   ^RV,
          V ,          ,          p\	        ^V,
          WBR7      # VR8¼  d;   ^\        P                  P                  W4      ,          p\	        RV,
          WBR7      # W1,          pV ^Œ8:  d�   VR8:  d#   \        WRR7      p\	        VRV,
          VR7      # V^8:  d#   \        WRR7      p\	        VRV,
          VR7      # ^\        P                  P                  W4      ,          p\	        RV,
          WBR7      # V'       gB   VR8¼  d   R# VR8¼  d2   ^\        P                  P                  W4      ,          p\        V4      # VR	8¼  d   RpM6V R
8:  d#   WR,          ,          R8:  d   \        WRR7      pM\!        WRR7      p\	        VRV,
          VR7      # )z”Computes the CDF(or SF) for the two-sided Kolmogorov-Smirnov statistic.

x must be of type float, n of type integer.

Simard & L'Ecuyer (2011) [7].
r   r   ri   r   gã¤0ïq&è?Tg      w@gš™™™™™@g      2@i † g      ø?gffffffö?)r   Úisnanr    Únanr   Úprodr#   rn   r   r   ÚscipyÚspecialÚsmirnovrA   rg   r   r˜   )r   rQ   r   rR   ÚprobÚ	nxsquaredr   s   &&&    r   Ú_kolmognr¢   v  se  € ô 
‡x‚x�‡{‚{ØˆÜ
ˆ1ƒv�„{�a˜1”fÜ�v‰vˆØˆC„xÜ$ S¨#°3Ô7Ð7ØˆC„xÜ$ S¨#°3Ô7Ð7Ø	�€AØˆC„xØ�Œ8Ü(¨¨c°sÔ;Ð;Ø�Œ8Ü—7’7œ2Ÿ9š9 Q¨¨!­Ó,°°AµÕ6¸!¸A½#À½'ÕBÓC‰Dä—6’6Ô5°aÓ8¸1¼r¿vºvÀaÈÅcÈ!Åe»}Õ;LÕLÓMˆDÜ$ T¨3°­:¸3Ô?Ð?Ø��E„zØ�C˜!•G˜a•<ÕˆÜ$ Q¨¥X¨tÔ=Ð=ØˆC„xØ”5—=‘=×(Ñ(¨Ó.Õ.ˆÜ$ S¨4¥Z°Ô?Ð?à•€IØˆC„xØ˜Ô Ü  ¨4Ô0ˆDÜ(¨¨s°T­z¸sÔCÐCØ˜Œ>Ü$ Q¨tÔ4ˆDÜ(¨¨s°T­z¸sÔCÐCà”5—=‘=×(Ñ(¨Ó.Õ.ˆÜ$ S¨4¥Z°Ô?Ð?÷ Ø˜ÔÙØ˜ÔØ”u—}‘}×,Ñ,¨QÓ2Õ2ˆDÜ˜dÓ#Ð#à�DÔØ‰Ø	
ˆfŒ˜ �V� sÔ*Ü ¨$Ô/‰ä# A¨dÔ3ˆÜ  ¨#°­-¸SÔAÐAr   c                óÎ  a € \         P                  ! S 4      '       d   S # \        S 4      S 8w  g   S ^ 8:  d   \         P                  # VR8¼  g   V^ 8:  d   ^ # S V,          pVR8:  dÍ   VR8:  d   R# S ^Œ8:  dP   \         P                  ! \         P
                  ! ^S 4      RS ,          ,          ^V,          ^,
          ,          4      pMV\         P                  ! \        S 4      S ^,
          \         P                  ! ^V,          ^,
          4      ,          ,           4      pV^,          S ^,          ,          # VS ^,
          8¼  d&   ^RV,
          S ^,
          ,          ,          S ,          # VR8¼  d2   ^\        P                  P                  P                  VS 4      ,          # VR,          p\        WARS ,          ,
          4      p\        VRV,
          4      pV 3R lp\        WQV^R7      # )znComputes the PDF for the two-sided Kolmogorov-Smirnov statistic.

x must be of type float, n of type integer.
r   r   r   c                 ó   <€ \        SV 4      # ©N)Úkolmogn)Ú_xr   s   &€r   Ú_kkÚ_kolmogn_p.<locals>._kkÖ  s   ø€ Ü�q˜"‹~Ðr   )ÚdxÚorderg      ð@)r   rš   r    r›   rœ   r#   rn   r   r   r�   ÚstatsÚksoneÚpdfrD   r   )r   rQ   rR   ÚprdÚdeltar¨   s   f&    r   Ú
_kolmogn_pr±   ²  sj  ø€ ô
 
‡x‚x�‡{‚{ØˆÜ
ˆ1ƒv�„{�a˜1”fÜ�v‰vˆØˆC„x�1˜”6ÙØ	ˆA�€AØˆC„xà�Œ8ÙØ�Œ8Ü—'’'œ"Ÿ)š) A q›/¨S°1­WÕ5¸¸Q½À½ÕCÓD‰Cä—&’&Ô4°QÓ7¸1¸Q½3Ä"Ç&Â&ÈÈQÍÐQRÍÓBSÕ:SÕSÓTˆCØ�Q�w˜˜A��~ÐØˆA��E„zà�C˜!•G  1¥Õ%Õ%¨Õ)Ð)ØˆC„xØ”5—;‘;×$Ñ$×(Ñ(¨¨AÓ.Õ.Ð.ð ��K€EÜ�˜3˜q�5•yÓ!€EÜ��s˜Q•wÓ€Eõô �s %¨qÔ1Ð1r   c                ó\  a a€ \         P                  ! S 4      '       d   S # \        S 4      S 8w  g   S ^ 8:  d   \         P                  # S^ 8:  d
   RS ,          # V^ 8:  d   R# \         P                  ! \         P
                  ! S4      \        P                  P                  S ^,           4      ,
          S ,          4      pVRS ,          8:  d   VRS ,          ,           ^,          # \         P                  ! \         P
                  ! VR,          4      S ,          4      ) pV^RS ,          ,
          8¼  d   V# \        P                  ! S4      \         P                  ! S 4      ,          p\        VRRS ,          ,
          4      pV V3R lp\        P                  P                  VRS ,          VRR7      # )zYComputes the PPF/ISF of kolmogn.

n of type integer, n>= 1
p is the CDF, q the SF, p+q=1
r   rj   c                 ó*   <€ \        SV 4      S,
          # r¥   )r¢   )rQ   r   r   s   &€€r   Ú_fÚ_kolmogni.<locals>._fó  s   ø€ Ü˜˜1‹~ Õ!Ð!r   g›+¡†›„=)Úxtol)r   rš   r    r›   rn   r   r�   rž   ÚloggammaÚexpm1ÚscuÚ	_kolmogcirk   rD   ÚoptimizeÚbrentq)r   r   r~   r°   rQ   Úx1r´   s   ff&    r   Ú	_kolmognir¾   Ü  s)  ù€ ô 
‡x‚x�‡{‚{ØˆÜ
ˆ1ƒv�„{�a˜1”fÜ�v‰vˆØˆA„vØ�1�uˆØˆA„vÙÜ�FŠF”B—F’F˜1“I¤§¡× 6Ñ 6°q¸µsÓ ;Õ;¸QÕ>Ó?€EØ��A•„~Ø˜˜a�• 1Õ$Ð$Ü	�Š”"—&’&˜˜3�“- •/Ó	"Ð"€AØˆA��A•�I„~ØˆÜ	�Š�qÓ	œ"Ÿ'š' !›*Õ	$€BÜ	ˆR��s˜1•u•Ó	€Bö"ô �>‰>× Ñ   S¨¥U¨B°UÐ Ó;Ð;r   c                óŒ  € \         P                  ! WVR.R.R\         P                  \         P                  \         P                  .R7      pV F_  w  rErg\         P                  ! V4      '       d   WGR&   K(  \        V4      V8w  d   \        RV 24      h\        \        V4      WVR7      VR&   Ka  	  VP                  R,          pV# )aÊ  Computes the CDF for the two-sided Kolmogorov-Smirnov distribution.

The two-sided Kolmogorov-Smirnov distribution has as its CDF Pr(D_n <= x),
for a sample of size n drawn from a distribution with CDF F(t), where
:math:`D_n &= sup_t |F_n(t) - F(t)|`, and
:math:`F_n(t)` is the Empirical Cumulative Distribution Function of the sample.

Parameters
----------
n : integer, array_like
    the number of samples
x : float, array_like
    The K-S statistic, float between 0 and 1
cdf : bool, optional
    whether to compute the CDF(default=true) or the SF.

Returns
-------
cdf : ndarray
    CDF (or SF it cdf is False) at the specified locations.

The return value has shape the result of numpy broadcasting n and x.
NÚzerosize_ok)ÚflagsÚ	op_dtypes.ún is not integral: ri   r   )	r   ÚnditerÚfloat64Úbool_rš   r    Ú
ValueErrorr¢   Úoperands)	r   rQ   r   ÚitÚ_nr§   Ú_cdfrx   Úresults	   &&&      r   r¦   r¦   ù  s£   € ô0 
�Š�A˜#˜tÐ$¨]¨OØ"¤B§J¡J´·±¼"¿*¹*ÐEô
G€Bã‰ˆ�Ü�8Š8�B�<Š<Øˆc‰FÙÜˆr‹7�bŒ=ÜÐ2°2°$Ð7Ó8Ð8Üœ#˜b›' 2Ô0ˆˆ#‹ñ ð �[‰[˜�_€FØ€Mr   c                ó$  € \         P                  ! WR.4      pV F^  w  r4p\         P                  ! V4      '       d   W5R&   K(  \        V4      V8w  d   \	        RV 24      h\        \        V4      V4      VR&   K`  	  VP                  R,          pV# )a\  Computes the PDF for the two-sided Kolmogorov-Smirnov distribution.

Parameters
----------
n : integer, array_like
    the number of samples
x : float, array_like
    The K-S statistic, float between 0 and 1

Returns
-------
pdf : ndarray
    The PDF at the specified locations

The return value has shape the result of numpy broadcasting n and x.
N.rÃ   r   )r   rÄ   rš   r    rÇ   r±   rÈ   )r   rQ   rÉ   rÊ   r§   rx   rÌ   s   &&     r   ÚkolmognprÎ     s�   € ô" 
�Š�A˜$�<Ó	 €BÛ‰	ˆ�Ü�8Š8�B�<Š<Øˆc‰FÙÜˆr‹7�bŒ=ÜÐ2°2°$Ð7Ó8Ð8ÜœC ›G RÓ(ˆˆ#‹ñ ð �[‰[˜�_€FØ€Mr   c                óf  € \         P                  ! WVR.4      pV F~  w  rErg\         P                  ! V4      '       d   WGR&   K(  \        V4      V8w  d   \	        RV 24      hV'       d   V^V,
          3M
^V,
          V3w  r‰\        \        V4      W‰4      VR&   K€  	  VP                  R,          p
V
# )aÃ  Computes the PPF(or ISF) for the two-sided Kolmogorov-Smirnov distribution.

Parameters
----------
n : integer, array_like
    the number of samples
q : float, array_like
    Probabilities, float between 0 and 1
cdf : bool, optional
    whether to compute the PPF(default=true) or the ISF.

Returns
-------
ppf : ndarray
    PPF (or ISF if cdf is False) at the specified locations

The return value has shape the result of numpy broadcasting n and x.
N.rÃ   r   )r   rÄ   rš   r    rÇ   r¾   rÈ   )r   r~   r   rÉ   rÊ   Ú_qrË   rx   Ú_pcdfÚ_psfrÌ   s   &&&        r   ÚkolmognirÓ   ;  sŸ   € ô& 
�Š�A˜#˜tÐ$Ó	%€BÛ‰ˆ�Ü�8Š8�B�<Š<Øˆc‰FÙÜˆr‹7�bŒ=ÜÐ2°2°$Ð7Ó8Ð8ß$(�r˜1˜R�4‘j¨q°­t°R¨j‰ˆÜœ3˜r›7 EÓ0ˆˆ#‹ñ ð �[‰[˜�_€FØ€Mr   i<ýÿÿ)g˜SË†Bž¿g¤A¤Az?g}<™Ù°j_¿g#ÿ+•K?g8�8�C¿g  J?glÁlÁf¿gUUUUUUµ?)T)'Únumpyr   Úscipy.specialr�   Úscipy.special._ufuncsrž   Ú_ufuncsr¹   Úscipy.stats._finite_differencesr   r-   r/   Ú
longdoubler,   r.   rk   rq   rt   r   r   rm   ru   rl   ro   rp   r
   r   r   r   rA   rL   rg   r˜   r¢   r±   r¾   r¦   rÎ   rÓ   © r   r   Ú<module>rÛ      s
  ðóH Û ß #Ð #Ý 7à€Ø	�Š�"—-’- Ó" EÓ	*€Ø	�Š�"—-’- Ó" U FÓ	+€à�7Š7�1�r—u‘u•9Ó€Ø�6Š6�!�b—e‘e•)Ó€Ø€Ø	�Š�‹€Ø�e‰e�q�j€Ø�5‰5�A�:€Ø
�%‰%�1�*€òIÐ òRò ô
ôH0òV&ô$QôhPôf9Bòx'2òT<ô:"òJö:r   