Can a 600 MB text file with digits of the square root of 2 be compressed to 600 KB? I have a simple script to calculate gaps in a sequence of digits of the square root of 2 (or any other multi-precision constant).
As input, I generated files with the bigfloat module in Python:
from bigfloat import sqrt, precision

MAX_PRECISION_BITS: int = 1 &lt;&lt; 30
CONSTANT = 2

precision_bits: int = 8
while precision_bits &lt; MAX_PRECISION_BITS:
    with open(f&quot;input/square_root_of_{CONSTANT}_with_{precision_bits}_bits.txt&quot;, 'w') as fd:
        fd.write(str(sqrt(CONSTANT, precision(precision_bits))))
        fd.flush()
    precision_bits *= 2

Although I can run the script any time, I decided to compress the input files, and I was surprised that a 646.5 MB got compressed to 632 KB, ie less than 1 MB! This value was obtained with the standard Zip method that is available in Mac OS X. I performed a diff command in the original and expanded file to check for possible differences and none was found.
I understand that every decimal digit takes about 3.32 bits, and the square root of 2  is conjectured to be normal, so I was expecting a compression to 40% or so.
How is this compression attained?
Clearly that's a way too good compression rate. $\sqrt{2}$ is not a rational number, so the decimal expansion will not start repeating. So there has to be something really fishy going on.
I run your script, and looked at the resulting file.
On my machine, the file square_root_of_2_with_536870912_bits.txt contains 161.614.250 digits, and the last 161.597.755 digits are all zeros. Only the first 16.495 digits are different from zero.
So given that pretty much almost everything in the files are zeros, it's not unexpected that the compression rate is so high.

I'm not experienced with the bigfloat package, so I can't tell if the bug is in your program or in the package itself. If you can't figure the error out yourself, open an issue on their Github page.
Btw, from those 16.495 digits, only about 5.000 of those are correct.