PiHex icon indicating copy to clipboard operation
PiHex copied to clipboard

Seems to give incorrect hexadecimal digits starting with the 3,708th

Open kundor opened this issue 2 years ago • 2 comments

I noticed while computing something with PiHex that it disagreed with results from the Python package pigen. So I compared them both with the file pi_hex_1m.txt downloaded from pi2e.ch. This has been verified in published analysis so I think it is dependable.

The first differing hexadecimal digit is 3708 after the decimal point, where PiHex gives 6 and the file has 7. In total there are 42 differing digits in the first 100,000.

kundor avatar Mar 31 '22 13:03 kundor

Hello, for the calculations here a specific formula is applied. I admit that it may give some deviations. This is indirectly evidenced by the fact that one cannot get a long chain at a time.

claygod avatar Mar 31 '22 14:03 claygod

while calculating the first 30,000 values.

Location Ref Calculated: 3709 6...7 *** 9091 6...7 *** 15076 D...E *** 22879 2...1 *** 23941 2...1 *** 25363 B...A *** 25408 A...9 *** 26839 E...D ***

with STEP set to 9. As noted in comments in ph_config lowering the number increases accuracy and runtime.

With step set to 8:

location Actual Calculated 23785 B...C ***

I would assume once an error is made, the subsequent calculations would be off as well. the easy fix is to lower the STEP. I'm still wrapping my head around the calculation and exactly with STEP is changing.

Because of the error only being in one nibble and not affecting others and subsequent calculations, I'm thinking the error is more likely related to building the return array than the actual calculation.... If anyone has thoughts, I'd love to hear from you. -foss

fossfool avatar Nov 18 '22 21:11 fossfool