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

Not arbitrary precision. Floating point range. Lower expectations please. #108

Closed
pcarrier opened this issue Jun 26, 2017 · 3 comments
Closed
Labels

Comments

@pcarrier
Copy link

pcarrier commented Jun 26, 2017

If I cannot get more digits of π or get 1 back this isn't arbitrary precision at all.

>>> 4e10*atan(1)

  40000000000 × atan(1)

   = 31415900000

>>> 10^10^10 + 1 - 10^10^10

  10^(10^10) + (1 - 10^(10^10))

   = 0

Please adjust your README:

Arbitrary-precision numeric type that can handle very large (or small) exponents like 10^(10^10). #

@pcarrier pcarrier changed the title Not arbitrary precision. Floating point precision. Not arbitrary precision. Floating point range. Fix your claims please. Jun 26, 2017
@pcarrier pcarrier changed the title Not arbitrary precision. Floating point range. Fix your claims please. Not arbitrary precision. Floating point range. Lower expectations please. Jun 26, 2017
@sharkdp
Copy link
Owner

sharkdp commented Jun 27, 2017

The internal precision is greater than what you see in your first example:

≫ atan(1)
  atan(1)
   = 0.785398
≫ atan(1) - 0.78539
  atan(1) - 0.78539
   = 0.0000081634

It's only the output that's currently restricted to six significant digits (see also #107), as this is more than enough for most real-world applications (in my opinion).

insect depends on purscript-quantities, which depends on purescript-decimals, which internally uses decimal.js. The README says that insect uses an arbitrary-precision numeric type because that's what decimal.js advertises. I believe this is only true in the sense that the precision is limited to N significant digits, where N can be configured. For insect, currently, we have N set to 30. But this could be changed (or made configurable: #107).

@pcarrier
Copy link
Author

pcarrier commented Jun 27, 2017

I would still very clearly lower expectations. Not sure what you mean by "internal precision", but I made the tool output a bunch of zeroes that really shouldn't be here in the first place. I can understand truncation, but are you saying that you are showing wrong digits on purpose?

Nothing in the README warns users that the model leads to errors like the examples I gave, and "arbitrary-precision numeric type" definitely led me to the wrong conclusion.

(BTW great tool, I'm already using it a lot)

@sharkdp
Copy link
Owner

sharkdp commented Jun 28, 2017

I would still very clearly lower expectations. Not sure what you mean by "internal precision", but I made the tool output a bunch of zeroes that really shouldn't be here in the first place. I can understand truncation, but are you saying that you are showing wrong digits on purpose?

Showing 31415900000 is misleading here, I agree. What I'm saying is that this is only a display issue (which might need solving). The internally stored value has a much higher precision (30 significant digits, instead of 6).

Nothing in the README warns users that the model leads to errors like the examples I gave, and "arbitrary-precision numeric type" definitely led me to the wrong conclusion.

Okay, what do you think:

"Uses a high-precision numeric type with 30 significant digits that handles very large (or small) exponents like 10^(10^10)."

(BTW great tool, I'm already using it a lot)

Thanks! I'm glad you like it.

@sharkdp sharkdp closed this as completed in 08c5ce2 Jul 1, 2017
sharkdp added a commit that referenced this issue Jul 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants