floating point calculations' accuracy

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

floating point calculations' accuracy

753 Views
stowoda
Contributor I

Hi.

 

I have to port some code from pc to the MCF51A. The code does some floating point calculations.

How could I proove the accuracy of the MCF51A using CodeWarrior's floating point library or libraries?

Will the results computed by the microcontroller be comparable to the results of the pc?

What else information do You need to help me?

 

regards

lu

Labels (1)
0 Kudos
3 Replies

459 Views
vier_kuifjes
Senior Contributor I

I'm using emulated floating point on a 52259 based system to calculate things like wind chill, heat index, relative humidity, sun rize/set times...

Some of these calculations even use math functions like EXP, SIN, COS etc. and are all done in single precision. I have the same calculations running in a Windows-based program. I have never noticed any difference in output between the two applications, but then I don't need accuracy up to the last bit in the final result. But as sun rize/set calculation involves an iteration, chances are high that the results would be different.

 

The fp_coldfire.a library is probably added automatically, otherwise you wouldn't be able to perform any float calculations.

0 Kudos

459 Views
stowoda
Contributor I

In addition to what I have previously written:

 

I am already running the same code with floating point calculations on both

the pc and µc and am not getting the same results. After a while, the results drift away.

 

The code is a iterative filter, so it uses results from the previous steps.

I am aware of rounding errors etc. but am not experienced enough to find a solution to that "drifting away".

 

if I would use double instead of float on the µC that drifting should appear at a later step.. Or am I wrong?

Sureley it depends on the range of the numbers the algorithm is struggling with..

 

I appreciate any help or hint , even to literature..

 

regards

lu

0 Kudos

459 Views
stowoda
Contributor I

Sorry but I dont know how to edit messages..

 

I am wondering if the "fp_coldfire.a - FPU emulation libraries", as it is written in the Reference Manual,

are included into my project at all.

0 Kudos