pub fn sve_residual<K: AbstractKernel>(kernel: &K, sve: &SVEResult) -> f64Expand description
The residual of the SVE sve of kernel, relative to the largest
singular value: max |K(x, y) - Σ_l s_l u_l(x) v_l(y)| / s_0
The maximum is taken over the points next to both ends and at the
midpoint of every segment of the singular functions, on both axes, where
the expansion is evaluated in f64. The result measures the
discretization of the kernel by the segments of its SVE hints (which
compute_sve does not check) together with the
truncation of the expansion, which contributes about the first singular
value left out, below epsilon·s_0.
As a maximum over finitely many points, it is a lower bound of the maximum over the whole domain. For resolved and under-resolved kernels (exp(a x y) and the same times 1 + x/2, a ridge (1 + x/2) / (1 + 100 (x - y)²), √(1 + x) e^{xy}, and e^{-Λy(x+1)/2} / (1 + e^{-Λy}), on 1 to 32 uniform segments per half axis), it was between 0.65 and 1.2 times the maximum over a 201 × 201 grid.
The evaluation in f64 limits it from below: rounding x and y moves
K(x, y) by about f64::EPSILON times |x ∂K/∂x| + |y ∂K/∂y|. For
e^{-Λy(x+1)/2} / (1 + e^{-Λy}) with the segments of the IR basis, it is
8·10⁻¹⁴ at Λ = 10², 9·10⁻¹² at Λ = 10⁴ and 10⁻⁸ at Λ = 10⁶, for
epsilon = 10⁻⁶ and 10⁻¹² alike, and does not decrease with more
segments or Gauss points.
It evaluates the kernel in f64 at 9 points per pair of segments, and
the singular functions at these points; for the same kernel (Λ = 10² to
10⁶), that took 0.1 to 0.3 times as long as the SVE on 8 threads, and
0.06 to 0.12 times on one (it runs on the calling thread).