Comments (6)
It's a bug, we should find how what causes it.
from symbolics.jl.
Here is the most minimal example I am able to reduce it to:
using Symbolics
@variables a b
simplify(a/b + 2*a^2/b)
This outputs (a + 2.0(a^2)) / b
, but I want (a + 2(a^2)) / b
. Replacing simplify
with simplify_fractions
changes nothing.
With expand(a/b + 2*a^2/b)
instead, I get a / b + (2(a^2)) / b
, so perhaps the problem is related to how simplify
puts everything in one fraction?
from symbolics.jl.
Possibly, and then it evaluates the fraction with /
which gives a float back for two ints.
from symbolics.jl.
I've done some digging. It seems that even
using SymbolicUtils
@syms x
pf = PolyForm(x) # polynomial 1*x^1
div(pf, pf) # x / x
outputs 1.0
instead of 1
.
Digging into in SymbolicUtils.jl's polyform.jl, it seems that it ultimately relies on DynamicPolynomials.jl to do the division.
There is an identical open/unresolved issue in that library. But it seems to me that this SymbolicUtils.jl commit was made to provide a workaround?
What is the way to go about this? I suppose the ideal way would be to fix it upstream?
from symbolics.jl.
Related Issues (20)
- Finding Coefficients of Cross Terms HOT 1
- Can't define custom derivative dependent on model parameters (locally) HOT 3
- Rational or integer coefficients with simplify? HOT 2
- Cannot sum an array of symbolics because of conversion error HOT 2
- Indexing vector of variables has strange repr
- Representation of AND `&` between symbolic vars HOT 1
- Error on violation of default type HOT 1
- Docstring of Differential instances is irrelevant
- `Differential`s display differently in a REPL than their docstring indicates they should HOT 1
- `derivative` gives wrong answer when differentiating with respect to an expression HOT 2
- Wrong answer for derivative at branch points
- Tracking issue for Gruntz's limit algorithm's dependencies HOT 1
- Passing function to `derivative` results in zero HOT 1
- Structs in structs
- Error with Julia 1.10 HOT 1
- Issue using `register_symbolic` with a function that returns `Vector{Float64}` after the 5.3.0 release HOT 2
- How to @register_symbolic a function by a non-interactive way HOT 1
- Can you remove NanMath from build_function output? HOT 5
- isaffine and islinear not handling differentials correctly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from symbolics.jl.