
    (ph|                         S SK r S SKrS SKJrJr  S SKJrJr  S SK	J
r
  S r\ R                  " SS9S 5       r " S	 S
5      rg)    N)assert_equalassert_allcloselog_ndtr	ndtri_exp)assert_func_equalc                 *    [        [        U 5      5      $ Nr   ys    U/var/www/html/venv/lib/python3.13/site-packages/scipy/special/tests/test_ndtri_exp.pylog_ndtr_ndtri_expr      s    IaL!!    class)scopec                  f    [         R                  R                  S5      n U R                  S5      nU$ )Ni  i  )nprandomRandomStaterandom_sample)random_statepointss     r   uniform_random_pointsr      s+    99((.L''-FMr   c            
           \ rS rSrSr\R                  R                  SSSSS\R                  " \
5      R                  * /5      S 5       r\R                  R                  S	/ S
Q5      S 5       rS rS rS rSrg)TestNdtriExp   a  Tests that ndtri_exp is sufficiently close to an inverse of log_ndtr.

We have separate tests for the five intervals (-inf, -10),
[-10, -2), [-2, -0.14542), [-0.14542, -1e-6), and [-1e-6, 0).
ndtri_exp(y) is computed in three different ways depending on if y
is in (-inf, -2), [-2, log(1 - exp(-2))], or [log(1 - exp(-2), 0).
Each of these intervals is given its own test with two additional tests
for handling very small values and values very close to zero.

test_inputg      $g      Yg    _g@xc                 B    UnUSU-  S-   -  n[        [        S USSS9  g )Ng      ?c                     U $ r
    r   s    r   <lambda>2TestNdtriExp.test_very_small_arg.<locals>.<lambda>&       ar   +=Trtolnan_okr   r   )selfr   r   scaler   s        r   test_very_small_arg TestNdtriExp.test_very_small_arg   s4     # 55;<		
r   zinterval,expected_rtol)))ir$   ))r-   ̗`¿-q=))r.   ưg|=))r0   r   gư>c                 D    Uu  pEXT-
  U-  U-   n[        [        S UUSS9  g )Nc                     U $ r
   r    r   s    r   r!   /TestNdtriExp.test_in_interval.<locals>.<lambda>9   r#   r   Tr%   r(   )r)   intervalexpected_rtolr   leftrightr   s          r   test_in_intervalTestNdtriExp.test_in_interval+   s3     ,"77$>		
r   c                 2   [         R                  R                  [         R                  " [        5      R
                  SSSS/5      n[         R                  " [        5      R                  * n[         R                  " X!/5      n[        U5      n[        XCSS9  g )Nr   r/   )r&   )
r   	nextafterreducefinfofloatmintinyarrayr   r   )r)   bignegtinynegxresults        r   test_extremeTestNdtriExp.test_extreme>   sl    * $$bhhuo&9&91aA%FG88E?'''HHg&'#A&.r   c                     [        [        [        R                  * S/5      [        R                  * [        R                  /5        g )Ng        )r   r   r   infr)   s    r   test_asymptotesTestNdtriExp.test_asymptotesZ   s*    Y~."&&"&&0ABr   c                 P    [         R                  " [        S5      5      (       d   eg )Ng      ?)r   isnanr   rJ   s    r   test_outside_domain TestNdtriExp.test_outside_domain]   s    xx	#''''r   r    N)__name__
__module____qualname____firstlineno____doc__pytestmarkparametrizer   r=   r>   maxr+   r8   rF   rK   rO   __static_attributes__r    r   r   r   r      s     [[tT5%"((5/2E2E1EF

 [[ 	


/8C(r   r   )rV   numpyr   numpy.testingr   r   scipy.specialr   r   scipy.special._testutilsr   r   fixturer   r   r    r   r   <module>r`      sB      7 - 6" g K( K(r   