-
Notifications
You must be signed in to change notification settings - Fork 6
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
proof of concept MutableArithmetics support #178
base: master
Are you sure you want to change the base?
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]) ```
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. |
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 only provides support for
sin
,cos
andsincos
. 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: