Examples of Sin


Examples of org.apache.commons.math3.analysis.function.Sin

    /**
     * Test of integrator for the sine function.
     */
    @Test
    public void testSinFunction() {
        UnivariateFunction f = new Sin();
        UnivariateIntegrator integrator = new MidPointIntegrator();
       
        double min = 0;
        double max = FastMath.PI;
        double expected = 2;
View Full Code Here

Examples of org.apache.pig.piggybank.evaluation.math.SIN

          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
  
   public void testSIN() throws Exception{
       EvalFunc<DataAtom> SIN = new SIN();
          Tuple tup = new Tuple(1);
          tup.setField(0, 0.5);
          DataAtom output = new DataAtom();
          SIN.exec(tup, output);
          double expected = Math.sin(0.5);
          double actual = (new Double(output.strval())).doubleValue();
          assertEquals(actual, expected, delta);
   }
View Full Code Here

Examples of org.boris.expr.function.excel.SIN

        assertEquals(eval(s, 4 - 4), 0.);
        assertEquals(eval(s, -0.00001), -1.);
    }

    public void testSIN() throws Exception {
        SIN s = new SIN();
        for (int i = 0; i < 100; i++) {
            double d = Math.random() * 1000;
            assertEquals("SIN not working", eval(s, d), Math.sin(d));
        }
    }
View Full Code Here

Examples of org.jquantlib.math.functions.Sin

    private void testSeveral(final Integrator I) {
        testSingle(I, "f(x) = 1",      new Constant(1.0),               0.0, 1.0, 1.0);
        testSingle(I, "f(x) = x",      new Identity(),                  0.0, 1.0, 0.5);
        testSingle(I, "f(x) = x^2",    new Square(),                    0.0, 1.0, 1.0/3.0);
        testSingle(I, "f(x) = sin(x)", new Sin(),                       0.0, Constants.M_PI, 2.0);
        testSingle(I, "f(x) = cos(x)", new Cos(),                       0.0, Constants.M_PI, 0.0);
        testSingle(I, "f(x) = Gaussian(x)", new NormalDistribution(), -10.0, 10.0, 1.0);

//TODO: http://bugs.jquantlib.org/view.php?id=452
//        testSingle(I, "f(x) = Abcd2(x)",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.