Ejemplo n.º 1
0
int main() {
    int numberOfPoints = 2;
    float x[2] = {0, 1};
    float y[2] = {0, 2};
    g.metafl("PDF");
    g.qplot(x, y, numberOfPoints);
}
Ejemplo n.º 2
0
int main() {
    srand(1396497803);
    double integrals[10];
    double steps[10];
    for (int loop = 0; loop < 10; loop++) {
        int two = 1;
        for (int loop2 = 0; loop2 < loop; loop2++) {
            two = two * 2;
        }
        steps[loop] = log(two * 1000);
        integrals[loop] =  log(fabs(4 *integral(circle, two*1000, 0, 1, 1) - PI));
    }
    G.metafl("PDF");
    G.qplot(steps, integrals, 10);
}
Ejemplo n.º 3
0
int main() {
    int samples = 8; //Any higher results in int overflow
    int n[samples];
    double logN[samples];
    n[0] = 10;
    logN[0] = log(10);
    double y[samples];
    y[0] = simpInt(fun, 0, 1, n[0]);
    for (int loop = 1; loop < samples; loop++) {
        n[loop] = n[loop - 1] * 5;
        logN[loop] = log(n[loop]);
        y[loop] = simpInt(fun, 0, 1, n[loop]) - (1./4.);
    }
    G.metafl("PDF");
    G.qplot(logN, y, samples);
    }