diff options
30 files changed, 851 insertions, 12 deletions
@@ -1,4 +1,20 @@ -2007-01-19 Bruno JOFRET <jofret@agon.inria.fr> +2007-01-29 Bruno JOFRET <bruno.jofret@inria.fr> + + * src/elementaryFunctions/tan : + Tangeant functions + * src/elementaryFunctions/tanh : + Hyperbolic Tangeant functions + * src/test/testCosh.c : + Add some Hyperbolic Cosine tests. + * src/test/tesSinh.c : + Add some Hyperbolic Sine tests. + * src/test/testTan.c : + Add some Tangeant tests. + * src/test/tesTanh.c : + Add some Hyperbolic Tangeant tests. + + +2007-01-19 Bruno JOFRET <bruno.jofret@inria.fr> * src/elementaryFunctions/cosh : Hyperbolic Cosine functions @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Tue Nov 21 15:22:58 2006 jofret -## Last update Mon Dec 4 16:55:06 2006 jofret +## Last update Mon Jan 29 17:38:13 2007 jofret ## ## Copyright INRIA 2006 ## @@ -42,6 +42,7 @@ BJ - Evaluate and draw a graph of function dependences. BJ - Find a way to code complex type taking care of double/float precision. + C struct ?? Did it this way but easy to change. + double[2] // float[2] ?? + + Standard C99 ?? BJ - Listing of atomic call and library dependences. 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)); +} diff --git a/src/test/Makefile b/src/test/Makefile index 5d7378ff..951a1272 100644 --- a/src/test/Makefile +++ b/src/test/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 Fri Dec 8 16:55:15 2006 jofret +## Last update Mon Jan 29 17:17:19 2007 jofret ## ## Copyright INRIA 2006 ## @@ -16,14 +16,21 @@ RM = rm -f CC = gcc INCLUDE = ../type LINK = ../lib -LIBS = -lm -lSin -lCos +LIBS = -lm \ + -lCos -lCosh \ + -lSin -lSinh \ + -lTan -lTanh CFLAGS = -Werror -Wall -pedantic -ansi CLFLAGS = -I$(INCLUDE) -L$(LINK) $(LIBS) AR = ar cru RANLIB = ranlib SRC = testCos.c \ + testCosh.c \ testSin.c \ + testSinh.c \ + testTan.c \ + testTanh.c \ test.c HEAD = test.h diff --git a/src/test/test.c b/src/test/test.c index d1867f8b..ffeeeb2a 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -5,7 +5,7 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 14:53:51 2006 jofret -** Last update Fri Dec 8 15:04:07 2006 jofret +** Last update Mon Jan 29 17:24:07 2007 jofret ** ** Copyright INRIA 2006 */ @@ -18,7 +18,9 @@ void newline() { } int main(int argc, char** argv) { - int cosStatus, sinStatus; + int cosStatus, coshStatus = 0; + int sinStatus, sinhStatus = 0; + int tanStatus, tanhStatus = 0; printf("-*- -> Begin test sequence <- -*-"); @@ -26,11 +28,21 @@ int main(int argc, char** argv) { /* Test Cosine stuffs */ cosStatus = testCos(); + /* Test Hyperbolic Cosine stuffs */ + coshStatus = testCosh(); /* Test Sine stuffs */ sinStatus = testSin(); + /* Test Hyperbolic Sine stuffs */ + sinStatus = testSinh(); + /* Test Tangeant stuffs */ + tanStatus = testTan(); + /* Test Hyperbolic Tangeant stuffs */ + tanhStatus = testTanh(); printf("-*- -> End test sequence <- -*-"); newline(); - return (cosStatus+sinStatus); + return (cosStatus+coshStatus+ + sinStatus+sinhStatus+ + tanStatus+tanhStatus); } diff --git a/src/test/test.h b/src/test/test.h index 0b4b7a46..3b0d3e09 100644 --- a/src/test/test.h +++ b/src/test/test.h @@ -5,7 +5,7 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 15:00:40 2006 jofret -** Last update Fri Dec 8 15:04:17 2006 jofret +** Last update Mon Jan 29 17:16:36 2007 jofret ** ** Copyright INRIA 2006 */ @@ -16,7 +16,27 @@ int testCos(); /* +** \brief Hyperbolic Cosine Test +*/ +int testCosh(); + +/* ** \brief Sine Test */ int testSin(); +/* +** \brief Hyperbolic Sine Test +*/ +int testSinh(); + +/* +** \brief Tangeant Test +*/ +int testTan(); + +/* +** \brief Hyperbolic Tangeant Test +*/ +int testTanh(); + diff --git a/src/test/testCosh.c b/src/test/testCosh.c new file mode 100644 index 00000000..0efb9868 --- /dev/null +++ b/src/test/testCosh.c @@ -0,0 +1,56 @@ +/* +** -*- C -*- +** +** testCosh.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 15:05:44 2006 jofret +** Last update Mon Jan 29 16:15:15 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <stdio.h> + +#define PI 3.1415826535 + +float scoshs(float); +double dcoshs(double); + + +void scoshsTest() { + printf(">> Float scalar\n"); + printf("scoshs(0) = %f\n", scoshs((float) 0)); + printf("scoshs(PI) = %f\n", scoshs(PI)); + printf("scoshs(PI/2) = %f\n", scoshs(PI/2)); + printf("scoshs(PI/3) = %f\n", scoshs(PI/3)); + printf("scoshs(PI/4) = %f\n", scoshs(PI/4)); + printf("scoshs(PI/6) = %f\n", scoshs(PI/6)); + printf("scoshs(-PI) = %f\n", scoshs(-PI)); + printf("scoshs(-PI/2) = %f\n", scoshs(-PI/2)); + printf("scoshs(-PI/3) = %f\n", scoshs(-PI/3)); + printf("scoshs(-PI/4) = %f\n", scoshs(-PI/4)); + printf("scoshs(-PI/6) = %f\n", scoshs(-PI/6)); +} + +void dcoshsTest() { + printf(">> Double scalar\n"); + printf("dcoshs(0) = %e\n", dcoshs((double) 0)); + printf("dcoshs(PI) = %e\n", dcoshs(PI)); + printf("dcoshs(PI/2) = %e\n", dcoshs(PI/2)); + printf("dcoshs(PI/3) = %e\n", dcoshs(PI/3)); + printf("dcoshs(PI/4) = %e\n", dcoshs(PI/4)); + printf("dcoshs(PI/6) = %e\n", dcoshs(PI/6)); + printf("dcoshs(-PI) = %e\n", dcoshs(-PI)); + printf("dcoshs(-PI/2) = %e\n", dcoshs(-PI/2)); + printf("dcoshs(-PI/3) = %e\n", dcoshs(-PI/3)); + printf("dcoshs(-PI/4) = %e\n", dcoshs(-PI/4)); + printf("dcoshs(-PI/6) = %e\n", dcoshs(-PI/6)); +} + +int testCosh() { + printf(">>>> Hyperbolic Cosine Tests\n"); + scoshsTest(); + dcoshsTest(); + return 0; +} diff --git a/src/test/testSinh.c b/src/test/testSinh.c new file mode 100644 index 00000000..22ac851c --- /dev/null +++ b/src/test/testSinh.c @@ -0,0 +1,55 @@ +/* +** -*- C -*- +** +** testSinh.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 15:06:16 2006 jofret +** Last update Mon Jan 29 16:16:59 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <stdio.h> + +#define PI 3.1415826535 + +float ssinhs(float); +double dsinhs(double); + +void ssinhsTest() { + printf(">> Float scalar\n"); + printf("ssinhs(0) = %f\n", ssinhs((float) 0)); + printf("ssinhs(PI) = %f\n", ssinhs(PI)); + printf("ssinhs(PI/2) = %f\n", ssinhs(PI/2)); + printf("ssinhs(PI/3) = %f\n", ssinhs(PI/3)); + printf("ssinhs(PI/4) = %f\n", ssinhs(PI/4)); + printf("ssinhs(PI/6) = %f\n", ssinhs(PI/6)); + printf("ssinhs(-PI) = %f\n", ssinhs(-PI)); + printf("ssinhs(-PI/2) = %f\n", ssinhs(-PI/2)); + printf("ssinhs(-PI/3) = %f\n", ssinhs(-PI/3)); + printf("ssinhs(-PI/4) = %f\n", ssinhs(-PI/4)); + printf("ssinhs(-PI/6) = %f\n", ssinhs(-PI/6)); +} + +void dsinhsTest() { + printf(">> Double scalar\n"); + printf("dsinhs(0) = %e\n", dsinhs((double) 0)); + printf("dsinhs(PI) = %e\n", dsinhs(PI)); + printf("dsinhs(PI/2) = %e\n", dsinhs(PI/2)); + printf("dsinhs(PI/3) = %e\n", dsinhs(PI/3)); + printf("dsinhs(PI/4) = %e\n", dsinhs(PI/4)); + printf("dsinhs(PI/6) = %e\n", dsinhs(PI/6)); + printf("dsinhs(-PI) = %e\n", dsinhs(-PI)); + printf("dsinhs(-PI/2) = %e\n", dsinhs(-PI/2)); + printf("dsinhs(-PI/3) = %e\n", dsinhs(-PI/3)); + printf("dsinhs(-PI/4) = %e\n", dsinhs(-PI/4)); + printf("dsinhs(-PI/6) = %e\n", dsinhs(-PI/6)); +} + +int testSinh() { + printf(">>>> Hyperbolic Sine Tests\n"); + ssinhsTest(); + dsinhsTest(); + return 0; +} diff --git a/src/test/testTan.c b/src/test/testTan.c new file mode 100644 index 00000000..0b1f1c52 --- /dev/null +++ b/src/test/testTan.c @@ -0,0 +1,56 @@ +/* +** -*- C -*- +** +** testTan.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 15:05:44 2006 jofret +** Last update Mon Jan 29 17:13:12 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <stdio.h> + +#define PI 3.1415826535 + +float stans(float); +double dtans(double); + + +void stansTest() { + printf(">> Float scalar\n"); + printf("stans(0) = %f\n", stans((float) 0)); + printf("stans(PI) = %f\n", stans(PI)); + printf("stans(PI/2) = %f\n", stans(PI/2)); + printf("stans(PI/3) = %f\n", stans(PI/3)); + printf("stans(PI/4) = %f\n", stans(PI/4)); + printf("stans(PI/6) = %f\n", stans(PI/6)); + printf("stans(-PI) = %f\n", stans(-PI)); + printf("stans(-PI/2) = %f\n", stans(-PI/2)); + printf("stans(-PI/3) = %f\n", stans(-PI/3)); + printf("stans(-PI/4) = %f\n", stans(-PI/4)); + printf("stans(-PI/6) = %f\n", stans(-PI/6)); +} + +void dtansTest() { + printf(">> Double scalar\n"); + printf("dtans(0) = %e\n", dtans((double) 0)); + printf("dtans(PI) = %e\n", dtans(PI)); + printf("dtans(PI/2) = %e\n", dtans(PI/2)); + printf("dtans(PI/3) = %e\n", dtans(PI/3)); + printf("dtans(PI/4) = %e\n", dtans(PI/4)); + printf("dtans(PI/6) = %e\n", dtans(PI/6)); + printf("dtans(-PI) = %e\n", dtans(-PI)); + printf("dtans(-PI/2) = %e\n", dtans(-PI/2)); + printf("dtans(-PI/3) = %e\n", dtans(-PI/3)); + printf("dtans(-PI/4) = %e\n", dtans(-PI/4)); + printf("dtans(-PI/6) = %e\n", dtans(-PI/6)); +} + +int testTan() { + printf(">>>> Tangeant Tests\n"); + stansTest(); + dtansTest(); + return 0; +} diff --git a/src/test/testTanh.c b/src/test/testTanh.c new file mode 100644 index 00000000..77c4452e --- /dev/null +++ b/src/test/testTanh.c @@ -0,0 +1,56 @@ +/* +** -*- C -*- +** +** testTanh.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 15:05:44 2006 jofret +** Last update Mon Jan 29 17:14:52 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <stdio.h> + +#define PI 3.1415826535 + +float stanhs(float); +double dtanhs(double); + + +void stanhsTest() { + printf(">> Float scalar\n"); + printf("stanhs(0) = %f\n", stanhs((float) 0)); + printf("stanhs(PI) = %f\n", stanhs(PI)); + printf("stanhs(PI/2) = %f\n", stanhs(PI/2)); + printf("stanhs(PI/3) = %f\n", stanhs(PI/3)); + printf("stanhs(PI/4) = %f\n", stanhs(PI/4)); + printf("stanhs(PI/6) = %f\n", stanhs(PI/6)); + printf("stanhs(-PI) = %f\n", stanhs(-PI)); + printf("stanhs(-PI/2) = %f\n", stanhs(-PI/2)); + printf("stanhs(-PI/3) = %f\n", stanhs(-PI/3)); + printf("stanhs(-PI/4) = %f\n", stanhs(-PI/4)); + printf("stanhs(-PI/6) = %f\n", stanhs(-PI/6)); +} + +void dtanhsTest() { + printf(">> Double scalar\n"); + printf("dtanhs(0) = %e\n", dtanhs((double) 0)); + printf("dtanhs(PI) = %e\n", dtanhs(PI)); + printf("dtanhs(PI/2) = %e\n", dtanhs(PI/2)); + printf("dtanhs(PI/3) = %e\n", dtanhs(PI/3)); + printf("dtanhs(PI/4) = %e\n", dtanhs(PI/4)); + printf("dtanhs(PI/6) = %e\n", dtanhs(PI/6)); + printf("dtanhs(-PI) = %e\n", dtanhs(-PI)); + printf("dtanhs(-PI/2) = %e\n", dtanhs(-PI/2)); + printf("dtanhs(-PI/3) = %e\n", dtanhs(-PI/3)); + printf("dtanhs(-PI/4) = %e\n", dtanhs(-PI/4)); + printf("dtanhs(-PI/6) = %e\n", dtanhs(-PI/6)); +} + +int testTanh() { + printf(">>>> Hyperbolic Tangeant Tests\n"); + stanhsTest(); + dtanhsTest(); + return 0; +} |