[go: nahoru, domu]

Skip to content

Commit

Permalink
Use default relative error tolerance for Cbrt.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 634859424
  • Loading branch information
tensorflower-gardener committed May 17, 2024
1 parent bc8d197 commit 59683af
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,10 @@ UNARY_TEST_FLOAT_32_BITS_OR_LESS(Cbrt, {
auto error_spec_gen = +[](NativeT x) {
NativeT eps = std::numeric_limits<NativeT>::epsilon();
NativeT min = std::numeric_limits<NativeT>::min();
// Allow a small absollute error (e.g. 9e-16 for F32).
// Allow a small absolute error (e.g. 9e-16 for F32).
// This corresponds to a 0.5% relative error for the
// smallest normalized floating point values.
return ErrorSpec{.abs_err = std::cbrt(min) / 200, .rel_err = 10 * eps};
return ErrorSpec{.abs_err = std::cbrt(min) / 200, .rel_err = 50 * eps};
};
Run(Cbrt, std::cbrt, error_spec_gen);
})
Expand Down

0 comments on commit 59683af

Please sign in to comment.