Post Reply 
HHC 2015 - Savage benchmark curiosity
10-09-2015, 12:53 PM
Post: #7
RE: HHC 2015 - Savage benchmark curiosity
(10-09-2015 07:45 AM)Dieter Wrote:  
(10-08-2015 08:31 PM)Claudio L. Wrote:  Question still remains: why does it self-correct?

I do not think it "self-corrects", it just happends to round once up, once down. Depending on where you stop the loop the results sometimes match, sometimes they don't.

There's a lot more than that going on!
Take the first iteration, for example:
1470.99993303
LN EXP --> 1470.99993302 (there's -1 change introduced here)
ATAN TAN 1 + --> 1471.99994304

1470.99991143
LN EXP --> 1470.99991143 (but not on this path...)
ATAN TAN 1 + --> 1471.99992140

So deviations from the "exact" result happen somewhat randomly on both paths, sometimes it +/- 1 in the LN/EXP combo, sometimes it's +/-1 in the ATAN function, which ends up around +/-2e-4 in the final result, amplified by TAN.
By the time you get to iteration 1647, you've been following 2 different paths for 170 iterations, and you end up with 2 different numbers, both containing a number of random deviations in the last 4 digits. Magically, this iteration produces the exact same result, on both paths.

The last position where the 2 paths differ has:
1647.99989715 and 1647.99992427

Applying the exact same operators to these 2 different numbers produces the exact same result...
1647.99989715 LN EXP --> 1647.99989715
ATAN --> 1.57018953072

1647.99992427 LN EXP --> 1647.99992428
ATAN --> 1.57018953072

Turns out that:
tan(1.57018953071)=1647.99988358
tan(1.57018953072)=1647.99991074
tan(1.57018953073)=1647.99993790

This is a lot less magical than it appeared at the beginning (at least to me). All numbers between 1074 and 3790 in the last 4 digits will produce the same result. The difference 1e-11 in the tangent produces +/- 2716 in the last 4 digits. If we think the last 4 digits are completely random, then there is a chance 2716 in 10000, or roughly 1 in 4, that they will produce the same result. That's a very good chance that the paths will get in sync again.
I think the mystery is solved, the loop runs until these somewhat random errors produce values that are within the +/- 2716 in the last four digits, then the ATAN/TAN pair will coalesce these range of numbers into the same result, syncing back the paths.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2015 - Savage benchmark curiosity - Claudio L. - 10-09-2015 12:53 PM



User(s) browsing this thread: 3 Guest(s)