My first reading of (CLHS)
http://www.lispworks.com/documentation/HyperSpec/Body/f_sinh_.htm
implies that
atanh(x) = (log (1 + x) - log(1 - x))/2
is an identity. It puts no qualifications on this equation. Further
http://www.lispworks.com/documentation/HyperSpec/Body/f_log.htm
tells me that along the negative real axis, the function log is
continuous from the upper half plane; thus
log(-1) = log(exp(%i %pi)) = %i pi not (-%i pi)
Thus
atanh(-2) = (log(-1) - log(3)) / 2 = (%i*%pi)/2-log(3)/2 = 1.57...
*%i - 0.5493...
These two facts make atanh continuous along the (-inf,-1] from the upper
half plane.
My second reading of CLHS says:
"The branch cut for the inverse hyperbolic tangent function is in two
pieces:
one along the negative real axis to the left of -1 (inclusive), continuous
with quadrant III"
Yikes! This seems to say that atanh is continuous along the (-inf,-1]
from the lower half plane. I hope that I'm wrong, but as I interpret
the CLHS, it is contradictory. I think Raymond's big float atanh
function conforms to my second reading of CLHS, while the rest
of Maxima conforms to the first.
I suspect that Raymond's big float atanh function is correct (what the
CLHS intends), and all other Maxima functions are wrong. I haven't
looked at Raymond's code, but the best cure might be to make double float
versions of the big float code. The functions rectform, logarc, ... also
need to be changed. That won't be easy because
atanh(x) # (log (1 + x) - log(1 - x))/2 along (minf,-1].
(%i1) atanh(-2.0);
(%o1) 1.5707963267948966*%i-0.54930614433405489
(%i2) atanh(-2.0b0);
(%o2) -1.570796326794897b0*%i-5.493061443340548b-1
(%i3) rectform(atanh(x + %i * y))$
(%i4) subst([x = -2.0, y = 0.0],%);
(%o4) 1.5707963267948966*%i-0.54930614433405489
(%i5) logarc(atanh(x));
(%o5) (log(x+1)-log(1-x))/2
(%i6) subst(x=-2,%);
(%o6) (log(-1)-log(3))/2
(%i7) float(%);
(%o7) 0.5*(3.1415926535897931*%i-1.0986122886681098)
(%i8) expand(%);
(%o8) 1.5707963267948966*%i-0.54930614433405489
Barton