Joey Tuttle writes: >In any case, I'm happy to sit back and wait for arbitrary >precision/accuracy facilities to be introduced in J.
Symbolic languages such as Maple and Mathematica have arbitrary precision, but you hit a switch to do native floating-point calculation when you want speed. Ironically, as I indicated in a previous post, the "worse" result for sin(pi) in J as compared with a few years ago may come from using a better library. The obvious way to evaluate sin(y) is to first reduce the argument mod pi or mod pi%2, and this requires an internal representation for pi, which is 66 bits for the Intel FSIN function. I hypothesize that the old result used a 64 bit representation of pi. The more bits you use, the better the result for large values of y. For example, FDLIBM uses a 1144 bit value for pi. However, it produces an even "worse" result for sin(pi). In any case, it is unreasonable to expect a sin function to quickly produce full precision results on arbitrary floating-point values. If we are sticking with floating-point arithmetic, 1p1 is never going to be exactly pi, and it is likely to be different from the value of pi used by library routines, so sin(pi) is unlikely to be exactly 0. dly writes: >Since transcendental functions cannot be produced by algebraical >operations, for those that care, algorithms should correct terms >which can be determined by other means. Once again, the symbolic languages do this, but at a considerable cost. For example, Pi in Maple can be evaluated to arbitrary precision, and it obeys simplification rules such as sin(Pi)=0. Simplification and evaluation are distinct, and the former requires a huge infrastructure to keep track of simplifications already done and allow for the recognition and application of simplification rules. This is antithetical to the J model, which does immediate evaluation and preserves a minimal amount of state. Best wishes, John ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
