I'm running these two codes. They both perform the same mathematical procedure (calculate series value up to large terms), and also, as expected, produce the same output.

But for some reason, the PyPy code is running significantly faster than the C code.

I cannot figure out why this is happening, as I expected the C code to run faster. 

I'd be thankful if anyone could help me by clarifying that (maybe there is a better way to write the C code?)

---

**C code:**

```
#include <stdio.h>
#include <math.h>

int main()
{
    double Sum = 0.0;
    long n;

    for(n = 2; n < 1000000000; n = n + 1) {
        double Sign;
        Sign = pow(-1.0, n % 2);        

        double N;
        N = (double) n;

        double Sqrt;
        Sqrt = sqrt(N);

        double InvSqrt;
        InvSqrt = 1.0 / Sqrt;

        double Ln;
        Ln = log(N);

        double LnSq;
        LnSq = pow(Ln, 2.0);

        double Term;
        Term = Sign * InvSqrt * LnSq;

        Sum = Sum + Term;
    }

    double Coeff;
    Coeff = Sum / 2.0;
    printf("%0.14f \n", Coeff);

    return 0;
}

```

---

**PyPy code (faster implementation of Python):**

```
from math import log, sqrt

Sum = 0

for n in range(2, 1000000000):
    Sum += ((-1)**(n % 2) * (log(n))**2) / sqrt(n)

print(Sum / 2)

```