python (3.12.0)
Αe d dl mZmZ d dlmZ d dlZd dlZd dlZd dlZd dl Z d dl
Z
d dlZd dlZd dl
Z
d dlZdZ ed Z ed Z ed Zej( j* Zej( j. Zd\ ZZeez d k( Zed
k( rej: d ZneZe
j@ jC e xs e
jD Z#e
j@ jI e#d Z%e
j@ jI e#d Z&d
Z'd Z(d Z)d Z*d Z+d Z,d Z-d dZ. G d d Z/ G d de0 Z1 G d de2 Z3 G d dejh Z5 G d dejh Z6d Z7ed
k( r ejp yy)! )verboserequires_IEEE_754)supportNgh㈵>naninf-inf) 7yACg):@g7yAC__main__zmath_testcases.txtzcmath_testcases.txtc x t j dt j d| d }|dk r|dz }|S )Nz<qz<dr l )structunpackpack)xns B/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_math.pyto_ulpsr ( s@
dFKKa01!4A1ugJH c 4 | rdt | | dz
z z S dS )N r )count_set_bits)r s r r r N s$ K,-1~a!a%i((414r c j || z
dz }|sy|dk( r| S | |z dz }t | | t || z S Nr )partial_product)startstop
numfactorsmids r r r R sQ ,1$J qz!Q&uc*_S$-GGGr c dx}}t t | j D ]+ }|t | |dz z dz dz | |z dz dz z }||z }- || t | z
z S r )reversedrange
bit_lengthr r )r innerouteris r py_factorialr% ` s EE
eALLN+
,
!q1u*!1A!5Q!|a7GHH
Q**++r c t t | t | z
}t | |z
}||k s||k ry d}|j |||| S )NzAerror = {:.3g} ({:d} ulps); permitted error = {:.3g} or {:d} ulps)absr format)expectedgotulp_tolabs_tol ulp_error abs_errorfmts r
ulp_abs_checkr0 k s_ GH%45IHsN#I GyG37zz)YAAr c # n K t | d 5 }|D ] }d|v r|d |j d }|j s,|j d \ }}|j \ }}}|j }|d } |dd }
||t | t | |
f d d d y # 1 sw Y y xY ww)Nutf-8encoding--->r r )openindexstripsplitfloat)fnamefplinelhsrhsidfnarg
rhs_piecesexpflagss r parse_mtestfilerG } s
eg &