File:  [MW Coherent from dump] / coherent / d / lib / libm / tanh.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:37 2019 UTC (7 years, 2 months ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * Hyperbolic tangent.
 */
#include <math.h>

#if	EMU87
#include "emumath.h"
#endif

double
tanh(x)
double x;
{
	double r;
	register int s;

	s = 0;
	if (x < 0.0) {
		x = -x;
		s = 1;
	}
	r = exp(-2.0*x);
	r = (1.0-r) / (1.0+r);
	return (s?-r:r);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.