For your `sqr` function, what is the benefit of writing `x * x` over using `x.powi(2)` [0]? You didn't mention it in the article, but did you find a performance improvement from doing this?
As far as CPU instructions go, multiplication is _significantly_ faster (i.e. an order of magnitude) than exponentiation.
That said, I can't speak to whether the Rust compiler wouldn't just optimize that away -- it seems like unrolling exponentiation into multiplication for small constant powers would be a very safe and easy thing to do.
[0]: https://doc.rust-lang.org/std/primitive.f64.html#method.powi