DerivativeStructure implements RealFieldElement<DerivativeStructure>, Serializable { public DerivativeStructure atan2(final DerivativeStructure x) throws DimensionMismatchException { compiler.checkCompatibility(x.compiler); final DerivativeStructure result = new DerivativeStructure(compiler); compiler.atan2(data, 0, x.data, 0, result.data, 0); return result; } private  DerivativeStructure(final DSCompiler compiler);  DerivativeStructure(final int parameters, final int order);  DerivativeStructure(final int parameters, final int order, final double value);  DerivativeStructure(final int parameters, final int order,
                               final int index, final double value);  DerivativeStructure(final double a1, final DerivativeStructure ds1,
                               final double a2, final DerivativeStructure ds2);  DerivativeStructure(final double a1, final DerivativeStructure ds1,
                               final double a2, final DerivativeStructure ds2,
                               final double a3, final DerivativeStructure ds3);  DerivativeStructure(final double a1, final DerivativeStructure ds1,
                               final double a2, final DerivativeStructure ds2,
                               final double a3, final DerivativeStructure ds3,
                               final double a4, final DerivativeStructure ds4);  DerivativeStructure(final int parameters, final int order, final double ... derivatives); private  DerivativeStructure(final DerivativeStructure ds); int getFreeParameters(); int getOrder(); DerivativeStructure createConstant(final double c); double getReal(); double getValue(); double getPartialDerivative(final int ... orders); double[] getAllDerivatives(); DerivativeStructure add(final double a); DerivativeStructure add(final DerivativeStructure a); DerivativeStructure subtract(final double a); DerivativeStructure subtract(final DerivativeStructure a); DerivativeStructure multiply(final int n); DerivativeStructure multiply(final double a); DerivativeStructure multiply(final DerivativeStructure a); DerivativeStructure divide(final double a); DerivativeStructure divide(final DerivativeStructure a); DerivativeStructure remainder(final double a); DerivativeStructure remainder(final DerivativeStructure a); DerivativeStructure negate(); DerivativeStructure abs(); DerivativeStructure ceil(); DerivativeStructure floor(); DerivativeStructure rint(); long round(); DerivativeStructure signum(); DerivativeStructure copySign(final DerivativeStructure sign); DerivativeStructure copySign(final double sign); int getExponent(); DerivativeStructure scalb(final int n); DerivativeStructure hypot(final DerivativeStructure y); static DerivativeStructure hypot(final DerivativeStructure x, final DerivativeStructure y); DerivativeStructure compose(final double ... f); DerivativeStructure reciprocal(); DerivativeStructure sqrt(); DerivativeStructure cbrt(); DerivativeStructure rootN(final int n); Field<DerivativeStructure> getField(); static DerivativeStructure pow(final double a, final DerivativeStructure x); DerivativeStructure pow(final double p); DerivativeStructure pow(final int n); DerivativeStructure pow(final DerivativeStructure e); DerivativeStructure exp(); DerivativeStructure expm1(); DerivativeStructure log(); DerivativeStructure log1p(); DerivativeStructure log10(); DerivativeStructure cos(); DerivativeStructure sin(); DerivativeStructure tan(); DerivativeStructure acos(); DerivativeStructure asin(); DerivativeStructure atan(); DerivativeStructure atan2(final DerivativeStructure x); static DerivativeStructure atan2(final DerivativeStructure y, final DerivativeStructure x); DerivativeStructure cosh(); DerivativeStructure sinh(); DerivativeStructure tanh(); DerivativeStructure acosh(); DerivativeStructure asinh(); DerivativeStructure atanh(); DerivativeStructure toDegrees(); DerivativeStructure toRadians(); double taylor(final double ... delta); DerivativeStructure linearCombination(final DerivativeStructure[] a, final DerivativeStructure[] b); DerivativeStructure linearCombination(final double[] a, final DerivativeStructure[] b); DerivativeStructure linearCombination(final DerivativeStructure a1, final DerivativeStructure b1,
                                                 final DerivativeStructure a2, final DerivativeStructure b2); DerivativeStructure linearCombination(final double a1, final DerivativeStructure b1,
                                                 final double a2, final DerivativeStructure b2); DerivativeStructure linearCombination(final DerivativeStructure a1, final DerivativeStructure b1,
                                                 final DerivativeStructure a2, final DerivativeStructure b2,
                                                 final DerivativeStructure a3, final DerivativeStructure b3); DerivativeStructure linearCombination(final double a1, final DerivativeStructure b1,
                                                 final double a2, final DerivativeStructure b2,
                                                 final double a3, final DerivativeStructure b3); DerivativeStructure linearCombination(final DerivativeStructure a1, final DerivativeStructure b1,
                                                 final DerivativeStructure a2, final DerivativeStructure b2,
                                                 final DerivativeStructure a3, final DerivativeStructure b3,
                                                 final DerivativeStructure a4, final DerivativeStructure b4); DerivativeStructure linearCombination(final double a1, final DerivativeStructure b1,
                                                 final double a2, final DerivativeStructure b2,
                                                 final double a3, final DerivativeStructure b3,
                                                 final double a4, final DerivativeStructure b4); @Override boolean equals(Object other); @Override int hashCode();  }
@Override @Test public void testAtan2() { double[] epsilon = new double[] { 5.0e-16, 3.0e-15, 2.2e-14, 1.0e-12, 8.0e-11 }; for (int maxOrder = 0; maxOrder < 5; ++maxOrder) { for (double x = -1.7; x < 2; x += 0.2) { DerivativeStructure dsX = new DerivativeStructure(2, maxOrder, 0, x); for (double y = -1.7; y < 2; y += 0.2) { DerivativeStructure dsY = new DerivativeStructure(2, maxOrder, 1, y); DerivativeStructure atan2 = DerivativeStructure.atan2(dsY, dsX); DerivativeStructure ref = dsY.divide(dsX).atan(); if (x < 0) { ref = (y < 0) ? ref.subtract(FastMath.PI) : ref.add(FastMath.PI); } DerivativeStructure zero = atan2.subtract(ref); for (int n = 0; n <= maxOrder; ++n) { for (int m = 0; m <= maxOrder; ++m) { if (n + m <= maxOrder) { Assert.assertEquals(0, zero.getPartialDerivative(n, m), epsilon[n + m]); } } } } } } }