detail Namespace Reference#

DiFfRG: DiFfRG::detail Namespace Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows
DiFfRG::detail Namespace Reference

Classes

struct  ScalingFit
 Result of a three-point power-law fit \( y = C (x - x_c)^\beta \). More...
 

Typedefs

using nvcc_iterator_traits_fix = std::iterator_traits<char *>::value_type
 

Functions

double solve_scaling_shift (const double A, const double B, const double d1, const double d2)
 Solve the three-point power-law condition for the shift \( s \).
 
ScalingFit fit_power_law_3 (std::array< double, 3 > x, std::array< double, 3 > y)
 Three-point power-law fit. Points need not be pre-sorted.
 

Typedef Documentation

◆ nvcc_iterator_traits_fix

using DiFfRG::detail::nvcc_iterator_traits_fix = std::iterator_traits<char *>::value_type

Function Documentation

◆ fit_power_law_3()

ScalingFit DiFfRG::detail::fit_power_law_3 ( std::array< double, 3 > x,
std::array< double, 3 > y )
inline

Three-point power-law fit. Points need not be pre-sorted.

Rejects non-monotone or tied data outright: a triple that is not strictly decreasing in both x and y is not a sample of a monotone power law, and fitting it produces a confident wrong answer rather than a visible failure.

◆ solve_scaling_shift()

double DiFfRG::detail::solve_scaling_shift ( const double A,
const double B,
const double d1,
const double d2 )
inline

Solve the three-point power-law condition for the shift \( s \).

Three points on \( y = C (x - x_c)^\beta \), ordered \( x_1 > x_2 > x_3 > x_c \) and hence \( y_1 > y_2 > y_3 > 0 \), determine \( x_c \). Writing \( s = x_3 - x_c \), \( d_1 = x_1 - x_3 \), \( d_2 = x_2 - x_3 \) and eliminating \( \beta \) between the three log-equations leaves

\[ F(s) = A \ln\!\big(1 + d_2/s\big) - B \ln\!\frac{s + d_1}{s + d_2} = 0, \qquad A = \ln(y_1/y_2),\; B = \ln(y_2/y_3). \]

\( F(s) \to +\infty \) as \( s \to 0^+ \) and \( F(s) \sim [A d_2 - B(d_1 - d_2)]/s \) as \( s \to \infty \), so a positive root exists iff \( A d_2 < B (d_1 - d_2) \). That condition is checked analytically rather than by probing some arbitrary large \( s \), which overflows for widely separated triples. It is also the honest test of the model: data that is log-linear in \( x \), or convex the wrong way, refutes the power law and must be rejected rather than fitted.

The bisection runs in \( \ln s \) because \( s \) legitimately spans many decades between the far-from-critical and converged regimes, and log1p carries the first term, which the naive \( \ln((s+d_2)/s) \) loses entirely once \( s \gg d_2 \).

Parameters
Aln(y1/y2), must be > 0. Callers on the divergent branch pass a difference of residuals directly, so no exponentials are ever formed.
Bln(y2/y3), must be > 0.
d1x1 - x3 > d2
d2x2 - x3 > 0
Returns
s > 0, or NaN if the data does not admit a positive root.