This article is rated B-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||
|
The value in the implentation section should really be what it was before someone changed it, 0.607. My comment wasn't correct which may have led to the confusion. The inverse of K is needed to get the true magnitude because all the shifts result in a gain of K = 1.647 which then must be removed to get the true magnitude.
See the article in the references section: http://www.dspguru.com/info/faqs/cordic2.htm
RDIC Gain (cumulative magnitude) of about 1.647. Therefore, to get the true value of magnitude we must multiply by the reciprocal of 1.647, which is 0.607. (Remember, the exact CORDIC Gain is a function of the how many iterations you do."
Addps4cat 19:56, 21 March 2006 (UTC)
Yeah, the value of K in the implentation is indeed correct. However, the equation for K given in previous edition was wrong, which led to my confusion and my changing of K in the implentation before. K is defined as cos(arctan(2^(-i))), you can simply check that K should be 1/sqrt(1+2^(-2i)), instead of sqrt(1+2^(-2i)) as given before. And by this definition, lim(K)=0.6073, again not 1.647 as given before. I've corrected it and removed the "inv" in the implentation to avoid further confusion. Cdpango 11:16, 23 March 2006 (UTC)
Maybe I've not expressed myself clearly. You indeed needs to multiply 0.6073(or divide 1.647) after the iterations. But the problem is we define K as "product of cos(arctan(2^(-i)))", so its value should be "product of 1/sqrt(1+2^(-2i))", instead of "product of sqrt(1+2^(-2i))", and it approaches 0.6073 when n approaches infinite. On the other hand, the system gain is A="product of sqrt(1+2^(-2i))"=1.647=1/K. I think that you just mixed up A and K. You can check the beignning part of section 3 of the following article, which explains this issue quite clearly. http://www.andraka.com/files/crdcsrvy.pdf It's nice to have a discussion. Best wishes! Cdpango 04:59, 24 March 2006 (UTC)
It seems interesting that the gain for the hyperbolic mode (m=-1)
is quoted in J.S. Walther's paper and in many other places as
If you run it it seems to converge to :
Has anyone else ran into this discrepency?
—Preceding unsigned comment added by 71.228.178.91 ( talk) 04:35, 1 February 2011 (UTC)
There is no sense to say of the limit of K
Nonsense!
On the other side, when if the number of iterations is, for example, 32, then the value of K should necessary to evaluate just for n=32. If instead of that we use suggested K=0.6072529350088812561694 (for : ) then error would be very big. By the way, coefficient K is not the Number !! For Number the more digits you use, the more precisely result you get. But for K the number n should be exactly equal to the number of iterations. Not more and not less!
The article mixes in n and i for subscripts and superscripts and it is confusing. n should be used to refer to the total number of iterations while i should refer to the current iteration. This pops up in the beta(n+1) equation. I don't know if I am right so I am hesitant to change it. Maybe someone with a little more experience w/the algorithm can edit it. Addps4cat 20:01, 3 March 2006 (UTC)
Decimal CORDIC was first suggested by J. E. Meggitt, "Pseudo Division and Pseudo Multiplication Processes", IBM Journal, April 1962
Hermann Schmid and Anthony Bogacki described decimal CORDIC only in 1973.[6] Vladimir Baykov ( talk) 19:29, 29 July 2010 (UTC)
Somebody has written: "For most ordinary purposes, 40 iterations (n = 40) is sufficient to obtain the correct result to the 10th decimal place."
Actually the number of iterations for CORDIC must be equal to the wordlength. For example, if the wordlength is 16 there is no sense to do 40 iterations , as said unknown author. In this case the number of iterations must be 16. Not more and not less! —Preceding unsigned comment added by Vladimir Baikov ( talk • contribs) 08:28, 22 November 2007 (UTC)
I don't fully agree with this. It would be true, if for each iteration the angle adjustment was half the previous adjustment. As anyone can see from the angle table in the article, this is not so. Though the number of bits required can be used as an indication of the number of iterations needed, it is not exact. -- 89.146.28.90 ( talk) 10:52, 2 February 2011 (UTC)
I can't figure out who developed it, and the articles creator left us with two choices, hence the "dispute" — siro χ o 21:49, Jul 26, 2004 (UTC)
any idea of the accuracy of this algorithm and connections with the number of iterations ? any comparison between this algorithm an some others ? -- bloublou 10:58, 11 August 2006 (UTC)
found also in DSP forum from Andraka "Sounds about right. THe worst case angular error after each iteration is the rotation angle of that iteration (which happens if the previous iteration landed exactly on your target angle), so the max error angle is atan(2^-i) after iteration i. Iterations start at 0. The last iteration needed to get an error of less than 0.1 degrees is therefore log2(tan(0.1)) rounded away from zero => 10, and counting from 0 you have 11 iterations to complete not counting your angle reduction." -- bloublou 17:23, 11 August 2006 (UTC)
about accuracy
you can have a look at: [2] on page 13 you can see the table contained the formulae of the CORDIC errors. naturally you cant read russian but the formulaes language is international. in this table:
n - word length (number of iterations equals to n for sin, cos, OR equals to 2n for asin, acos, ln, exp) r - the number of additional bits of the words
and here we say about root mean square errors.
you can find many other ideas incl. cordic accuracy in [3]
Vladimir Baykov
vladimir@baykov.de
Just for the record, here is the souce code in Python programming language
#!/usr/bin/python
from __future__ import division
from math import atan,pi,sqrt
import sys
def main_function(degrees,iterations = 8):
# convert from degrees into radians
beta = degrees * pi / 180.0
ArcTanTable = []
for i in range(iterations):
ArcTanTable.append( atan( 2.0**(-1 * i) ) )
KN = []
value = 1.0
for i in range(iterations):
value = value * sqrt( 1.0 + 2.0**(-2 * i) )
KN.append(1.0 / value)
Vx , Vy = 1.0 , 0.0
for i in range(iterations):
if beta < 0:
Vx,Vy = Vx + Vy * 2.0**(-1 * i) , Vy - Vx * 2.0**(-1 * i)
beta = beta + ArcTanTablei
else:
Vx,Vy = Vx - Vy * 2.0**(-1 * i) , Vy + Vx * 2.0**(-1 * i)
beta = beta - ArcTanTablei
Vx,Vy = Vx * KNiterations - 1 , Vy * KNiterations - 1
print "K[%9d] = %14.12f" % (iterations - 1,KNiterations - 1])
print "Sin(%4.1f) = %14.12f and Cos(%4.1f) = %14.12f" % (degrees,Vy,degrees,Vx)
if __name__ == '__main__':
if len(sys.argv) == 2:
deg = float(sys.argv1])
iter = 8
elif len(sys.argv) == 3:
deg = float(sys.argv1])
iter = int(sys.argv2])
else:
print "using default values of 17 degrees and 8 iterations"
deg = 17.0
iter = 8
main_function(deg,iter)
Here is a sample run
$ python cordic.py 30 40 K[ 39] = 0.607252935009 Sin(30.0) = 0.500000000000 and Cos(30.0) = 0.866025403785
The python code above seems a little complex given that a port of the C implementation to JS can be written like this:
var AG_CONST = 0.6072529350; function FIXED(X) { return X * 65536.0; } function FLOAT(X) { return X / 65536.0; } function DEG2RAD(X) { return 0.017453 * (X); } var Angles = [ FIXED(45.0), FIXED(26.565), FIXED(14.0362), FIXED(7.12502), FIXED(3.57633), FIXED(1.78991), FIXED(0.895174), FIXED(0.447614), FIXED(0.223811), FIXED(0.111906), FIXED(0.055953), FIXED(0.027977) ]; var X; var Y; var TargetAngle; var CurrAngle; var Step; X = FIXED(AG_CONST); /* AG_CONST * cos(0) */ Y = 0; /* AG_CONST * sin(0) */ TargetAngle = FIXED(28.027); CurrAngle = 0; for (Step = 0; Step < 12; Step++) { var NewX; if (TargetAngle > CurrAngle) { NewX = X - (Y >> Step); Y = (X >> Step) + Y; X = NewX; CurrAngle += Angles[Step]; } else { NewX = X + (Y >> Step); Y = -(X >> Step) + Y; X = NewX; CurrAngle -= Angles[Step]; } } print('CORDIC: ' + FLOAT(TargetAngle) + ' ' + FLOAT(Y) + ' ' + FLOAT(X) + '\n' ); print('FP: ' + FLOAT(TargetAngle) + ' ' + Math.sin(DEG2RAD(FLOAT(TargetAngle))) + ' ' + Math.cos(DEG2RAD(FLOAT(TargetAngle))) + '\n' );
86.152.208.199 00:55, 19 February 2007 (UTC)richmoore44@gmail.com 86.152.208.199 00:55, 19 February 2007 (UTC)
It seems a little strange that Volder should publish his first paper describing the CORDIC in the IRE Transactions on Electronic Computers, September 1959 and in the very same journal Daggett publishes his work on CORDIC. I reckon Daggett was peer reviewing for the journal and stole some ideas!! But seriously had Volder written an earlier or paper or were the two actually working together? Graemec2 07:46, 10 October 2006 (UTC)
It would be much more logical to put the References in the chronological order: beginning from the first publications to the recent ones. —The preceding unsigned comment was added by 80.133.27.236 ( talk) 21:37, 12 January 2007 (UTC).
The reference number [3] was made by Muller only to show very doubtful or more precisely speaking absolute senseless the limit value of K
The number of iterations n should be equal the wordlength of the computer. Unlimited n corresponds to unlimited wordlength. Did anybody see a computer with the unlimited length of word?! On the other hand, if the number of iterations is, for example, 32, then the value of K should be necessary to evaluate just for n=32. If instead of that we use suggested K=0.6072529350088812561694 (for : ) then error would be large!
In the other words the coefficient K for unlimited n has neither practical nor theoretical sense! So reference number [3] is unnecessary. Vladimir Baykov ( talk) 21:25, 18 July 2010 (UTC)
About history and application of CORDIC. In 1966 in "Electronics" was published the paper of J.Parini about DIVIC computer, based on CORDIC technique. Vladimir Baykov ( talk) 21:25, 20 July 2010 (UTC)
A note regarding numerical approximation: Since this is an reference work, it is foolish to assume a few digits would suite everyone. In fact, the first digits are listed on J. M. Muller, page 134. -- Ylai 08:49, 2 January 2007 (UTC)
Additional note: It is even more strange to ask for source for the additional digits, while the initial approximation is technically. unsourced itself. Not everybody calculates with single or double precision hardware only. -- Ylai 08:51, 2 January 2007 (UTC)
N[Product[1/Sqrt[1 + 2^(-2n)], {n, 0, Infinity}], 22]
About the following edit:
01:00, 2 January 2007 Dicklyon (Talk | contribs) (→Implementation in C - remove section, as the algorithm is not useful either pedagogically or practically in this form)
C is more known than MATLAB. Please allow the example at least here. Thanks. :) 130.83.161.82 08:39, 18 May 2007 (UTC)
This is copied from history:
The following is a C implementation of CORDIC using floats. Beta is the input angle in radians. We start with vector v = (1,0).
int i = 0;
int iterations = 0; // Number of times to run the algorithm
float arctanTableiterations]; // in Radians
float K = 0.6073; // K
float v_x,v_y; // Vector v; x and y components
for(i=0; i < iterations; i++) {
arctanTablei = atan(pow(2,-i));
}
float vnew_x; // To store the new value of x;
for(i = 0; i < iterations; i++) {
// If beta is negative, we need to do a counter-clockwise rotation:
if( beta < 0) {
vnew_x = v_x + (v_y*pow(2,-i));
v_y -= (v_x*pow(2,-i));
beta += arctanTablei];
}
// If beta is positive, we need to do a clockwise rotation:
else {
vnew_x = v_x - (v_y*pow(2,-i));
v_y += (v_x*pow(2,-i));
beta -= arctanTablei];
}
v_x = vnew_x;
}
v_x *= K;
v_y *= K;
I have removed the following external link as it appears to be broken: http://www.dspguru.com/info/faqs/cordic2.htm If it comes back or someone can find the new URL (if there is one) - please update it. 194.72.120.131 ( talk) 11:20, 12 November 2010 (UTC)
I don`t understand what is the difference between NOTES and REFERENCES? I guess it would be better ALL LITERATURE state in the chronological order! — Preceding unsigned comment added by 134.99.136.28 ( talk) 13:41, 12 October 2013 (UTC)
The Motorola 68000 Floating Point Coprocessor, the MC68881, internally uses CORDIC. The MC68882 does as well and improves on its predecessor by generating a result step on each clock edge (doubling the speed). I think the 6809's Floating Point ROM M6839 also uses CORDIC as it was developed by the same engineers, before they worked on the 68000's co-processor. — Preceding unsigned comment added by 131.107.147.56 ( talk) 20:28, 8 October 2014 (UTC)
Hello fellow Wikipedians,
I have just modified 5 external links on CORDIC. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
An editor has reviewed this edit and fixed any errors that were found.
Cheers.— InternetArchiveBot ( Report bug) 17:50, 28 July 2017 (UTC)
This is not the main purpose of the page (although the main reason of existence of CORDIC is efficient computation of tric functions), but IMHO it's unreasonable to do "beta = beta mod pi" by recursively adding or subtracting pi! It requires a recursion of depth > 1000 if you call it with beta = 5000 which is not an extremely large value! (In addition, you get rounding errors from performing more than 1000 additions of pi.) A simple "mod" instruction should really be preferred. — MFH: Talk 13:42, 11 September 2018 (UTC)
CORDIC
- and closely related methods
- known as:
- pseudo-multiplication
- and
- pseudo-division
- or
- factor combining
- are commonly used
- when no hardware multiplier is available
- (e.g. in simple microcontrollers and FPGAs).
- as the only operations it requires are
- additions, subtractions, bitshift and lookup tables.
As such, they all belong to the class of shift-and-add algorithms.
In computer science, CORDIC is often used to implement floating-point arithmetic when the target platform lacks hardware multiply for cost or space reasons.
I just added the last sentence quoted above. It partially duplicates the first sentence above (grammatically exploded), but 95% of readers will barely notice this, as their parse recursion is already busy dropping the factoids embedded in the first sentence into the buffer-overrun bit bucket. — MaxEnt 13:25, 3 September 2020 (UTC)
The More Formalized section of this article uses sin and cos in the rotation matrix to develop the ability to calculate sin and cos. 174.63.44.188 ( talk) 02:28, 17 March 2023 (UTC)
This article is rated B-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||
|
The value in the implentation section should really be what it was before someone changed it, 0.607. My comment wasn't correct which may have led to the confusion. The inverse of K is needed to get the true magnitude because all the shifts result in a gain of K = 1.647 which then must be removed to get the true magnitude.
See the article in the references section: http://www.dspguru.com/info/faqs/cordic2.htm
RDIC Gain (cumulative magnitude) of about 1.647. Therefore, to get the true value of magnitude we must multiply by the reciprocal of 1.647, which is 0.607. (Remember, the exact CORDIC Gain is a function of the how many iterations you do."
Addps4cat 19:56, 21 March 2006 (UTC)
Yeah, the value of K in the implentation is indeed correct. However, the equation for K given in previous edition was wrong, which led to my confusion and my changing of K in the implentation before. K is defined as cos(arctan(2^(-i))), you can simply check that K should be 1/sqrt(1+2^(-2i)), instead of sqrt(1+2^(-2i)) as given before. And by this definition, lim(K)=0.6073, again not 1.647 as given before. I've corrected it and removed the "inv" in the implentation to avoid further confusion. Cdpango 11:16, 23 March 2006 (UTC)
Maybe I've not expressed myself clearly. You indeed needs to multiply 0.6073(or divide 1.647) after the iterations. But the problem is we define K as "product of cos(arctan(2^(-i)))", so its value should be "product of 1/sqrt(1+2^(-2i))", instead of "product of sqrt(1+2^(-2i))", and it approaches 0.6073 when n approaches infinite. On the other hand, the system gain is A="product of sqrt(1+2^(-2i))"=1.647=1/K. I think that you just mixed up A and K. You can check the beignning part of section 3 of the following article, which explains this issue quite clearly. http://www.andraka.com/files/crdcsrvy.pdf It's nice to have a discussion. Best wishes! Cdpango 04:59, 24 March 2006 (UTC)
It seems interesting that the gain for the hyperbolic mode (m=-1)
is quoted in J.S. Walther's paper and in many other places as
If you run it it seems to converge to :
Has anyone else ran into this discrepency?
—Preceding unsigned comment added by 71.228.178.91 ( talk) 04:35, 1 February 2011 (UTC)
There is no sense to say of the limit of K
Nonsense!
On the other side, when if the number of iterations is, for example, 32, then the value of K should necessary to evaluate just for n=32. If instead of that we use suggested K=0.6072529350088812561694 (for : ) then error would be very big. By the way, coefficient K is not the Number !! For Number the more digits you use, the more precisely result you get. But for K the number n should be exactly equal to the number of iterations. Not more and not less!
The article mixes in n and i for subscripts and superscripts and it is confusing. n should be used to refer to the total number of iterations while i should refer to the current iteration. This pops up in the beta(n+1) equation. I don't know if I am right so I am hesitant to change it. Maybe someone with a little more experience w/the algorithm can edit it. Addps4cat 20:01, 3 March 2006 (UTC)
Decimal CORDIC was first suggested by J. E. Meggitt, "Pseudo Division and Pseudo Multiplication Processes", IBM Journal, April 1962
Hermann Schmid and Anthony Bogacki described decimal CORDIC only in 1973.[6] Vladimir Baykov ( talk) 19:29, 29 July 2010 (UTC)
Somebody has written: "For most ordinary purposes, 40 iterations (n = 40) is sufficient to obtain the correct result to the 10th decimal place."
Actually the number of iterations for CORDIC must be equal to the wordlength. For example, if the wordlength is 16 there is no sense to do 40 iterations , as said unknown author. In this case the number of iterations must be 16. Not more and not less! —Preceding unsigned comment added by Vladimir Baikov ( talk • contribs) 08:28, 22 November 2007 (UTC)
I don't fully agree with this. It would be true, if for each iteration the angle adjustment was half the previous adjustment. As anyone can see from the angle table in the article, this is not so. Though the number of bits required can be used as an indication of the number of iterations needed, it is not exact. -- 89.146.28.90 ( talk) 10:52, 2 February 2011 (UTC)
I can't figure out who developed it, and the articles creator left us with two choices, hence the "dispute" — siro χ o 21:49, Jul 26, 2004 (UTC)
any idea of the accuracy of this algorithm and connections with the number of iterations ? any comparison between this algorithm an some others ? -- bloublou 10:58, 11 August 2006 (UTC)
found also in DSP forum from Andraka "Sounds about right. THe worst case angular error after each iteration is the rotation angle of that iteration (which happens if the previous iteration landed exactly on your target angle), so the max error angle is atan(2^-i) after iteration i. Iterations start at 0. The last iteration needed to get an error of less than 0.1 degrees is therefore log2(tan(0.1)) rounded away from zero => 10, and counting from 0 you have 11 iterations to complete not counting your angle reduction." -- bloublou 17:23, 11 August 2006 (UTC)
about accuracy
you can have a look at: [2] on page 13 you can see the table contained the formulae of the CORDIC errors. naturally you cant read russian but the formulaes language is international. in this table:
n - word length (number of iterations equals to n for sin, cos, OR equals to 2n for asin, acos, ln, exp) r - the number of additional bits of the words
and here we say about root mean square errors.
you can find many other ideas incl. cordic accuracy in [3]
Vladimir Baykov
vladimir@baykov.de
Just for the record, here is the souce code in Python programming language
#!/usr/bin/python
from __future__ import division
from math import atan,pi,sqrt
import sys
def main_function(degrees,iterations = 8):
# convert from degrees into radians
beta = degrees * pi / 180.0
ArcTanTable = []
for i in range(iterations):
ArcTanTable.append( atan( 2.0**(-1 * i) ) )
KN = []
value = 1.0
for i in range(iterations):
value = value * sqrt( 1.0 + 2.0**(-2 * i) )
KN.append(1.0 / value)
Vx , Vy = 1.0 , 0.0
for i in range(iterations):
if beta < 0:
Vx,Vy = Vx + Vy * 2.0**(-1 * i) , Vy - Vx * 2.0**(-1 * i)
beta = beta + ArcTanTablei
else:
Vx,Vy = Vx - Vy * 2.0**(-1 * i) , Vy + Vx * 2.0**(-1 * i)
beta = beta - ArcTanTablei
Vx,Vy = Vx * KNiterations - 1 , Vy * KNiterations - 1
print "K[%9d] = %14.12f" % (iterations - 1,KNiterations - 1])
print "Sin(%4.1f) = %14.12f and Cos(%4.1f) = %14.12f" % (degrees,Vy,degrees,Vx)
if __name__ == '__main__':
if len(sys.argv) == 2:
deg = float(sys.argv1])
iter = 8
elif len(sys.argv) == 3:
deg = float(sys.argv1])
iter = int(sys.argv2])
else:
print "using default values of 17 degrees and 8 iterations"
deg = 17.0
iter = 8
main_function(deg,iter)
Here is a sample run
$ python cordic.py 30 40 K[ 39] = 0.607252935009 Sin(30.0) = 0.500000000000 and Cos(30.0) = 0.866025403785
The python code above seems a little complex given that a port of the C implementation to JS can be written like this:
var AG_CONST = 0.6072529350; function FIXED(X) { return X * 65536.0; } function FLOAT(X) { return X / 65536.0; } function DEG2RAD(X) { return 0.017453 * (X); } var Angles = [ FIXED(45.0), FIXED(26.565), FIXED(14.0362), FIXED(7.12502), FIXED(3.57633), FIXED(1.78991), FIXED(0.895174), FIXED(0.447614), FIXED(0.223811), FIXED(0.111906), FIXED(0.055953), FIXED(0.027977) ]; var X; var Y; var TargetAngle; var CurrAngle; var Step; X = FIXED(AG_CONST); /* AG_CONST * cos(0) */ Y = 0; /* AG_CONST * sin(0) */ TargetAngle = FIXED(28.027); CurrAngle = 0; for (Step = 0; Step < 12; Step++) { var NewX; if (TargetAngle > CurrAngle) { NewX = X - (Y >> Step); Y = (X >> Step) + Y; X = NewX; CurrAngle += Angles[Step]; } else { NewX = X + (Y >> Step); Y = -(X >> Step) + Y; X = NewX; CurrAngle -= Angles[Step]; } } print('CORDIC: ' + FLOAT(TargetAngle) + ' ' + FLOAT(Y) + ' ' + FLOAT(X) + '\n' ); print('FP: ' + FLOAT(TargetAngle) + ' ' + Math.sin(DEG2RAD(FLOAT(TargetAngle))) + ' ' + Math.cos(DEG2RAD(FLOAT(TargetAngle))) + '\n' );
86.152.208.199 00:55, 19 February 2007 (UTC)richmoore44@gmail.com 86.152.208.199 00:55, 19 February 2007 (UTC)
It seems a little strange that Volder should publish his first paper describing the CORDIC in the IRE Transactions on Electronic Computers, September 1959 and in the very same journal Daggett publishes his work on CORDIC. I reckon Daggett was peer reviewing for the journal and stole some ideas!! But seriously had Volder written an earlier or paper or were the two actually working together? Graemec2 07:46, 10 October 2006 (UTC)
It would be much more logical to put the References in the chronological order: beginning from the first publications to the recent ones. —The preceding unsigned comment was added by 80.133.27.236 ( talk) 21:37, 12 January 2007 (UTC).
The reference number [3] was made by Muller only to show very doubtful or more precisely speaking absolute senseless the limit value of K
The number of iterations n should be equal the wordlength of the computer. Unlimited n corresponds to unlimited wordlength. Did anybody see a computer with the unlimited length of word?! On the other hand, if the number of iterations is, for example, 32, then the value of K should be necessary to evaluate just for n=32. If instead of that we use suggested K=0.6072529350088812561694 (for : ) then error would be large!
In the other words the coefficient K for unlimited n has neither practical nor theoretical sense! So reference number [3] is unnecessary. Vladimir Baykov ( talk) 21:25, 18 July 2010 (UTC)
About history and application of CORDIC. In 1966 in "Electronics" was published the paper of J.Parini about DIVIC computer, based on CORDIC technique. Vladimir Baykov ( talk) 21:25, 20 July 2010 (UTC)
A note regarding numerical approximation: Since this is an reference work, it is foolish to assume a few digits would suite everyone. In fact, the first digits are listed on J. M. Muller, page 134. -- Ylai 08:49, 2 January 2007 (UTC)
Additional note: It is even more strange to ask for source for the additional digits, while the initial approximation is technically. unsourced itself. Not everybody calculates with single or double precision hardware only. -- Ylai 08:51, 2 January 2007 (UTC)
N[Product[1/Sqrt[1 + 2^(-2n)], {n, 0, Infinity}], 22]
About the following edit:
01:00, 2 January 2007 Dicklyon (Talk | contribs) (→Implementation in C - remove section, as the algorithm is not useful either pedagogically or practically in this form)
C is more known than MATLAB. Please allow the example at least here. Thanks. :) 130.83.161.82 08:39, 18 May 2007 (UTC)
This is copied from history:
The following is a C implementation of CORDIC using floats. Beta is the input angle in radians. We start with vector v = (1,0).
int i = 0;
int iterations = 0; // Number of times to run the algorithm
float arctanTableiterations]; // in Radians
float K = 0.6073; // K
float v_x,v_y; // Vector v; x and y components
for(i=0; i < iterations; i++) {
arctanTablei = atan(pow(2,-i));
}
float vnew_x; // To store the new value of x;
for(i = 0; i < iterations; i++) {
// If beta is negative, we need to do a counter-clockwise rotation:
if( beta < 0) {
vnew_x = v_x + (v_y*pow(2,-i));
v_y -= (v_x*pow(2,-i));
beta += arctanTablei];
}
// If beta is positive, we need to do a clockwise rotation:
else {
vnew_x = v_x - (v_y*pow(2,-i));
v_y += (v_x*pow(2,-i));
beta -= arctanTablei];
}
v_x = vnew_x;
}
v_x *= K;
v_y *= K;
I have removed the following external link as it appears to be broken: http://www.dspguru.com/info/faqs/cordic2.htm If it comes back or someone can find the new URL (if there is one) - please update it. 194.72.120.131 ( talk) 11:20, 12 November 2010 (UTC)
I don`t understand what is the difference between NOTES and REFERENCES? I guess it would be better ALL LITERATURE state in the chronological order! — Preceding unsigned comment added by 134.99.136.28 ( talk) 13:41, 12 October 2013 (UTC)
The Motorola 68000 Floating Point Coprocessor, the MC68881, internally uses CORDIC. The MC68882 does as well and improves on its predecessor by generating a result step on each clock edge (doubling the speed). I think the 6809's Floating Point ROM M6839 also uses CORDIC as it was developed by the same engineers, before they worked on the 68000's co-processor. — Preceding unsigned comment added by 131.107.147.56 ( talk) 20:28, 8 October 2014 (UTC)
Hello fellow Wikipedians,
I have just modified 5 external links on CORDIC. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
An editor has reviewed this edit and fixed any errors that were found.
Cheers.— InternetArchiveBot ( Report bug) 17:50, 28 July 2017 (UTC)
This is not the main purpose of the page (although the main reason of existence of CORDIC is efficient computation of tric functions), but IMHO it's unreasonable to do "beta = beta mod pi" by recursively adding or subtracting pi! It requires a recursion of depth > 1000 if you call it with beta = 5000 which is not an extremely large value! (In addition, you get rounding errors from performing more than 1000 additions of pi.) A simple "mod" instruction should really be preferred. — MFH: Talk 13:42, 11 September 2018 (UTC)
CORDIC
- and closely related methods
- known as:
- pseudo-multiplication
- and
- pseudo-division
- or
- factor combining
- are commonly used
- when no hardware multiplier is available
- (e.g. in simple microcontrollers and FPGAs).
- as the only operations it requires are
- additions, subtractions, bitshift and lookup tables.
As such, they all belong to the class of shift-and-add algorithms.
In computer science, CORDIC is often used to implement floating-point arithmetic when the target platform lacks hardware multiply for cost or space reasons.
I just added the last sentence quoted above. It partially duplicates the first sentence above (grammatically exploded), but 95% of readers will barely notice this, as their parse recursion is already busy dropping the factoids embedded in the first sentence into the buffer-overrun bit bucket. — MaxEnt 13:25, 3 September 2020 (UTC)
The More Formalized section of this article uses sin and cos in the rotation matrix to develop the ability to calculate sin and cos. 174.63.44.188 ( talk) 02:28, 17 March 2023 (UTC)