In trigcat.spad.pamphlet:
axiom asin(1.0)
Type: Floataxiom asin(complex(1.0,
Type: Complex(Float)Transferred from savannah. This and the log(i)-log(-i) bug can be fixed by using GCL's asin and log here. I tried:if $ has Field and $ has sqrt: $ -> $ then -- asin x == atan(x/sqrt(1-x**2)) asin x == ASIN(COMPLEX(real x,imag x)$Lisp)$Lisp but the form of x when complex in axiom is not that of lisp, i.e. asin gets passed a non-number: >> System error: ((1 . 0) 0 . 0) is not of type NUMBER. In general, I think it a good idea to avoid having to duplicate the functionality of the standard lisp functions in axiom, but there may be some philosophical reason for doing this due to the domain structures or some such. If one needs the correct logic for a duplicate implementation, one can look at the gcl_numlib.lsp file in the lsp/ subdirectory. No, here it is a Complex(Float), the implementation of float allow arbitrary precision, Common Lisp no. Morever, it'a generic implementation (in a category) OK, then what we want is something like:asin x == - %i * log( %i * x + sqrt(1 - x*x)) but this does not appear to be used when put into trigcat.spad.pamphlet and recompiling. Perhaps someone could explain? Secondly, perhaps ist is of use to bring forward GMP/mpfr optimized multi-precision floating point in GCL for use by axiom here? I understand the multi-precision argument, but is there a difference between a "generic imlementation" and the lisp one where the category of the domain coincides precisely with the lisp type? Lastly, do we have to use this difficult interface as opposed to the developer email list? take care, `take care` ... Yes I think it's a good idea to add mpfr to gcl
Regards I believe furthermore, that the problem with `argument` as described in bug #47 will persist if we fix it this way.
I think that a lot of care has to be taken if we use Lisp functions instead of "homegrown" ones. Concerning the place of discussion, I too think that it would be better to: - ask on axiom-developer whether it is really an issue, if this is not clear
- signal the issue on IssueTracker
- discuss it on axiom-developer
- add proposed fixes on IssueTracker.
Since any change on IssueTracker will notify axiom-developer, there is no danger of missing anything. I think that the following definition would work:asin x == if x = 1 then pi()/2::$ else atan(x/sqrt(1-x**2)) There is one thing that puzzles me, though. Also in pi() == 2*asin(1) which seems to be asking for trouble. However, I couldn't find a domain that would use this definition for From #333: I propose to remplace in asin x == atan (x/sqrt(1-x**2)) in trigcat.spad line 162 byThe result seems right... Status: open => fix proposed |

Savannah--unknown, Thu, 31 Mar 2005 12:53:55 -0600 reply