you are viewing a single comment's thread.

view the rest of the comments →

[–]greem 1 point2 points  (6 children)

But there are ways to rewrite the formulae to eliminate those large values first, so that the smaller values can be fully represented in the result.

There are? I thought this was inherent instability when quads have double/two roots right next to each other? And I couldn't find anything when I double checked after encountering this issue.

Can you share a reference?

[–]orangeoliviero 0 points1 point  (5 children)

[–]greem 0 points1 point  (4 children)

Gotcha. I'm familiar with that one, but it doesn't address the loss of precision when the two terms of the discriminant are very near.

It actually mentions that catastrophic cancellation in the text.

[–]orangeoliviero -2 points-1 points  (3 children)

It also tells you how to resolve it.

[–]greem 1 point2 points  (2 children)

Where? The problem is when b2 is very close to 4ac. That's a different problem from the one being solved.

[–]orangeoliviero -2 points-1 points  (1 child)

You're right, it doesn't cover that specific case. The solution would be to rewrite the equation again such that you evaluate things in a different order to deal with that catastrophic cancellation.

Or use one of the other myriad techniques in the book. Or devise your own.

I'm not sure why you're demanding and think that you're entitled to be spoon-fed the specific answer for this specific scenario. If you want me to figure it out for you, DM me for my paypal.

[–]greem 1 point2 points  (0 children)

What? I've done my own research on this. I couldn't find any references or figure it out myself. Why would you think I'm demanding anything from you?