davidedc / Algebrite

Computer Algebra System in Javascript (Typescript)
http://algebrite.org
MIT License
966 stars 59 forks source link

roots(numerator(...)) better than roots(...) ? #110

Open thunderkid opened 4 years ago

thunderkid commented 4 years ago

Running this: roots(-1+a/(2+b),a) gives this ugly thing: b/((b/(2+b)+2/(2+b))*(b/((2+b)*(b/(2+b)+2/(2+b)))+2/((2+b)*(b/(2+b)+2/(2+b)))))+2/((b/(2+b)+2/(2+b))*(b/((2+b)*(b/(2+b)+2/(2+b)))+2/((2+b)*(b/(2+b)+2/(2+b))))) instead of just giving 2+b. Even after running this through simplify it doesn't get to the proper answer. However if you run roots(numerator(-1+a/(2+b)), a) then you indeed get 2+b. Some quick experiments with other expressions don't seem to suffer from using the roots(numerator... pattern. Am I missing something or would it be better to have roots always do this internally?