Re: Tough problem...



On Wed, 28 Jun 2006 05:37:48 +0200, "Atmapuri"
<janez.makovsek@xxxxxxx> wrote:

This situation occurs in FFT, when the length of the FFT goes in to
million of points. The sin and cos functions become inaccurate when
the i in sin(i*arg) goes in to millions.

I'm no expert here, and I dont quite get where the i comes from, but
if it's an loop index, couldn't you do something like this:

var
i: integer;
j: double;
begin

j:= start_value;
for i:= start_value to end_value do
begin
compute sin(j*arg)
j:= j + 1;
if j > TWO_PI then
j:= j - TWO_PI;
end;
end;

Certainly not perfect, but should hold on to more precision than using
sin(i*arg) straight up, i think?

- Asbjørn
.



Relevant Pages

  • Re: Tough problem...
    ... The sin and cos functions become inaccurate when ... I'm no expert here, and I dont quite get where the i comes from, but ...
    (borland.public.delphi.language.basm)
  • Re: Sine and Cosine Accuracy on AMD64 and Pentium 4
    ... > 2) It seems to me you're testing the output of the log function> as ... Note that this does not depend at all on the accuracy of the sin ... and cos functions. ... important than the accurate kinetic energy. ...
    (comp.compilers)
  • Re: need help with operations stability
    ... > and I need some references where can I solve the next problem: ... either PI/2 is wrong or your sin and cos functions are wrong. ... that sin and cos implemented in the intel processors FPU are a little bit ...
    (comp.lang.cpp)
  • Re: Parametric plot with a data file instead of functions.
    ... my sin and cos functions come from a 3-column data file. ... I am not quite sure what you mean by "sin and cos functions come from ... If you want to plot the cos of column 2 versus the sin of column one, ...
    (comp.graphics.apps.gnuplot)
  • Re: SIND, COSD, TAND functions
    ... NOT justify writing the radian-based trig functions to be deliberately ... sin is 0.0. ... But, yes, I am more for SINDthan for inaccurate SIN. ...
    (comp.lang.fortran)