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

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

[Octave-bug-tracker] [bug #58536] Adding exponential functions is return


From: miro
Subject: [Octave-bug-tracker] [bug #58536] Adding exponential functions is returning wrong results in symbolic mode
Date: Tue, 9 Jun 2020 14:29:29 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0

URL:
  <https://savannah.gnu.org/bugs/?58536>

                 Summary: Adding exponential functions is returning wrong
results in symbolic mode
                 Project: GNU Octave
            Submitted by: miro
            Submitted on: Tue 09 Jun 2020 06:29:27 PM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 5.2.0
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

In symbolic mode:

1) exponential function with imaginary exponent is not well supported, adding
opposite numbers never return zero, such as in this case
i+(-i)=exp(i*pi/4)+exp(-i*pi/4)=0

2) The worse result is coming when adding numbers of vertexes of symmetric
polygon on unit circle. The expected result is 0, but
simplify(sum(exp(sym(2)*pi*[0:4]*1i/5))) returns 
1 - \left(-1\right)^{\frac{3}{5}} - \sqrt[5]{-1} + e^{\frac{4 i \pi}{5}} +
e^{\frac{2 i \pi}{5}}

3) in the result of 2) there is also wrong that sqrt(-1) is not replaced by
"i" and there are expressions like (-1)**(3/5), they shouldn't appear at all
during symbolic counting, or at least they should be replaced by complex
number if the counting method is not so good

4) working with something more complex based on exponential function with
complex coefficient, such as circulant matrices should provide wrong results
for eigenvectors, eigenvalues and determinant in symbolic mode


FIX

The simplest fix should be defining Euler's formula into symbolic identities
and enabling following identity response:
expand(exp(x+iy))==exp(x)*(cos(y)+i*sin(y))


OTHER ERRORS

Anyway the strange form of result in using (-1)**(3/5) as the most simplified
expression should have negative impact on other results than only our
trigonometric case mentioned here.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58536>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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