
    Џkh                     "    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       \/var/www/teggl/fontify/venv/lib/python3.12/site-packages/scipy/_lib/pyprima/common/redrho.pyredrhor      s}     """""" I3Fl	bggi 6) %v%%%%%J    )__doc__constsr   numpyr   r    r   r   <module>r      s     !r   