jalberse / shimmer

Physically based rendering in Rust
Apache License 2.0
33 stars 0 forks source link

Use fused multiply-add for evaluating polynomials #21

Closed jalberse closed 8 months ago

jalberse commented 9 months ago

evaluate_polynomial() could be calculated via Float::mul_add(), similar to how PBRT does. In fact, I used to - but it was evaluating incorrectly. I've implemented it the "Keep It Simple, Stupid" way so that I can move onto feature development and more important testing, but we might get a performance bump if we do this later.

jalberse commented 8 months ago

I've actually just switched to using the fast_polynomial crate for now. It seems to fit my use case well and works fine in testing, and seems reasonably fast. Other crates for polynomial evaluation I looked at look a bit "heavy" for what I need.