Re: [eclipse-clp-users] Large integers and delayed goals

From: Matteo Bellotto <matteob8_at_...325...>
Date: Tue, 13 Mar 2012 12:31:36 +0000 (GMT)
Hi Sergey,
 using your code I obtained the same, wrong, result.
I've sligtly modified your code, defining explicitly the domain of the variables, and this update has improved the search, i.e. I didn't get any "wrong answer".
Here there the modified code:
  Result:: 1..100,
  A #> 0, B #> 0, C #> 0, D #> 0,
  A #=< B, B #=< C, C #=< D,
  A*A*A*A + B*B*B*B + C*C*C*C #= D*D*D*D,
  labeling([A, B, C, D]).
 ?- test(R).
 No (22.43s cpu)
Please note that, increasing the domains bounds, the search will take a (really) longer time.



 Da: Sergey Dymchenko <kit1980@...6...>
Inviato: Venerd́ 9 Marzo 2012 18:24
Oggetto: [eclipse-clp-users] Large integers and delayed goals

I want to find positive natural numbers A, B, C, D, such that A^4 +
B^4 + C^4 = D^4.
My program do this:

    A #> 0, B #> 0, C #> 0, D #> 0,
    A #=< B, B #=< C, C #=< D,
    A*A*A*A + B*B*B*B + C*C*C*C #= D*D*D*D,
    labeling([A, B, C, D])

But I get incorrect result [1, 1, 9742, 9742] with 10 delayed goals.
As far as I understand, the system finds that the result is imprecise,
but correct enough because 9742^4 is a large number.
Probably floating arithmetic is used, not big integers...
Is there a way to force precise arithmetic for large integers?


Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
ECLiPSe-CLP-Users mailing list
Received on Tue Mar 13 2012 - 12:43:59 CET

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:29 CEST