cheby
ActiuChebyshev polynomial toolkit for scientific computing: node generation, coefficient fitting, Clenshaw evaluation, and piecewise segment tables.
2 estrelles
0 forks
Rust
AGPL-3.0
Actualitzat fa 2 dies
Per què existeix
cheby provides a complete Chebyshev interpolation pipeline suitable for numerical kernels and ephemeris-style piecewise approximations. Its segment-table API offers O(1) lookup for high-accuracy function approximation over arbitrary intervals.
Funcionalitats clau
- Node generation on [-1, 1] and mapped intervals
- DCT-based coefficient fitting
- Stable Clenshaw evaluation (value + derivative)
- Uniform piecewise segment tables with O(1) lookup
- Generic over ChebyScalar (works with qtty quantities)
Primers passos
# Add to your Cargo.toml
[dependencies]
cheby = "0.1"
# Interpolate sin(x) with Chebyshev polynomials
use cheby::{evaluate, fit_coeffs, nodes};
const N: usize = 9;
let xi: [f64; N] = nodes();
let values: [f64; N] = std::array::from_fn(|k| xi[k].sin());
let coeffs = fit_coeffs(&values);
let tau = 0.42;
let approx = evaluate(&coeffs, tau);
println!("sin({tau}) ~= {approx}"); Contribuir
Donem la benvinguda a les contribucions! Aquí tens com pots ajudar:
- 1 Fes un fork del repositori i crea la teva branca des de main
- 2 Fes els teus canvis i afegeix tests si s'escau
- 3 Assegura't que tots els tests passen amb cargo test
- 4 Envia un pull request amb una descripció clara
Llicència
Aquest projecte està llicenciat sota la llicència AGPL-3.0. Consulta el fitxer LICENSE per a més detalls.
Enllaços ràpids
Etiquetes
math interpolation chebyshev numerics rust