Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

atanh() - Return the hyperbolic Tangent of value as a Argument in Java

  1. import java.lang.Math.*;
  2. class Demoatanh
  3. {
  4. double atanh(double x)
  5. {
  6. return 0.5*Math.log( (x + 1.0) / (x - 1.0));
  7. }
  8. public static void main(String args[])
  9. {
  10. Demoatanh d =new Demoatanh();
  11. double x= -2.0;
  12. double res = d.atanh(x);
  13. System.out.println(res );
  14. }
  15. }


Output:
-0.5493061443340549