Live data from Hacker News

Reverse Engineering the Constants in the Pentium FPU

righto.com

21–24 of 24 posts

Re: Reverse Engineering the Constants in the Pentium FPU

#21
post #18

Earlier quoted context omitted.

That somehow looked very similar to the typical powers of ten table found in floating point conversion routines. I got the first confirmation by searching for 0x5c3bd5191b525a249 / 2^67, which happened to match how many exabytes are equal to 5 exbibits.

Constant 9 does match the expression ( at least when I truncate the output in KCalc 2^13*10^16/2^28 shows base16 0x470de4df82 )... However, I don't know enough about floating point conversion to understand why that value's useful, or why it's stored where a fractional part normally would be in that same format. Constants 6 and 7 visually appear to be in a similar fractional range and possibly as if extending precisio…

The FPU supports decimal numbers in BCD (binary-coded decimal). Presumably these large powers of 10 are useful for BCD conversion, especially since they are near other BCD-related masks. But they aren't normal floating-point numbers, so they don't have exponent parts. Yes, constants 6 and 7 look like they should be part of the same sequence, but nothing that I try will work.

Re: Reverse Engineering the Constants in the Pentium FPU

#22
post #20
post #17

Earlier quoted context omitted.

There used to be a site called the Inverse Symbolic Calculator (also a sibling site, Plouffe's Inverter) where you could give in a decimal expansion and it would search for known constants. Unfortunately, it seems to be down (the frontend exists, the backend just gives 404). Maybe someone else made something similar? Edit: I found https://mrob.com/pub/ries/ , which may or may not help.

The ries program is very cool for turning a number into an equation. However, I tried it on some of the Pentium constants and it didn't do very well. In particular, it seems to be allergic to numeric constants, preferring complicated symbolic expressions. For instance, if I put in 0.5625, I expect to get 9/16 out. However, ries doesn't come up with that, instead suggesting the best answer is sin(pi*sqrt(x)) = 1/sqrt(…

Yes, I feared as much. Perhaps trying to get a copy of Piouffe’s inverter would be possible, but I don't know.

Re: Reverse Engineering the Constants in the Pentium FPU

#23
post #20
post #17

Earlier quoted context omitted.

There used to be a site called the Inverse Symbolic Calculator (also a sibling site, Plouffe's Inverter) where you could give in a decimal expansion and it would search for known constants. Unfortunately, it seems to be down (the frontend exists, the backend just gives 404). Maybe someone else made something similar? Edit: I found https://mrob.com/pub/ries/ , which may or may not help.

The ries program is very cool for turning a number into an equation. However, I tried it on some of the Pentium constants and it didn't do very well. In particular, it seems to be allergic to numeric constants, preferring complicated symbolic expressions. For instance, if I put in 0.5625, I expect to get 9/16 out. However, ries doesn't come up with that, instead suggesting the best answer is sin(pi*sqrt(x)) = 1/sqrt(…

Yeah, RIES won't work well with that because there are too many constants to test out for RIES. AFAIK RIES doesn't natively handle constants larger than 9 partly to reduce the already enormous search space.
Post reply on HN