| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/scipy/special/tests/__pycache__/ |
Upload File : |
�
d�c�2 � �� � d Z ddlZddlZddlZddlmZ ddlmZ ddl m
Z
ddlmZm
Z
ddlZn# e$ r e
d� � ZY nw xY wd� Z G d � d
e� � Z G d� d� � ZdS )
z�Tests for hyp2f1 for complex values.
Author: Albert Steppi, with credit to Adam Kullberg (FormerPhycisist) for
the implementation of mp_hyp2f1 below, which modifies mpmath's hyp2f1 to
return the same branch as scipy's on the standard branch cut.
� N)�
NamedTuple)�assert_allclose)�hyp2f1)�
check_version�
MissingModule�mpmathc �� � |j dk ot |j � � dk }t || z
t || z
� � z
� � dk ot || z
� � dk }t ||z
t ||z
� � z
� � dk ot ||z
� � dk }|r
|j dz }|r|s
|s|j dz }n|}t t j | |||� � � � S )a) Return mpmath hyp2f1 calculated on same branch as scipy hyp2f1.
For most values of a,b,c mpmath returns the x - 0j branch of hyp2f1 on the
branch cut x=(1,inf) whereas scipy's hyp2f1 calculates the x + 0j branch.
Thus, to generate the right comparison values on the branch cut, we
evaluate mpmath.hyp2f1 at x + 1e-15*j.
The exception to this occurs when c-a=-m in which case both mpmath and
scipy calculate the x + 0j branch on the branch cut. When this happens
mpmath.hyp2f1 will be evaluated at the original z point.
� �?�V瞯�<r � y V瞯�<)�real�abs�imag�round�complexr r )�a�b�c�z�
on_branch_cut�cond1�cond2�z_mpmaths �A/usr/lib/python3/dist-packages/scipy/special/tests/test_hyp2f1.py� mp_hyp2f1r s� � � �F�S�L�:�S���[�[�7�%:�M���A���a�!�e���$�%�%��/�E�E�!�a�%�L�L�A�4E�E���A���a�!�e���$�%�%��/�E�E�!�a�%�L�L�A�4E�E�� �
�F�T�M��� �e� �u� ��6�H�$������6�=��A�q�(�3�3�4�4�4� c �L � e Zd ZU eed<