[OpenJDK 2D-Dev] X11 uniform scaled wide lines and dashed lines; STROKE_CONTROL in Pisces
Jim Graham
james.graham at oracle.com
Tue Dec 28 23:03:33 UTC 2010
Hi Denis,
I'm attaching a test program I wrote that compares the old and new
algorithms.
Obviously the old one missed a bunch of solutions because it classified
all solutions as 1 or 3, but the new one also sometimes misses a
solution. You might want to turn this into an automated test for the
bug (and maybe use it as a stress test with a random number generator).
I think one problem might be that you use "is close to zero" to check if
you should use special processing. I think any tests which say "do it
this way and get fewer roots" should be conservative and if we are on
the borderline and we can do the code that generates more solutions then
we should generate more and them maybe refine the roots and eliminate
duplicates. That way we can be (more) sure not to leave any roots unsolved.
The test as it is has a test case (I just chose random numbers to check
and got lucky - d'oh!) that generates 1 solution from the new code even
though the equation had 2 distinct solutions that weren't even near each
other...
...jim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CubicSolver.java
Type: java/*
Size: 9830 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20101228/822a8815/CubicSolver.java>
More information about the 2d-dev
mailing list