Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complicated expressions with logarithm return incorrect results #208

Open
JakubVanek opened this issue Apr 3, 2022 · 2 comments
Open

Complicated expressions with logarithm return incorrect results #208

JakubVanek opened this issue Apr 3, 2022 · 2 comments

Comments

@JakubVanek
Copy link

JakubVanek commented Apr 3, 2022

Hi! I've noticed that mate-calc sometimes gives wrong results of some computations.

Expected behaviour

-ln(20/100)/sqrt(pi^2+ln(20/100)^2) evaluates to 0.4559498107691261 (calculated by Python)

Actual behaviour

It evaluates to -0.624079067+1.218190647i.

Steps to reproduce the behaviour

Just enter the expression above to mate-calc.

MATE general version

1.24.0 from Ubuntu 20.04

Package version

Current HEAD of this repository (commit 665bbc0).

Linux Distribution

Ubuntu 20.04.

Link to bugreport of your Distribution (requirement)

I don't see how this applies here given that the issue reproduces on a clean build of mate-calc (albeit relying on distro's packaging of MATE core).

@JakubVanek
Copy link
Author

JakubVanek commented Apr 3, 2022

Oh, it seems that the top logarithm is applied on the whole (20/100)/sqrt(pi^2+ln(20/100)^2) and not just on (20/100).

@JakubVanek
Copy link
Author

JakubVanek commented Apr 3, 2022

Oh well, even the issue described in #168 still happens - -ln(1) is calculated as pi*i.

@JakubVanek JakubVanek changed the title Complex expressions with logarithm return incorrect results Complicated expressions with logarithm return incorrect results Apr 3, 2022
@mbkma mbkma added the confirmed label Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants