Serving the Quantitative Finance Community

 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ quiz - Maths and acccuracy

March 28th, 2013, 4:56 pm

Don't suppose there is user-friendly install of Boost 1.53? a la boostrpro?
 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

C++ quiz - Maths and acccuracy

March 28th, 2013, 5:11 pm

Yes, there is, nothing's changed since the last time this questions was asked: http://www.wilmott.com/messageview.cfm? ... adid=93607 :-)
 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

C++ quiz - Maths and acccuracy

March 28th, 2013, 6:45 pm

outrun: not sure if that's the same thing you're talking about, but:http://ryppl.org/http://groups.google.c ... pl-dev"our tool for modularizing Boost's SVN history is still under active development: http://github.com/ryppl/Boost2Git"http: ... RptcY"Last updated 4 days ago"http://github.com/ryppl/Boost2Git
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ quiz - Maths and acccuracy

March 29th, 2013, 12:16 pm

How to get wrong answers, twice!!Is multiprecision better ?(?) (problem is x(n = 1) is not exactly representable in either 10- or 20-place arithmetic).
Last edited by Cuchulainn on March 28th, 2013, 11:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ quiz - Maths and acccuracy

March 29th, 2013, 12:19 pm

(double)
Last edited by Cuchulainn on March 28th, 2013, 11:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ quiz - Maths and acccuracy

March 29th, 2013, 12:19 pm

QuoteOriginally posted by: outrunI think Cuch is looking for a simple installer that also includes binaries instead of having to run the build scripts?That would be great -- just like the old days.Seriously, lack of automagic installer reduces captive audience by BIG%.
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

C++ quiz - Maths and acccuracy

March 29th, 2013, 12:27 pm

QuoteOriginally posted by: CuchulainnHow to get wrong answers, twice!!Is multiprecision better ?(?) (problem is x(n = 1) is not exactly representable in either 10- or 20-place arithmetic).Indeed! This example shows that Range X(double low,double high) is an error-prone representation of an interval. A potentially more accurate one would be CenteredInterval X(double center, double delta).
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ quiz - Maths and acccuracy

March 29th, 2013, 12:51 pm

QuoteOriginally posted by: Traden4AlphaQuoteOriginally posted by: CuchulainnHow to get wrong answers, twice!!Is multiprecision better ?(?) (problem is x(n = 1) is not exactly representable in either 10- or 20-place arithmetic).Indeed! This example shows that Range X(double low,double high) is an error-prone representation of an interval. A potentially more accurate one would be CenteredInterval X(double center, double delta).Potentially..
Last edited by Cuchulainn on March 28th, 2013, 11:00 pm, edited 1 time in total.
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

C++ quiz - Maths and acccuracy

March 29th, 2013, 1:16 pm

The idea behind CenteredInterval X(double center, double delta) is to create a different definition of an interval and overload all operators to compute resultant values of "centre" and "delta".For example, for multiplication, Y=A*B, in the common case in which |centre| > |delta|, A.centre>0, B.centre>0, the proper interval calculation might be:Y.centre = A.centre*B.centre + A.delta*B.delta;Y.delta = A.delta*B.centre + A.centre*B.delta + LSB(Y.centre)/2;It's an exercise for the student to fill out the other 7 cases of |centre| ≤ |delta| and the signs on A.centre and B.centre; and to cleverly optimize/compact/collapse the case logic for speed.
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ quiz - Maths and acccuracy

March 29th, 2013, 2:32 pm

Not sure about LSB how to computeStill [1,1].
Last edited by Cuchulainn on March 28th, 2013, 11:00 pm, edited 1 time in total.
 
User avatar
Polter
Posts: 1
Joined: April 29th, 2008, 4:55 pm

C++ quiz - Maths and acccuracy

March 29th, 2013, 2:48 pm

QuoteOriginally posted by: CuchulainnQuoteOriginally posted by: outrunI think Cuch is looking for a simple installer that also includes binaries instead of having to run the build scripts?That would be great -- just like the old days.Seriously, lack of automagic installer reduces captive audience by BIG%.Well, yes, self-extracting pre-built binaries are definitely self-extracting and it would be hard for them not to include binaries, I'm not quite sure the what's the problem or what reduces captive audience exactly? :-)In any case, there's also (haven't tested, the aforementioned option works well for me): http://vertexwahn.de/
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

C++ quiz - Maths and acccuracy

March 29th, 2013, 3:07 pm

The problem is deeper than defining "Range product(const Range& r1, const Range& r2)" because Range is fundamentally the wrong data type for storing this kind of interval data. Round-off error in Range makes it incapable of doing accurate interval math on small intervals.We'd need a new data type because Range won't work.Something like the code below should produceValue [1, 2.0e-21] Value [1, 4.0e-21] Value [1, 8.0e-21] Value [1, 1.6e-20] .....(eventually, the center value will start changing, too)
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

C++ quiz - Maths and acccuracy

March 29th, 2013, 3:17 pm

Quote Range is fundamentally the wrong data type for storing this kind of interval data. Round-off error in Range makes it incapable of doing accurate interval math on small intervals.Indeed.