factor/core/math
Jon Harper 5424ad5586 math.integers, bignum/f, improve performance.
This changes avoids looping many times if the denominator is a power of
2. After this change, the implementation matches the linked sbcl
algorithm.  This was probably a mistake done when porting the algorithm.
Basically, as an optimization, all trailing zeros are removed from the
base2 representation of the denominator to have smaller bignums to
divide. But the previous factor implementation didn't take this into
account when making the initial guess of the shift of the numerator to
obtain a result in the range [2^54-1,2^53]. The loop would then correct
the initial guess by a factor of 2 at each iteration, so it would run as
many iteration as the denominator base2 power reduction, instead of only
a few times. For pathological cases, the speed up is huge (10^4):
1 1000 2^ bignum/f
2015-07-26 12:33:55 -07:00
..
floats factor: Retrying on the unit tests. Also normalize some syntax with FUNCTION:. 2015-07-02 17:28:17 -07:00
integers math.integers, bignum/f, improve performance. 2015-07-26 12:33:55 -07:00
order factor: Retrying on the unit tests. Also normalize some syntax with FUNCTION:. 2015-07-02 17:28:17 -07:00
parser math.parser: remove digits>integer. 2015-07-19 19:18:47 -07:00
authors.txt Initial import 2007-09-20 18:09:08 -04:00
math-docs.factor factor: clean up whitespace in -docs files 2015-07-02 10:31:22 -07:00
math-tests.factor factor: Retrying on the unit tests. Also normalize some syntax with FUNCTION:. 2015-07-02 17:28:17 -07:00
math.factor math: moving >fraction to math. 2015-07-19 16:57:45 -07:00
summary.txt Initial import 2007-09-20 18:09:08 -04:00