Re: [fpc-pascal] Special math. functions (erf, erfc, ...)

2006-12-17 Thread astlab
Hi Hansi, > > I'm searching for FreePascal implementations of some special > > mathematical functions related to statistics like erf, erfc and some > > other cumulative probability functions. Did anybody implement such > > functions already (e.g. from the Numerical Recipies)? > > Some functions ar

Re: [fpc-pascal] Special math. functions (erf, erfc, ...)

2006-12-16 Thread astlab
Hi Hansi, > I'm searching for FreePascal implementations of some special > mathematical functions related to statistics like erf, erfc and some > other cumulative probability functions. Did anybody implement such > functions already (e.g. from the Numerical Recipies)? Some functions are availabl

Re: [fpc-pascal]isprime()

2003-02-11 Thread astlab
I've revised isprime(), now it is a bit faster. The new version embedded in a small unit can be found at: http://www.polarhome.com/~franco/isprime.pas Franco ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-

Re: [fpc-pascal]isprime()

2003-02-09 Thread astlab
Hi Mark > Just out of curiosity, is Franco's algorithm based upon the recent > discovery by mathematicians in India? No, the method of Agrawal, Kayal and Saxena is still in a theoretical state and we have to wait for an efficient algorithm to apply it. I used an old Miller-Rabin method. By testin

Re: [fpc-pascal]isprime()

2003-02-09 Thread astlab
Hi Anton > To me it seems that your function works properly. I compared the > results for all cardinal values, using your algorithm > (cprimes_v.create below) against the results of my own algorithm > (cprimes_m.create below), which I updated to 32 bits tonight. I'm happy to read that the functio

Re: [fpc-pascal]isprime()

2003-02-07 Thread astlab
Hi Anton :) > Does the function return false for 0 and 1? Yes > How easy isit to upgrade for > 64 bit lengths? Indeed, isprime() is part of a routine working with the 'nat' big numbers of the unit bigint10. Its purpose is to perform a primality check by a strong test to the base 2 and a Lucas t

[fpc-pascal]isprime()

2003-02-07 Thread astlab
I made a function of 116 lines in assembler: isprime(n: cardinal): boolean; which returns true if a cardinal is prime, false otherwise. The routine is fast and uses only an array of 18 cardinals and six cardinals as local variables. Obviously it may be used by an external unit, anyhow let me know