Example usage for java.lang StrictMath sinh

List of usage examples for java.lang StrictMath sinh

Introduction

In this page you can find the example usage for java.lang StrictMath sinh.

Prototype

public static native double sinh(double x);

Source Link

Document

Returns the hyperbolic sine of a double value.

Usage

From source file:Main.java

public static void main(String[] args) {

    double d1 = (90 * Math.PI) / 180, d2 = 50, d3 = 0;

    System.out.println("Hyperbolic sine of d1 = " + StrictMath.sinh(d1));

    System.out.println("Hyperbolic sine of d2 = " + StrictMath.sinh(d2));

    System.out.println("Hyperbolic sine of d3 = " + StrictMath.sinh(d3));
}

From source file:org.esa.beam.util.math.FastMathPerformance.java

public void testSinh() {
    System.gc();//from   w ww.j a v  a 2s  .  co  m
    double x = 0;
    long time = System.nanoTime();
    for (int i = 0; i < RUNS; i++)
        x += StrictMath.sinh(i * F1);
    long strictTime = System.nanoTime() - time;

    System.gc();
    double y = 0;
    time = System.nanoTime();
    for (int i = 0; i < RUNS; i++)
        y += FastMath.sinh(i * F1);
    long fastTime = System.nanoTime() - time;

    System.gc();
    double z = 0;
    time = System.nanoTime();
    for (int i = 0; i < RUNS; i++)
        z += Math.sinh(i * F1);
    long mathTime = System.nanoTime() - time;

    report("sinh", x + y + z, strictTime, fastTime, mathTime);
}