Open frithnanth opened 6 years ago
I think a better plan here would be to simply add one of the reverse functions to the library, and then document that rather than giving a detailed explanation of the reverse transform in the README give it in the code. Which of the methods in your opinion is numerically more stable and accurate?
The precision and stability of the different algorithms depend on how they are implemented. Sorry, but I can't be more helpful. What I found out is that the first algorithm listed in the Wikipedia page is slightly faster than the other two, which kind of surprises me, since the conjugation used in the second one should be quite fast. I suspect that the Complex data type has not been optimized yet. My implementation of the first and third algorithm are in the "quite quick & dirty" side of the spectrum, so I think they can be tuned up. BTW, I tried to tune up those algorithms, but I ended up delivering a bug report in Rakudo :-)
I changed my fork of your repository, adding the reverse transform to the library as suggested. Do you want me to open another PR?
I suggested that specific example just because it might be useful for the reader to know that the algorithm you implemented is good enough to allow a reverse transform which outputs the original values to a precision of 10⁻¹². I'm not sure such a thing should go in the README.md file; I would leave such a program in the
examples
directory.