This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trivial opts in basic arithmetic with number field elements
Detailed description by Michael Orlitzky: The addition to `_reduce_c_()` bails out early if the denominator is one because in that case there's nothing to do. The check is cheap and avoids several other function calls that do nothing when the denominator is one. The changes to `_add_()` and `_sub_()` are identical. We now pull out the GCD of the two denominators (which are smallish numbers) early, and it eventually cancels out. This would happen anyway when we call `_reduce_c_()` before `return`ing, but at that point we would be cancelling the same GCD out of the relatively-largish product of the denominators. (This also makes it more likely that we hit the new "fast return" in `_reduce_c_()`.)
- Loading branch information