Raymond Toy writes:
> Now that I understand what haipart does, yes, the ldb version is
> easier to understand.
>
> This surprises me a bit since I'm pretty sure the ldb's get source
> transformed to the code in the current version. (Hmm, if not, maybe a
> declaration that integer is an integer will make that transformation
> happen.)
Yes, I also think so. But I only did a few tests with cmucl
yet. (without any optimizations turned on, and cmucl is good at
that). I did a few short test with allegro, and all three versions
(even the onlined ldb thing) turned out to be equally fast!
Conclusion: I have to do more thorough timing tests.
But then, it shouldn't matter much, because haipart isn't used in many
places and I prefer the clarity over a few microseconds in speed any
time.
>
> There's a few other silly things in clmacs too like
Yes, definitely!
>
> (defun zl-remove (item list &optional (n most-positive-fixnum))
> #+lucid (setq n 16777214) ;;yukkk.
> #+(or cmu sbcl) (setq n (min n (1- most-positive-fixnum))) ; yukkk
> (remove item list :count n :test 'equal))
>
> This is the same as
>
> (defun zl-remove (item list &optional n)
> (remove item list :count n :test 'equal))
I can't imagine the count argument to be used at all, but I haven't
looked at the code yet. All this should be cleaned up.
>
> Andreas> I'm working on primep. But I'm not content with pseudoprimality, so
> Andreas> implementing a fast primep test will still take some time.
>
> What is primep supposed to do for large numbers?
Well, test for primality :-)
I haven't decided what to do yet. Currently a few small primes are
directly tested against, then I do a few Miller-Rabin
tests. Afterwards the Lucas-PseudoPrimality test makes things clear for
all numbers < 10^16. If the number has not yet been proved composite
by all this chances are good that it really is prime (against the
compostion of Lucas and Miller-Rabin tests no counterexample is known,
though we only know for sure up to 10^16). Then it is time for either
an ECC-PrimeProver or the APRCL Test. Both can really prove a number
prime. And if you need a certificate, then there is the Pratt-Test.
At the moment I'm still in the middle of the work. I hope I can finish
it soon :-)
Andreas
--
Wherever I lay my .emacs, there´s my $HOME.