[gforth] / gforth / Attic / atanh.c  

gforth: gforth/Attic/atanh.c

File: [gforth] / gforth / Attic / atanh.c (download) (as text)
Revision: 1.2, Sat Dec 14 14:21:19 1996 UTC (16 years, 5 months ago) by anton
Branch: MAIN
CVS Tags: v0-2-1, v0-3-0
Changes since 1.1: +5 -4 lines
fixed a few bugs
changed version number to 0.2.1

/* replacement for asinh, acosh, and atanh */

#include <math.h>

double atanh(double r1)
{
  double r2=r1 < 0 ? -r1 : r1;
  double r3=log((r2/(1.0-r2)*2)+1)/2;

  return r1 < 0 ? -r3 : r3;
  /* fdup f0< >r fabs 1. d>f fover f- f/  f2* flnp1 f2/
     r> IF  fnegate  THEN ;
     */
}

double asinh(double r1)
{
  return atanh(r1/sqrt(1.0+r1*r1));
  /* fdup fdup f* 1. d>f f+ fsqrt f/ fatanh ; */
}

double acosh(double r1)
{
  return(log(r1+sqrt(r1*r1-1.0)));
  /* fdup fdup f* 1. d>f f- fsqrt f+ fln ; */
}

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help