@@ -304,7 +304,7 @@ impl f32 {
304
304
/// ```
305
305
/// let x = 2.0_f32;
306
306
/// let abs_difference = (x.powi(2) - (x * x)).abs();
307
- /// assert!(abs_difference <= 1e-5 );
307
+ /// assert!(abs_difference <= 1e-4 );
308
308
///
309
309
/// assert_eq!(f32::powi(f32::NAN, 0), 1.0);
310
310
/// ```
@@ -328,7 +328,7 @@ impl f32 {
328
328
/// ```
329
329
/// let x = 2.0_f32;
330
330
/// let abs_difference = (x.powf(2.0) - (x * x)).abs();
331
- /// assert!(abs_difference <= 1e-5 );
331
+ /// assert!(abs_difference <= 1e-4 );
332
332
///
333
333
/// assert_eq!(f32::powf(1.0, f32::NAN), 1.0);
334
334
/// assert_eq!(f32::powf(f32::NAN, 0.0), 1.0);
@@ -388,7 +388,7 @@ impl f32 {
388
388
/// // ln(e) - 1 == 0
389
389
/// let abs_difference = (e.ln() - 1.0).abs();
390
390
///
391
- /// assert!(abs_difference <= 1e-6 );
391
+ /// assert!(abs_difference <= 1e-4 );
392
392
/// ```
393
393
#[ rustc_allow_incoherent_impl]
394
394
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -413,7 +413,7 @@ impl f32 {
413
413
/// // 2^2 - 4 == 0
414
414
/// let abs_difference = (f.exp2() - 4.0).abs();
415
415
///
416
- /// assert!(abs_difference <= 1e-5 );
416
+ /// assert!(abs_difference <= 1e-4 );
417
417
/// ```
418
418
#[ rustc_allow_incoherent_impl]
419
419
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -442,7 +442,7 @@ impl f32 {
442
442
/// // ln(e) - 1 == 0
443
443
/// let abs_difference = (e.ln() - 1.0).abs();
444
444
///
445
- /// assert!(abs_difference <= 1e-6 );
445
+ /// assert!(abs_difference <= 1e-4 );
446
446
/// ```
447
447
///
448
448
/// Non-positive values:
@@ -479,7 +479,7 @@ impl f32 {
479
479
/// // log5(5) - 1 == 0
480
480
/// let abs_difference = (five.log(5.0) - 1.0).abs();
481
481
///
482
- /// assert!(abs_difference <= 1e-6 );
482
+ /// assert!(abs_difference <= 1e-4 );
483
483
/// ```
484
484
///
485
485
/// Non-positive values:
@@ -512,7 +512,7 @@ impl f32 {
512
512
/// // log2(2) - 1 == 0
513
513
/// let abs_difference = (two.log2() - 1.0).abs();
514
514
///
515
- /// assert!(abs_difference <= 1e-6 );
515
+ /// assert!(abs_difference <= 1e-4 );
516
516
/// ```
517
517
///
518
518
/// Non-positive values:
@@ -545,7 +545,7 @@ impl f32 {
545
545
/// // log10(10) - 1 == 0
546
546
/// let abs_difference = (ten.log10() - 1.0).abs();
547
547
///
548
- /// assert!(abs_difference <= 1e-6 );
548
+ /// assert!(abs_difference <= 1e-4 );
549
549
/// ```
550
550
///
551
551
/// Non-positive values:
@@ -582,8 +582,8 @@ impl f32 {
582
582
/// let abs_difference_x = (x.abs_sub(1.0) - 2.0).abs();
583
583
/// let abs_difference_y = (y.abs_sub(1.0) - 0.0).abs();
584
584
///
585
- /// assert!(abs_difference_x <= f32::EPSILON );
586
- /// assert!(abs_difference_y <= f32::EPSILON );
585
+ /// assert!(abs_difference_x <= 1e-4 );
586
+ /// assert!(abs_difference_y <= 1e-4 );
587
587
/// ```
588
588
#[ rustc_allow_incoherent_impl]
589
589
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -621,7 +621,7 @@ impl f32 {
621
621
/// // x^(1/3) - 2 == 0
622
622
/// let abs_difference = (x.cbrt() - 2.0).abs();
623
623
///
624
- /// assert!(abs_difference <= f32::EPSILON );
624
+ /// assert!(abs_difference <= 1e-4 );
625
625
/// ```
626
626
#[ rustc_allow_incoherent_impl]
627
627
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -652,7 +652,7 @@ impl f32 {
652
652
/// // sqrt(x^2 + y^2)
653
653
/// let abs_difference = (x.hypot(y) - (x.powi(2) + y.powi(2)).sqrt()).abs();
654
654
///
655
- /// assert!(abs_difference <= 1e-6 );
655
+ /// assert!(abs_difference <= 1e-4 );
656
656
/// ```
657
657
#[ rustc_allow_incoherent_impl]
658
658
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -676,7 +676,7 @@ impl f32 {
676
676
///
677
677
/// let abs_difference = (x.sin() - 1.0).abs();
678
678
///
679
- /// assert!(abs_difference <= 1e-6 );
679
+ /// assert!(abs_difference <= 1e-4 );
680
680
/// ```
681
681
#[ rustc_allow_incoherent_impl]
682
682
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -700,7 +700,7 @@ impl f32 {
700
700
///
701
701
/// let abs_difference = (x.cos() - 1.0).abs();
702
702
///
703
- /// assert!(abs_difference <= 1e-6 );
703
+ /// assert!(abs_difference <= 1e-4 );
704
704
/// ```
705
705
#[ rustc_allow_incoherent_impl]
706
706
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -725,7 +725,7 @@ impl f32 {
725
725
/// let x = std::f32::consts::FRAC_PI_4;
726
726
/// let abs_difference = (x.tan() - 1.0).abs();
727
727
///
728
- /// assert!(abs_difference <= f32::EPSILON );
728
+ /// assert!(abs_difference <= 1e-4 );
729
729
/// ```
730
730
#[ rustc_allow_incoherent_impl]
731
731
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -784,7 +784,7 @@ impl f32 {
784
784
/// // acos(cos(pi/4))
785
785
/// let abs_difference = (f.cos().acos() - std::f32::consts::FRAC_PI_4).abs();
786
786
///
787
- /// assert!(abs_difference <= 1e-6 );
787
+ /// assert!(abs_difference <= 1e-4 );
788
788
/// ```
789
789
#[ doc( alias = "arccos" ) ]
790
790
#[ rustc_allow_incoherent_impl]
@@ -813,7 +813,7 @@ impl f32 {
813
813
/// // atan(tan(1))
814
814
/// let abs_difference = (f.tan().atan() - 1.0).abs();
815
815
///
816
- /// assert!(abs_difference <= f32::EPSILON );
816
+ /// assert!(abs_difference <= 1e-4 );
817
817
/// ```
818
818
#[ doc( alias = "arctan" ) ]
819
819
#[ rustc_allow_incoherent_impl]
@@ -854,8 +854,8 @@ impl f32 {
854
854
/// let abs_difference_1 = (y1.atan2(x1) - (-std::f32::consts::FRAC_PI_4)).abs();
855
855
/// let abs_difference_2 = (y2.atan2(x2) - (3.0 * std::f32::consts::FRAC_PI_4)).abs();
856
856
///
857
- /// assert!(abs_difference_1 <= f32::EPSILON );
858
- /// assert!(abs_difference_2 <= f32::EPSILON );
857
+ /// assert!(abs_difference_1 <= 1e-4 );
858
+ /// assert!(abs_difference_2 <= 1e-4 );
859
859
/// ```
860
860
#[ rustc_allow_incoherent_impl]
861
861
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -884,8 +884,8 @@ impl f32 {
884
884
/// let abs_difference_0 = (f.0 - x.sin()).abs();
885
885
/// let abs_difference_1 = (f.1 - x.cos()).abs();
886
886
///
887
- /// assert!(abs_difference_0 <= 1e-6 );
888
- /// assert!(abs_difference_1 <= 1e-6 );
887
+ /// assert!(abs_difference_0 <= 1e-4 );
888
+ /// assert!(abs_difference_1 <= 1e-4 );
889
889
/// ```
890
890
#[ doc( alias = "sincos" ) ]
891
891
#[ rustc_allow_incoherent_impl]
@@ -914,7 +914,7 @@ impl f32 {
914
914
/// let approx = x + x * x / 2.0;
915
915
/// let abs_difference = (x.exp_m1() - approx).abs();
916
916
///
917
- /// assert!(abs_difference < 1e-10 );
917
+ /// assert!(abs_difference < 1e-4 );
918
918
/// ```
919
919
#[ rustc_allow_incoherent_impl]
920
920
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -945,7 +945,7 @@ impl f32 {
945
945
/// let approx = x - x * x / 2.0;
946
946
/// let abs_difference = (x.ln_1p() - approx).abs();
947
947
///
948
- /// assert!(abs_difference < 1e-10 );
948
+ /// assert!(abs_difference < 1e-4 );
949
949
/// ```
950
950
///
951
951
/// Out-of-range values:
@@ -982,7 +982,7 @@ impl f32 {
982
982
/// let g = ((e * e) - 1.0) / (2.0 * e);
983
983
/// let abs_difference = (f - g).abs();
984
984
///
985
- /// assert!(abs_difference <= f32::EPSILON );
985
+ /// assert!(abs_difference <= 1e-4 );
986
986
/// ```
987
987
#[ rustc_allow_incoherent_impl]
988
988
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -1012,7 +1012,7 @@ impl f32 {
1012
1012
/// let abs_difference = (f - g).abs();
1013
1013
///
1014
1014
/// // Same result
1015
- /// assert!(abs_difference <= f32::EPSILON );
1015
+ /// assert!(abs_difference <= 1e-4 );
1016
1016
/// ```
1017
1017
#[ rustc_allow_incoherent_impl]
1018
1018
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -1042,7 +1042,7 @@ impl f32 {
1042
1042
/// let g = (1.0 - e.powi(-2)) / (1.0 + e.powi(-2));
1043
1043
/// let abs_difference = (f - g).abs();
1044
1044
///
1045
- /// assert!(abs_difference <= f32::EPSILON );
1045
+ /// assert!(abs_difference <= 1e-6 );
1046
1046
/// ```
1047
1047
#[ rustc_allow_incoherent_impl]
1048
1048
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -1095,7 +1095,7 @@ impl f32 {
1095
1095
///
1096
1096
/// let abs_difference = (f - x).abs();
1097
1097
///
1098
- /// assert!(abs_difference <= 1e-6 );
1098
+ /// assert!(abs_difference <= 1e-5 );
1099
1099
/// ```
1100
1100
#[ doc( alias = "arccosh" ) ]
1101
1101
#[ rustc_allow_incoherent_impl]
@@ -1125,7 +1125,7 @@ impl f32 {
1125
1125
///
1126
1126
/// let abs_difference = (f - e).abs();
1127
1127
///
1128
- /// assert!(abs_difference <= 1e-5 );
1128
+ /// assert!(abs_difference <= 1e-4 );
1129
1129
/// ```
1130
1130
#[ doc( alias = "arctanh" ) ]
1131
1131
#[ rustc_allow_incoherent_impl]
@@ -1153,7 +1153,7 @@ impl f32 {
1153
1153
///
1154
1154
/// let abs_difference = (x.gamma() - 24.0).abs();
1155
1155
///
1156
- /// assert!(abs_difference <= f32::EPSILON );
1156
+ /// assert!(abs_difference <= 1e-4 );
1157
1157
/// ```
1158
1158
#[ rustc_allow_incoherent_impl]
1159
1159
#[ must_use = "method returns a new number and does not mutate the original value" ]
@@ -1248,7 +1248,7 @@ impl f32 {
1248
1248
/// let one = x.erf() + x.erfc();
1249
1249
/// let abs_difference = (one - 1.0).abs();
1250
1250
///
1251
- /// assert!(abs_difference <= f32::EPSILON );
1251
+ /// assert!(abs_difference <= 1e-4 );
1252
1252
/// ```
1253
1253
#[ rustc_allow_incoherent_impl]
1254
1254
#[ must_use = "method returns a new number and does not mutate the original value" ]
0 commit comments