Hi all,
looking at issue http://www.openoffice.org/issues/show_bug.cgi?id=40309
I get some problems:
The algorithm, which is used for x<=30 is not good. The results become
invalid for larger order and for larger x. I guess that this was the
reason to switch to the asymptotic formula for x>30. But this formula
has the precondition that x is much larger than order^2. My tests show,
that for c significant digits, you need x > order^2*13^c (estimation).
Searching around I come across an iterative solution from Peter
Deuflhard [1] (German). My tests as Basic macro results in an accuracy
of at least 12 digits. But it needs approximately order+x*1.1+30 iterations.
[1] http://www.mathematik.uni-dortmund.de/ieem/BzMU/BzMU2007/Deuflhard.pdf
So the question is, how much iterations are acceptable?
For example BESSELJ(3000;200) results in -7,79235815417491E-003 with the
current implementation with asymptotic formula, but the true value is
-1.186524260848996e-2. Gnumeric results -1.186524260848841E-002, my
Basic version of Deuflhard's algorithm results -1,18652426084901E-002.
But calculating this needs 3147 iterations. For order 200 you would need
x>520000 to result in at least 1 digit accuracy with the asymptotic formula.
Second problem: The current implementation restricts the order to
integer values. In mathematic the order need not to be integer. ODF1.2
also allows non-integer order. Are there plans to implement a solution
in OOo with non-integer orders? I personally have no idea how to do it.
So the question is, shall I implement Deuflhard's algorithm nevertheless?
Perhaps warn the user in the help, that large input values results in
long lasting calculations? Or return an error, if neither asymptotic
formula results at least 2 digits (How tell the user, that the result is
not accurate?) nor Deuflhard's algorithm calculates in reasonable time
(where to cut?)?
kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]