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

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

[Octave-bug-tracker] [bug #35779] Incorrect results of logm


From: anonymous
Subject: [Octave-bug-tracker] [bug #35779] Incorrect results of logm
Date: Sat, 10 Mar 2012 01:38:16 +0000
User-agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; IEMB3)

URL:
  <http://savannah.gnu.org/bugs/?35779>

                 Summary: Incorrect results of logm
                 Project: GNU Octave
            Submitted by: None
            Submitted on: 2012年03月10日 01時38分15秒
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Masaru Muranishi
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.6.1
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

I'd like to report following.

In my understanding, logm is inverse function of expm, namely, following
should be satisfied for any square matrix M.

M=logm(expm(M))

I tried following calculation using octave3.6.1.

A=[0 -i;i 0]
B=expm(A)
C=logm(B)

We expect A=C.
However, I got following results.

A=
  0 + 0i  -0 - 1i
  0 + 1i   0 + 0i

B=
  1.54308 + 0.00000i   0.00000 - 1.17520i
  0.00000 + 1.17520i   1.54308 + 0.00000i

C=
  -7.8496e-017   0.00000e+000
   0.0000e+000   1.09991e-015

Obviously, C is different from A.

Moreover, I tried following.

A=[0 -1;1 0]
B=expm(A)
C=logm(B)

I got following.

A=
  0   -1
  1    0

B=
  0.54030   -0.84147
  0.84147    0.54030

C=
   -5.4911e-016    1.4142e+000
   -1.4142e+000   -1.8647e-016
 
Obviously, C is different from A.

I think that the matrix [0 -i;i 0] or [0 -1;1 0] are relatively simple
matrix.
If octave can not give correct answer to this kind of relatively simple
matrix, I concern this fact may spoile trust of octave.

For your information, I'd like to add results of same kind of calculation by
scilab.

A=
   0  - 1i
   i    0

B= (=expm(A))
   1.5430806   -1.1752012i
   1.1752012i   1.5430806

C= (=logm(B))
   0   -i
   i   -3.331E-16


A=
   0   -1
   1    0

B= (=expm(A))
   0.5403023   -0.8414710
   0.8414710    0.5403023

C= (=logm(B))
   5.370D-14-2.220D-16i   -1.+9.192D-17
   1.-1.579D-16i           2.516D-16+2.22D-16i

I think scilab give correct answer to same calculation.





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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