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

using MutableArithmetic api? #118

Open
kalmarek opened this issue Mar 25, 2021 · 2 comments
Open

using MutableArithmetic api? #118

kalmarek opened this issue Mar 25, 2021 · 2 comments

Comments

@kalmarek
Copy link
Owner

so that we can write MA.@rewrite a + b + c instead of sequence of Arblib.add!s.

@Joel-Dahne
Copy link
Collaborator

I have looked a little bit at this package before and I think it would be very nice to support it! It's a perfect fit for our use case. I would be happy to take a look at this at some point but at the moment I'm focused on, slowly, improving the support for polynomials and series (which would both benefit even more from this than for example Arb would).

@kalmarek
Copy link
Owner Author

yeah, this was more of a reminder for us, @saschatimme spearheaded the package so he'll be more qualified to implement this ;)

But it's great to hear that you're still working on the package, I've been mostly taken by my other projects for quite a while!

nsajko added a commit to nsajko/Arblib.jl that referenced this issue Nov 15, 2023
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])
```
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