From: Paul Gofman Subject: Re: [PATCH 4/4] d2d1: Implement cubic bezier-line intersection. Message-Id: <3574ab92-2404-529b-0e86-6b910387bbc7@gmail.com> Date: Wed, 1 Apr 2020 20:13:56 +0300 In-Reply-To: <68805882-3179-3665-63eb-7a0902694add@debian.org> References: <20200331201103.15219-1-conmanx360@gmail.com> <20200331201103.15219-4-conmanx360@gmail.com> <346d7617-c4d0-2b16-35b6-e3cd92157695@gmail.com> <68805882-3179-3665-63eb-7a0902694add@debian.org> On 4/1/20 20:03, Giovanni Mascellani wrote: > Il 01/04/20 18:46, Paul Gofman ha scritto: >> Given the complex roots are not needed here and the polynomial is always >> cubic, is this generic method really beneficial? It would probably be >> simpler and quicker to find one root x1 with simple bisection, then >> divide the polynomial into (x - x1) and deal with remaining quadratic >> equation. > This kind of division is typically numerically unstable. It might be > that for cubic polynomials the problem is not very apparent, Yes, factoring out the roots from a high degree polynomial can accumulate the error, but how's that a problem for just one root? Also, I think just using double precision in analytical solution will avoid any practical stability problems in this case.