| 215 | } |
| 216 | |
| 217 | NOINLINE static size_t largest_prime_factor (size_t n) |
| 218 | { |
| 219 | size_t res=1; |
| 220 | size_t tmp; |
| 221 | while (((tmp=(n>>1))<<1)==n) |
| 222 | { res=2; n=tmp; } |
| 223 | |
| 224 | size_t limit=(size_t)sqrt(n+0.01); |
| 225 | for (size_t x=3; x<=limit; x+=2) |
| 226 | while (((tmp=(n/x))*x)==n) |
| 227 | { |
| 228 | res=x; |
| 229 | n=tmp; |
| 230 | limit=(size_t)sqrt(n+0.01); |
| 231 | } |
| 232 | if (n>1) res=n; |
| 233 | |
| 234 | return res; |
| 235 | } |
| 236 | |
| 237 | NOINLINE static double cost_guess (size_t n) |
| 238 | { |
no test coverage detected