JuliaMath / JuliaMath/Roots.jl

Wrong roots with multroot

Open
#69 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
413
Forks
61
Avg merge
57m
Merged PRs (30d)
5

Description

Hi!

I've had issues with the multroot function.
I have the function f(x)=1.7273219441449328e-6+257.8444185695129*x+111.17574047075945*x^2

the roots for this polynomial function should be: -2.31925 and -6.699e-9
but if I do :
`using Roots`
`f(x)=1.7273219441449328e-6+2*128.92220928475646*x+3*37.05858015691982*x^2`
`roots(f)`
`multroot(f)`

I get the following results:
`2-element Array{Float64,1}:`
` -2.31925`
` 0.0`
and:
`([-2.31925,0.0],[1,1])`

I know 0 is "almost the same thing" as -6.699e-9, but in what I am trying to do it makes a difference. Any idea why I get this problems?

(also if I compute the roots with the classic formula for 2nd order polynomial with Julia I get the right answers)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.