Hacker Newsnew | past | comments | ask | show | jobs | submit | SideQuark's commentslogin

> It tries to get people to take a concept that has been understood for thousands of years for physical objects

That's false. Property used to mean a set of rights that gives legal control over valuable things, not limited to simply "physical objects", has been around for thousands of years. Ancients used it for future payments, interest (which could be traded), and much more.

Ancient Syrians (600BC) gave exclusive rights for breadmakers to make certain breads for a year window, and these were property rights, tradeable, sellable, had futures, etc. Ancient Greeks had a patent system for "a new refinement in luxury" that were property rights. Athenaeus (200AD) describes the system in place then where inventors could own their inventions and be the only one to profit for some time.

These are all property rights - something owned by a person, sellable, tradeable, has value, exclusive use. That you (and too many others) seem to think property can only be a "physical object" is as short-sighted as some who claim property can only be land.


> which avoids many of the flaws with IEEE floats

... by repeating lots of the flaws that led to IEEE754, requiring extra accumulators (the "quire") and hardware to do basic ops since the posit format alone fails, and making numerical analysis a complete mess, breaking the ability to write correct numerical algorithms.

They lose precision over large dynamic ranges, making algorithms fail on many inputs, without extreme care (and loss of accuracy over such ranges), lack of NaN/inf makes them fail on lots of other issues (and there are algorithms requiring NaN and inf behavior under IEEE754 for performance - I'll list one I recently made below...), this lack makes it harder to debug where algorithms broke, costing development time, ....

The algo I recently developed needed to find extrema of cubics over a finite range. This requires solving a quadratic. A quadratic root solver can have /0 = inf and sqrt(-) = NaN cases, which are often fiddled with using branches.

In my case I knew I'd be doing these in batches, and wanted C/C++ code to auto vectorize and do them in SIMD, and did not want to pay the cost for branches. This speed up the flow by about 8x on almost all larger processors, at the cost of some slots having NaN or inf. Those with NaN or inf had underlying cubics I could discard. So by using the IEEE754 aware multi parallel root finder (written in strd c++), I could check that the roots were in my interval (also parallelized) as a <= root <= b, which fails for root being NaN or inf. This check is also parallelzied.

All in standard C++, no hint of parallelization intrinsics, handled by modern compilers perfectly, and getting massive speed gains.

This is but one place NaN and inf are extremely useful. This type of use appears all over in scientific computing, graphics, pysics sims, etc.

Posits cannot handle this type of stuff.


To be honest I'm a bit confused by your comments but the parts I can understand show some misunderstandings.

> lack of NaN/inf makes them fail on lots of other issues

You comment repeats several times assertions of the form "fails on lots of stuff", but does not really elaborate further x) But that aside.

Posits do have a NaN value, with the difference being that only 1 bit pattern is reserved to it instead of potentially quadrillions of them. This makes a huge difference especially at lower precisions, where NaN bit patterns waste an appreciable amount of the total set of values. They do not have inf, they simply do not overflow.

> In my case I knew I'd be doing these in batches, and wanted C/C++ code to auto vectorize and do them in SIMD, and did not want to pay the cost for branches. This speed up the flow by about 8x on almost all larger processors, at the cost of some slots having NaN or inf. Those with NaN or inf had underlying cubics I could discard.

Can you point to your code? I'd be very very surprised if it somehow cannot be rendered using posits.

Pathological cases do exist, of course. Nobody claims that posits are uniformly better than IEEE floats, such a claim being obviously, trivially nonsensical.

> All in standard C++, no hint of parallelization intrinsics, handled by modern compilers perfectly, and getting massive speed gains

Speed gains over what? x) I don't get it. Over branchy or scalar IEEE code? If yes, what's the relevance of that?

And yes, a 40-year old format with decades of hardware and compiler support works better in practice than any conceivable alternative... because all such alternatives are proof-of-concepts with no hardware or compiler support! There's no commercial hardware of any kind for posits, let alone SIMD. I really fail to see your point here.


Correct me if I am wrong, but your algorithm looks to me like it would work fine with posits? You would just get a NaR value instead of both NaN and inf, because div-by-zero and sqrt(-) both yield NaR (the difference here with floats is that it is unique and can get compared to NaR), and so it just works fine?

Your eye also doesn’t have a consistent gamma, nor does the camera, now does any viewing technology. If you’re complaining about the slight linear section of many gamma curves, they are very important for avoiding various artifacts.


Well, there's all sort of different problems, but most modern display technologies both in software visual profile and hardware implementation use LUTs. When sRGB was born the monitors were unable to even meet it as a spec so some crazy simplifications were fine. Now we're using those bits to drive HDR monitors over much larger color volumes and dynamic range, but it's hard to move on from the "good enough" legacy of sRGB.

Certainly, eyes don't have a consistent gamma, they don't even match between people, much less outside the foveal field.


LUTs don’t magically add color volume, change the possible colors or dynamic range, or add much at all to the physics of a display. They’re usually used to reduce bit depth. They do not add more low or high colors than the screen physics started with.


Market cap will price in the debt, as it always does. Empirical evidence (dig through Google scholar) finds that cash assets, debt, profits, settlements, and the like, all are reflected in market cap changes at over 99% accuracy (the 1% is from measurement noise, so it may well be 100%).

Making debt of that form illegal would kill any company that needed money to stay afloat, such as during some emergency, or war, or COVID, or tons of events that companies regularly survive.


And laws can be completely useless when enforced intermittently.

Laws that are enforced and more importantly are enforceable have a much higher rate of making a difference. The same works here.


> The most rigorous evidence comes from a 2018 whole-population study tracking nearly half a million children born in Western Australia between 1980 and 2001. Of those, 1,870 developed schizophrenia, but not one of the 66 children with cortical blindness did.

1870/500,000 * 66 = 0.247

Not a single blind child getting it is the most likely outcome, and this is called "the most rigorous evidence"?

It didn't protect rats in a study https://www.sciencedirect.com/science/article/abs/pii/S09209...

There sure is a lot of reported cases of all sorts of blindness with schizophrenia, constantly shrinking the pool of types of the two, making this conjecture constantly shrinking https://pmc.ncbi.nlm.nih.gov/articles/PMC4246684/

It also seems the Australia study does not quite say what the article claims it does - a follow-up study: https://jmsgr.tamhsc.edu/the-lack-of-comorbidity-between-ear...

Too bad this article simply doesn't mention all this. Of course the article will get less clicks with a less wild title.


Doesn't the article address some of that in the next paragraph, which includes a link to a study from 2013?

> That sample of blind children is small, but the pattern holds across more than 70 years of evidence: not a single congenitally blind person with schizophrenia has ever been reported. The protection seems to be specific to cortical blindness, which is caused by damage to the brain’s visual cortex.

I believe that also addresses the discrepancy between the 2014 study you linked and the article. That 2014 study you linked is noting that it does happen with other kinds of blindness. I haven't been through the whole 2014 study (or the 2013 one, for that matter), but it does say

> As the case-reports presented in this section show, only congenital/early cortical blindness—the type of blindness that occurs when bilateral lesions of the occipital cortex deprive the individual from vision (Cummings and Trimble, 2002, p. 110)—seems to confer protective effects.

Isn't that saying the same thing the article does. What am I missing?


> but the pattern holds across more than 70 years of evidence

No, those are also stupidly small samples. Look at the papers I listed.

> That 2014 study you linked is noting that it does happen with other kinds of blindness

Yes, from 1950 till 2014, as more and more kinds of blindness were found with schizophrenia, the type of blindness has been dwindling to smaller and smaller classes, ensuring there is not enough predictive power in the claims. Again, look at the papers I listed. ALL of this is covered.

> Isn't that saying the same thing the article does.

The article says lots of nonsense, like the most likely outcome of data is somehow the best evidence for an unproven claim. It implies the Australia study says a thing it DOES NOT SAY. Is this not enough bad reporting to question the accuracy of the article?

> What am I missing?

Simply look at the papers I posted. They are right there for you to read. The article is click bait trying to claim there is some surprising scientific claim that HAS NO SCIENTIFIC PROOF.


Yeah the article is terrible. There was a much better one on schizophrenia a while back called The Insanity Virus https://www.discovermagazine.com/the-insanity-virus-02-16990


M-expressions were never implemented and never used.


Actually, variations on M-expressions have been created many times in the Lisp world. (Look what you can do with macros!) So far, none of them has caught on. The latest attempt for Scheme is SRFI-266, which creates a very nice infix expression sublanguage. If I were working on a team, I would encourage them to use this, but I don't know if it has enough traction to become widespread.


It's a common mistake to think that the syntax of Lisps are a problem. People solving the supposed problem then discover it wasn't something that needed to be solved.


Haskell's syntax comes from ISWIM, which was motivated quite a lot by m-expressions.


Except in mathematica - which isn’t formally a lisp, but practically it’s used like one a lot of the time.


Completely worked out at least 20 years ago: https://www.lomont.org/papers/2005/CompareFloat.pdf


Note for the skeptic: this cites Knuth, Volume II, writes out the IEEE edge cases, and optimizes.


Great reading, thanks. Describes how to handle ±0, works with difference to avoid truncation errors. First half of the paper is arriving at this correct snippet, second part of the paper is about optimizing it.

    bool DawsonCompare(float af, float bf, int maxDiff)
    {
        int ai = *reinterpret_cast<int*>(&af);
        int bi = *reinterpret_cast<int*>(&bf);
        if (ai < 0)
            ai = 0x80000000 - ai;
        if (bi < 0)
            bi = 0x80000000 - bi;
        int diff = ai - bi;
        if (abs(diff) < maxDiff)
            return true;
        return false;
    }


> The extra half ulp error makes no difference to the accuracy of calculations

It absolutely does matter. The first, and most important reason, is one needs to know the guarantees of every operation in order to design numerical algorithms that meet some guarantee. Without knowing that the components provide, it's impossible to design algorithms on top with some guarantee. And this is needed in a massive amount of applications, from CAD, simulation, medical and financial items, control items, aerospace, and on and on.

And once one has a guarantee, making the lower components tighter allows higher components to do less work. This is a very low level component, so putting the guarantees there reduces work for tons of downstream work.

All this is precisely what drove IEEE 754 to become a thing and to become the standard in modern hardware.

> the problem is that languages traditionally rely on an OS provided libm leading to cross architecture differences

No, they don't not things like sqrt and atanh and related. They've relied on compiler provided libs since, well, as long as there have been languages. And the higher level libs, like BLAS, are built on specific compilers that provide guarantees by, again, libs the compiler used. I've not seen OS level calls describing the accuracy of the floating point items, but a lot of languages do, including C/C++ which underlies a lot of this code.


> The first, and most important reason, is one needs to know the guarantees of every operation in order to design numerical algorithms that meet some guarantee

sure, but a 1 ulp guarantee works just as well here while being substantially easier to provide.

> And the higher level libs, like BLAS, are built on specific compilers that provide guarantees

Sure, but Blas doesn't provide any accuracy guarantees so it being built on components that sort of do has pretty minimal value for it. For basically any real application, the error you experience is error from the composition of intrinsics, not the composed error of those intrinsic themselves, and that remains true even if those intrinsics have 10 ULP error or 0.5 ULP error


> If you take a real analysis class, the elementary functions will be defined exactly as the author of the EML paper does.

I just looked through many of the best known real analysis texts, and not a single one defines them this way. This list included the texts by

Royden, Terence Tao, Rudin, Spivak, Bartle & Sherbert, Pugh, and a few others....

Can you cite a single text book that has this definition you claim is in every real analysis course? I find all evidence points to the opposite.


I guess you're right, I was probably mislead this whole time. I went through my old analysis class book [1] and there doesn't seem to be an explicit definition of elementary functions. The best I can find is this paragraph (I translate from italian):

> The elementary functions of analysis, that is powers, roots, exponentials, logarithms and their inverses, functions obtained from the former by arithmetic operations or composition, admit the limit f(p) for x → p, for any p in their set of definition. The study of such functions, which is not limited to the sole real functions of real variable, is carried out naturally in the setting of metric spaces.

That said, I'm relatively sure that a definition was given in class and it didn't include arbitrary roots: despite being notoriously difficult, the exam didn't require students to draw the graph of any elementary function including implicitly-defined algebraic roots.

I picked up another one of the old recommended books [2] and it seems to be similarly vague; while the book currently taught in my university [3], gives this definition:

> The following functions (from ℂ to ℂ) are called the elementary functions of the Analysis:

> 1) Rational functions (integral or fractional)

> 2) Algebraic functions (explicit or implicit)

> 3) The exponential function

> 4) The logarithm function

> 5) All those functions that can be obtained by combining a finite number of times the functions of kind 1)...4).

So, roots of arbitrary polynomials implicitly defined are indeed considered elementary. I never knew this.

[1]: https://search.worldcat.org/title/1261811544

[2]: https://search.worldcat.org/title/801297519

[3]: https://search.worldcat.org/title/935666878


So, I did a bit of research and I wasn't going crazy: there are apparently two competing definitions of "elementary" in use [1]:

> the class of functions [...] is what I would call exponential-logarithmic functions or EL functions; that is, they are the functions that can be expressed using some finite combination of constant functions, the identity function, exp, log, composition, and arithmetic operations (+−×÷). Some authors call this class of functions elementary functions, but that term is now more commonly used in a different sense, which includes algebraic functions.

Evidently my professor was in the exponential-logarithmic camp.

[1]: https://mathoverflow.net/a/442656


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: