Post Reply 
@Thomas Klemm -> CORDIC Article
06-04-2014, 05:57 PM
Post: #23
RE: @Thomas Klemm -> CORDIC Article
(06-03-2014 02:02 PM)pito Wrote:  I've flashed my CM3 with the old stuff I've found - when running below code with 34digits I get (I've added your result for comparison):

Code:
TRIG9
TRIG9= 9.000 000 000 000 000 000 000 000 000 000 227
yours: 8.999 999 999 999 999 999 999 999 999 937 535
Elapsed x1 =201 ms

Code:
#define _PI  "3.1415926535897932384626433832795028841971693993751"
//  TRIG9 PRECISION TEST
cout<<"TRIG9"<<endl;
decfp tmp, PI;
PI = _PI;
tmp = "9.0";  // 9 DEGREE
// deg to rad
timer = millis;
tmp = tmp *  PI / "180.0";
tmp = arcsin ( arccos ( arctan ( tan ( cos ( sin ( tmp ) ) ) ) ) ) ;
// rad to deg
tmp = tmp * "180.0" / PI;
timer = millis - timer;
cout<<"TRIG9= "<<tmp<<endl;
cout<<"Elapsed x1 ="<<timer<<" ms"<<endl;

But I've learned you do rounding after each calculation so maybe that is what makes the diff..

Does anyone know of a table of correct values for this?
newRPL gave me (for 34 digits):

8.999999999999999999999999999999979

I ran a loop from 9 to 900 digits, and the difference is always only the last 2 digits, being the worst difference 85 ULP.

But how do we know right from wrong?

Claudio
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
@Thomas Klemm -> CORDIC Article - Tugdual - 05-31-2014, 08:00 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-01-2014, 08:28 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-02-2014, 10:13 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-02-2014, 10:58 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-02-2014, 11:05 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-02-2014, 11:20 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-03-2014, 02:02 PM
RE: @Thomas Klemm -> CORDIC Article - Claudio L. - 06-04-2014 05:57 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 02:52 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 06:06 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 06:30 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 06:45 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 07:16 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 07:30 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 07:51 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 08:12 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 08:34 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 09:21 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 09:33 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 09:41 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 09:50 PM
RE: @Thomas Klemm -> CORDIC Article - pito - 06-04-2014, 10:46 PM



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