Post Reply 
@Thomas Klemm -> CORDIC Article
06-03-2014, 02:02 PM (This post was last modified: 06-03-2014 02:03 PM by pito.)
Post: #20
RE: @Thomas Klemm -> CORDIC Article
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..
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 - 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)