Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing method for ^ #46

Closed
laurentbartholdi opened this issue Aug 21, 2024 · 4 comments
Closed

Missing method for ^ #46

laurentbartholdi opened this issue Aug 21, 2024 · 4 comments

Comments

@laurentbartholdi
Copy link

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?

@dzhang314
Copy link
Owner

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.

@dzhang314
Copy link
Owner

Adding a reference to issue #28, which I am designating as the tracking issue for a new, higher-performance implementation of exp and log.

@laurentbartholdi
Copy link
Author

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 packages
  • Lots of packages require powers, even if in silly manners; for example, NonlinearSolve 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.

@dzhang314
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants