Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
NicolasRobidoux
Posts: 1944 Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada
Post
by NicolasRobidoux » 2012-12-11T07:32:52-07:00
Cristy's patch looks like a good one: In exact arithmetic, we are never taking a square root of something negative. But we're not in exact arithmetic.
From svn diff:
Code: Select all
- const double sqrt_discriminant = sqrt(discriminant);
+ const double sqrt_discriminant =
+ sqrt(discriminant < -0.0 ? 0.0 : discriminant);
If more problems crop up, I should carefully put some MagickEpsilons in there.
NicolasRobidoux
Posts: 1944 Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada
Post
by NicolasRobidoux » 2012-12-11T07:39:40-07:00
This bug is an immediate illustration of "direct" SVD decompositions being ill-conditioned. Fast, but better be extra careful. And I was not.
NicolasRobidoux
Posts: 1944 Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada
Post
by NicolasRobidoux » 2012-12-11T08:31:08-07:00
Forgot to use changelist again with IM6 (Makefile.PL, magick-baseconfig.h and version.h changed when I did not intend to).
-----
In any case, I made the test this one to minimize the impact of "various computation branches on floating point computation":
Code: Select all
/*
* In exact arithmetic, discriminant can't be negative. In floating
* point, it can, because of the bad conditioning of SVD
* decompositions done through the associated normal matrix.
*/
const double sqrt_discriminant =
sqrt(discriminant > 0.0 ? discriminant : 0.0);
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2012-12-11T20:09:50-07:00
The patch seems to have solved the problem.
NicolasRobidoux
Posts: 1944 Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada
Post
by NicolasRobidoux » 2012-12-12T06:02:12-07:00
I'm really impressed at how fast Cristy, Anthony and Fred got the issue figured out and solved.
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2012-12-12T10:59:33-07:00
NicolasRobidoux wrote: I'm really impressed at how fast Cristy, Anthony and Fred got the issue figured out and solved.
Thanks goes to Anthony and Cristy and you. I really had nothing to contribute on this one.
tsanders
Posts: 13 Joined: 2012-12-06T04:14:34-07:00
Authentication code: 6789
Post
by tsanders » 2012-12-13T00:47:43-07:00
Is there any progress on the new beta release? Thanks.
tsanders
Posts: 13 Joined: 2012-12-06T04:14:34-07:00
Authentication code: 6789
Post
by tsanders » 2012-12-13T05:32:54-07:00
Found it! Checked it out and it works 100% OK! Thanks everyone, GREAT JOB!
NicolasRobidoux
Posts: 1944 Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada
Post
by NicolasRobidoux » 2012-12-13T05:51:03-07:00
tsanders wrote: GREAT JOB!
... to you too. Thank you for your very informative bug report.
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2012-12-13T16:16:02-07:00
I have mapped it into IMv7 too.
NicolasRobidoux
Posts: 1944 Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada
Post
by NicolasRobidoux » 2012-12-14T06:28:37-07:00
anthony wrote: I have mapped it into IMv7 too.
Apologies if I forgot. Juggling -> dropping balls.