|
![](/i/fill.gif) |
Came up with it today (Dec. 29). I know it's not a significant improvement,
but at least it shouldn't hurt. With the current implementation, it takes 10
multiplications and 3 additions/subtractions. My version shaves 3
multiplications off the process... not to mention that it eliminates a bunch
of temporaries, which I believe were only there for self-documentation, when
instead you could simply spell it out in the comments.
DBL quilt_cubic(DBL t, DBL p1, DBL p2)
{
DBL it = 1.0 - t;
return (t * (t*t + 3.0*it*(it*p1 + t*p2) ) * INV_SQRT_3_4);
}
--
Anthony Bennett
Post a reply to this message
|
![](/i/fill.gif) |