C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Numerics complex transcendentals

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Thu, 24 Oct 2024 21:32:42 +0200
On 24/10/2024 20.03, Paul Caprioli via Std-Proposals wrote:
> My colleagues and I are looking into the accuracy of complex mathematical operations/functions with different compilers/libraries.
> The first version of our paper is available at: https://inria.hal.science/hal-04714173
>
> In the Numerics [complex.transcendentals] section of the C++ standard, some functions (e.g., acos) have a remark, "Behaves the same as the C function cacos.
> See also: ISO/IEC 9899:2018." Others (e.g., log) have a note, "The semantics of this function are intended to be the same in C++ as they are for clog in C."
> Others (e.g., cos) have neither.
>
> Are these differences intentional and meaningful? I would appreciate any pointers or help in learning more.

These words probably haven't been touched for three decades.

My guess is that we want "the same" behavior as in C for all of those functions
(e.g. regarding branch cuts), and the differences in note phrasing are accidental.

I would guess that all C++ implementations defer to the corresponding C functions
for those trigonometrics.


Quote from the paper, section 3:

"The following table shows the results for the complex bivariate operations in single precision."

What are the "results"? It would be good to repeat what the numbers mean.

Jens

Received on 2024-10-24 19:33:02