
    -i                     &    S r SSKJrJr  SSKrS rg)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                 "   [         (       a  US:  d   e[        R                  " U 5      (       a  [        * nO[        R                  " U5      (       d  US::  a  U S:  a  US-  nO[        * nO{[        R                  " U5      (       a  [        R                  " U 5      (       a  SnOB[        R                  " U5      (       a#  [        R
                  " U 5      (       a  [        * nOX-  n[         (       a  [        R                  " U5      (       a   eU$ )z`
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       R/var/www/html/venv/lib/python3.13/site-packages/scipy/_lib/pyprima/common/ratio.pyredratr      s     y!|| 
xx~~	$419 !8AIE HE	T		r{{400	T		r{{400	 y88E??""L    )__doc__constsr   r   numpyr   r    r   r   <module>r      s    ' (r   