File tree 3 files changed +13
-8
lines changed 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -1237,8 +1237,10 @@ pub trait Float
1237
1237
fn is_sign_negative ( self ) -> bool ;
1238
1238
1239
1239
/// Fused multiply-add. Computes `(self * a) + b` with only one rounding
1240
- /// error. This produces a more accurate result with better performance than
1241
- /// a separate multiplication operation followed by an add.
1240
+ /// error, yielding a more accurate result than an unfused multiply-add.
1241
+ ///
1242
+ /// Using `mul_add` can be more performant than an unfused multiply-add if
1243
+ /// the target architecture has a dedicated `fma` CPU instruction.
1242
1244
///
1243
1245
/// ```
1244
1246
/// use num_traits::Float;
Original file line number Diff line number Diff line change 1
- /// The fused multiply-add operation.
2
- /// Computes (self * a) + b with only one rounding error.
3
- /// This produces a more accurate result with better performance
4
- /// than a separate multiplication operation followed by an add.
1
+ /// Fused multiply-add. Computes `(self * a) + b` with only one rounding
2
+ /// error, yielding a more accurate result than an unfused multiply-add.
3
+ ///
4
+ /// Using `mul_add` can be more performant than an unfused multiply-add if
5
+ /// the target architecture has a dedicated `fma` CPU instruction.
5
6
///
6
7
/// Note that `A` and `B` are `Self` by default, but this is not mandatory.
7
8
///
Original file line number Diff line number Diff line change @@ -215,8 +215,10 @@ pub trait Real
215
215
fn is_sign_negative ( self ) -> bool ;
216
216
217
217
/// Fused multiply-add. Computes `(self * a) + b` with only one rounding
218
- /// error. This produces a more accurate result with better performance than
219
- /// a separate multiplication operation followed by an add.
218
+ /// error, yielding a more accurate result than an unfused multiply-add.
219
+ ///
220
+ /// Using `mul_add` can be more performant than an unfused multiply-add if
221
+ /// the target architecture has a dedicated `fma` CPU instruction.
220
222
///
221
223
/// ```
222
224
/// use num_traits::real::Real;
You can’t perform that action at this time.
0 commit comments