Giter VIP home page Giter VIP logo

Comments (6)

ChrisRackauckas avatar ChrisRackauckas commented on June 7, 2024

It's a bug, we should find how what causes it.

from symbolics.jl.

hersle avatar hersle commented on June 7, 2024

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.

ChrisRackauckas avatar ChrisRackauckas commented on June 7, 2024

Possibly, and then it evaluates the fraction with / which gives a float back for two ints.

from symbolics.jl.

hersle avatar hersle commented on June 7, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.