§
    fŠtj  ã                   ó(   — d Z ddlmZmZ ddlZd„ ZdS )a  
This module calculates the reduction ratio for trust-region methods.

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ÚREALMAXé    Nc                 ó¸  — t           r|dk    sJ ‚t          j        | ¦  «        r	t           }n�t          j        |¦  «        s|dk    r| dk    r|dz  }njt           }nat          j        |¦  «        rt          j        | ¦  «        rd}n6t          j        |¦  «        rt          j        | ¦  «        r	t           }n| |z  }t           rt          j        |¦  «        rJ ‚|S )zh
    This function evaluates the reduction ratio of a trust-region step, handling inf/nan properly.
    r   é   r   )r   ÚnpÚisnanr   ÚisposinfÚisneginf)ÚaredÚpredÚrshrinkÚratios       ú]/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/scipy/_lib/pyprima/common/ratio.pyÚredratr      sï   € õ ð Ø˜!Š|ˆ|ˆ|ˆ|õ 
„x��~„~ð å�ˆˆÝ	Œ�$‰Œð ˜4 1š9˜9ð �!Š8ˆ8à˜A‘IˆEˆEõ �HˆEˆEÝ	Œ�TÑ	Ô	ð �rœ{¨4Ñ0Ô0ð ØˆˆÝ	Œ�TÑ	Ô	ð �rœ{¨4Ñ0Ô0ð Ý�ˆˆà�T‘	ˆõ ð #Ý”8˜E‘?”?Ð"Ð"Ð"Ø€Ló    )Ú__doc__Úconstsr   r   Únumpyr   r   © r   r   ú<module>r      sN   ððð ð 'Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ø Ð Ð Ð ð(ð (ð (ð (ð (r   