assertEquals(Ops.SIN, Ops.compose(Linear.create(0.5,0.0),Ops.compose(Linear.create(2.0,0.0), Ops.SIN)));
}
@Test public void testDerivativeChains() {
Op sin=Ops.SIN;
Op ddddsin=sin.getDerivativeOp().getDerivativeOp().getDerivativeOp().getDerivativeOp();
//System.out.println(ddddsin);
assertTrue(ddddsin==sin);
Op cos=Ops.COS;
assertTrue(cos.getDerivativeOp().getDerivativeOp().getDerivativeOp().getDerivativeOp()==cos);
assertTrue(Ops.EXP.getDerivativeOp()==Ops.EXP);
Op quad=Quadratic.create(Math.random(), Math.random(), Math.random());
Op ddquad=quad.getDerivativeOp().getDerivativeOp();
Op dddquad=ddquad.getDerivativeOp();
assertEquals(Constant.class,ddquad.getClass());
assertEquals(0.0,dddquad.apply(Math.random()),0.00001);
Op sum=Constant.create(10).sum(sin);
assertTrue(cos==sum.getDerivativeOp());
}