3 ms·
Ok, with o1 and some careful prompting I got the following, which seems equivalent to the first approach from the article: float uint8_div_255(uint8_t x) {
by Y_Y 2y ago
Ok, with o1 and some careful prompting I got the following, which seems equivalent to the first approach from the article:
float uint8_div_255(uint8_t x) {
uint32_t y = x * 0x010101u; // x * 65793
return ((float)y) * (1.0f / 16777215.0f);
}
- andrepd 2y agoSpending a drum of oil's worth of energy and knowing the answer beforehand, you too can get an LLM to print you a plausible but wrong snippet of code.
- jiggawatts 2y agoI was about to debate the “drum of oil” quip, but thinking about it: the o1 model can cost tens of dollars for a long back-and-forth conversation. A barrel of oil is currently $70, so if you’ve spent more than that on your chat, you’ve gone through an “energy slave for a year” in a matter of minutes! (A barrel of oil contains the same energy as the work done by a human labourer over a year.) Note: You might argue that most of the cost is due to the rental on the chips and not the electrical bill. Sure, but a silicon chip has a minuscule material cost and is mostly expensive because of the energy-intensive processes required to make it.