Hi again.

I found an implementation of a closed form cubic root solver
(from graphics gems):
http://read.pudn.com/downloads21/sourcecode/graph/71499/gems/Roots3And4.c__.htm

I did some micro benchmarks, and it's about 25% slower than the one I have.
I'm thinking we should use it anyway because it's much better in every
other way: it finds all roots, it doesn't make its callers give it a root
array that is longer than the total number of roots, and most importantly,
it doesn't fail because of an iteration upper bound. From my testing, I noticed
that this happens too frequently for comfort in my cubicRootsInAB. I haven't
noticed any rendering artifacts caused by this, but I also haven't tried
rendering every possible curve and it's better to prevent bugs than fix them.

What do you think?

Regards,
Denis.

Reply via email to