Fix #379: <complex>: asinh(-1e+307 + 2e+307i) is wrong - #401
Conversation
|
Amy Wishnousky (@amyw-msft) Do we need to make corresponding changes to the UCRT? |
I found another correctness bug in UCRT complex (but not in STL) during testing. I didn't report that bug in #379 because I believed this is not the place to report UCRT bugs. |
|
You are correct that this isn't the place for UCRT bugs, but the implementations are similar -- I believe they both came from Dinkumware once upon a time, so when one is broken, usually they both are. |
|
Can you provide test values that exercise each of the altered lines? |
Assuming 64-bit L1234L1242L1305L1380 |
|
Hello statementreply! I'm seeing that the new implementation doesn't pass the test cases you enumerated above assuming nearly_equal_partwise tests that the results are within +/- 1 ULP. e.g. Thanks again for your contribution! |
|
That seems expected to me; if you're concerned about the 2 ULP differences, I recommend filing an issue to investigate later. |
|
I still would like to give statementreply a couple days to comment in case they want to before merging just in case the results I observe are unexpected. |
|
Billy O'Neal (@BillyONeal) That's expected. This PR fixes some coding errors in the original implementation (which doesn't guarantee +/- 1 ULP accuracy) of complex |
|
Sounds good, thanks again for your contribution! |
|
This is a great example of a bug that we would have had a much harder time fixing before open-source! We really appreciate your analysis, test cases, and fix. 😸 |
Fix formula in complex asinh, acosh and acos. (microsoft#401)
Description
Fix a few wrong formula (possibly typo) in complex asinh, acosh and acos. (#379)
Checklist
Be sure you've read README.md and understand the scope of this repo.
If you're unsure about a box, leave it unchecked. A maintainer will help you.
_Uglyas perhttps://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
verified by an STL maintainer before automated testing is enabled on GitHub,
leave this unchecked for initial submission).
members, adding virtual functions, changing whether a type is an aggregate
or trivially copyable, etc.).
the C++ Working Draft (including any cited standards), other WG21 papers
(excluding reference implementations outside of proposed standard wording),
and LWG issues as reference material. If they were derived from a project
that's already listed in NOTICE.txt, that's fine, but please mention it.
If they were derived from any other project (including Boost and libc++,
which are not yet listed in NOTICE.txt), you must mention it here,
so we can determine whether the license is compatible and what else needs
to be done.