summaryrefslogtreecommitdiff
path: root/src/elementaryFunctions/tanh
diff options
context:
space:
mode:
Diffstat (limited to 'src/elementaryFunctions/tanh')
-rw-r--r--src/elementaryFunctions/tanh/Makefile47
-rw-r--r--src/elementaryFunctions/tanh/ctanha.c28
-rw-r--r--src/elementaryFunctions/tanh/ctanhs.c23
-rw-r--r--src/elementaryFunctions/tanh/dtanha.c20
-rw-r--r--src/elementaryFunctions/tanh/dtanhs.c17
-rw-r--r--src/elementaryFunctions/tanh/stanha.c20
-rw-r--r--src/elementaryFunctions/tanh/stanhs.c17
-rw-r--r--src/elementaryFunctions/tanh/tanh.h57
-rw-r--r--src/elementaryFunctions/tanh/ztanha.c27
-rw-r--r--src/elementaryFunctions/tanh/ztanhs.c24
10 files changed, 280 insertions, 0 deletions
diff --git a/src/elementaryFunctions/tanh/Makefile b/src/elementaryFunctions/tanh/Makefile
new file mode 100644
index 00000000..81c83d42
--- /dev/null
+++ b/src/elementaryFunctions/tanh/Makefile
@@ -0,0 +1,47 @@
+##
+## -*- makefile -*-
+##
+## Makefile
+## Made by Bruno JOFRET <bruno.jofret@inria.fr>
+##
+## Started on Thu Nov 30 16:33:40 2006 jofret
+## Last update Mon Jan 29 16:46:38 2007 jofret
+##
+## Copyright INRIA 2006
+##
+
+NAME = ../../lib/libTanh.a
+
+RM = rm -f
+CC = gcc
+INCLUDE = ../../type
+LINK = ../../lib
+CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK)
+AR = ar cru
+RANLIB = ranlib
+
+SRC = stanhs.c \
+ dtanhs.c \
+ ctanhs.c \
+ ztanhs.c \
+ stanha.c \
+ dtanha.c \
+ ctanha.c \
+ ztanha.c
+
+HEAD = tanh.h
+OBJ = $(SRC:.c=.o)
+
+all: $(NAME)
+
+$(NAME) : $(HEAD) $(OBJ)
+ $(AR) $@ $(OBJ)
+ $(RANLIB) $@
+
+clean:
+ $(RM) $(OBJ)
+
+distclean: clean
+ $(RM) $(NAME)
+
+re: clean all
diff --git a/src/elementaryFunctions/tanh/ctanha.c b/src/elementaryFunctions/tanh/ctanha.c
new file mode 100644
index 00000000..5224de9c
--- /dev/null
+++ b/src/elementaryFunctions/tanh/ctanha.c
@@ -0,0 +1,28 @@
+/*
+** -*- C -*-
+**
+** ctanha.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 14:54:24 2006 jofret
+** Last update Mon Jan 29 17:05:40 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+
+#ifndef STDC99
+#include "floatComplex.h"
+#else
+#include <complex.h>
+typedef float complex floatComplex;
+#endif
+
+floatComplex ctanhs(floatComplex);
+
+void ctanha(floatComplex* x, int strideX, floatComplex* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = ctanhs(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/tanh/ctanhs.c b/src/elementaryFunctions/tanh/ctanhs.c
new file mode 100644
index 00000000..8eb8e6ee
--- /dev/null
+++ b/src/elementaryFunctions/tanh/ctanhs.c
@@ -0,0 +1,23 @@
+/*
+** -*- C -*-
+**
+** ctanhs.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 12:04:28 2006 jofret
+** Last update Mon Jan 29 17:05:27 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#ifndef STDC99
+#include "floatComplex.h"
+#else
+#include <complex.h>
+typedef float complex floatComplex;
+#endif
+
+floatComplex ctanhs(floatComplex z) {
+ /* FIXME: Dummy... */
+ return z;
+}
diff --git a/src/elementaryFunctions/tanh/dtanha.c b/src/elementaryFunctions/tanh/dtanha.c
new file mode 100644
index 00000000..0a10ae16
--- /dev/null
+++ b/src/elementaryFunctions/tanh/dtanha.c
@@ -0,0 +1,20 @@
+/*
+** -*- C -*-
+**
+** dtanha.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 14:54:56 2006 jofret
+** Last update Mon Jan 29 17:05:17 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+double dtanhs(double);
+
+void dtanha(double* x, int strideX, double* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = dtanhs(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/tanh/dtanhs.c b/src/elementaryFunctions/tanh/dtanhs.c
new file mode 100644
index 00000000..aafc99bd
--- /dev/null
+++ b/src/elementaryFunctions/tanh/dtanhs.c
@@ -0,0 +1,17 @@
+/*
+** -*- C -*-
+**
+** dtanhs.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 12:02:41 2006 jofret
+** Last update Mon Jan 29 17:05:08 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#include <math.h>
+
+double dtanhs(double x) {
+ return (tanh(x));
+}
diff --git a/src/elementaryFunctions/tanh/stanha.c b/src/elementaryFunctions/tanh/stanha.c
new file mode 100644
index 00000000..c0e47b2f
--- /dev/null
+++ b/src/elementaryFunctions/tanh/stanha.c
@@ -0,0 +1,20 @@
+/*
+** -*- C -*-
+**
+** stanha.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 16:03:27 2006 jofret
+** Last update Mon Jan 29 17:04:59 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+float stanhs(float);
+
+void stanha(float* x, int strideX, float* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = stanhs(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/tanh/stanhs.c b/src/elementaryFunctions/tanh/stanhs.c
new file mode 100644
index 00000000..7eaa532e
--- /dev/null
+++ b/src/elementaryFunctions/tanh/stanhs.c
@@ -0,0 +1,17 @@
+/*
+** -*- C -*-
+**
+** stanhs.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 11:05:37 2006 jofret
+** Last update Mon Jan 29 17:04:50 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#include <math.h>
+
+float stanhs(float x) {
+ return (tanh(x));
+}
diff --git a/src/elementaryFunctions/tanh/tanh.h b/src/elementaryFunctions/tanh/tanh.h
new file mode 100644
index 00000000..7a73685d
--- /dev/null
+++ b/src/elementaryFunctions/tanh/tanh.h
@@ -0,0 +1,57 @@
+/*
+** -*- C -*-
+**
+** tanh.h
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Tue Dec 5 15:49:18 2006 jofret
+** Last update Mon Jan 29 17:04:18 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+/*
+** Compute Hyperbolic Tangeant for different types .
+*/
+
+/*
+** \brief Float Hyperbolic Tangeant function
+*/
+float stanhs(float);
+
+/*
+** \brief Double Hyperbolic Tangeant function
+*/
+double dtanhs(double);
+
+/*
+** \brief Float Complex Hyperbolic Tangeant function
+*/
+floatComplex ctanhs(floatComplex);
+
+/*
+** \brief Double Complex Hyperbolic Tangeant function
+*/
+doubleComplex ztanhs(doubleComplex);
+
+/*
+** \brief Float Matrix Hyperbolic Tangeant function
+*/
+void stanha(float*, int, float*, int, int);
+
+/*
+** \brief Double Matrix Hyperbolic Tangeant function
+*/
+void dtanha(double*, int, double*, int, int);
+
+/*
+** \brief Float Complex Matrix Hyperbolic Tangeant function
+*/
+void ctanha(floatComplex*, int, floatComplex*, int, int);
+
+/*
+** \brief Double Complex Matrix Hyperbolic Tangeant function
+*/
+void ztanha(doubleComplex*, int, doubleComplex*, int, int);
+
+
diff --git a/src/elementaryFunctions/tanh/ztanha.c b/src/elementaryFunctions/tanh/ztanha.c
new file mode 100644
index 00000000..36aaeb38
--- /dev/null
+++ b/src/elementaryFunctions/tanh/ztanha.c
@@ -0,0 +1,27 @@
+/*
+** -*- C -*-
+**
+** ztanha.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 16:12:02 2006 jofret
+** Last update Mon Jan 29 17:04:42 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#ifndef STDC99
+#include "doubleComplex.h"
+#else
+#include <complex.h>
+typedef double complex doubleComplex;
+#endif
+
+doubleComplex ztanhs(doubleComplex);
+
+void ztanha(doubleComplex* x, int strideX, doubleComplex* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = ztanhs(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/tanh/ztanhs.c b/src/elementaryFunctions/tanh/ztanhs.c
new file mode 100644
index 00000000..aad50c83
--- /dev/null
+++ b/src/elementaryFunctions/tanh/ztanhs.c
@@ -0,0 +1,24 @@
+/*
+** -*- C -*-
+**
+** ztanhs.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 12:05:48 2006 jofret
+** Last update Mon Jan 29 17:04:29 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#ifndef STDC99
+#include "doubleComplex.h"
+#else
+#include <complex.h>
+typedef double complex doubleComplex;
+#endif
+
+
+doubleComplex ztanhs(doubleComplex z) {
+ /* FIXME: Dummy... */
+ return (DoubleComplex(0,1));
+}