�
I�gh� � � � d Z ddlZ G d� de� � ZddlmZ d� Zd� Zd � Zd
� Z dd�Z
dgfd�Zdd
�Zdd�Z
dd�Zdd�Zedd�� � Zedd�� � ZdS )aI
---------------------------------------------------------------------
.. sectionauthor:: Juan Arias de Reyna <arias@us.es>
This module implements zeta-related functions using the Riemann-Siegel
expansion: zeta_offline(s,k=0)
* coef(J, eps): Need in the computation of Rzeta(s,k)
* Rzeta_simul(s, der=0) computes Rzeta^(k)(s) and Rzeta^(k)(1-s) simultaneously
for 0 <= k <= der. Used by zeta_offline and z_offline
* Rzeta_set(s, derivatives) computes Rzeta^(k)(s) for given derivatives, used by
z_half(t,k) and zeta_half
* z_offline(w,k): Z(w) and its derivatives of order k <= 4
* z_half(t,k): Z(t) (Riemann Siegel function) and its derivatives of order k <= 4
* zeta_offline(s): zeta(s) and its derivatives of order k<= 4
* zeta_half(1/2+it,k): zeta(s) and its derivatives of order k<= 4
* rs_zeta(s,k=0) Computes zeta^(k)(s) Unifies zeta_half and zeta_offline
* rs_z(w,k=0) Computes Z^(k)(w) Unifies z_offline and z_half
----------------------------------------------------------------------
This program uses Riemann-Siegel expansion even to compute
zeta(s) on points s = sigma + i t with sigma arbitrary not
necessarily equal to 1/2.
It is founded on a new deduction of the formula, with rigorous
and sharp bounds for the terms and rest of this expansion.
More information on the papers:
J. Arias de Reyna, High Precision Computation of Riemann's
Zeta Function by the Riemann-Siegel Formula I, II
We refer to them as I, II.
In them we shall find detailed explanation of all the
procedure.
The program uses Riemann-Siegel expansion.
This is useful when t is big, ( say t > 10000 ).
The precision is limited, roughly it can compute zeta(sigma+it)
with an error less than exp(-c t) for some constant c depending
on sigma. The program gives an error when the Riemann-Siegel
formula can not compute to the wanted precision.
� Nc � � e Zd Zd� ZdS )�RSCachec � � ddi i g| _ d S )Nr �
)� _rs_cache)�ctxs �g/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/mpmath/functions/rszeta.py�__init__zRSCache.__init__6 s � ��B��B���
�
�
� N)�__name__�
__module__�__qualname__r
� r r r r 5 s# � � � � � �(� (� (� (� (r r � )�defunc �& � |dz }|dz }t | � d|dz z � � d|z dz | � |� � z
� � }| � d|z � � }t | � d|z � � | � |� � dz |z � � }|| _ i }| j |d<