MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / directCalc

Method directCalc

src/test/Derivative.java:74–85  ·  view source on GitHub ↗
(boolean report)

Source from the content-addressed store, hash-verified

72 static DoubleUnaryOperator wrappedFirst = getFirstWrapped(f, 0.1);
73
74 private static void directCalc(boolean report) {
75 System.gc();
76 double result = 0;
77 double h = 0.1;
78 long t0 = System.currentTimeMillis();
79 for (int i = 1; i < 1000000; i++) {
80 result += (math(i + h) - math(i - h)) / h / 2;
81 }
82 if (report)
83 System.out.println("Direct: ..........."+ result + "........" + (System.currentTimeMillis() - t0));
84
85 }
86
87 private static void unwrappedFI(DoubleUnaryOperator f, boolean report) {
88 System.gc();

Callers 1

mainMethod · 0.95

Calls 3

mathMethod · 0.95
gcMethod · 0.80
printlnMethod · 0.65

Tested by

no test coverage detected