I've found something strange with mpmath's hypergeometric functions:

sage: f = lambda n: sum(binomial(n,k)^2 * 2^k for k in range(n+1))
sage: g = lambda n: (-f(n) + 8*f(n-1) - 3*f(n-2))/8

Now define:

sage: h = lambda n: catalan_number(n)*mpmath.hyp3f2(-n, -n+1, 2, -2*n, 1, -1)

Now, I have a proof that g(n+1) equals h(n) when n >= 1. But I find this:

sage: g(25)
60529607948876437
sage: h(24)
mpf('60529607948876432.0')
sage: g(25) - h(24)
mpf('8.0')

When I print the two numbers, it looks like they differ by 5 -- but when
I subtract them, they differ by 8. Why is that?

I'm not concerned that mpmath isn't getting precisely the same answer;
I know it's doing floating point stuff and I haven't changed the
precision. It's just the printing that looks very strange.

Dan

--
---  Dan Drake
-----  http://mathsci.kaist.ac.kr/~drake
-------

Attachment: signature.asc
Description: Digital signature

Reply via email to