§
    Tiê  ã                   ó$   — d Z ddlmZ ddlZd„ ZdS )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k    rdk    sn J ‚| |z  }|dk    rd| z  }n |dk    r|}nt          j        |¦  «        |z  }t           r| |cxk    r|k    sn 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       úx/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/scipy/_lib/pyprima/common/redrho.pyÚredrhor      s¨   € õ ð #Ø˜Ð"Ð"Ò"Ð" Ò"Ð"Ð"Ð"Ð"Ð"ð ˜‘€Ià3‚€ØF‰lˆˆØ	bŠˆØˆˆåŒgiÑ Ô  6Ñ)ˆõ ð &Ø˜Ð%Ð%Ò%Ð%˜vÒ%Ð%Ð%Ð%Ð%Ð%à€Jó    )Ú__doc__Úconstsr   Únumpyr   r   © r   r   ú<module>r      sH   ððð ð Ð Ð Ð Ð Ð Ø Ð Ð Ð ð!ð !ð !ð !ð !r   