当前位置: 首页>>代码示例>>Java>>正文


Java FastMath.acosh方法代码示例

本文整理汇总了Java中org.apache.commons.math3.util.FastMath.acosh方法的典型用法代码示例。如果您正苦于以下问题:Java FastMath.acosh方法的具体用法?Java FastMath.acosh怎么用?Java FastMath.acosh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math3.util.FastMath的用法示例。


在下文中一共展示了FastMath.acosh方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compute

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
@Override
protected double compute(double value) {
	return Double.isNaN(value) ? Double.NaN : FastMath.acosh(value);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:5,代码来源:ArcHyperbolicCosine.java

示例2: value

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double value(double x) {
    return FastMath.acosh(x);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:5,代码来源:Acosh.java

示例3: acosh

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** {@inheritDoc} */
public SparseGradient acosh() {
    return new SparseGradient(FastMath.acosh(value), 1.0 / FastMath.sqrt(value * value - 1.0), derivatives);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:5,代码来源:SparseGradient.java

示例4: acosh

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** Compute inverse hyperbolic cosine of a derivative structure.
 * @param operand array holding the operand
 * @param operandOffset offset of the operand in its array
 * @param result array where result must be stored (for
 * inverse hyperbolic cosine the result array <em>cannot</em> be the input
 * array)
 * @param resultOffset offset of the result in its array
 */
public void acosh(final double[] operand, final int operandOffset,
                 final double[] result, final int resultOffset) {

    // create the function value and derivatives
    double[] function = new double[1 + order];
    final double x = operand[operandOffset];
    function[0] = FastMath.acosh(x);
    if (order > 0) {
        // the nth order derivative of acosh has the form:
        // dn(acosh(x)/dxn = P_n(x) / [x^2 - 1]^((2n-1)/2)
        // where P_n(x) is a degree n-1 polynomial with same parity as n-1
        // P_1(x) = 1, P_2(x) = -x, P_3(x) = 2x^2 + 1 ...
        // the general recurrence relation for P_n is:
        // P_n(x) = (x^2-1) P_(n-1)'(x) - (2n-3) x P_(n-1)(x)
        // as per polynomial parity, we can store coefficients of both P_(n-1) and P_n in the same array
        final double[] p = new double[order];
        p[0] = 1;
        final double x2  = x * x;
        final double f   = 1.0 / (x2 - 1);
        double coeff = FastMath.sqrt(f);
        function[1] = coeff * p[0];
        for (int n = 2; n <= order; ++n) {

            // update and evaluate polynomial P_n(x)
            double v = 0;
            p[n - 1] = (1 - n) * p[n - 2];
            for (int k = n - 1; k >= 0; k -= 2) {
                v = v * x2 + p[k];
                if (k > 2) {
                    p[k - 2] = (1 - k) * p[k - 1] + (k - 2 * n) * p[k - 3];
                } else if (k == 2) {
                    p[0] = -p[1];
                }
            }
            if ((n & 0x1) == 0) {
                v *= x;
            }

            coeff *= f;
            function[n] = coeff * v;

        }
    }

    // apply function composition
    compose(operand, operandOffset, function, result, resultOffset);

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:57,代码来源:DSCompiler.java


注:本文中的org.apache.commons.math3.util.FastMath.acosh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。