5 ms·
BLAS doesn't use floating-point numbers? So what does it use? My impression was that BLAS was a library of fast linear algebra. Decimals are not fast, as far as
by michaelochurch 12y ago
BLAS doesn't use floating-point numbers? So what does it use? My impression was that BLAS was a library of fast linear algebra. Decimals are not fast, as far as I'm aware.
- Aardwolf 12y agoI think it does use them? What does "real" here mean? http://www.netlib.org/lapack/explore-html/d8/daf/saxpy_8f.html http://www.netlib.org/lapack/explore-html/d8/daf/saxpy_8f.ht... Seems to mean floating point according to this...: http://www-classes.usc.edu/engr/ce/108/text/fbk01.htm http://www-classes.usc.edu/engr/ce/108/text/fbk01.htm Please correct me if I'm wrong, I'm not that familiar with Fortran.
- sharpneli 12y agoIt does use floats. Floats are not that much of a problem as people might think. They come as a surprise for those that don't know how they work. Small course in numerical analysis would do people good. Switching to fixed point would not cure anything, just change the ways they can break. Floats actually have way superior error propagation properties compared to fixed point if your range varies widely, as it often does in physics. In a massively simplified way one can say that multiplication is error free in floats whereas in fixed point multiplication is horrible.
- dragonwriter 12y agoSwitching to arbitrary position decimal/rational would cure most easily curable problems (which are the ones that deal with simple arithmetic not working as expected.) Dealing with the bigger problems (like combining arithmetic with transcendental functions and then getting bitten by approximation issues) require using a symbolic math engine and only reducing to numeric approximations when needed (e.g., for presentation) rather than for intermediate values. "Throw floats at the problem and hope that it works okay" is a great approach for performance, but not really the best approach for correctness. Which is fine, if its a conscious decision, but its so pervasive and encouraged by most programming environments that its easy for people to forget the tradeoff that they are making.
- minimax 12y agoIt does use floating point. I think the slide was misleading. http://www.netlib.org/blas/blast-forum/cblas.h http://www.netlib.org/blas/blast-forum/cblas.h
- acqq 12y agoBLAS uses it, and Excel of course also uses floating point. On the first look, it appears a dubious presentation anyway. The examples don't have much sense too: you can't actually calculate properly sin( 10e22 ) in binary floating point format because both exponent and mantissa are binary: the exponent is 2^76 and in 4-bytes floats you have 23 bits, in 8-byte doubles 53 bits, so you can't even represent the starting number with the enough bits to calculate meaningful sin. You'd need a two parameter function to be even able to pass what you actually want to pass. So calling sin( 10e22 ) in the languages with 4 or 8-bytes binary FP of course can't be expected to produce any meaningful result. But maybe all this was spoken, not written, and it's just misleading to read it without knowing the comments. "Who is NOT using: Excel, BLAS" could maybe then mean that author wanted to say "Excel, BLAS, they use them too"? (If we want to believe that he had any idea what he wrote about). Definitely not good to give this presentation to somebody who doesn't already know more. Confusion guaranteed.
- stephencanon 12y agoPaul Zimmermann certainly knows that BLAS and Excel use floating-point. I assume that the spoken content of the presentation made the meaning of those slides much clearer; it’s too bad that the slides are being discussed in a vacuum. Also 1e22 (note: not 10e22) is exactly representable in double (though not in float). Specifically, it is exactly equal to: 1.000011110000110011110000011001001101110101011001001 * 2^73 which requires only a 52 bit significand.
- acqq 12y agoYou are absolutely right, 1e22 fits in the double, exactly with the bit pattern you showed. And it doesn't fit in the float. Thanks. One more proof that PDF alone is too little of the presentation and that it's easy for the reader to remain confused. I consider your reply "a missing slide" between p 15 and p 16. So the author is: http://en.wikipedia.org/wiki/Paul_Zimmermann http://en.wikipedia.org/wiki/Paul_Zimmermann
- silentvoice 12y agoIt's a little bit of a misrepresentation on the part of the presenter. BLAS is a specification for linear algebra software, of which implementers are free to use the most appropriate representation of numbers as they wish - the fastest being floating point because of native hardware support. Although the naming schemes for BLAS routines do explicitly reference "single precision" and "double precision" so now I'm confused too.