You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think that the current defaults have worked out for simplification. Users are very confused and it's not a good situation. #507#494 etc. When almost every issue starts becoming "you're using it wrong", then I would venture to think that something is wrong in the API and how it's being presented to users.
Now the difficulty here is #507 (comment) as @stevengj points out many things are assuming safety: no dividing by zero, etc. And there are good reasons for that, but why is that the default? Maple, Mathematica, etc. all of these systems did not choose that default because it does not give the results people expect, and I don't think simplify_fractions.(simplify.(inv(A) * det(A), expand=true)) is a satisfying answer.
But there is a different way to construct this that would give both safety and convenience. We could do it through the type system because our variables have context, and implicitly this information is about spaces. Right now we have:
@variables a::Real
as the default (though users don't write the ::Real of course), and so everything has been shoved into that type. But we can have different versions:
@variables a::Real# real under the assumption that substitutions are limiting behavior, so `a/a = 1` because it does even as `a->0`@variables a::SafeReal# real without limiting assumptions@variables a::SymbolicFloat# only assumptions floating point safe simplifications
and having different rule sets. Under this setup, it would then make sense for a::Real to always simplify fractions in the constructor, which means simplify_fractions would not have to be a separate step because it wouldn't be so slow. It would just be understood that SafeReal is going to be slower, and simplify_fractions would just be folded into simplify by default (with an option to turn it off).
The text was updated successfully, but these errors were encountered:
This is due to a bug which I also fixed in the PR.
shashi
changed the title
Simplify the default simplify so that a small fraction needs simplify_fraction
Number types with varying levels of safety
Jan 17, 2022
shashi
changed the title
Number types with varying levels of safety
Simplify the default simplify so that a small fraction needs simplify_fraction
Jan 17, 2022
Self-explanatory title, but I'll dig in anyways.
I don't think that the current defaults have worked out for simplification. Users are very confused and it's not a good situation. #507 #494 etc. When almost every issue starts becoming "you're using it wrong", then I would venture to think that something is wrong in the API and how it's being presented to users.
Now the difficulty here is #507 (comment) as @stevengj points out many things are assuming safety: no dividing by zero, etc. And there are good reasons for that, but why is that the default? Maple, Mathematica, etc. all of these systems did not choose that default because it does not give the results people expect, and I don't think
simplify_fractions.(simplify.(inv(A) * det(A), expand=true))
is a satisfying answer.But there is a different way to construct this that would give both safety and convenience. We could do it through the type system because our variables have context, and implicitly this information is about spaces. Right now we have:
as the default (though users don't write the
::Real
of course), and so everything has been shoved into that type. But we can have different versions:and having different rule sets. Under this setup, it would then make sense for
a::Real
to always simplify fractions in the constructor, which meanssimplify_fractions
would not have to be a separate step because it wouldn't be so slow. It would just be understood thatSafeReal
is going to be slower, andsimplify_fractions
would just be folded intosimplify
by default (with an option to turn it off).The text was updated successfully, but these errors were encountered: