7 ms·
Now I’m calculating with constructive reals
- tromp 5y agoThey're also easily accessible in Haskell from package Data.Number.CReal [1] that implements the ideas in this paper [2]. [1] https://hackage.haskell.org/package/numbers-3000.2.0.2/docs/Data-Number-CReal.html https://hackage.haskell.org/package/numbers-3000.2.0.2/docs/... [2] https://repository.ubn.ru.nl/bitstream/handle/2066/29853/29853.pdf https://repository.ubn.ru.nl/bitstream/handle/2066/29853/298...
- foxes 5y agoLol at the proofs that are simply the words "trivial", "easy" etc. Why is it so hard to just write it out fully, in a completed paper -- it would barely add any length. I agree I may find them easy, but the attitude is harmful. Besides after doing any sort of functional programming the whole paper is obvious, so why even bother :). The same brain rot extends to more complicated situations.
- choeger 5y agoI don't know about this particular paper, but there's a) usually a page limit when publishing and b) definitely a limit to a reader's patience. So filling a paper with trivial or technical proofs is not good form. That being said, many scientific papers would benefit from being rewritten in a style that focuses on the reader and readability. That's only understandable: when writing for a journal or conference, there's a lot of time pressure and your audience are bespoke experts on the matter at hand. But there's only a slight chance your paper becomes important to a broader audience. I wonder if one could form a business of rewriting classic papers of CS and math.
- l33t2328 5y agoA business? Maybe not, but certainly many a masters degree has been had doing just that.
- fennecs 5y agoFor b) most people do not read a paper linearly, you look at maybe the intro, skim around a bit, and then maybe go to an appropriate section. If you are really invested then maybe you go through the whole thing. A graph would be a much better format. A bespoke expert with time pressure is not going to comb over the whole thing, they will pick out the bits they care about.
- l33t2328 5y agoFor the intended audience of a paper, many things are considered trivial or easy. The attitude may be harmful when teaching(if you’re unaware of what the students find trivial), but in professional communication it is a signal to the reader that they shouldn’t spend unnecessary time focusing on some (trivial or easy to verify) part of the argument.
- naikrovek 5y agoa miniscule point in the article which I can't get past: 0.99 recurring is not the same as 1. how can it be? the difference is infinitely small and the difference is not, and can not be zero. I have been called names because of this. "0.99 recurring" is an approximation and "1.0" is not, so how can they be considered the same? the world is dumb and I want off
- hummusandsushi 5y agoIt may be unintuitive, but 0.99 recurring is equal to 1 and this can be shown in many ways. qntm has apparently compiled some number of them: https://qntm.org/pointnine https://qntm.org/pointnine
- pdonis 5y ago> 0.99 recurring is not the same as 1. how can it be? Because 0.99 recurring is another way of writing an infinite series whose sum can be proved to be 1. > 0.99 recurring" is an approximation No, it isn't. See above.
- deleted 5y ago[deleted]
- ChrisLomont 5y agoAny two real numbers that are not the same has another distinct number between them; the midpoint for example. No number fits between 1 and 0.99999....., so they are the same number.
- svat 5y agoThe Wikipedia article is (or was) quite good: https://en.wikipedia.org/wiki/0.999 https://en.wikipedia.org/wiki/0.999...
- deleted 5y ago[deleted]
- yakubin 5y agoIf what you have a problem with is the statement that "0.9999... = 1", then there are two proofs of that: 1. Analytical 0.9999... = \sum_{n=1} ^{\infty} (9 * 0.1^n) = 0.9/(1 - 0.1) = 0.9/0.9 = 1 The first equality is by definition of strings of the form "0.abcdef...". The second is the sum of geometric series. 2. Algebraical x = 0.9999... 10x = 9.99999... 9x = 10x - x = 9.9999... - 0.9999... = 9 x = 1
- svat 5y agoGreat article. As it says, it's a translation into Javascript of the Java code from the Android calculator, and the article it references ("Small-data computing: correct calculator arithmetic" by Hans-J. Boehm) is really an awesome read: available at https://cacm.acm.org/magazines/2017/8/219594-small-data-computing/fulltext https://cacm.acm.org/magazines/2017/8/219594-small-data-comp... or https://dl.acm.org/doi/10.1145/2911981 https://dl.acm.org/doi/10.1145/2911981 and PDF at https://dl.acm.org/doi/pdf/10.1145/2911981 https://dl.acm.org/doi/pdf/10.1145/2911981 — the Android calculator is a hidden gem of an application.
- nayuki 5y agoI enjoyed the cool tip where you can scroll horizontally in the Android calculator to see an arbitrary number of decimal places!
- rawling 5y agoIt's a neat feature but the UX annoys me. For sqrt(2) it goes straight from 1.41421356 to "...41421356E-8". I feel like either it should just scroll the decimal places, or at least when it makes the jump from decimal to scientific it should show the "1" instead of the "..." so it's obvious what it's done.
- yakubin 5y agoThe linked paper by Boehm about implementation of the Android calculator (6.0+) with constructive reals was also interesting: <https://dl.acm.org/doi/10.1145/2911981 https://dl.acm.org/doi/10.1145/2911981>
- togaen 5y agoInteresting article, but waaaay longer than it needed to be.
- fennecs 5y agoBasically the article is just lazy evaluation like in Haskell working with infinite lists. Numbers like Pi, e, sqrt(2) are the programs that generate them. However we use syntactic sugar, or just a compact notation, to represent that program or algorithm. It’s useful to be able to glue all these calculations together, a bit like lazy evaluation, or working with generators. Some programs we have some guarantee, we can probe to arbitrary depths and will have a consistent result, eg Pi. However in general for two random real numbers it’s undecidable if they are even equivalent.
- red_trumpet 5y ago> Mike Sebastian maintains a page of “calculator forensics”, recording the result of computing arcsin(arccos(arctan(tan(cos(sin(9)))))) on as many different models of calculator as he or his pals can get their hands on. The value should be exactly 9 That's mathematically not correct. To define the function arcsin you have to choose a codomain, which is typically the interval [-pi/2, pi/2]. So for any values x not in that interval you will have arcsin(sin(x)) != x.
- fennecs 5y agoDynamic typing failures come up in math too. People love to ignore precisely where functions are defined, and then try to dynamically extend it elsewhere and are surprised when it spits out nonsense. Another example, saying a function has a non isolated singularity. It’s more like a codimension something region where you fail to glue together and get a coherent result.
- fiddlerwoaroof 5y agoI assume this is assuming degrees instead of radians? At least, iOS’s builtin calculator seems to use degrees by default.
- LegionMammal978 5y agoI believe this is referring to the trigonometric functions as calculated using degrees, in which the codomain of arcsin is [-90°, 90°]. Of course, the expression still violates dimensional analysis.
- amelius 5y agoIt's kinda obvious that this is using degrees, not radians.
- xigoi 5y agoIt definitely wasn't obvious to me — I wanted to point out the same thing.
- nimish 5y agoFrom the Boehm article: > Many users consider the result of 1+2 to be a finite number, and find it confusing to be able to scroll through lots of zeros on the right.
- giomasce 5y agoIt's unfortunate there is no an equality decision procedure. If two numbers are equal you will see that the difference is zero no matter how much precision you request, but of you always see zero difference you will never know if the numbers are equal or you just have to keep searching. I know that such a decision procedure exists for algebraic number (i.e., you can allow roots of any orders and general polynomial root extraction), but I don't know about transcendental functions like exponential and logarithm. And frankly it smells a lot of undecidability. Computational things tend to become undecidable just a little bit after they become interesting, and sometimes even before.
- Rerarom 5y agoYeah equality of computable reals is undecidable (basically the halting of a Turing machine can be encoded as a computable real being nonzero).
- chriswarbo 5y agoThis technique can't be applied to equality, since equality "collapses" the entire decimal expansion down to a single bit: we can't make closer and closer approximations, since that first bit requires an infinite amount of work. In fact, talking about "Nth decimals" also requires an infinite amount of work. For example, what's the first digit of '0.99999... + 0.00000...'? Note that this is not the same as 'rounded to one significant digit'. Let's call the numbers x and y; there are a few possibilities: - If y = 0, then the sum is equal to x: - If x eventually has a non-9 digit, then the first digit is 0; e.g. if the third digit is a 3, then the result is 0.993... - If x repeats 9 forever, the first digit can be either 1 or 0, depending on taste - If y > 0, then the result depends on the relative magnitudes of y and (1 - x). The first digit could be 0 (if y < 1 - x), or 1 (if y > 1 - x). If these differences only occur after billions of decimal places, we must go that far through the calculation to determine whether the first digit is 0 or 1! Most computable real representations will actually calculate to within some epsilon, e.g. a power of 10 if we're rounding the final decimal when displaying the result. That ensures all of these problems disappear, but of course it introduces uncertainty. We can likewise ask whether two numbers are equal to some precision; but not necessarily in general. (There might be tricks/identities for the particular functions being used in this calculator; but the above applies to "computable reals" in the strictest sense; i.e. where each function is a Universal Turing Machine)
- grobclaw 5y agoI went to the "use my calculator yourself" page. The calculator looks nice but the interface is either awfull or I don't get it. I tried for 5 minutes to type in "1/5 + 1/5 + 1/5" and failed...
- rrobukef 5y agoIt's in reverse polish notation: let a be the sequence (1, "Enter", 5, "Enter", /) then press $a, $a, +, $a, +.