Hacker News new | ask | show | jobs
by ncmncm 1363 days ago
That is the way to do the math, but not the way to write the code.

That said, I would like for my compiler to combine any multiplications involved down to one factor for input to the fastest sin/cos operations the machine has. And, to treat resulting multipliers close enough to 1, 1/2, and 1/4 as exact, and then skip the multiplication entirely.

But the second part is a hard thing to ask of a compiler.

1 comments

Yeah, seems to me that languages should allow way more semantic expression than most do today.

I wish I had done CS, those kinds of compiler optimization sounds so fun. I'd love to work on that

Good news, optimization is engineering, not CS. CS is all about what a program would eventually do, if you were ever to run it. Once you run it, you have moved to the domain of technicians. Engineering is about making it run better.
Compiler optimization is very much CS.
Only in practice. And, mostly implemented by engineers.