Ë
    WËhê  ã                   ó"   — d Z ddlmZ ddlZd„ Zy)a  
This module provides a function that calculates RHO when it needs to be reduced.

Translated from Zaikun Zhang's modern-Fortran reference implementation in PRIMA.

Dedicated to late Professor M. J. D. Powell FRS (1936--2015).

Python translation by Nickolai Belakovski.
é   )Ú	DEBUGGINGé    Nc                 ó¾   — t         r| |cxkD  rdkD  sJ ‚ J ‚| |z  }|dkD  rd| z  }n |dk  r|}nt        j                  |«      |z  }t         r| |cxkD  r|k\  sJ ‚ J ‚|S )a]  
    This function calculates RHO when it needs to be reduced.
    The scheme is shared by UOBYQA, NEWUOA, BOBYQA, LINCOA. For COBYLA, Powell's code reduces RHO by
    'RHO *= 0.5; if RHO <= 1.5 * RHOEND: RHO = RHOEND' as specified in (11) of the COBYLA
    paper. However, this scheme seems to work better, especially after we introduce DELTA.
    r   éú   gš™™™™™¹?é   )r   ÚnpÚsqrt)Úrho_inÚrhoendÚ	rho_ratioÚrhos       úZ/var/www/html/jupyter_env/lib/python3.12/site-packages/scipy/_lib/pyprima/common/redrho.pyÚredrhor      s}   € õ Ø˜Ô" Ò"Ð"Ñ"Ð"Ð"ð ˜‘€Ià3‚ØF‰l‰Ø	bŠØ‰äg‰giÓ  6Ñ)ˆõ Ø˜Ô%˜vÒ%Ð%Ñ%Ð%Ð%à€Jó    )Ú__doc__Úconstsr   Únumpyr   r   © r   r   ú<module>r      s   ðñõ Û ó!r   