ChebyshevSharp

Fast Chebyshev interpolation, derivatives, splines, Slider, Tensor Train, and finite-horizon dynamic programming tools for .NET.

Use ChebyshevSharp when direct model evaluations are expensive but repeated values, sensitivities, integrals, roots, or surrogate evaluations need to run quickly inside a .NET application.

Get Started Choose a Class API

dotnet add package ChebyshevSharp

What Do You Want to Do?

Learn by following

Start with guided introductions and worked case studies. Use this path when you are new to the library or want to see a complete modelling workflow before adapting it.

Solve a task

Jump to concrete API patterns for construction, refinement, differentiation, serialization, high-dimensional models, and dynamic programming.

Understand the math

Use the concept pages when you need the numerical assumptions behind Chebyshev nodes, spectral convergence, interpolation stability, piecewise smoothness, Sobol indices, and performance.

Look up details

Use reference pages when you need exact API documentation, validation commands, file formats, citations, release history, or contribution rules.

Common Workflows

If you want to... Start here
Choose between dense, spline, Slider, and TT models Which Class Should I Use?
Build a smooth dense approximation Getting Started
Build from a precomputed Chebyshev grid Pre-computed Values
Handle kinks, singularities, or known breakpoints Piecewise Chebyshev Interpolation and Special Points
Work with high-dimensional functions Sliding Technique and Tensor Train Interpolation
Compute derivatives, Greeks, integrals, roots, or algebraic combinations Computing Greeks, Calculus, and Chebyshev Algebra
Solve a finite-horizon Bellman problem Continuous-State Dynamic Programming
Save, load, validate, or benchmark a model Serialization, Testing & Validation, and Performance

Case Studies

These tutorials are public, reproducible examples of how Chebyshev methods behave in applied numerical workflows.

  • Fixed-Rate Bond Case Study shows why a request-level fixed-rate bond surface should be decomposed around the smooth discounting pieces instead of cloned as one global high-dimensional object.
  • Callable Bond Case Study studies callable bond risk acceleration while preserving the non-smooth exercise decision.
  • American Option Case Study compares regression, reinforcement-learning-style simulation, and dynamic Chebyshev continuation approximation.

Minimal Example

using ChebyshevSharp;

double Function(double[] x, object? data) =>
    Math.Sin(x[0]) + Math.Cos(x[1]);

var cheb = new ChebyshevApproximation(
    function: Function,
    numDimensions: 2,
    domain: new[] { new[] { -1.0, 1.0 }, new[] { -1.0, 1.0 } },
    nNodes: new[] { 11, 11 });

cheb.Build();

double value = cheb.VectorizedEval(new[] { 0.5, 0.3 }, new[] { 0, 0 });
double dx0 = cheb.VectorizedEval(new[] { 0.5, 0.3 }, new[] { 1, 0 });