[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #55968] Incorrect simplify to sinc function
From: |
Colin Macdonald |
Subject: |
[Octave-bug-tracker] [bug #55968] Incorrect simplify to sinc function |
Date: |
Wed, 20 Mar 2019 20:07:19 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0 |
Follow-up Comment #1, bug #55968 (project octave):
SymPy's sinc is "unnormalized".
I think if you do `function_handle(X)` it should normalize again (because it
is rewriting it into Octave code).
There isn't much we can do about this... I haven't included a sinc.m yet in
Symbolic, but on my local installation:
>> sinc(4.2)
ans = 0.044547
>> f = sinc(x) % note pi being introduced
f = (sym) sinc(π⋅x)
>> subs(f, x, sym(42)/10)
ans = (sym)
⎛21⋅π⎞
sinc⎜────⎟
⎝ 5 ⎠
>> double(ans) % and this should match
ans = 0.044547
So the output looks confusing but I don't think there is anything except an
unfixable cosmetic bug here.
It does highlight how the various glue between Octave (Symbolic package) and
SymPy ("octave_code") needs to be considered carefully on a case-by-case
basis, not just blindly machine generated.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55968>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #55968] Incorrect simplify to sinc function, Z. M., 2019/03/20
- [Octave-bug-tracker] [bug #55968] Incorrect simplify to sinc function,
Colin Macdonald <=
- [Octave-bug-tracker] [bug #55968] [octave forge] (symbolic) Incorrect simplify to sinc function, Mike Miller, 2019/03/20
- [Octave-bug-tracker] [bug #55968] [octave forge] (symbolic) Incorrect simplify to sinc function, Mike Miller, 2019/03/20
- [Octave-bug-tracker] [bug #55968] [octave forge] (symbolic) Incorrect simplify to sinc function, Colin Macdonald, 2019/03/21
- [Octave-bug-tracker] [bug #55968] [octave forge] (symbolic) Incorrect simplify to sinc function, Mike Miller, 2019/03/21
- [Octave-bug-tracker] [bug #55968] [octave forge] (symbolic) Incorrect simplify to sinc function, Z. M., 2019/03/22
- [Octave-bug-tracker] [bug #55968] [octave forge] (symbolic) Incorrect simplify to sinc function, Colin Macdonald, 2019/03/22
- [Octave-bug-tracker] [bug #55968] [octave forge] (symbolic) Incorrect simplify to sinc function, Colin Macdonald, 2019/03/22
- [Octave-bug-tracker] [bug #55968] [octave forge] (symbolic) Incorrect simplify to sinc function, Z. M., 2019/03/25
- [Octave-bug-tracker] [bug #55968] [octave forge] (symbolic) Incorrect simplify to sinc function, Mike Miller, 2019/03/25
- [Octave-bug-tracker] [bug #55968] [octave forge] (symbolic) Incorrect simplify to sinc function, Colin Macdonald, 2019/03/26