Viewing profile — purplesyringa
purplesyringa
HN member- Joined
- Sun, Apr 14, 2024, 2:17 PM UTC
- HN karma
- 572
- Public activity
- 126 items
- HN profile
- View on Hacker News ↗
About purplesyringa
No profile information was provided.
Recent public activity
-
comment
Comment #49096752
To expand on this, the imprecision arises the moment you write 0.1 (decimal) in source code and the compiler converts it to binary; the arithmetic itself is (mostly) exact. So as l…
-
comment
Comment #49096710
`log_a x The topic of the post is that in PHP and Lua (without LuaJIT), sometimes this inequality doesn't hold, and instead we get `log_a x > log_b x`, which is very incorrect and …
-
comment
Comment #49095419
I sort of needed to do that. I needed to compress data with an approximately geometric distribution, and as part of that process I needed to invert its CDF, which is `CDF = 1 - (1 …
-
comment
Comment #49095346
That's interesting! On my PC it reproduces under Lua 5.5 (`log_a x > log_b x`), but not under LuaJIT (`log_a x = log_b x`). I took a look at LuaJIT's implementation ( https://githu…
-
comment
Comment #49095302
Thank you! This point has been driving me mad for the last couple of years. While answering a sibling comment, I found a paper analyzing various libms for their precision: https://…
-
comment
Comment #49095216
Thank you! I completely agree with this, floats are treated as a lot more magical than they actually are. I myself often rely on their exact guarantees for fun tricks (e.g. fast pr…
-
comment
Comment #49033426
The log base is a parameter, not a function, so that doesn't typecheck. Multivariate monotonicity isn't really a popular term, as far as I'm aware, so I'm not aware of good termino…
-
comment
Comment #49026680
Python, PHP, and Rust do indeed use libm. Not LLVM's libm specifically, though, but rather just about anything they can find in runtime, and those libraries can have suboptimal acc…
-
comment
Comment #49026564
> PHP uses a JIT from Lua. Wow, TIL! I was certain this is a mistake, but apparently PHP uses DynAsm ( https://wiki.php.net/rfc/jit ), which was developed for LuaJIT ( https://luaj…
-
comment
Comment #49026492
Yeah, I simplified it a little. Though I must say I'm surprised pretty much every library I looked at uses the natural logarithm specifically, and not log2, which would seemingly b…
-
comment
Comment #48972043
> small source files How small are we talking? We've had great success with bzip-style compression on ~400 KB (about 20% better than gzip), but I don't know if it scales well. It's…
-
comment
Comment #48971725
We considered it, but that requires knowing the path to the file and being able to open it, which I don't think is possible in general (e.g. if the file is loaded with `loadstring`…
-
comment
Comment #48971693
Thanks! I relayed this to Yuki and we'll make sure to fix the issues. > You can include the start delimiter in the string: At first I had no clue why we thought that didn't work, i…
-
comment
Comment #48911088
> the fence basically means "resolve all funny business with this variable before proceeding" Thanks, that's a good explanation! I understand it better now. > What I'd actually wor…
-
comment
Comment #48903418
> A huge part of the problem here is that you're playing with the 8-bit registers. [...] That's an interesting thought, though in this particular case I think it's a little misguid…
-
comment
Comment #48895665
The right-shift is the problem. You need to shift right by `j * 8`, which itself requires a shift to compute (`j better than a load, but it's still noticeable.
-
comment
Comment #48895600
I knew the loop was latency-bound and I couldn't easily decrease the latency, so I knew I had to somehow avoid the dependency chain at all. I remembered that CPUs predict some prop…
-
comment
Comment #48891968
The optimization in the post is only advantageous if `next_j[i][j] == j` holds often enough. Without prior knowledge, the compiler can't know if it's going to improve performance, …
-
comment
Comment #48890282
That would be great, if only it worked as intended! From the perspective of an optimizing compiler, `a == b ? a : b` is worse than `b` regardless of the probability you assign to `…
-
comment
Comment #48794265
Thanks!
-
comment
Comment #47938194
My brain does not understand how one can see `(+ a b)` in text and read it as `a b +`. I suppose you can argue that moving operators to the right and removing all parentheses conve…
-
comment
Comment #47933096
There used to be hype about Wasm, now it's a technology as any other. It's still used, and used a lot; it just doesn't get focused on as much.
-
comment
Comment #47933074
> tl;dr: the LISP syntax is just syntax sugar. The textual format is as "stack-like" as the binary format. Not that you're technically wrong, but I think you're begging the questio…
-
comment
Comment #47819600
There's just so many "but"s to this that I can't in good faith recommend people to treat floats as deterministic, even though I'd very much love to do so (and I make such assumptio…
-
comment
Comment #47760038
And here are the constants for the ostensibly more useful 54x54->108 product: https://play.rust-lang.org/?version=stable&mode=release&edit... I tried to go even higher, but the bou…