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


Java FastMath.cosh方法代码示例

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


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

示例1: cosh

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** Compute 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
 * hyperbolic cosine the result array <em>cannot</em> be the input
 * array)
 * @param resultOffset offset of the result in its array
 */
public void cosh(final double[] operand, final int operandOffset,
                 final double[] result, final int resultOffset) {

    // create the function value and derivatives
    double[] function = new double[1 + order];
    function[0] = FastMath.cosh(operand[operandOffset]);
    if (order > 0) {
        function[1] = FastMath.sinh(operand[operandOffset]);
        for (int i = 2; i <= order; ++i) {
            function[i] = function[i - 2];
        }
    }

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

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

示例2: sinh

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** Compute hyperbolic sine 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
 * hyperbolic sine the result array <em>cannot</em> be the input
 * array)
 * @param resultOffset offset of the result in its array
 */
public void sinh(final double[] operand, final int operandOffset,
                 final double[] result, final int resultOffset) {

    // create the function value and derivatives
    double[] function = new double[1 + order];
    function[0] = FastMath.sinh(operand[operandOffset]);
    if (order > 0) {
        function[1] = FastMath.cosh(operand[operandOffset]);
        for (int i = 2; i <= order; ++i) {
            function[i] = function[i - 2];
        }
    }

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

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

示例3: value

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

示例4: cosh

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

示例5: sinh

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

示例6: tan

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/**
 * Compute the
 * <a href="http://mathworld.wolfram.com/Tangent.html" TARGET="_top">
 * tangent</a> of this complex number.
 * Implements the formula:
 * <pre>
 *  <code>
 *   tan(a + bi) = sin(2a)/(cos(2a)+cosh(2b)) + [sinh(2b)/(cos(2a)+cosh(2b))]i
 *  </code>
 * </pre>
 * where the (real) functions on the right-hand side are
 * {@link FastMath#sin}, {@link FastMath#cos}, {@link FastMath#cosh} and
 * {@link FastMath#sinh}.
 * <p>
 * Returns {@link Complex#NaN} if either real or imaginary part of the
 * input argument is {@code NaN}.
 * </p>
 * Infinite (or critical) values in real or imaginary parts of the input may
 * result in infinite or NaN values returned in parts of the result.
 * <pre>
 *  Examples:
 *  <code>
 *   tan(a &plusmn; INFINITY i) = 0 &plusmn; i
 *   tan(&plusmn;INFINITY + bi) = NaN + NaN i
 *   tan(&plusmn;INFINITY &plusmn; INFINITY i) = NaN + NaN i
 *   tan(&plusmn;&pi;/2 + 0 i) = &plusmn;INFINITY + NaN i
 *  </code>
 * </pre>
 *
 * @return the tangent of {@code this}.
 * @since 1.2
 */
public Complex tan() {
    if (isNaN || Double.isInfinite(real)) {
        return NaN;
    }
    if (imaginary > 20.0) {
        return createComplex(0.0, 1.0);
    }
    if (imaginary < -20.0) {
        return createComplex(0.0, -1.0);
    }

    double real2 = 2.0 * real;
    double imaginary2 = 2.0 * imaginary;
    double d = FastMath.cos(real2) + FastMath.cosh(imaginary2);

    return createComplex(FastMath.sin(real2) / d,
                         FastMath.sinh(imaginary2) / d);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:51,代码来源:Complex.java

示例7: tanh

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/**
 * Compute the
 * <a href="http://mathworld.wolfram.com/HyperbolicTangent.html" TARGET="_top">
 * hyperbolic tangent</a> of this complex number.
 * Implements the formula:
 * <pre>
 *  <code>
 *   tan(a + bi) = sinh(2a)/(cosh(2a)+cos(2b)) + [sin(2b)/(cosh(2a)+cos(2b))]i
 *  </code>
 * </pre>
 * where the (real) functions on the right-hand side are
 * {@link FastMath#sin}, {@link FastMath#cos}, {@link FastMath#cosh} and
 * {@link FastMath#sinh}.
 * <p>
 * Returns {@link Complex#NaN} if either real or imaginary part of the
 * input argument is {@code NaN}.
 * </p>
 * Infinite values in real or imaginary parts of the input may result in
 * infinite or NaN values returned in parts of the result.
 * <pre>
 *  Examples:
 *  <code>
 *   tanh(a &plusmn; INFINITY i) = NaN + NaN i
 *   tanh(&plusmn;INFINITY + bi) = &plusmn;1 + 0 i
 *   tanh(&plusmn;INFINITY &plusmn; INFINITY i) = NaN + NaN i
 *   tanh(0 + (&pi;/2)i) = NaN + INFINITY i
 *  </code>
 * </pre>
 *
 * @return the hyperbolic tangent of {@code this}.
 * @since 1.2
 */
public Complex tanh() {
    if (isNaN || Double.isInfinite(imaginary)) {
        return NaN;
    }
    if (real > 20.0) {
        return createComplex(1.0, 0.0);
    }
    if (real < -20.0) {
        return createComplex(-1.0, 0.0);
    }
    double real2 = 2.0 * real;
    double imaginary2 = 2.0 * imaginary;
    double d = FastMath.cosh(real2) + FastMath.cos(imaginary2);

    return createComplex(FastMath.sinh(real2) / d,
                         FastMath.sin(imaginary2) / d);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:50,代码来源:Complex.java


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