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

[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/




reply via email to

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