| Server IP : 93.86.61.54 / Your IP : 216.73.216.156 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/sympy/testing/__pycache__/ |
Upload File : |
o
�8Va� � @ s� d Z ddlmZmZmZmZ ddlmZmZ ddl m
Z
ddlmZm
Z
ddlmZ ddlmZ ddd�Zddd�Zddd�Zddd�Zddd�Zd
S )z Helpers for randomized testing � )�uniform�Random� randrange�randint)�is_sequence�as_int)�Tuple)�comp�I)�Symbol)� nsimplify� ���� � FNc C sF t | |�t ||�}}|s|t| S t|d|d�tt|d|d� S )a
Return a random complex number.
To reduce chance of hitting branch cuts or anything, we guarantee
b <= Im z <= d, a <= Re z <= c
When rational is True, a rational approximation to a random number
is obtained within specified tolerance, if any.
T)�rational� tolerance)r r
r )�a�b�c�dr r �A�B� r �8/usr/lib/python3/dist-packages/sympy/testing/randtest.py�random_complex_number s
�r ���ư>c sx t | ||�\} }}t|t�r|gn| j|jB }tt|� ���fdd�|D ���}| �|��� } |�|��� }
t| |
|�S )a
Test numerically that f and g agree when evaluated in the argument z.
If z is None, all symbols will be tested. This routine does not test
whether there are Floats present with precision higher than 15 digits
so if there are, your results may not be what you expect due to round-
off errors.
Examples
========
>>> from sympy import sin, cos
>>> from sympy.abc import x
>>> from sympy.testing.randtest import verify_numerically as tn
>>> tn(sin(x)**2 + cos(x)**2, 1, x)
True
c s g | ] }t � �����qS r )r )�.0�_�r r r r r r �
<listcomp>1 s z&verify_numerically.<locals>.<listcomp>) r �
isinstancer �free_symbols�list�zip�subs�nr )�f�g�z�tolr r r r �reps�z1�z2r r r �verify_numerically s "r. c C sP ddl m} t||||�}| �|��||�} || |��|�}
t| �� |
�� |�S )a�
Test numerically that the symbolically computed derivative of f
with respect to z is correct.
This routine does not test whether there are Floats present with
precision higher than 15 digits so if there are, your results may
not be what you expect due to round-off errors.
Examples
========
>>> from sympy import sin
>>> from sympy.abc import x
>>> from sympy.testing.randtest import test_derivative_numerically as td
>>> td(sin(x), x)
True
r )�
Derivative)�sympy.core.functionr/ r �diffr% �doit_numericallyr r&