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

abs broken with Symbolics #128

Open
blegat opened this issue May 22, 2023 · 1 comment
Open

abs broken with Symbolics #128

blegat opened this issue May 22, 2023 · 1 comment

Comments

@blegat
Copy link

blegat commented May 22, 2023

We used to be able to use Symbolics.Num in quaternions but #122 broke our workflow; see dionysos-dev/Dionysos.jl#211

The issue is that isinf is not defined for Num types defined in Symbolics. Maybe these could be done only for AbstractFloat ?

cc @sethaxen

@sethaxen
Copy link
Collaborator

Thanks for the issue! I don't think the solution is to restrict the more accurate branch to AbstractFloat, because then we would hit the less accurate branch whenever using wrappers of floating point numbers, e.g. those in ForwardDiff and ReverseDiff.

A better way is probably to specialize abs(::Quaternion{Num}) to hit the simpler version. On Julia v1.9, we can do this with a package extension (suggested in #123 (comment)). It makes more sense to include such an extension QuaternionsSymbolicsExt here than in Symbolics.

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

No branches or pull requests

3 participants