Ruud H.G. van Tol on Tue, 03 Oct 2023 14:54:50 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

constant expressions



Beware, "academic" examples only:

? for( i=1, 1e6, )
cpu time = 85 ms, real time = 87 ms.

? for( i=1, 1e6, 0 )
cpu time = 97 ms, real time = 98 ms.

? for( i=1, 1e6, 0+0+0+0+0+0+0 )
cpu time = 312 ms, real time = 313 ms.

? for( i=1, 1e6, 1 )
cpu time = 104 ms, real time = 105 ms.

? for( i=1, 1e6, 1/1/1/1/1/1/1 )
cpu time = 465 ms, real time = 419 ms.


Would it be feasible, and useful, and doable,
to make PARI/GP optimize constant expressions?

-- Ruud