error in computing atanh

조회 수: 8 (최근 30일)
Francisco Peñuñuri
Francisco Peñuñuri 2021년 2월 13일
편집: Francisco Peñuñuri 2021년 2월 13일
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.

채택된 답변

David Goodmanson
David Goodmanson 2021년 2월 13일
편집: David Goodmanson 2021년 2월 13일
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
John D'Errico
John D'Errico 2021년 2월 13일
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.
Francisco Peñuñuri
Francisco Peñuñuri 2021년 2월 13일
편집: Francisco Peñuñuri 2021년 2월 13일
I agree with you. Still, is somehow awkward that sqrt(4) gives the principal value (regardless if this is positive or negative) while atanh(3.1) does not. I will accept the answer.
Thank you very much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by