https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90638
--- Comment #8 from Igor Smirnov <Igor.Smirnov at cern dot ch> --- Let me add corrections to my previous post. 1. It needs to add (long double) before M_PI / LONG_MAX in the line long double phid = M_PI / LONG_MAX; in the above example. But the result is not changed significantly. 2. Two results for the very last expression for C++ and C++17 are correct. 3. In the other expressions only the versions 4.8.5, C++03 and C++03(GNU) give completely wrong results. Do you support "C++03"? The other versions give the correct real component and the imaginary component with wrong sign, but since this component is anyway extremely small, this can be explained by precision problems.