|
VikingofRock posted:I just wish floats were associative, and that it was a little easier to do stuff like summing products without losing precision. For all that I was joking about posits earlier, I actually do think the general goals of unums / posits are pretty admirable. unfortunately non-associativity is inherent in fixed-width floating-point
|
# ? Oct 24, 2023 00:56 |
|
|
# ? May 27, 2024 03:38 |
|
Athas posted:What should the default number type be? do it Ada-style and permit the declaration of integer types with arbitrary ranges code:
|
# ? Oct 24, 2023 01:01 |
|
god I covet ranges as type information. so righteous
|
# ? Oct 24, 2023 01:22 |
|
tef posted:there's this long post about posits being a scam thanks for the link. sounds like posits are “not awful, not actually better than IEEE floats, but can be made to seem better on some relatively meaningless comparisons”. Posits are better on some part of some of the error graphs, but big meh. I did like the pithy statements about just doing math to improve stability and conditioning instead of doing the exact same dumb calculation with more better number representations.
|
# ? Oct 24, 2023 04:40 |
|
Internet Janitor posted:do it Ada-style and permit the declaration of integer types with arbitrary ranges sounds useful
|
# ? Oct 24, 2023 04:41 |
|
Athas posted:What should the default number type be? Linked list of bits.
|
# ? Oct 24, 2023 06:02 |
|
succ
|
# ? Oct 24, 2023 06:13 |
|
oh boy, is my face red. i thought .net decimal was a fixed point type, but it's a floating point one! i think i conflated it with sql server's decimal type (which is a fixed point type) although the .net decimal type uses base 10, meaning you can do normal person math on it without it going wildly wrong i think i've refined my position to be: floating point, whatever, but you should also be able to easily do Normal People Maths on the computer. and langs should facilitate that
|
# ? Oct 24, 2023 06:46 |
|
Internet Janitor posted:do it Ada-style and permit the declaration of integer types with arbitrary ranges Integers are easy, the problem is what to do when people want fractions.
|
# ? Oct 24, 2023 07:37 |
|
VikingofRock posted:a symbolic expression, which is then computed to arbitrary precision when it's time to output the results Yeah this IMO, this has the much more amusing error case that the storage requirement for intermediate results can grow arbitrarily due to irreducible fractions, so to a novice the numbers just become slower for no visible reason. I'd really like to visit the parallel universe where this is what Javascript did, so I could see which bizarre cargo cult tricks novices come up with as workarounds. I think it is pretty cool how IEEE floating point lets people who have no idea about numerical issues (most people, including me) actually write numerical programs that work OK most of the time. All the other proposed systems have far worse idiot-case behaviour.
|
# ? Oct 24, 2023 07:41 |
|
Lunar Suite posted:healthcare IT is a gently caress, and the successor product we're forced to upgrade to next year is somehow worse than this ancient and venerable colossus. which of your current system and your new system are written in MUMPS (a) current (b) new (c) both (d) neither
|
# ? Oct 24, 2023 07:42 |
|
DELETE CASCADE posted:chris lattner peaked with llvm and it's been all downhill from there clang and its C++ stdlib are quite good unfortunately Chris doesn’t seem to truly feel the fundamental beauty and power of LISP
|
# ? Oct 24, 2023 07:49 |
|
a lot of my employer's services business is in the (admittedly canadian) healthcare field, and we see some poo poo never had to deal with any of the code end of their stuff but the weirdest stuff that we touch seems to be working with the million disjointed bits on the hardware side. virtualization, storage, networking... it's a miracle if even a quarter of one of those things works right
|
# ? Oct 24, 2023 07:54 |
|
Internet Janitor posted:do it Ada-style and permit the declaration of integer types with arbitrary ranges Dylan did this really well because in the original language definition you could not only explicitly define named constrained types like this for use elsewhere, but also define them inline in a method definition if your method only worked on a specific range, you could just say so in the definition and call sites would warn you could even specialize methods for individual instances of parameter types—and before a bunch of “let’s try to roll back some dynamic behavior” revisions, you could even do so on the fly leading to interesting features like methods that can memorize expensive computations for specific parameters at the language level rather than by (more) explicit maintenance of a cache
|
# ? Oct 24, 2023 08:51 |
|
Athas posted:Integers are easy, the problem is what to do when people want fractions. sounds like an exercise for the user to implement.
|
# ? Oct 24, 2023 15:12 |
|
javascript should just have adopted TeX model of arithmetic wholesale.
|
# ? Oct 24, 2023 15:14 |
|
Cybernetic Vermin posted:javascript should just have adopted TeX model of arithmetic wholesale. javascript does numbers right. "it's a number, worrying about the implementation is for losers writing c or whatever."
|
# ? Oct 24, 2023 15:57 |
|
Hmm, I just learned that the Playstation 1 didn't have a FPU and only used fixed point numbers (having a bunch of graphical artifacts as a consequence).
|
# ? Oct 24, 2023 16:59 |
|
ColTim posted:Hmm, I just learned that the Playstation 1 didn't have a FPU and only used fixed point numbers (having a bunch of graphical artifacts as a consequence). i just learned that you never played a ps1 game
|
# ? Oct 24, 2023 17:00 |
|
wobbly textures are a vibe.
|
# ? Oct 24, 2023 17:00 |
|
it was an interesting time in that the ps1 and the n64 could not have been more different steps into 3d graphics like, same gen trying to do the same thing, and you could always tell their output apart from a mile away
|
# ? Oct 24, 2023 17:01 |
|
emulators like Duckstation (or maybe just Duckstation) can fix wobbly textures these days with some math that I’m sure I would not understand working on an emulator seems like it would be right up my VM/compiler/performance alley, but I am always intimidated by the math part
|
# ? Oct 24, 2023 17:25 |
|
ColTim posted:Hmm, I just learned that the Playstation 1 didn't have a FPU and only used fixed point numbers (having a bunch of graphical artifacts as a consequence).
|
# ? Oct 24, 2023 17:27 |
|
redleader posted:although the .net decimal type uses base 10, meaning you can do normal person math on it without it going wildly wrong decimal isn't much better, you can't reliably do things like add 1/3 to 2/3 decimal is great when you have very specific base ten rounding rules, but most of those cases actually want fixed point math, and fixed point binary gives the same results as fixed point decimal the rest of the time decimal float is almost entirely as tricky as binary float
|
# ? Oct 24, 2023 18:33 |
|
also the ps1 had no perspective correction on texturing which is why texture were sliding like that (artists would subdivide long polygons to reduce the problem) the video memory was fun too, it was a giant rectangular buffer that had to be addressed with 2d coordinates (and you'd define a rectangular area to be sent to the screen). on the engine i had worked with they had implemented texture memory management with a quadtree texture mapping was faster if the textured polygons were oriented in the same direction as they were in video memory and slower if they were at a 90 angle
|
# ? Oct 24, 2023 18:37 |
|
Subjunctive posted:emulators like Duckstation (or maybe just Duckstation) can fix wobbly textures these days with some math that I’m sure I would not understand Grum fucked around with this message at 20:17 on Oct 24, 2023 |
# ? Oct 24, 2023 19:25 |
|
for the longest time i didn't know why the modelview matrix and projection matrix had to be separate until i realized that linear interpolation of texture co-ordinates yields a result that is mostly, but not entirely, correct. but yeah that's what the ps1 did since its triangle rasterizer is an entirely 2D device with no concept of a Z dimension.
|
# ? Oct 24, 2023 19:33 |
|
me and my demoscene buddy were so proud of ourselves ca. 1998 when we not only had a perspective correct triangle filler but also implemented the 3d clipping algorithm from Foley and Van Dam. we spent hours skimming the surface of a cube, the polygons not breaking up. we didn't get out much
|
# ? Oct 24, 2023 19:38 |
|
Athas posted:Integers are easy, the problem is what to do when people want fractions. type R = Z * N override Eq R : Eq (n1, d1) (n2, d2) = (n1 * d2 == n2 * d1)
|
# ? Oct 24, 2023 20:15 |
|
Cybernetic Vermin posted:javascript should just have adopted TeX model of arithmetic wholesale. JavaScript should have never existed in the first place, Netscape should have used Scheme-48 which I believe even at the time supported Scheme’s full numeric tower as designed by mathematicians and computer scientists
|
# ? Oct 24, 2023 21:19 |
|
Subjunctive posted:working on an emulator seems like it would be right up my VM/compiler/performance alley, but I am always intimidated by the math part work on other parts of the emulator, or on improving MAME for example, you could fix 68K MMU emulation so A/UX, NetBSD, and MacMach will boot on an emulated Mac IIx
|
# ? Oct 24, 2023 21:22 |
|
Dylan16807 posted:decimal isn't much better, you can't reliably do things like add 1/3 to 2/3 works for me because that's how money works, and money is what an awful lot of code needs to deal with
|
# ? Oct 25, 2023 00:24 |
|
Sagacity posted:me and my demoscene buddy were so proud of ourselves ca. 1998 when we not only had a perspective correct triangle filler but also implemented the 3d clipping algorithm from Foley and Van Dam. we spent hours skimming the surface of a cube, the polygons not breaking up. would have expected a folding chair with 1998 Foley and Van Dam
|
# ? Oct 25, 2023 01:05 |
|
prisoner of waffles posted:thanks for the link. sounds like posits are “not awful, not actually better than IEEE floats, but can be made to seem better on some relatively meaningless comparisons”. Posits are better on some part of some of the error graphs, but big meh. yup the main "innovation" in posits is variable length exponent encoding. for small exponent values, this frees up bits to store more mantissa. for any word size, ieee has worse precision when encoding numbers whose exponent is close to 0 but like all VL encodings, there's a price - larger exponents need more bits than a fixed length encoding would. so posits actually have worse precision over much of the number line, and a bunch of weird behaviors whenever calculations cause changes in exponent size (because that changes how many bits of mantissa get preserved) for example, does (x*2) / 2 = x? in any binary floating point system, you'd hope so, since x*2 means "add one to exponent" and x/2 means "subtract one from exponent". as long as x*2 doesn't overflow the exponent field, you ought to get the same number back. with ieee, you do, but with posits, there are many values of x where you do not, even if not triggering exponent overflow Athas posted:I think it is pretty cool how IEEE floating point lets people who have no idea about numerical issues (most people, including me) actually write numerical programs that work OK most of the time. All the other proposed systems have far worse idiot-case behaviour. gustafson often promotes posits by claiming they'll enable naive programmers to safely implement equations right out of math textbooks with no need to think about numerical stability, but this is basically a lie besides the issue i mention above, a few extra bits of mantissa don't magically save you. gustafson definitely knows this as he spends so much time crafting "IEEE bad" examples by selectively triggering catastrophic cancellation in IEEE. CC is inherent to all attempts at approximating real numbers with finite digits; he could just as easily cherry pick examples where posits suffer CC and IEEE doesn't
|
# ? Oct 25, 2023 01:08 |
|
BobHoward posted:yup yeh, seems enough of an expert to know that what he’s promising is misleading.
|
# ? Oct 25, 2023 01:38 |
|
BobHoward posted:gustafson often promotes posits by claiming they'll enable naive programmers to safely implement equations right out of math textbooks with no need to think about numerical stability, but this is basically a lie yeah honestly, if you really need the "extra good" calculations you probably need a real symbolic calculator
|
# ? Oct 25, 2023 01:54 |
|
aside, there's always double-double floating point https://www.cs.cmu.edu/~quake/robust.html like this stuff
|
# ? Oct 25, 2023 01:57 |
|
actually that's an interesting question, how does big-boy financial software do math anyway? (very carefully) for basic lemonade-stand financial math sure, you'd count your money in cents (or local equivalent thereof) and do everything in integer arithmetic. decimal percentage calculations on e.g. your tax return work fine too, just multiply and divide by your power-of-ten denominator. compound interest is where you start needing to take exponents though. i guess maybe you can do floating point math to raise 1.05 to the power 30 or whatever and then turn that into a decimal percentage and do the rest with integer math? idk if accountants consider that sort of thing copacetic or not. probably if you're considering say 30 years of annually-compounded 5% interest on a billion dollars then you might want to count your significant figures carefully ($3,321,942,375 and some number of cents i think) (no this isn't a syq from hacker news)
|
# ? Oct 25, 2023 03:16 |
|
Sapozhnik posted:actually that's an interesting question, how does big-boy financial software do math anyway? (very carefully) integers and multiplication by 1000 or so
|
# ? Oct 25, 2023 03:18 |
|
|
# ? May 27, 2024 03:38 |
|
Sapozhnik posted:actually that's an interesting question, how does big-boy financial software do math anyway? (very carefully) in excel ????
|
# ? Oct 25, 2023 03:37 |