[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: Numerical issues with sin()/cos()

**From**: |
Mike Miller |

**Subject**: |
Re: Numerical issues with sin()/cos() |

**Date**: |
Tue, 27 Mar 2018 12:00:54 -0700 |

**User-agent**: |
Mutt/1.9.4 (2018-02-28) |

On Tue, Mar 27, 2018 at 11:29:54 -0700, Mike Miller wrote:
>* It doesn't look to me like the errors are in the sin function.*
In fact, I think what you want to look at are the differences between
the following v1 and v2
N = 33; M = N/2; n = -M:M;
v1 = sin (0.37 * pi * n) ./ (pi * n);
v2 = sin (0.37 * pi * [n]) ./ (pi * [n]);
I think what is hurting your precision here is the lazy evaluation of
ranges in Octave.
--
mike

**
**`signature.asc`

*Description:* PGP signature