fn bc_cubic_spline(x: f32, b: f32, c: f32) -> f32 {
    let a = x.abs();

    let k = if a < 1.0 {
        (12.0 - 9.0 * b - 6.0 * c).mul_add(
            a.powi(3),
            6.0f32.mul_add(c, 12.0f32.mul_add(b, -18.0)) * a.powi(2),
        ) + (6.0 - 2.0 * b)
    } else if a < 2.0 {
        (-12.0 * b - 48.0 * c).mul_add(
            a,
            (-b - 6.0 * c).mul_add(a.powi(3), 6.0f32.mul_add(b, 30.0 * c) * a.powi(2)),
        ) + 8.0f32.mul_add(b, 24.0 * c)
    } else {
        0.0
    };

    k / 6.0
}
// Calculate a splice based on the b and c parameters.
// from authors Mitchell and Netravali.
Calculate a splice based on the b and c parameters.
from authors Mitchell and Netravali.
Calculate a splice based on the b and c parameters . from authors Mitchell and Netravali .
fn bc_cubic_spline(x: f32, b: f32, c: f32) -> f32 {
    let a = x.abs();
    let k = if a < 1.0 {
        (12.0 - 9.0 * b - 6.0 * c).mul_add(
            a.powi(3),
            6.0f32.mul_add(c, 12.0f32.mul_add(b, -18.0)) * a.powi(2),
        ) + (6.0 - 2.0 * b)
    } else if a < 2.0 {
        (-12.0 * b - 48.0 * c).mul_add(
            a,
            (-b - 6.0 * c).mul_add(a.powi(3), 6.0f32.mul_add(b, 30.0 * c) * a.powi(2)),
        ) + 8.0f32.mul_add(b, 24.0 * c)
    } else {
        0.0
    };
    k / 6.0
}
fn bc_cubic_spline ( x : f32 , b : f32 , c : f32 ) -> f32 { let a = x . abs ( ) ; let k = if a < 1.0 { ( 12.0 - 9.0 * b - 6.0 * c ) . mul_add ( a . powi ( 3 ) , 6.0f32 . mul_add ( c , 12.0f32 . mul_add ( b , - 18.0 ) ) * a . powi ( 2 ) , ) + ( 6.0 - 2.0 * b ) } else if a < 2.0 { ( - 12.0 * b - 48.0 * c ) . mul_add ( a , ( - b - 6.0 * c ) . mul_add ( a . powi ( 3 ) , 6.0f32 . mul_add ( b , 30.0 * c ) * a . powi ( 2 ) ) , ) + 8.0f32 . mul_add ( b , 24.0 * c ) } else { 0.0 } ; k / 6.0 }
Calculate a splice based on the b and c parameters.
Calculate a splice based on the b and c parameters .
x
f32
b
f32
c
f32
x
f32
b
f32
c
f32