diff options
Diffstat (limited to 'src/elementaryFunctions')
21 files changed, 564 insertions, 4 deletions
diff --git a/src/elementaryFunctions/Makefile b/src/elementaryFunctions/Makefile index b7f62ed9..2e505d6f 100644 --- a/src/elementaryFunctions/Makefile +++ b/src/elementaryFunctions/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Tue Dec 5 09:19:53 2006 jofret -## Last update Fri Jan 19 15:17:32 2007 jofret +## Last update Mon Jan 29 17:06:19 2007 jofret ## ## Copyright INRIA 2006 ## @@ -15,9 +15,9 @@ DIRS = cos \ acos \ asin \ cosh \ - sinh #\ -# tan \ -# tanh \ + sinh \ + tan \ + tanh #\ # exp \ # log diff --git a/src/elementaryFunctions/tan/Makefile b/src/elementaryFunctions/tan/Makefile new file mode 100644 index 00000000..3f22534d --- /dev/null +++ b/src/elementaryFunctions/tan/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:08:57 2007 jofret +## +## Copyright INRIA 2006 +## + +NAME = ../../lib/libTan.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 = stans.c \ + dtans.c \ + ctans.c \ + ztans.c \ + stana.c \ + dtana.c \ + ctana.c \ + ztana.c + +HEAD = tan.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/tan/ctana.c b/src/elementaryFunctions/tan/ctana.c new file mode 100644 index 00000000..77a6df0c --- /dev/null +++ b/src/elementaryFunctions/tan/ctana.c @@ -0,0 +1,28 @@ +/* +** -*- C -*- +** +** ctana.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 14:54:24 2006 jofret +** Last update Mon Jan 29 16:12:36 2007 jofret +** +** Copyright INRIA 2006 +*/ + + +#ifndef STDC99 +#include "floatComplex.h" +#else +#include <complex.h> +typedef float complex floatComplex; +#endif + +floatComplex ctans(floatComplex); + +void ctana(floatComplex* x, int strideX, floatComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = ctans(x[i]); + } +} diff --git a/src/elementaryFunctions/tan/ctans.c b/src/elementaryFunctions/tan/ctans.c new file mode 100644 index 00000000..a1d4a81e --- /dev/null +++ b/src/elementaryFunctions/tan/ctans.c @@ -0,0 +1,23 @@ +/* +** -*- C -*- +** +** ctans.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 12:04:28 2006 jofret +** Last update Mon Jan 29 16:12:26 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#ifndef STDC99 +#include "floatComplex.h" +#else +#include <complex.h> +typedef float complex floatComplex; +#endif + +floatComplex ctans(floatComplex z) { + /* FIXME: Dummy... */ + return z; +} diff --git a/src/elementaryFunctions/tan/dtana.c b/src/elementaryFunctions/tan/dtana.c new file mode 100644 index 00000000..42e85490 --- /dev/null +++ b/src/elementaryFunctions/tan/dtana.c @@ -0,0 +1,20 @@ +/* +** -*- C -*- +** +** dtana.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 14:54:56 2006 jofret +** Last update Mon Jan 29 16:12:12 2007 jofret +** +** Copyright INRIA 2006 +*/ + +double dtans(double); + +void dtana(double* x, int strideX, double* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = dtans(x[i]); + } +} diff --git a/src/elementaryFunctions/tan/dtans.c b/src/elementaryFunctions/tan/dtans.c new file mode 100644 index 00000000..c4ce0346 --- /dev/null +++ b/src/elementaryFunctions/tan/dtans.c @@ -0,0 +1,17 @@ +/* +** -*- C -*- +** +** dtans.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 12:02:41 2006 jofret +** Last update Mon Jan 29 16:12:01 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <math.h> + +double dtans(double x) { + return (tan(x)); +} diff --git a/src/elementaryFunctions/tan/stana.c b/src/elementaryFunctions/tan/stana.c new file mode 100644 index 00000000..44058c44 --- /dev/null +++ b/src/elementaryFunctions/tan/stana.c @@ -0,0 +1,20 @@ +/* +** -*- C -*- +** +** stana.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 16:03:27 2006 jofret +** Last update Mon Jan 29 16:11:44 2007 jofret +** +** Copyright INRIA 2006 +*/ + +float stans(float); + +void stana(float* x, int strideX, float* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = stans(x[i]); + } +} diff --git a/src/elementaryFunctions/tan/stans.c b/src/elementaryFunctions/tan/stans.c new file mode 100644 index 00000000..afea84a4 --- /dev/null +++ b/src/elementaryFunctions/tan/stans.c @@ -0,0 +1,17 @@ +/* +** -*- C -*- +** +** stans.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 11:05:37 2006 jofret +** Last update Mon Jan 29 16:11:29 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <math.h> + +float stans(float x) { + return (tan(x)); +} diff --git a/src/elementaryFunctions/tan/tan.h b/src/elementaryFunctions/tan/tan.h new file mode 100644 index 00000000..62309c9e --- /dev/null +++ b/src/elementaryFunctions/tan/tan.h @@ -0,0 +1,57 @@ +/* +** -*- C -*- +** +** tan.h +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Tue Dec 5 15:49:18 2006 jofret +** Last update Mon Jan 29 16:10:30 2007 jofret +** +** Copyright INRIA 2006 +*/ + +/* +** Compute Tangeant for different types . +*/ + +/* +** \brief Float Tangeant function +*/ +float stans(float); + +/* +** \brief Double Tangeant function +*/ +double dtans(double); + +/* +** \brief Float Complex Tangeant function +*/ +floatComplex ctans(floatComplex); + +/* +** \brief Double Complex Tangeant function +*/ +doubleComplex ztans(doubleComplex); + +/* +** \brief Float Matrix Tangeant function +*/ +void stana(float*, int, float*, int, int); + +/* +** \brief Double Matrix Tangeant function +*/ +void dtana(double*, int, double*, int, int); + +/* +** \brief Float Complex Matrix Tangeant function +*/ +void ctana(floatComplex*, int, floatComplex*, int, int); + +/* +** \brief Double Complex Matrix Tangeant function +*/ +void ztana(doubleComplex*, int, doubleComplex*, int, int); + + diff --git a/src/elementaryFunctions/tan/ztana.c b/src/elementaryFunctions/tan/ztana.c new file mode 100644 index 00000000..a815e58b --- /dev/null +++ b/src/elementaryFunctions/tan/ztana.c @@ -0,0 +1,27 @@ +/* +** -*- C -*- +** +** ztana.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 16:12:02 2006 jofret +** Last update Mon Jan 29 16:11:17 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#ifndef STDC99 +#include "doubleComplex.h" +#else +#include <complex.h> +typedef double complex doubleComplex; +#endif + +doubleComplex ztans(doubleComplex); + +void ztana(doubleComplex* x, int strideX, doubleComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = ztans(x[i]); + } +} diff --git a/src/elementaryFunctions/tan/ztans.c b/src/elementaryFunctions/tan/ztans.c new file mode 100644 index 00000000..9c37fdc5 --- /dev/null +++ b/src/elementaryFunctions/tan/ztans.c @@ -0,0 +1,24 @@ +/* +** -*- C -*- +** +** ztans.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 12:05:48 2006 jofret +** Last update Mon Jan 29 16:10:46 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#ifndef STDC99 +#include "doubleComplex.h" +#else +#include <complex.h> +typedef double complex doubleComplex; +#endif + + +doubleComplex ztans(doubleComplex z) { + /* FIXME: Dummy... */ + return (DoubleComplex(0,1)); +} 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)); +} |