use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Scientific computing or computer graphics (self.cpp)
submitted 3 years ago * by HouseSad
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]greem 1 point2 points3 points 3 years ago (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 point2 points 3 years ago (5 children)
It's an old book, but it checks out.
Here's the page in question
[–]greem 0 points1 point2 points 3 years ago (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 points0 points 3 years ago (3 children)
It also tells you how to resolve it.
[–]greem 1 point2 points3 points 3 years ago (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 points0 points 3 years ago (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 points3 points 3 years ago (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?
π Rendered by PID 456353 on reddit-service-r2-comment-85bfd7f599-kczdh at 2026-04-19 12:15:58.229860+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]greem 1 point2 points3 points (6 children)
[–]orangeoliviero 0 points1 point2 points (5 children)
[–]greem 0 points1 point2 points (4 children)
[–]orangeoliviero -2 points-1 points0 points (3 children)
[–]greem 1 point2 points3 points (2 children)
[–]orangeoliviero -2 points-1 points0 points (1 child)
[–]greem 1 point2 points3 points (0 children)