
    h                     "    S r SSKJr  SSKrS rg)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                     [         (       a  Xs=:  a  S:  d   e   eX-  nUS:  a  SU -  nO"US::  a  UnO[        R                  " U5      U-  n[         (       a  Xs=:  a  U:  d   e   eU$ )aI  
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/html/shao/venv/lib/python3.13/site-packages/scipy/_lib/pyprima/common/redrho.pyredrhor      s{     y"""""" I3Fl	bggi 6) y%v%%%%%J    )__doc__constsr   numpyr   r    r   r   <module>r      s     !r   