what math function do you use to get zero below 0.8 and 1.0 over 0.8?
Conversation
Notices
-
Efi кисуня (nap pet) 🐱💤 (efi@chitter.xyz)'s status on Thursday, 10-Feb-2022 05:24:16 UTC Efi кисуня (nap pet) 🐱💤 -
witch hat hacker 🎃 spooky ver (haskal@cybre.space)'s status on Thursday, 10-Feb-2022 05:24:08 UTC witch hat hacker 🎃 spooky ver @efi sign(floor(x/0.8)) ?
-
witch hat hacker 🎃 spooky ver (haskal@cybre.space)'s status on Thursday, 10-Feb-2022 05:24:08 UTC witch hat hacker 🎃 spooky ver @efi actually wait just floor(x/0.8) for that input domain
Santa Claes 🇸🇪🇭🇰🎅 likes this. -
Efi кисуня (nap pet) 🐱💤 (efi@chitter.xyz)'s status on Thursday, 10-Feb-2022 05:24:14 UTC Efi кисуня (nap pet) 🐱💤 @haskal no negs, [0.0 - 1.0] range
-
Efi кисуня (nap pet) 🐱💤 (efi@chitter.xyz)'s status on Thursday, 10-Feb-2022 05:24:15 UTC Efi кисуня (nap pet) 🐱💤 @haskal a glsl that doesn't use "if", 'cause I think I've done this before but i'm stuk
-
witch hat hacker 🎃 spooky ver (haskal@cybre.space)'s status on Thursday, 10-Feb-2022 05:24:15 UTC witch hat hacker 🎃 spooky ver @efi do u care about negative input values
-
witch hat hacker 🎃 spooky ver (haskal@cybre.space)'s status on Thursday, 10-Feb-2022 05:24:16 UTC witch hat hacker 🎃 spooky ver @efi define math function,,,,
you can express this just as you said in pure math,
but if you're looking specifically for like, glsl functions for example then that's different -
Santa Claes 🇸🇪🇭🇰🎅 (clacke@libranet.de)'s status on Thursday, 10-Feb-2022 05:28:24 UTC Santa Claes 🇸🇪🇭🇰🎅 @haskal @efi If you have abs() then you can emulate a lot of ifs with abs and you can get away with subtraction rather than division. Or in this case sign() could be helpful as you hinted at. -
witch hat hacker 🎃 spooky ver (haskal@cybre.space)'s status on Thursday, 10-Feb-2022 05:28:25 UTC witch hat hacker 🎃 spooky ver @efi not true tbh
now tbf division (really if the optimizer knows that it's doing it'll convert that into multiplication) is slow so maybe there's a faster way? but that's the basic solution -
Efi кисуня (nap pet) 🐱💤 (efi@chitter.xyz)'s status on Thursday, 10-Feb-2022 05:28:26 UTC Efi кисуня (nap pet) 🐱💤 @haskal what? rly? what?
-
Efi кисуня (nap pet) 🐱💤 (efi@chitter.xyz)'s status on Thursday, 10-Feb-2022 05:28:26 UTC Efi кисуня (nap pet) 🐱💤 @haskal see? im dum and u smrt
-
Santa Claes 🇸🇪🇭🇰🎅 (clacke@libranet.de)'s status on Thursday, 10-Feb-2022 05:51:09 UTC Santa Claes 🇸🇪🇭🇰🎅 @efi @haskal The 0.8 threshold could use both and be f(x) = sign(x - 0.8 + abs(x - 0.8)).
Here sign(n + abs(n)) acts as an n > 0. -
Efi кисуня (nap pet) 🐱💤 (efi@chitter.xyz)'s status on Thursday, 10-Feb-2022 05:51:10 UTC Efi кисуня (nap pet) 🐱💤 -
Santa Claes 🇸🇪🇭🇰🎅 (clacke@libranet.de)'s status on Thursday, 10-Feb-2022 05:58:20 UTC Santa Claes 🇸🇪🇭🇰🎅 @efi @haskal Stuff like this is awesome for writing matrix formulas in Lotus 123, Excel and Lotus Notes. -
Efi кисуня (nap pet) 🐱💤 (efi@chitter.xyz)'s status on Thursday, 10-Feb-2022 05:58:21 UTC Efi кисуня (nap pet) 🐱💤 -
Efi кисуня (nap pet) 🐱💤 (efi@chitter.xyz)'s status on Thursday, 10-Feb-2022 06:17:10 UTC Efi кисуня (nap pet) 🐱💤 @clacke @haskal this relies on sign(0.0) being 0.0 and that is surreal
-
Santa Claes 🇸🇪🇭🇰🎅 (clacke@libranet.de)'s status on Thursday, 10-Feb-2022 06:17:10 UTC Santa Claes 🇸🇪🇭🇰🎅 @efi @haskal Hmm, maybe that can't be trusted, you never know. But then it can be inverted, do f(x) = (sign(x - 0.8) + abs(sign(x - 0.8))/2 instead. Hopefully division by 2 is efficient or otherwise maybe there's some bitshift operation.
-