lg() function results small imaginary residual on a specific case

Issue #1397 new
Laszlo B created an issue

Hello,

I have found that for specific inputs the lg function returns small residual imaginary parts. My input is real, and positive.

On the picture you can see after performing the first calculation, as a result, I’ve got an extra imaginary part of +336,403059152214544085e-42j

After that I evaluated only the argument of the logarithm, which resulted: 3,97258663612438237122e3

When I called the lg() on the ans, it produced the same imaginary part there (I assume ans is ultra precise in the background)

After that I called the lg() on the copy of the result instead of the ans, and the imaginary part disappeared.

I tried modifying the argument of the lg, I swapped the ‘4' to '3.8’ in the arguments (second picture), and from 3.8 to 4.1 it produces the same phenomena, with the same imaginary part (only the real part is changing). Performing these calculations with Matlab, it did not resulted any imaginary components, and speedcrunch calculates the real parts correctly.

I am using the 0.12 version, and Windows 10 19044 build

I assume this result is due to some numerical errors.

Comments (2)

  1. gilga

    I try it and I get entirely different results (complex number enabled):

    In your last line, you used a dot instead of a comma (American instead of European style notation)

  2. Log in to comment