error in computing atanh
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Francisco Peñuñuri
am 13 Feb. 2021
Bearbeitet: Francisco Peñuñuri
am 13 Feb. 2021
When computing atanh(3.1) in R2018.a and R2020.a the complex part has positive sign.
When computing in fortran (and Mathematica) the result is negative.
0 Kommentare
Akzeptierte Antwort
David Goodmanson
am 13 Feb. 2021
Bearbeitet: David Goodmanson
am 13 Feb. 2021
Hello Francisco,
The imaginary part is i*pi/2, so the two answers are a+i*pi/2 and a-i*pi/2, where a is real. Both answers are equally valid, so unless an answer is violating some prearranged standard set by the particular software invoked, there is not an error. Note that
tanh(a+i*b) = tanh(a+i*b+i*n*pi)
so there is an ambiguity modulo i*pi in the atahh function..
3 Kommentare
John D'Errico
am 13 Feb. 2021
But there is no international standards commission that decides which is the principal branch to take on some multi-valued result. And while it seems pretty standard to take the POSITIVE branch for a sqrt, so it may have seemed just as logical to take the positive branch here.
The result is valid and non-unique. You cannot say more than that.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!