pub fn decode_function(
table: &DodecetString,
domain_min: f64,
domain_max: f64,
x: f64,
) -> f64Expand description
Decode and interpolate a dodecet lookup table
§Arguments
table- Lookup table fromencode_functiondomain_min- Minimum domain valuedomain_max- Maximum domain valuex- Query point
§Example
use dodecet_encoder::calculus;
let f = |x: f64| x.sin();
let table = calculus::encode_function(f, 0.0, 2.0 * std::f64::consts::PI, 360);
let y = calculus::decode_function(&table, 0.0, 2.0 * std::f64::consts::PI, std::f64::consts::PI/2.0);
assert!((y - 1.0).abs() < 0.1); // sin(π/2) ≈ 1