octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48307] sinc loses precision for large argumen


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments
Date: Mon, 27 Jun 2016 08:11:54 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0

Follow-up Comment #9, bug #48307 (project octave):

Dan, you're absolutely right that we shouldn't expand a series about 0 if
we're dealing with things much greater than 2pi.

I also agree that reducing modulo 2*pi is much more problematic than reducing
modulo 2.  There is also bug #45339 about sind etc that should also be able to
reduce their arguments modulo 360 but don't.

However, we really only get benefits if the remainders are represented
accurately.  Try


octave:1> x = double(10000001)/3 
x =    3.3333e+06
octave:2> fprintf ("%.100g\n", mod (x, 2))
1.6666666665114462375640869140625


and you can see that the argument only has about 10 significant figures
accuracy.  The fact that  sinc  is accurate to 10 significant figures shows
that it is working as expected, given the input.  This is independent of
whether or not we take the mod explicitly -- sin automatically works on the
modulus.

The patch I proposed works for things like  double(10000001)/4, but nothing
can help fractions whose precision is actually lost.

I'm tempted to suggest we close this bug as "invalid".

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48307>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]