[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #48307] sinc loses precision for large argumen
From: |
Colin Macdonald |
Subject: |
[Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments |
Date: |
Sun, 26 Jun 2016 05:43:35 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0 |
Follow-up Comment #2, bug #48307 (project octave):
>> sinc(x)
ans = (sym) 0
>> sinc(d)
ans = 4.5268e-17
> You'd need to come up with a more concrete comparison to establish there is
a numerical problem.
Without disagreeing with any of your points, I think its very common practice
to for a special function library to aim for 15 digits **relative accuracy**
(and document when it cannot do that). Here it cannot. As x gets large, we
lose relative accuracy, I think linearly with x.
I certainly agree its good to not blindly assume symbolic computed results are
correct. Here is Maple (which doesn't seem to have a built-in sinc).
> x := 10000001/3;
x := 10000001/3
> Digits := 32;
Digits := 32
> evalf ( sin(Pi*x) / (Pi*x) );
-7
-0.82699326043336203093078665439080 10
And pasting back into Octave:
>> Maple = -0.82699326043336203093078665439080e-7
Maple = -8.2699e-08
>> Q = sinc(10000001/3)
Q = -8.2699e-08
>> Q - Maple
ans = -5.2279e-17
>> (Maple - Q) / Maple
ans = -6.3216e-10
1. These results match SymPy's (Symbolic pkg).
2. Again, we see that the absolute error is fine (< eps), but that the
relative error is approx "2e6*eps".
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?48307>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments, Colin Macdonald, 2016/06/24
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments, Dan Sebald, 2016/06/24
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments,
Colin Macdonald <=
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments, Dan Sebald, 2016/06/26
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments, Dan Sebald, 2016/06/26
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments, Dan Sebald, 2016/06/26
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments, Lachlan Andrew, 2016/06/26
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments, Dan Sebald, 2016/06/27
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments, Marco Caliari, 2016/06/27
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments, Lachlan Andrew, 2016/06/27
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments, Dan Sebald, 2016/06/27
- [Octave-bug-tracker] [bug #48307] sinc loses precision for large arguments, Lachlan Andrew, 2016/06/27