I have set up a complex calculation with a lot of gonimetric functions, and e.g. for n*PI/2 it creates a chaos-formula (extremely narrow and high spikes). So I need to filter out these arguments, and I round off the cos(angle), to force it to 0. E.g. at 14 decimals.
When n gets large, I need to set the accuracy to fewer decimals (n can get up to 10^6), e.g. to 12.
Also, I need to figure out the quadrant where, for a certain argument, the function is.
I use sign(cos(angle)), that yields only 1 and -1, never 0, as it should for the nagles mentioned.
I think I need to develop a kind of magnet function, meaning that all angle values are being left as they are, unless they are close to the problem-causing angles. Then they should snap to a better-evaluated constant, like (example 312/214).
Anyone knows an approximate for PI?
Funny: in Excel everything worked fine. It appears that one can be too accurate......
Has anyone gotten extended-precision arithmetic to work with the symbolic processor? I'm trying to make a function that takes an extended-precision number and returns an extended-precision answer, but it doesn't seem to work. I'm attaching a worksheet that shows it working under some very special circustances for cos.
Also, I mentioned earlier that atan2 returns an answer from 0 to 2pi, actually it's -pi to pi and angle returns a value from 0 to 2pi.