Method
NumCosmoMathSpectralchebyshev_rebase
Declaration [src]
gdouble
ncm_spectral_chebyshev_rebase (
NcmSpectral* spectral,
GArray* c,
guint len,
gdouble a_in,
gdouble b_in,
gdouble a_out,
gdouble b_out,
GArray** rebased
)
Description [src]
Expresses the same polynomial as a Chebyshev series on [a_out, b_out]. The Chebyshev
variable $s_\mathrm{in}$ of [a_in, b_in] is $s_\mathrm{in} = \alpha s_\mathrm{out} + \beta$ in
terms of the one of [a_out, b_out], and each $T_k(s_\mathrm{in})$ is expanded in the
$T_j(s_\mathrm{out})$ by the Chebyshev recurrence, at a cost of $O(n^2)$.
The target need not lie inside the source interval; outside it the result continues the
polynomial, and $T_k(s_\mathrm{in})$ grows as $(|s_\mathrm{in}| + \sqrt{s_\mathrm{in}^2 - 1})^k$
there. The returned $\sum_j |c_\mathrm{out}^j|$ bounds $|f|$ on the target interval and shows
when that growth has amplified roundoff. The scratch space belongs to spectral.
Parameters
c-
Type: An array of
doubleChebyshev coefficients on [
a_in,b_in].The data is owned by the caller of the method. len-
Type:
guintNumber of leading coefficients of
cto use, 0 for all. a_in-
Type:
gdoubleLeft endpoint of the interval of
c. b_in-
Type:
gdoubleRight endpoint of the interval of
c. a_out-
Type:
gdoubleLeft endpoint of the target interval.
b_out-
Type:
gdoubleRight endpoint of the target interval.
rebased-
Type: An array of
doubleThe coefficients on [
a_out,b_out].The argument will be set by the function. The caller of the method takes ownership of the returned data, and is responsible for freeing it.