Example: The Hyperbolic Functions
The Hyperbolic functions are exercised with argument 0.
import com.imsl.math.*;
public class HyperbolicEx1 {
public static void main(String args[]) {
// Exercise the hyperbolic functions with argument 0.0
System.out.println("sinh(0.) is "+Hyperbolic.sinh(0.));
System.out.println("cosh(0.) is "+Hyperbolic.cosh(0.));
System.out.println("tanh(0.) is "+Hyperbolic.tanh(0.));
System.out.println("asinh(0.) is "+Hyperbolic.asinh(0.));
System.out.println("acosh(0.) is "+Hyperbolic.acosh(0.));
System.out.println("atanh(0.) is "+Hyperbolic.atanh(0.));
}
}
Output
sinh(0.) is 0.0
cosh(0.) is 1.0
tanh(0.) is 0.0
asinh(0.) is 0.0
acosh(0.) is NaN
atanh(0.) is 0.0
Link to Java source.