Closed laurentbartholdi closed 1 month ago
Hi @laurentbartholdi, thanks for your interest in MultiFloats.jl! I appreciate your suggestion, and I do agree that this is a nice quick-and-dirty fix if you need floating-point exponentiation in your program. However, I am deliberately not going to add support for the ^
operator in MultiFloats.jl until there is a highly-efficient pure MultiFloat
implementation, as I do not want to give user the impression that this is a supported operation until I have put in the work to support it.
In general, many users have the misconception that floating-point exponentiation ^
is just another arithmetic operator, when in fact it is very expensive and requires evaluating transcendental functions. Therefore, I actually consider it a feature, not a bug, that a user has to write exp(y*log(x))
instead of x^y
, making them consciously aware that exp
and log
are being called.
Adding a reference to issue #28, which I am designating as the tracking issue for a new, higher-performance implementation of exp
and log
.
Great! While I respect fully your argument, I wish to point out that
MultiFloats
is soo good that I use it extensively, including when calling other packagesNonlinearSolve
computes precisely once x^(4/5)
to make an estimation on the required precision of something. I understand that the "correct" thing to do is to contact the author of NonlinearSolve
and ask him/her to avoid the power operation since it's the only place the code uses other operations than +,-,*,/; but life is so short, and it would be so nice if MultiFloats
worked out of the box.Hey @laurentbartholdi, that's an excellent point -- compatibility with other packages, even ones that do silly things, is worth pursuing. I will prioritize implementation of exp
and log
for MultiFloats.jl and provide an implementation of ^
as soon as it is finished.
I added the following to my code:
While I'm eagerly waiting for transcendental functions, it's a useful if dirty workaround for code that relies on powers. Perhaps you want to add it?