arlyon / arlyon/parallel-totient
Optimising Euler's totient
- Dominant language
- C
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
These are the options I have come across so far:
Euler's product formula using prime factorisation and Euler's totient's multiplicative properties.
The [wiki link](https://en.wikipedia.org/wiki/Euler%27s_totient_function#Euler's_product_formula) explains it pretty well. However, given how expensive factorisation of primes is, it would have to be tested against the gcd method of calculating Euler's totient.
Improving the current GCD algorithm. The [wiki](https://en.wikipedia.org/wiki/Greatest_common_divisor) covers a few of them, many of which are implemented by [GMP](https://gmplib.org). These are further described in the [GMP manual](https://gmplib.org/gmp-man-6.2.0.pdf) on page 104. Given how many calls to gcd are made, this could have a reasonable effect.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the current GCD-based Euler totient implementation and any benchmark or test entry point. Compare it with the product-formula and alternative GCD approaches described in the issue, and consider the work complete when a measured change improves performance without changing results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100