loda-cpp icon indicating copy to clipboard operation
loda-cpp copied to clipboard

Condition is always false

Open helpau opened this issue 1 year ago • 1 comments

Benchmarks(for gcd) shows probably significant(about 15%) improvement

helpau avatar Dec 25 '24 17:12 helpau

looks good in general, but we must be 100% sure that this case cannot occur to avoid an infinite loop. need to check the details of the mod() for this

Sorry, I can't write a strict mathematical proof. The optimization seemed pretty obvious to me because 0<=a,b<INF, and also because a,b and gcd(a,b) are decreasing at each iteration.

helpau avatar Dec 27 '24 16:12 helpau