Post AjqodfW2dXVCIk948e by gnarley_boot@norwoodzero.net
 (DIR) More posts by gnarley_boot@norwoodzero.net
 (DIR) Post #AjpIUnCFJrL5pDeLui by iro_miya@mk.absturztau.be
       2024-07-11T15:49:26.149Z
       
       6 likes, 11 repeats
       
       WHAT
       
 (DIR) Post #AjpIUp984Q2Bs8CtKi by Suiseiseki@freesoftwareextremist.com
       2024-07-11T16:24:40.975543Z
       
       3 likes, 0 repeats
       
       @iro_miya The post has it backwards - for loops are a functional abstraction of the scary math symbols.
       
 (DIR) Post #AjpTTNWmMvt9Q9mZBw by fcktheworld587@social.linux.pizza
       2024-07-11T18:27:50Z
       
       0 likes, 0 repeats
       
       @Suiseiseki @iro_miya they're just different ways of communicating the same function
       
 (DIR) Post #AjpWDGlA42uvewWHSK by q66@blahaj.social
       2024-07-11T18:46:37Z
       
       2 likes, 0 repeats
       
       @iro_miya i've been entirely convinced for years that the whole reason i cannot math is that math notation is just "every variable name is a single letter" times 1000
       
 (DIR) Post #AjpWSYMosmjObyQE88 by lanodan@queer.hacktivis.me
       2024-07-11T19:00:44.908486Z
       
       0 likes, 0 repeats
       
       @q66 @iro_miya In a way Math is like obfuscated APL and also more toward functional than imperative.
       
 (DIR) Post #AjpWZ9xU224yw7imYq by Suiseiseki@freesoftwareextremist.com
       2024-07-11T19:02:20.488810Z
       
       1 likes, 0 repeats
       
       @lanodan @q66 @iro_miya APL mentioned.https://www.gnu.org/software/apl/
       
 (DIR) Post #AjpWyEDrJaXPOvKnpo by karna@poa.st
       2024-07-11T19:07:02.794250Z
       
       1 likes, 0 repeats
       
       @Suiseiseki @lanodan @q66 @iro_miya 
       
 (DIR) Post #AjpXGBzWLizJh3C59E by Suiseiseki@freesoftwareextremist.com
       2024-07-11T19:10:05.879617Z
       
       1 likes, 0 repeats
       
       @karna Yes, he had indeed been crafting the perfect memes even prior to 1969.
       
 (DIR) Post #AjplkrbxZQnmoyh11M by futurebird@sauropods.win
       2024-07-11T21:52:37Z
       
       0 likes, 0 repeats
       
       @iro_miya Oh jeeeezI need one where it's reversed and it says "By the way this scary code is just a summation symbol and a product symbol."
       
 (DIR) Post #AjpmPvM2YerAIspFgG by AustinB@esq.social
       2024-07-11T21:59:55Z
       
       0 likes, 0 repeats
       
       @futurebird @iro_miya I feel like I get for loops better now.
       
 (DIR) Post #AjqnghyfqA4eqpQJBg by enigmatico@mk.absturztau.be
       2024-07-11T21:37:02.332Z
       
       2 likes, 1 repeats
       
       @iro_miya While it's true that you can implement sums using a for loop, it can be optimized using basic summation identities. More specifically\displaystyle{\sum^k_{n=0}3n = 3\sum^k_{n=0}n = 3\left(\sum^{k-1}_{n=0}n + k\right) = 3\left(\frac{k(k-1)}{2}+k\right)}Where k \in \mathbb{Z}⁺, k > 0. So you can simply use this generic formula and save yourself a for loop.The same can be applied to the multiplication as well, although in this case how much computational cost you save will depend on how the machine calculates the factorial.\displaystyle{\prod^k_{n=1}2n = 2\prod^k_{n=1}n = 2(k!)}
       
 (DIR) Post #AjqnsCgE1ty9G5H8vA by iska@catposter.club
       2024-07-12T09:51:02.527Z
       
       1 likes, 1 repeats
       
       @enigmatico@mk.absturztau.be @iro_miya@mk.absturztau.be do you actually think fedi users can comprehend math above elementary school
       
 (DIR) Post #AjqoMMO8V0cY3VC6LY by gnarley_boot@norwoodzero.net
       2024-07-12T09:56:35.706371Z
       
       1 likes, 0 repeats
       
       @iska @enigmatico @iro_miya AFAIK toe and 3T are math brains.
       
 (DIR) Post #AjqodfW2dXVCIk948e by gnarley_boot@norwoodzero.net
       2024-07-12T09:59:43.005872Z
       
       2 likes, 0 repeats
       
       @iska @enigmatico @iro_miya Yeah hit them up with real math they will know what yer talking about cc @theorytoe @3T
       
 (DIR) Post #AjqpyyYn7pedOy9h0S by waifu@mai.waifuism.life
       2024-07-12T10:13:11.881Z
       
       0 likes, 0 repeats
       
       @iro_miya@mk.absturztau.be lmao real
       
 (DIR) Post #AjrQNMnkFHN3st4zkO by lispi314@udongein.xyz
       2024-07-12T10:09:03.888422Z
       
       0 likes, 0 repeats
       
       @enigmatico @iska @iro_miya This would probably be more readable if my client rendered LaTeX.Anyhow, from what I recall identities had some caveats.
       
 (DIR) Post #AjrQNNzpnodTafkAEK by hayley@social.applied-langua.ge
       2024-07-12T10:25:16.625747Z
       
       0 likes, 1 repeats
       
       @lispi314 @iska @enigmatico @iro_miya latex2png.com is handy; fun fact, LLVM will rewrite to the closed form but GCC will notfor loop fails Steele https://vimeo.com/6624203 though, since now you have to work backwards to get back to the parallelisable sum from the for loop and accumulator
       
 (DIR) Post #Ajrdb8UdXS0Qxz2PNg by alex@masto.digittante.com
       2024-07-12T19:27:40Z
       
       1 likes, 0 repeats
       
       @lanodan @q66 @iro_miya I co-sign this. Recovering (still) #APL user here....
       
 (DIR) Post #AjrwmiVprGIizcpms4 by enigmatico@mk.absturztau.be
       2024-07-12T10:23:25.835Z
       
       1 likes, 0 repeats
       
       @lispi314@udongein.xyz @iska@catposter.club @iro_miya@mk.absturztau.be The caveat being, if you're trying to optimize something like a pi product, it might be difficult to optimize if it would result in a factorial like I stated in this case. Factorials suck and you should avoid them as much as possible.There are other functions that might be difficult to optimize. I remember many old games used lookup tables to optimize trig functions, but they had to give up in FP accuracy in doing so.Yet for cases like a sum, it might be better to simplify the formula first and avoid loops, which are heavy to compute.
       
 (DIR) Post #Ajt97MjdPkfc8mrSTo by lispi314@udongein.xyz
       2024-07-12T18:12:56.602754Z
       
       0 likes, 0 repeats
       
       @enigmatico @iska @iro_miya Now that I can read it (thanks @hayley) that definitely does look very familiar (might've learned at least that one and a few others in school at some point), the first limitation that comes to mind is that most summation of lists I do in code on a regular basis aren't (easily) predictable sequential values.In that case other than parallelization when the list gets large-enough to cost less to parallelize than just do the normal way, there's not much to be done (besides the obvious type hinting and whatnot for the compiler).
       
 (DIR) Post #Ajt97Nuf2F5HnH1mIy by iska@catposter.club
       2024-07-13T12:58:28.813Z
       
       0 likes, 0 repeats
       
       @lispi314@udongein.xyz @enigmatico@mk.absturztau.be @iska@catposter.club @iro_miya@mk.absturztau.be @hayley@social.applied-langua.ge most of the time parallelizing is free, did you forget that SIMD/VLIW exists?
       
 (DIR) Post #Ajt99p94kxKuphvvEm by iska@catposter.club
       2024-07-13T12:59:01.794Z
       
       0 likes, 0 repeats
       
       @lispi314@udongein.xyz @enigmatico@mk.absturztau.be @iska@catposter.club @iro_miya@mk.absturztau.be @hayley@social.applied-langua.ge and pipelining, yeah
       
 (DIR) Post #AjtNaJTU0xpjmi0IXw by hayley@social.applied-langua.ge
       2024-07-13T13:04:08.524692Z
       
       1 likes, 0 repeats
       
       @iska @enigmatico @iro_miya @lispi314 you would not believe what I replied 14 hours ago https://social.applied-langua.ge/notice/AjrvcA512UJaFrHgnI (TL/DR: shuffling into/out of vectors costs, + unlikely to get that many arguments, (reduce #'+ vector) is more interesting)