proof of concept MutableArithmetics support - #178
Open
nsajko wants to merge 1 commit into
Open
Conversation
This only provides support for `sin`, `cos` and `sincos`. The idea was to show how easy it is to add MA support, after which someone else may decide to add more full support, which would be autogenerated, I guess. NB: I think you may also want to overload `MA.operate`. Updates kalmarek#118 Usage example: ```julia-repl julia> using Arblib, MutableArithmetics julia> o() = one(Arb) o (generic function with 1 method) julia> sin(o()) [0.8414709848078965066525023216302989996225630607983710656727517099919104043912 +/- 4.00e-77] julia> operate_to!!(o(), sin, o()) [0.8414709848078965066525023216302989996225630607983710656727517099919104043912 +/- 4.00e-77] julia> sincos(o()) ([0.8414709848078965066525023216302989996225630607983710656727517099919104043912 +/- 4.00e-77], [0.5403023058681397174009366074429766037323104206179222276700972553811003947745 +/- 4.21e-77]) julia> sc = (o(), o()) (1.0000000000000000000000000000000000000000000000000000000000000000000000000000, 1.0000000000000000000000000000000000000000000000000000000000000000000000000000) julia> operate_to!!(sc, sincos, o()) ([0.8414709848078965066525023216302989996225630607983710656727517099919104043912 +/- 4.00e-77], [0.5403023058681397174009366074429766037323104206179222276700972553811003947745 +/- 4.21e-77]) julia> sc ([0.8414709848078965066525023216302989996225630607983710656727517099919104043912 +/- 4.00e-77], [0.5403023058681397174009366074429766037323104206179222276700972553811003947745 +/- 4.21e-77]) ```
Collaborator
|
Thank you! This would certainly be helpful as a starting point! Indeed it then seems somewhat straightforward to add support for all methods in Base and SpecialFunctions.jl. |
Owner
|
if anyone is willing to spend more time here is what i've written at some point: with the same data with BigFloats for comparison: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This only provides support for
sin,cosandsincos. The idea was to show how easy it is to add MA support, after which someone else may decide to add more full support, which would be autogenerated, I guess.NB: I think you may also want to overload
MA.operate.Updates #118
Usage example: