Oakfield API Documentation 1.0.0
Numerical core APIs
Loading...
Searching...
No Matches
zeta.h File Reference

Riemann zeta evaluation helpers with branch metadata and error estimates. More...

#include <stddef.h>
#include "oakfield/field.h"
Include dependency graph for zeta.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SimComplexBall
 Complex ball enclosure with evaluator status, rigor, and refinement metadata. More...
 
struct  SimZetaContext
 Evaluation controls for the Riemann zeta dispatcher. More...
 
struct  SimZetaResult
 Value, error estimates, branch metadata, and status from zeta evaluation. More...
 
struct  SimZetaDerivativeResult
 Zeta value and first derivative with associated error and branch metadata. More...
 

Macros

#define SIM_ZETA_FLAG_USED_REFLECTION   0x1u
 
#define SIM_ZETA_FLAG_NEAR_POLE   0x2u
 
#define SIM_ZETA_FLAG_TRIVIAL_ZERO   0x4u
 
#define SIM_ZETA_FLAG_USED_ETA   0x8u
 
#define SIM_ZETA_FLAG_USED_NEAR_ONE_LAURENT   0x10u
 
#define SIM_ZETA_FLAG_USED_AFE   0x20u
 
#define SIM_ZETA_FLAG_USED_ADAPTIVE_REFINEMENT   0x40u
 
#define SIM_ZETA_FLAG_USED_RIEMANN_SIEGEL   0x80u
 
#define SIM_ZETA_FLAG_USED_LOCAL_EXPANSION   0x100u
 
#define SIM_ZETA_FLAG_ZERO_PROXIMITY   0x200u
 

Typedefs

typedef enum SimZetaStatus SimZetaStatus
 Status values returned by zeta evaluators.
 
typedef enum SimBallRigor SimBallRigor
 Rigor level attached to complex-ball enclosures.
 
typedef enum SimZetaBranch SimZetaBranch
 Dispatcher branch used for a zeta evaluation.
 
typedef struct SimComplexBall SimComplexBall
 Complex ball enclosure with evaluator status, rigor, and refinement metadata.
 
typedef struct SimZetaContext SimZetaContext
 Evaluation controls for the Riemann zeta dispatcher.
 
typedef struct SimZetaResult SimZetaResult
 Value, error estimates, branch metadata, and status from zeta evaluation.
 
typedef struct SimZetaDerivativeResult SimZetaDerivativeResult
 Zeta value and first derivative with associated error and branch metadata.
 

Enumerations

enum  SimZetaStatus {
  SIM_ZETA_STATUS_OK = 0 , SIM_ZETA_STATUS_SINGULAR , SIM_ZETA_STATUS_INVALID_ARGUMENT , SIM_ZETA_STATUS_NO_CONVERGENCE ,
  SIM_ZETA_STATUS_NUMERIC_FAILURE
}
 Status values returned by zeta evaluators. More...
 
enum  SimBallRigor { SIM_BALL_RIGOR_HEURISTIC = 0 , SIM_BALL_RIGOR_VALIDATED , SIM_BALL_RIGOR_FORMAL }
 Rigor level attached to complex-ball enclosures. More...
 
enum  SimZetaBranch {
  SIM_ZETA_BRANCH_DIRECT_EULER_MACLAURIN = 0 , SIM_ZETA_BRANCH_ETA_ACCELERATED , SIM_ZETA_BRANCH_APPROXIMATE_FUNCTIONAL_EQUATION , SIM_ZETA_BRANCH_RIEMANN_SIEGEL ,
  SIM_ZETA_BRANCH_NEAR_ONE_LAURENT , SIM_ZETA_BRANCH_LOCAL_EXPANSION , SIM_ZETA_BRANCH_REFLECTION
}
 Dispatcher branch used for a zeta evaluation. More...
 

Functions

const char * sim_zeta_status_string (SimZetaStatus status)
 Human-readable description of a zeta status value.
 
const char * sim_zeta_branch_string (SimZetaBranch branch)
 Human-readable description of a zeta branch value.
 
SimZetaContext sim_zeta_context_default (void)
 Default tolerances and truncation limits for the current zeta dispatcher.
 
SimZetaContext sim_zeta_context_interactive (void)
 Low-latency zeta context for interactive visual exploration.
 
SimZetaResult sim_zeta_eval_direct_euler_maclaurin (SimComplexDouble s, const SimZetaContext *context)
 Evaluate zeta(s) with the direct Euler-Maclaurin branch.
 
SimZetaResult sim_zeta_eval_eta_accelerated (SimComplexDouble s, const SimZetaContext *context)
 Evaluate zeta(s) with the Phase 2 accelerated eta/Hasse branch.
 
SimZetaResult sim_zeta_eval_approximate_fe (SimComplexDouble s, const SimZetaContext *context)
 Evaluate zeta(s) with the Phase 3 approximate functional equation branch.
 
SimZetaResult sim_zeta_eval_riemann_siegel (double t, const SimZetaContext *context)
 Evaluate zeta(1/2 + i t) with the Phase 4 Riemann-Siegel branch.
 
SimZetaDerivativeResult sim_zeta_eval_with_derivative (SimComplexDouble s, const SimZetaContext *context)
 Evaluate zeta(s) and its first complex derivative.
 
SimComplexBall sim_zeta_eval_ball (SimComplexDouble s, const SimZetaContext *context)
 Ball-style enclosure derived from the current zeta error model.
 
SimZetaResult sim_zeta_eval (SimComplexDouble s, const SimZetaContext *context)
 Evaluate zeta(s) using the Phase 3 dispatcher and adaptive refinement layer.
 

Detailed Description

Riemann zeta evaluation helpers with branch metadata and error estimates.

Enumeration Type Documentation

◆ SimBallRigor

Rigor level attached to complex-ball enclosures.

Enumerator
SIM_BALL_RIGOR_HEURISTIC 

Heuristic error bounds only.

SIM_BALL_RIGOR_VALIDATED 

Bounds validated by runtime checks.

SIM_BALL_RIGOR_FORMAL 

Formally justified enclosure.

◆ SimZetaBranch

Dispatcher branch used for a zeta evaluation.

Enumerator
SIM_ZETA_BRANCH_DIRECT_EULER_MACLAURIN 

Direct Euler-Maclaurin summation branch.

SIM_ZETA_BRANCH_ETA_ACCELERATED 

Eta-accelerated series branch.

SIM_ZETA_BRANCH_APPROXIMATE_FUNCTIONAL_EQUATION 

Approximate functional equation.

SIM_ZETA_BRANCH_RIEMANN_SIEGEL 

Riemann-Siegel branch.

SIM_ZETA_BRANCH_NEAR_ONE_LAURENT 

Laurent expansion near s=1.

SIM_ZETA_BRANCH_LOCAL_EXPANSION 

Local expansion around a cached center.

SIM_ZETA_BRANCH_REFLECTION 

Reflection/formula-transformed branch.

◆ SimZetaStatus

Status values returned by zeta evaluators.

Enumerator
SIM_ZETA_STATUS_OK 

Evaluation completed successfully.

SIM_ZETA_STATUS_SINGULAR 

Argument lies on a singularity or pole.

SIM_ZETA_STATUS_INVALID_ARGUMENT 

Input argument or output pointer was invalid.

SIM_ZETA_STATUS_NO_CONVERGENCE 

Series/refinement did not converge within budget.

SIM_ZETA_STATUS_NUMERIC_FAILURE 

Evaluation produced an unstable numeric result.

Function Documentation

◆ sim_zeta_branch_string()

const char * sim_zeta_branch_string ( SimZetaBranch  branch)

Human-readable description of a zeta branch value.

Parameters
branchBranch identifier from a zeta result.
Returns
Static diagnostic string.

◆ sim_zeta_context_default()

SimZetaContext sim_zeta_context_default ( void  )

Default tolerances and truncation limits for the current zeta dispatcher.

Returns
Default zeta evaluation context.

◆ sim_zeta_context_interactive()

SimZetaContext sim_zeta_context_interactive ( void  )

Low-latency zeta context for interactive visual exploration.

This keeps the existing dispatcher but relaxes tolerances, caps work budgets, and disables validation so renderers can use sim_zeta_eval() for responsive previews without changing the exact path.

Returns
Relaxed low-latency zeta evaluation context.

◆ sim_zeta_eval()

SimZetaResult sim_zeta_eval ( SimComplexDouble  s,
const SimZetaContext context 
)

Evaluate zeta(s) using the Phase 3 dispatcher and adaptive refinement layer.

Parameters
sComplex zeta argument.
contextOptional evaluation context.
Returns
Structured zeta result from the adaptive dispatcher.

◆ sim_zeta_eval_approximate_fe()

SimZetaResult sim_zeta_eval_approximate_fe ( SimComplexDouble  s,
const SimZetaContext context 
)

Evaluate zeta(s) with the Phase 3 approximate functional equation branch.

Parameters
sComplex zeta argument.
contextOptional evaluation context.
Returns
Structured zeta result for the approximate functional equation branch.

◆ sim_zeta_eval_ball()

SimComplexBall sim_zeta_eval_ball ( SimComplexDouble  s,
const SimZetaContext context 
)

Ball-style enclosure derived from the current zeta error model.

The returned rigor metadata distinguishes heuristic, validated, and future formal interval results. The current implementation provides heuristic and cross-checked validated balls, plus formal enclosures for exact special values and direct-Euler-Maclaurin right-half-plane paths, including a genuinely complex family with Re(s) > 1.

Parameters
sComplex zeta argument.
contextOptional evaluation context.
Returns
Complex ball enclosure with status and rigor metadata.

◆ sim_zeta_eval_direct_euler_maclaurin()

SimZetaResult sim_zeta_eval_direct_euler_maclaurin ( SimComplexDouble  s,
const SimZetaContext context 
)

Evaluate zeta(s) with the direct Euler-Maclaurin branch.

Parameters
sComplex zeta argument.
contextOptional evaluation context.
Returns
Structured zeta result for the direct branch.

◆ sim_zeta_eval_eta_accelerated()

SimZetaResult sim_zeta_eval_eta_accelerated ( SimComplexDouble  s,
const SimZetaContext context 
)

Evaluate zeta(s) with the Phase 2 accelerated eta/Hasse branch.

Parameters
sComplex zeta argument.
contextOptional evaluation context.
Returns
Structured zeta result for the eta/Hasse branch.

◆ sim_zeta_eval_riemann_siegel()

SimZetaResult sim_zeta_eval_riemann_siegel ( double  t,
const SimZetaContext context 
)

Evaluate zeta(1/2 + i t) with the Phase 4 Riemann-Siegel branch.

Parameters
tCritical-line height.
contextOptional evaluation context.
Returns
Structured zeta result on the critical line.

◆ sim_zeta_eval_with_derivative()

SimZetaDerivativeResult sim_zeta_eval_with_derivative ( SimComplexDouble  s,
const SimZetaContext context 
)

Evaluate zeta(s) and its first complex derivative.

Parameters
sComplex zeta argument.
contextOptional evaluation context.
Returns
Structured value and derivative result.

◆ sim_zeta_status_string()

const char * sim_zeta_status_string ( SimZetaStatus  status)

Human-readable description of a zeta status value.

Parameters
statusStatus returned by zeta/ball evaluators.
Returns
Static diagnostic string.