[OpenJDK 2D-Dev] CubicCurve2D.solveCubic and containment/intersection bugs.

Denis Lila dlila at redhat.com
Thu Jan 27 22:03:08 UTC 2011


> When I first saw "I am Denis Lila" I chuckled because it came
> across like "I am Ironman"

:-D

Well, it is pushed. Now all that's left on my end is the performance
improvement for pisces (dashing in particular). Could you please file
a performance regression bug for it?

Thank you,
Denis.

PS: I was looking at 4074742 and I think last week's pushes fixed it.
I mean, that's an RFE for more precision, and declaring such things
"fixed" is pretty loaded, but I can't reproduce it with the given
reproducer anymore, and the current method is very accurate so I
think it should be closed.

----- Original Message -----
> On 1/27/2011 6:16 AM, Denis Lila wrote:
> >> Line 1161 - "num> 1"?
> >
> > Done.
> > Can the compiler take care of this sort of thing? It should be able
> > to
> > figure out that the only possible values for num are {0, 1, 2, 3}.
> 
> I don't think it can without a tremendous amount of code scanning. I
> don't think the compiler group would find it worth the effort, or that
> the translation of "num==2||num==3" can be approximated with "num>1"
> is
> easy for a computer to come up with...
> 
> >> Line 1271 - if the vals are opposite sign, is it worth
> >> bisectRoot'ing?
> >
> > Do you mean if badRootVal and fx are of opposite signs?
> > I don't think bisectRoot would be good here. It is far slower than
> > what we
> > have, and in terms of accuracy we wouldn't really gain much because
> > in
> > the two root case the polynomial is very flat at the second root and
> > evaluating solveEqn(eqn, 3, x), where x is all the doubles near the
> > second
> > root, shows that the computed values change sign many, many times.
> > BisectRoot
> > finds a root in an interval where the function is known to be
> > monotonic and
> > has opposite signs at the end points. Monotonicity doesn't hold in
> > this case,
> > so all bisectRoot would do is look for values in the interval where
> > solveEqn returns exactly 0, but that's not really any better than a
> > random
> > sampling of the interval in the 2 root case.
> 
> Sounds good.
> 
> > Is it good to go now?
> 
> 1163 - I'd slice the trailing ") {" off the end of the line since that
> could confuse some autoformatters that aren't good at parsing through
> comments (gnuemacs sometimes reacts to unbalanced entities in
> comments).
> 
> 1387 - very formal! I would have just put "[dlila]" where you put
> "[1]".  or "I am Legend"... ;-)
> 
> It's good to go, I don't think I need to see another webrev if you go
> with the previous 2 suggestions...
> 
> ...jim



More information about the 2d-dev mailing list