Re: Numbers and calculations and strange things

From: Claus Henning (claus#minus#guntram#dot#henning#at#ortim#dot#de)
Date: 11/30/04


Date: Tue, 30 Nov 2004 07:27:53 +0100

Manuel Meitinger schrieb:
> Have you checked if _controlfp(0,0) returns the same value?
> If not, the floating-point handling is different.

If this is the reason for different results, he uses an instable
algorithm. This means that the output data of some part of his CALCULATE
function has a big difference while the input data has small one. This
means that his algorithm is bad and that he should not use it for his
purposes.

Claus

>
> "Mateusz Łoskot" <check@my.signature.net> schrieb im Newsbeitrag
> news:JJuqd.54170$ha.48890@news.chello.at...
>
>>Hi,
>>
>>I have a real problem and I'm seriously confused having no idea what is
>>going on. I believe someone is able to explain me that.
>>
>>I'm doing some spherical trigonometry calculations in my application and I
>>use one function, let say it is called CALCULATE, which implements some
>>algorithm and returns double number as a result. For better understanding
>>of my later explanations I can say that the CALCULATE computes area in
>>square/area units (m2, km2, spherical degrees, etc.).
>>
>>I test this function on both eVC++ 4.0 and my iPAQ 2210 and MS VC++ 2003
>>on my Windows 2000 (Intel PIII).
>>
>>The problem is that the CALCULATE function gives me very different results
>>on both machines, for the same input data !!!
>>
>>Here are sample results which I get from my CALCULATE:
>>
>>First, I get the result in sperical degrees:
>>
>>VC++ 2003: 3.9536637543773154e-009
>>eVC++ 4.0: 2.8474172550380e-009
>>
>>NOTE: Here you can see how different are those results (?)
>>
>>Second, I convert it (spherical degrees) to more readable units:
>>
>>1) multiply it by constant 707632.4 to get square kilometers (km2):
>>
>>VC++ 2003: 0.0027977405713030304
>>eVC++ 4.0: 0.0020149247059840
>>
>>2) multiply it by constant 710010963049.73752482656869140624 to get square
>>meters (m2):
>>
>>VC++ 2003: 2807.1446098202787
>>eVC++ 4.0: 2021.6974674540
>>
>>So, you can see how big differences I get in every case.
>>
>>I'm sure for 99.9% that my CALCULATE function is working well, I'm testing
>>it for 3 days and on Windows 2000 (on desktop) I get very stable results,
>>I even can say I get real results (i.e. real area of my car park ;-)
>>
>>I debuged it step by step on both: evc++ and vc++ simultaneously and I
>>checked every number and results of my CALCULATE internalls.
>>
>>I can't believe there are such big differences beween iPAQ's CPU
>>implementation and PIII implementation
>>to give me so different results of my computations.
>>
>>Any explanation is welcome.
>>
>>--
>>Mateusz Łoskot, mateusz (at) loskot (dot) net
>>Registered Linux User #220771, Debian (Sarge)
>
>
>



Relevant Pages

  • Re: Greg Berchins filter design method
    ... Artificially adding a few samples of delay to the input data almost ... Modifying the algorithm to perform a "weighted least squares" fit is ... weighting low frequency data higher than high frequency data ...
    (comp.dsp)
  • Re: Is unsorted DB searching in NP?
    ... - what is your input data? ... To tell what complexity class this is in, ... algorithm (an algorithm that takes time proportional to the ... scan the array in order, return i, when you ...
    (comp.theory)
  • Re: Algorithm wanted
    ... >> I need an algorithm that will do more or less this. ... > quite clear about whether I wanted the longest row or not. ... anomalous errors. ... or the input data was too sparse. ...
    (comp.programming)
  • Re: pattern equality test?
    ... >> when I found the bugs in my algorithm. ... I like explanations of algorithms better than unexplained ... > after all it's supposed to be neither language nor OS-specific, ... code is less ambiguous than English. ...
    (comp.programming)
  • Re: Are natural languages secure ciphers?
    ... > algorithm secret, whereas encoding keeps all of the ... to keep the input data secret. ... What is "ZIP compression"? ...
    (sci.crypt)