What is the precision of std::erf?

Jonathan H

C++11 introduced very useful math functions in the standard like erf and erfc. There are mentions about "guaranteed underflow" for inputs greater or smaller than certain values, but I don't know enough about floating point representation to understand clearly what this means in terms of precision.

If this question makes sense; what precision (order of magnitude at least) can I expect from the approximation implemented by the standard library (if it is specified)?

Fabio Ceconello

This depends on the quality of the implementation, which is up to the vendor of the compiler (or runtime libraries, if acquired separately). In the best case, the precision will match the precision of the specific type you use (double, long double, and so on).

Notice that the precision of the returned value is not related to the guaranteed underflow. This is just an enforced postcondition that assures the return value is the special underflow FP value if the input is outside the expected domain.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

std::fmod abysmal double precision

From Dev

std::string to float (via std::stof) precision

From Dev

SqlServer: what means precision 53?

From Dev

What is sub-millisecond precision?

From Dev

Using std::accumulate to add floats with best precision

From Dev

Using std::accumulate to add floats with best precision

From Dev

What is the precision of cpp_dec_float_50?

From Dev

What's the type of the "precision" specifier for printf?

From Dev

What is the maximum precision of CSS3 opacity?

From Dev

What is causing this "possible loss of precision" error?

From Dev

What is the precision of the bash builtin time command?

From Dev

What is the maximum precision of CSS3 opacity?

From Dev

what reference should I use to use erf / erfc function

From Dev

Bitshifting std_logic_vector while keep precision and conversion to signed

From Java

What is the purpose of std::launder?

From Java

What exactly is std::labs() there for?

From Dev

What is the performance of std::bitset?

From Dev

What is the complexity of std::tgamma?

From Java

What exactly is std::atomic?

From Java

What is std::promise?

From Dev

What happened to std::assert

From Dev

What is std::strtoul for unicode

From Dev

What is the purpose of std::rank?

From Dev

What is the complexity of std::tgamma?

From Dev

What is the definition of Convert_Single_Precision_To_Double_Precision_Floating_Point() in the Intel software developer manuals?

From Dev

What is a reasonable time to get a gps fix with 10 meters precision?

From Java

What is the correct/standard way to check if difference is smaller than machine precision?

From Dev

What is the correct way of using a fixed precision number in rust-postgres?

From Dev

What does "numeric precision radix" mean in the SQL Server metadata?

Related Related

  1. 1

    std::fmod abysmal double precision

  2. 2

    std::string to float (via std::stof) precision

  3. 3

    SqlServer: what means precision 53?

  4. 4

    What is sub-millisecond precision?

  5. 5

    Using std::accumulate to add floats with best precision

  6. 6

    Using std::accumulate to add floats with best precision

  7. 7

    What is the precision of cpp_dec_float_50?

  8. 8

    What's the type of the "precision" specifier for printf?

  9. 9

    What is the maximum precision of CSS3 opacity?

  10. 10

    What is causing this "possible loss of precision" error?

  11. 11

    What is the precision of the bash builtin time command?

  12. 12

    What is the maximum precision of CSS3 opacity?

  13. 13

    what reference should I use to use erf / erfc function

  14. 14

    Bitshifting std_logic_vector while keep precision and conversion to signed

  15. 15

    What is the purpose of std::launder?

  16. 16

    What exactly is std::labs() there for?

  17. 17

    What is the performance of std::bitset?

  18. 18

    What is the complexity of std::tgamma?

  19. 19

    What exactly is std::atomic?

  20. 20

    What is std::promise?

  21. 21

    What happened to std::assert

  22. 22

    What is std::strtoul for unicode

  23. 23

    What is the purpose of std::rank?

  24. 24

    What is the complexity of std::tgamma?

  25. 25

    What is the definition of Convert_Single_Precision_To_Double_Precision_Floating_Point() in the Intel software developer manuals?

  26. 26

    What is a reasonable time to get a gps fix with 10 meters precision?

  27. 27

    What is the correct/standard way to check if difference is smaller than machine precision?

  28. 28

    What is the correct way of using a fixed precision number in rust-postgres?

  29. 29

    What does "numeric precision radix" mean in the SQL Server metadata?

HotTag

Archive