There are a few places in the codebase that do things like this.
- t3 += if t3 < 0.0 { -disc.sqrt() } else { disc.sqrt() };
+ t3 += disc.sqrt().copysign(t3);
Searching for < 0.0 might lead you to some other examples.
It's a small thing but might help with branch prediction.
There are a few places in the codebase that do things like this.
Searching for
< 0.0might lead you to some other examples.It's a small thing but might help with branch prediction.