Incorrect suggestion for clippy::suboptimal_flops
#10003
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
Clippy suggests that I change
1_f64 - (x - 1.0).powi(2)
into(x - 1.0).mul_add(-x - 1.0, 1_f64)
, but these expressions do not yield identical results.Lint Name
clippy::suboptimal_flops
Reproducer
I tried this code:
I saw this happen:
The suggested expression is not equivalent to the original. Some examples:
Version
Related
Probably related to #4735 and #4751, but this is fairly dangerous.
Additional Labels
No response
The text was updated successfully, but these errors were encountered: