failed tests in rtest_trig



Hi Barton,

I have a patch for src/float.lisp which makes atanh(bfloat(x))
match bfloat(rectform(atanh(x))). More on that in another message.

> The reference http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node128.html
> is more clear than is CHLS about the continuity of atanh. Indeed,
> atanh(-2) = -1.57....*%i - 0.54930...

I dunno. I'm hesitant to adopt anything from CLtL2,
as it isn't the spec for any variety of Lisp of interest to Maxima,
and it isn't based on considerations any more fundamental
than CLHS (both are derived from the same sources),
and I find CLtL2's convention of leaving document history
in the document only increases confusion.

> In the long run, I think we should change rectform and logarc to
> use atanh(x) = log((1+x) * sqrt(1/(1-x^2)), and etc.

I don't think we need to go to that much trouble.
We already have a workable branch cut convention
(namely whatever is induced by the definitions recommended
by Kahan).

> In the short run, I don't know--GCL gets most of this stuff wrong.

Can you be more specific?
Actually I've come to the conclusion that GCL is the
one Lisp variety which gets the branch cuts of
asin, acos, and atanh all right ...

> Some of yesterday's modifications to trigi.lisp produce
> inaccurate values for atanh for values near zero.
> I don't think that's something we want to allow.

Well, I think it's better than being off by %pi everywhere
on (-\infty, -1) U (1, \infty).

I'm certainly not opposed to replacing (log(1 + z) - log(1 - z))/2
with some other formula or collection of formulas.
We just have to make sure that the replacement has
the same branch cuts.

All the best,
Robert