Algebrite icon indicating copy to clipboard operation
Algebrite copied to clipboard

Simplify giving error in ^1.3.0: Floating point numbers in polynomial

Open thunderkid opened this issue 4 years ago • 2 comments

In version 1.3.0 and 1.3.1, If you run simplify on the following polynomial: - i * s ^ 2 * ( - 19.6 * m ^ 2 * x / s ^ 2 - 16 * m ^ 2 / s ^ 2 ) ^ 0.5 / ( 9.8 * m ) - 4 * s / 9.8 then you get the error Stop: floating point numbers in polynomial However, if you leave off the last part - 4*s/9.8, then it works. Also, the full simplification was working ok in version 1.2.1, and it works ok on the algebrite.org website.

thunderkid avatar May 29 '20 17:05 thunderkid

Here's a cleaner example. Running simplify on 0.123 * x + 335 * y gives the floating point numbers in polynomial error in version 1.3.1 but not 1.2.1.

thunderkid avatar Jun 05 '20 16:06 thunderkid

in v 1.2.0, the simplification gives: 1.0*s*(-0.408163-0.102041*i*s*(-19.6*m^2.0*x/(s^2.0)-16.0*m^2.0/(s^2.0))^0.5/m)

we probably didn't attempt to factor the polynomial as part of simplification in 1.2.1 because attempting the factorisation would have given us the same error, see https://github.com/davidedc/Algebrite/blob/fb1a5f770c5c8c352371f2596746d04cc5c11e2c/sources/factorpoly.coffee#L67 .

davidedc avatar Apr 05 '21 17:04 davidedc