Back to library index.

Package cheby (in cheby.i) -

Index of documented functions or symbols:

cheby_conv

cheby_deriv

### cheby_conv

```DOCUMENT fit = cheby_conv(poly, interval)
convert polynomial coefficients POLY = [a0, a1, ..., aN] to a
Chebyshev fit suitable for input to cheby_eval.  The INTERVAL
= [xmin,xmax] is the most stable region for evaluation.  Omitting
INTERVAL gives the natural interval [-1,1] for Chebyshev polynomials.
You may also pass another Chebyshev fit (from cheby_fit) as the
INTERVAL to use the same interval as that fit.```

### cheby_deriv

```DOCUMENT cheby_deriv(fit)
returns Chebyshev fit to the derivative of the function of the
input Chebyshev FIT.
```

### cheby_eval

```DOCUMENT cheby_eval(fit, x)
evaluates the Chebyshev fit (from cheby_fit) at points X.
the return values have the same dimensions as X.
```

### cheby_fit

```DOCUMENT fit = cheby_fit(f, interval, n)
or fit = cheby_fit(f, x, n)
returns the Chebyshev fit (for use in cheby_eval) of degree N
to the function F on the INTERVAL (a 2 element array [a,b]).
In the second form, F and X are arrays; the function to be
fit is the piecewise linear function of xp interp(f,x,xp), and
the interval of the fit is [min(x),max(x)].  You can use the
nterp= keyword to set a different interpolator, which must have
the same calling sequence as interp (e.g.- nterp=spline).

The return value is the array [a,b, c0,c1,c2,...cN] where [a,b]
is the interval over which the fit applies, and the ci are the
Chebyshev coefficients.  It may be useful to use a relatively
large value of N in the call to cheby_fit, then to truncate the
resulting fit to fit(1:3+m) before calling cheby_eval.
```

### cheby_integ

```DOCUMENT cheby_integ(fit)
or cheby_integ(fit, x0)
returns Chebyshev fit to the integral of the function of the
input Chebyshev FIT.  If X0 is given, the returned integral will
be zero at X0 (which should be inside the fit interval fit(1:2)),
otherwise the integral will be zero at x=fit(1).
```

### cheby_poly

```DOCUMENT cheby_poly(fit)
returns coefficients An of x^n as [A0, A1, A2, ..., An] for
the given FIT returned by cheby_fit.  You should only consider
actually using these for very low degree polynomials; cheby_eval
is nearly always a superior way to evaluate the polynomial.
```

```DOCUMENT tfit = cheby_trunc(fit, err)