Chris Kerr

Results 21 comments of Chris Kerr

Continuing the discussion on https://github.com/echemdata/galvani/issues/51 No copyright I have on my own code can forbid someone from writing `import galvani` in a file and distributing that, either on its own...

I've had this problem too - I ended up importing the data into sqlite, indexing by Data_Point and exporting again.

Running the test with `pdb=True` and investigating further: ``` core/tests/test_numbers.py(2135)check_prec_and_relerr() -> assert abs((x - y)/y) < 2**(-(prec + 1)) (Pdb) abs((x - y)/y) 1.848892746611746418933738824882e-32 (Pdb) 2**(-(prec + 1)) 6.162975822039155e-33 (Pdb)...

With "double-double" arithmetic, the relationship between the number of bits in the mantissa (`np.finfo(npval).nmant`) and the precision is not the same as for IEEE 754 quadruple precision arithmetic.

Possibly related numpy issue: https://github.com/numpy/numpy/issues/21094

There doesn't seem to be an official way to detect when `np.longdouble` is using "double-double" format. Perhaps it could be done by checking `np.finfo().nmant` which is 105 for "double-double" and...

> What should be precision be if not `nmant + 1`? In this case, `nmant - 1` would get the test to pass. I will do some more tests to...

Here is the full `np.finfo` contents for a "double double" architecture: ``` In [58]: np.finfo(np.longdouble(1)).__dict__ Out[58]: {'dtype': dtype('float128'), 'precision': 31, 'iexp': 11, 'maxexp': 1024, 'minexp': -1022, 'negep': -106, 'machep': -105,...

`eps` is equal to `2**-nmant` just like on your architecture. The test expects the relative error to be less than `2**-(nmant + 2)`, and this seems to work for IEE754...

Asserting the relative error to be less than `eps` passes for `Rational(2, 3)`. Using `hypothesis` I was able to discover an example `Rational(512776084643583063, 256388042321791534)` which has a relative error just...