Karim Belabas on Sun, 04 Dec 2022 10:09:03 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: I don't find the solution ...
|
- To: pari-dev@pari.math.u-bordeaux.fr
- Subject: Re: I don't find the solution ...
- From: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
- Date: Sun, 4 Dec 2022 10:07:57 +0100
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1670144876; c=relaxed/relaxed; bh=rqdd0P509UM0LMzj3kIh77LGPdfopAq/EhXZxg6DqGw=; h=DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To; b=xAsORhYz5qN3/A2P4LKXr6DgOjNwNmnTM9bp1PpgKRYD4lEMWcHPvuPEdc7ulDnkTZ7TAHoz6qU+lHM+/VV6D0asfl9niQu0WKFr2qgUkLolG9DXtT1S1MpH9fA02Cm/5G0qA8wsMY51+TICsd2ARZ4FfiWCxDTqDxIZan/GbAkD8Ci/mhJ7NO4if9Fv9TDtQMhs7wnPNrvPBTocafSrh8ChpXvJl9H4a/hKzGwTtPXX48SqtYmdOr4gE2s3ZjmZL1JW1VT8TwrwJkFleacu7jWs5XRB7DnZtvNX4Y7yGOZxu7CDCNUgxUkXb6cwsztueGZmVuObvZ1TRv8jDI9+xapk2lZRsuXUtRx2bViKh2++GcHQqF85l0hXrSjGvwPoeWbt35xy7h5EabCSuXQiCwXGIntiREQNI7qdfLbqrY2ewDzJIzTOq7zlpFClupY+a8kTNUkqH7MkBDkj1c1C+BOu7APLtBW60EU6HI57tslu6d6ovbJDLePXKnmQED7ueqt0uSWTtGZ6RiBn0tWPdukWnq2cdiNvDOLCsDFjeJcugAVNry8XRsRC4jEAUZvo5rAyKHr4k4W7Q1tw+uNHk3XZ0mX3dXjbQHrB1tTjLQC53azLXWvkOT7tkEJhAJy3UnOp7PzKQgrF5pccGA9Th/4770GHW+GVmyklQrznIQg=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1670144876; cv=none; b=rAfUGKLDPC0d5IqG9aZg0YTmDojnuGSEn6nWaUebwHCwKiARsEaE0cNkJhaq67Gn7jIYNRdR5FQ2yVyGHonAdBeJ46rSEKWVNO5B30xLgzxfuRO8+ClZOj8OmtMLuuG+DHpqCmhfmsA+1QOGwYptX1d7X3zaKisnO5O4Fftl926bmYwTGhVFd5IipAfU87iPbyZjjSBLTqvNEi96bSczS1PcEgecr0NIcDy2vW3b+CRBbzX5tOIgbeQtQdt4vjh2u8ryWBz53b1AZTFX/q0g73p5xyY4NsObmdq824X1RkqISovH7yBmzHpFLZT95gwNCICAig4MgoaXI/wQdlZNF5UegkDsXgf/dO2BsHNBIKYHQIuJsqE8tvNSzobB2W/BonV1uY4eYkV1EWp6yRhmIBPX2hYhKljOuEtjw2lB7+AMO2AFgBM9HOShNGdkLcMXwZQl2YDtc/Ob0mqotQYVY6ZZzLKNyNTsB8aCplezykk4DA2f3Vs38uAvAg3xd4PE+/keBEwgSbcYdXudOKAl7k/7LIk1KXROCGi2Zhko0iYp+gjHTeIHjuKuMcIK8t+bT6FYJgI6yZ6+wOm+NRwFqguVCN+c7MyCdtzofbhu4d6ZvDwk+6LS41678J+BfbVk7ad/5PBLu2cpQ5KcIpvPlN8VAOfme1Uo4Igoteu24F8=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Cc: Jean-Luc ARNAUD <jl.arnaud@free.fr>
- Delivery-date: Sun, 04 Dec 2022 10:09:03 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1670144876; bh=rqdd0P509UM0LMzj3kIh77LGPdfopAq/EhXZxg6DqGw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SBYNzobhqc4kNgd3Rdhg+cavJDYuAHKp/TuFMpCaPggu6z7TWAYS1cUBmUIm2c8kZ cmCJWmc9qFlKuMvZ3ntjqKFaB5pQpKYlR2YyLiCbguUVlcxlnxvSDI72h5fvRBzUln YyF0YYgI/EYfvazOO159ZW/20EsKYA4JSCjzdp/AGxKSatnzpt8Ubqt0eUk6P9m8t2 LbB0DkDP+y7K5I1XxWOSYV/pZC61EIEOWhgdCNsIeNYbIYPDvdlctlXTGWizIStRVT DXpUZV/EMA4F51ZxyDbc4h7QTBW5gwfqh4hOJasfJVZ7J/mXFXcaVUkTqyZguxHmjV cFlB03MRfwdNd3X3Z6YkEuH1R5DqB4ire1DcK4Eh3BzK/g/V6Ud0wzle4lbRQzYjYg 2zesTypM4VvSsDhAejgT1SQtHOtjmNL3TJccR8TLqtnKdh8xBc2xEb6B8OHeAGie0Y 0YszbtJwUmslrpmZezFHw6ncCJUB8fVM5DWyTJiCbEjc5/U/j2F5FoZB+daR840j1/ 4Z5ALMaM4jOdxA98PJdGHbiJVVabCuVM51JQF2k11zUuXOVfIYWazGEiBJrUKp99K0 LcZSznskVxn/S1pbTAWw09IWtAI6a8+yl8AhuYzqlbg8+GiV0R90V3rInUXLLJ23ml hdaaU4MULrAOeHB+Tr6SvVlg=
- In-reply-to: <7dc738bb-2e57-9a51-769c-da4194c24277@free.fr>
- Mail-followup-to: pari-dev@pari.math.u-bordeaux.fr, Jean-Luc ARNAUD <jl.arnaud@free.fr>
- References: <7dc738bb-2e57-9a51-769c-da4194c24277@free.fr>
* Jean-Luc ARNAUD [2022-12-04 02:03]:
> Hi,
>
> Working with eval, I get the expected result with:
>
> eval([ a=((6*k)!*(-1)^k)/(((3*k)!*(k!)^3)*640320^(3*k)), k*a ]);
>
> But I don't achieve the same calculation with pareval.
>
> I'm using ()-> for the first equation, but what should I use for the second?
>
> I tried:
>
> pareval([ (a)->((6*k)!*(-1)^k)/(((3*k)!*(k!)^3)*640320^(3*k)), ()->k*a
> ]));
>
> or:
>
> eval([ ()->a=((6*k)!*(-1)^k)/(((3*k)!*(k!)^3)*640320^(3*k)), ()->k*a
> ]));
>
> The first pareval results in correct calculation of the first term, but the
> second term is always 0.
Please state what you are really trying to achieve. The above breaks
fundamental assumptions of PARI's parallel model; see ??eval :
"closures must not access global variales and must be free of side effects".
>From the distribution or PARI website, the booklet 'Introduction to
parallel GP' (esp. section 2.) should be useful as well.
Incidentally, you should replace factorials by binomial coefficients as
much as possible (or recurrences if consecutive values are needed):
? k=10^6;
? (6*k)!/((3*k)!*(k!)^3);
time = 9,638 ms.
? binomial(6*k,3*k)*binomial(3*k,k)*binomial(2*k,k);
time = 366 ms.
? % == %`
%4 = 1
Cheers,
K.B.
--
Karim Belabas / U. Bordeaux, vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/
`