summaryrefslogtreecommitdiff
path: root/src/elementaryFunctions/tanh
diff options
context:
space:
mode:
Diffstat (limited to 'src/elementaryFunctions/tanh')
-rw-r--r--src/elementaryFunctions/tanh/Makefile10
-rw-r--r--src/elementaryFunctions/tanh/ctanha.c6
-rw-r--r--src/elementaryFunctions/tanh/ctanhs.c14
-rw-r--r--src/elementaryFunctions/tanh/dtanha.c4
-rw-r--r--src/elementaryFunctions/tanh/stanha.c4
-rw-r--r--src/elementaryFunctions/tanh/tanh.h57
-rw-r--r--src/elementaryFunctions/tanh/ztanha.c6
-rw-r--r--src/elementaryFunctions/tanh/ztanhs.c14
8 files changed, 25 insertions, 90 deletions
diff --git a/src/elementaryFunctions/tanh/Makefile b/src/elementaryFunctions/tanh/Makefile
index 1da672a6..c37f631c 100644
--- a/src/elementaryFunctions/tanh/Makefile
+++ b/src/elementaryFunctions/tanh/Makefile
@@ -5,7 +5,7 @@
## Made by Bruno JOFRET <bruno.jofret@inria.fr>
##
## Started on Thu Nov 30 16:33:40 2006 jofret
-## Last update Wed Jan 31 11:58:52 2007 jofret
+## Last update Fri Feb 23 17:28:51 2007 jofret
##
## Copyright INRIA 2006
##
@@ -14,9 +14,9 @@ NAME = ../../lib/libTanh.a
RM = rm -f
CC = gcc
-INCLUDE = ../../type
-LINK = ../../lib
-CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) $(STANDARD)
+INCLUDE = -I ../../type -I ../includes
+LINK = -L ../../lib
+CFLAGS = -Werror -Wall -pedantic -ansi $(INCLUDE) $(LINK) $(STANDARD)
AR = ar cru
RANLIB = ranlib
@@ -29,7 +29,7 @@ SRC = stanhs.c \
ctanha.c \
ztanha.c
-HEAD = tanh.h
+HEAD = ../includes/tanh.h
OBJ = $(SRC:.c=.o)
all: $(NAME)
diff --git a/src/elementaryFunctions/tanh/ctanha.c b/src/elementaryFunctions/tanh/ctanha.c
index 86871d97..5062be25 100644
--- a/src/elementaryFunctions/tanh/ctanha.c
+++ b/src/elementaryFunctions/tanh/ctanha.c
@@ -5,14 +5,12 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Thu Dec 7 14:54:24 2006 jofret
-** Last update Wed Jan 31 11:11:30 2007 jofret
+** Last update Fri Feb 23 17:32:04 2007 jofret
**
** Copyright INRIA 2006
*/
-#include "floatComplex.h"
-
-floatComplex ctanhs(floatComplex);
+#include "tanh.h"
void ctanha(floatComplex* x, int strideX, floatComplex* y, int strideY, int size) {
int i = 0;
diff --git a/src/elementaryFunctions/tanh/ctanhs.c b/src/elementaryFunctions/tanh/ctanhs.c
index aae62956..1be95099 100644
--- a/src/elementaryFunctions/tanh/ctanhs.c
+++ b/src/elementaryFunctions/tanh/ctanhs.c
@@ -5,20 +5,18 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Thu Dec 7 12:04:28 2006 jofret
-** Last update Tue Feb 13 11:03:07 2007 jofret
+** Last update Fri Feb 23 17:31:52 2007 jofret
**
** Copyright INRIA 2006
*/
-#include "floatComplex.h"
-
-floatComplex ctans(floatComplex);
+#include "tanh.h"
+#include "tan.h"
floatComplex ctanhs(floatComplex z) {
- float real = creal(z);
- float imag = cimag(z);
+ float real = creals(z);
+ float imag = cimags(z);
floatComplex result = ctans(FloatComplex(-imag, real));
- return (FloatComplex(cimag(result), -creal(result)));
- return z;
+ return (FloatComplex(cimags(result), -creals(result)));
}
diff --git a/src/elementaryFunctions/tanh/dtanha.c b/src/elementaryFunctions/tanh/dtanha.c
index 0a10ae16..fe690b23 100644
--- a/src/elementaryFunctions/tanh/dtanha.c
+++ b/src/elementaryFunctions/tanh/dtanha.c
@@ -5,12 +5,12 @@
** 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
+** Last update Fri Feb 23 17:31:10 2007 jofret
**
** Copyright INRIA 2006
*/
-double dtanhs(double);
+#include "tanh.h"
void dtanha(double* x, int strideX, double* y, int strideY, int size) {
int i = 0;
diff --git a/src/elementaryFunctions/tanh/stanha.c b/src/elementaryFunctions/tanh/stanha.c
index c0e47b2f..54aea93d 100644
--- a/src/elementaryFunctions/tanh/stanha.c
+++ b/src/elementaryFunctions/tanh/stanha.c
@@ -5,12 +5,12 @@
** 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
+** Last update Fri Feb 23 17:30:54 2007 jofret
**
** Copyright INRIA 2006
*/
-float stanhs(float);
+#include "tanh.h"
void stanha(float* x, int strideX, float* y, int strideY, int size) {
int i = 0;
diff --git a/src/elementaryFunctions/tanh/tanh.h b/src/elementaryFunctions/tanh/tanh.h
deleted file mode 100644
index 7a73685d..00000000
--- a/src/elementaryFunctions/tanh/tanh.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-** -*- 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
index ff22d6a9..d1ca0fc7 100644
--- a/src/elementaryFunctions/tanh/ztanha.c
+++ b/src/elementaryFunctions/tanh/ztanha.c
@@ -5,14 +5,12 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Thu Dec 7 16:12:02 2006 jofret
-** Last update Wed Jan 31 10:56:20 2007 jofret
+** Last update Fri Feb 23 17:30:40 2007 jofret
**
** Copyright INRIA 2006
*/
-#include "doubleComplex.h"
-
-doubleComplex ztanhs(doubleComplex);
+#include "tanh.h"
void ztanha(doubleComplex* x, int strideX, doubleComplex* y, int strideY, int size) {
int i = 0;
diff --git a/src/elementaryFunctions/tanh/ztanhs.c b/src/elementaryFunctions/tanh/ztanhs.c
index 3c2498a7..0cc3e64c 100644
--- a/src/elementaryFunctions/tanh/ztanhs.c
+++ b/src/elementaryFunctions/tanh/ztanhs.c
@@ -5,20 +5,18 @@
** Made by Bruno JOFRET <bruno.jofret@inria.fr>
**
** Started on Thu Dec 7 12:05:48 2006 jofret
-** Last update Tue Feb 13 10:47:24 2007 jofret
+** Last update Fri Feb 23 17:30:25 2007 jofret
**
** Copyright INRIA 2006
*/
-#include "doubleComplex.h"
-
-doubleComplex ztans(doubleComplex);
+#include "tanh.h"
+#include "tan.h"
doubleComplex ztanhs(doubleComplex z) {
- double real = creal(z);
- double imag = cimag(z);
+ double real = zreals(z);
+ double imag = zimags(z);
doubleComplex result = ztans(DoubleComplex(-imag, real));
- return (DoubleComplex(cimag(result), -creal(result)));
- return (DoubleComplex(0,1));
+ return (DoubleComplex(zimags(result), -zreals(result)));
}