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

tan() has degraded precision in the Calculation app. #2043

Open
goualard-f opened this issue Apr 3, 2023 · 1 comment
Open

tan() has degraded precision in the Calculation app. #2043

goualard-f opened this issue Apr 3, 2023 · 1 comment

Comments

@goualard-f
Copy link

goualard-f commented Apr 3, 2023

Describe the bug

In the "Calculation" app, the tan() function returns undef for some arguments that are computable. Maybe a duplicate of issue #1386?

Screenshots

screenshot(2)

To Reproduce

Steps to reproduce the behavior:

  1. Go to the 'Calculation' app
  2. Type 'tan(642336890023956)'
  3. See error

Expected behavior

With the Python app. of the calculator, we get:

>>> from math import tan
>>> tan(642336890023956)
1285230487114249.8

The value 642336890023956 is very close to a multiple of $\pi/2$:

$642336890023956\approx \pi\times204462182355175.4999999999999997523324\cdots$

which must be the source of the problem. However, that does not explain the degraded precision with respect to what is computed with other mathematical libraries.

Environment

  • Epsilon version (Settings > About > Software version). 20.4.0
  • The platform(s) on which the problem happens: online simulator, actual device, etc...
    Online simulator.
@pitonyak
Copy link

I have verified the behavior.

First, I tested using LibreOffice Calc and I received a similar (but different) value (1285230487114206). Then I tried on my HP Prime in both Home and CAS mode, which returned different negative numbers (like -74 and -54 or similar), probably based on the HP precision.

I do see that NumWorks should be using double precision (see https://www.numworks.com/calculator/update/version-01).

I then tested to receive undef from the standard calculator and from Python I now see 1285230487114250, so 0.2 greater than in the example above.

I am curious if the problem is related to converting the input or in the calculation library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants