Page 15 of 15

ISO C++11 published

Posted: January 24th, 2016, 11:30 am
by Polter

ISO C++11 published

Posted: January 25th, 2016, 10:34 am
by Polter
That's a pretty interesting idea -- add warnings or errors when using a numerically unstable floating point expression: http://github.com/mcarton/rust-herbie-lint

ISO C++11 published

Posted: January 25th, 2016, 10:56 am
by Cuchulainn
QuoteOriginally posted by: PolterThat's a pretty interesting idea -- add warnings or errors when using a numerically unstable floating point expression: http://github.com/mcarton/rust-herbie-lintWhat is the definition of 'numerically unstable thing'Quotetest.rs:155:5: 155:30 warning: Numerically unstable expression, #[warn(herbie)] on by defaulttest.rs:155 (a+b).sin() - (a+b).cos(); ^~~~~~~~~~~~~~~~~~~~~~~~~test.rs:155:5: 155:30 help: Try thistest.rs: (b.sin() * (a.sin() + a.cos())) - ((a.cos() - a.sin()) * b.cos());Take b = 0, the answers are not even the same. Am I missing something subtle? Was it machine-produced code or written on the fly? Quotetest.rs:40:5: 40:18 warning: Numerically unstable expression, #[warn(herbie)] on by defaulttest.rs:40 (a/b + c) * b; ^~~~~~~~~~~~~test.rs:40:5: 40:18 help: Try thistest.rs: (c * b) + a;I agree with this one. But the algorithm should never get that far in the first place.

ISO C++11 published

Posted: January 25th, 2016, 6:12 pm
by Polter
QuoteOriginally posted by: CuchulainnQuoteOriginally posted by: PolterThat's a pretty interesting idea -- add warnings or errors when using a numerically unstable floating point expression: http://github.com/mcarton/rust-herbie-lintWhat is the definition of 'numerically unstable thing'From the paper, the goal seems to be the following:QuoteTo correct inaccurate formulas, programmers must rearrange their computations to avoid rounding error. These rearrangements are often based on identities of real-number arithmetic. For example, to avoid catastrophic cancellation in (1+x)-x , one could reassociateinto 1+(x-x) , which simplifies to 1 and is exactly accurate.Quotetest.rs:155:5: 155:30 warning: Numerically unstable expression, #[warn(herbie)] on by defaulttest.rs:155 (a+b).sin() - (a+b).cos(); ^~~~~~~~~~~~~~~~~~~~~~~~~test.rs:155:5: 155:30 help: Try thistest.rs: (b.sin() * (a.sin() + a.cos())) - ((a.cos() - a.sin()) * b.cos());Take b = 0, the answers are not even the same. Am I missing something subtle? Was it machine-produced code or written on the fly?Seems to reduce to the same thing: http://www.wolframalpha.com/input/?i=Fu ... y%5bsin(b)+*+(sin(a)+%2b+cos(a))+-+(cos(a)+-+sin(a))+*+cos(b)%5d

ISO C++11 published

Posted: January 25th, 2016, 7:54 pm
by Cuchulainn
QuoteOriginally posted by: PolterQuoteOriginally posted by: CuchulainnQuoteOriginally posted by: PolterThat's a pretty interesting idea -- add warnings or errors when using a numerically unstable floating point expression: http://github.com/mcarton/rust-herbie-lintWhat is the definition of 'numerically unstable thing'From the paper, the goal seems to be the following:QuoteTo correct inaccurate formulas, programmers must rearrange their computations to avoid rounding error. These rearrangements are often based on identities of real-number arithmetic. For example, to avoid catastrophic cancellation in (1+x)-x , one could reassociateinto 1+(x-x) , which simplifies to 1 and is exactly accurate.Quotetest.rs:155:5: 155:30 warning: Numerically unstable expression, #[warn(herbie)] on by defaulttest.rs:155 (a+b).sin() - (a+b).cos(); ^~~~~~~~~~~~~~~~~~~~~~~~~test.rs:155:5: 155:30 help: Try thistest.rs: (b.sin() * (a.sin() + a.cos())) - ((a.cos() - a.sin()) * b.cos());Take b = 0, the answers are not even the same. Am I missing something subtle? Was it machine-produced code or written on the fly?Seems to reduce to the same thing: http://www.wolframalpha.com/input/?i=Fu ... y%5bsin(b)+*+(sin(a)+%2b+cos(a))+-+(cos(a)+-+sin(a))+*+cos(b)%5dWhat if you do it by hand?? BTW I agree with Wolfram. I TAKE IT BACK it's notation!!!!(a+b)cos() == cos(a+b)LOL==It is not consistent with accepted mathematical notation, which is bad.

ISO C++11 published

Posted: January 26th, 2016, 10:52 am
by Cuchulainn
I think this is the official/accepted term:Loss of significance

ISO C++11 published

Posted: February 4th, 2016, 9:16 pm
by Cuchulainn
Does this class walk, talk and quack like an abstract class?

ISO C++11 published

Posted: February 18th, 2016, 9:23 am
by Cuchulainn
QuoteType generators are sometimes viewed as a workaround for the lack of ``templated typedefs'' in C++.

ISO C++11 published

Posted: February 26th, 2016, 10:02 am
by Cuchulainn
what is the status of the uckly duckling std::valarray in C++11?

ISO C++11 published

Posted: June 13th, 2016, 2:35 pm
by Cuchulainn
You can see that this code is wrong, but why?