Re:Ask HN: Those with success using GPT-4 for programming – ...
by acqq on Monday May 22, 2023 @07:21PM
(#36037957)
But 3000003 is exact in fp32, as well as it is 3000002.5, 3000002.75 before it or 3000003.25, 3000003.5, 3000003.75 after it?
https://www.h-schmidt.net/FloatConverter/IEEE754.html
And AFAIK the LLMs, lacking the ability to actually calculate, can't check which numbers are such?
Re:Ask HN: Those with success using GPT-4 for programming – ...
by siboehm on Monday May 22, 2023 @07:33PM
(#36038042)
Ha, you're right. I should've used 30,000,000. The answer it gave regarding how to do "ties to even" was still correct though: "Evenness" is decided by the least significant bit of the mantissa, not be the "evenness" of the decimal representation.
2. For more complicated tasks it requires good prompting. Example: Tell me three ways to fix this error, then pick the best way and implement it. <paste error> <paste relevant code>. Without the "step-by-step" approach it almost never works.
3. It's pretty good at writing microbenchmarks for C++. They always compile, but require some editing. I use the same prompting approach as (2.) for generating microbenchmarks.
4. It's pretty useful for explaining things to me that I then validate later via Google. Example (I had previously tried and failed to Google the answer): The default IEEE rounding mode is called "round to nearest, ties to even". However all large floating point numbers are even. So how is it decided whether 3,000,003 (which is not representable in fp32) becomes 3,000,002 or 3,000,004?.
5. It can explain assembly code. I dump plain objdump -S output into it.
The main limitation seems to be UI. chat.openai.com is horrible for editing large prompts. I wrote some scripts myself to support file-based history, command substitution etc.