diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/elementaryFunctions/acosh/Makefile.am | 22 | ||||
-rw-r--r-- | src/elementaryFunctions/acosh/Makefile.in | 92 | ||||
-rw-r--r-- | src/elementaryFunctions/acosh/sacoshs.c | 22 | ||||
-rw-r--r-- | src/elementaryFunctions/acosh/testAcosh.c | 152 | ||||
-rw-r--r-- | src/elementaryFunctions/acosh/testDoubleAcosh.c | 88 | ||||
-rw-r--r-- | src/elementaryFunctions/acosh/testFloatAcosh.c | 87 | ||||
-rw-r--r-- | src/elementaryFunctions/acosh/zacoshs.c | 22 |
7 files changed, 273 insertions, 212 deletions
diff --git a/src/elementaryFunctions/acosh/Makefile.am b/src/elementaryFunctions/acosh/Makefile.am index b6dd8881..55009674 100644 --- a/src/elementaryFunctions/acosh/Makefile.am +++ b/src/elementaryFunctions/acosh/Makefile.am @@ -37,16 +37,22 @@ HEAD = ../includes/acosh.h check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ -I $(top_builddir)/type -check_PROGRAMS = testAcosh +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/elementaryFunctions/acosh/libAcosh.la \ + @LIBMATH@ + +check_PROGRAMS = testFloatAcosh testDoubleAcosh -TESTS = testAcosh +TESTS = testFloatAcosh testDoubleAcosh # # -*- Hyperbolic Acosine Tests -*- # -testAcosh_SOURCES = testAcosh.c -testAcosh_CFLAGS = $(check_INCLUDES) -testAcosh_LDADD = $(top_builddir)/type/libDoubleComplex.la \ - $(top_builddir)/type/libFloatComplex.la \ - $(top_builddir)/elementaryFunctions/acosh/libAcosh.la \ - @LIBMATH@
\ No newline at end of file +testFloatAcosh_SOURCES = testFloatAcosh.c +testFloatAcosh_CFLAGS = $(check_INCLUDES) +testFloatAcosh_LDADD = $(check_LDADD) + +testDoubleAcosh_SOURCES = testDoubleAcosh.c +testDoubleAcosh_CFLAGS = $(check_INCLUDES) +testDoubleAcosh_LDADD = $(check_LDADD)
\ No newline at end of file diff --git a/src/elementaryFunctions/acosh/Makefile.in b/src/elementaryFunctions/acosh/Makefile.in index 7e769a1d..0ff883a8 100644 --- a/src/elementaryFunctions/acosh/Makefile.in +++ b/src/elementaryFunctions/acosh/Makefile.in @@ -32,8 +32,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -check_PROGRAMS = testAcosh$(EXEEXT) -TESTS = testAcosh$(EXEEXT) +check_PROGRAMS = testFloatAcosh$(EXEEXT) testDoubleAcosh$(EXEEXT) +TESTS = testFloatAcosh$(EXEEXT) testDoubleAcosh$(EXEEXT) subdir = elementaryFunctions/acosh DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -63,13 +63,21 @@ libAcosh_la_OBJECTS = $(am_libAcosh_la_OBJECTS) libAcosh_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libAcosh_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_testAcosh_OBJECTS = testAcosh-testAcosh.$(OBJEXT) -testAcosh_OBJECTS = $(am_testAcosh_OBJECTS) -testAcosh_DEPENDENCIES = $(top_builddir)/type/libDoubleComplex.la \ +am_testDoubleAcosh_OBJECTS = \ + testDoubleAcosh-testDoubleAcosh.$(OBJEXT) +testDoubleAcosh_OBJECTS = $(am_testDoubleAcosh_OBJECTS) +am__DEPENDENCIES_1 = $(top_builddir)/type/libDoubleComplex.la \ $(top_builddir)/type/libFloatComplex.la \ $(top_builddir)/elementaryFunctions/acosh/libAcosh.la -testAcosh_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testAcosh_CFLAGS) \ +testDoubleAcosh_DEPENDENCIES = $(am__DEPENDENCIES_1) +testDoubleAcosh_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleAcosh_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_testFloatAcosh_OBJECTS = testFloatAcosh-testFloatAcosh.$(OBJEXT) +testFloatAcosh_OBJECTS = $(am_testFloatAcosh_OBJECTS) +testFloatAcosh_DEPENDENCIES = $(am__DEPENDENCIES_1) +testFloatAcosh_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testFloatAcosh_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I. -I$(top_builddir)/includes@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp @@ -83,8 +91,10 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(libAcosh_la_SOURCES) $(testAcosh_SOURCES) -DIST_SOURCES = $(libAcosh_la_SOURCES) $(testAcosh_SOURCES) +SOURCES = $(libAcosh_la_SOURCES) $(testDoubleAcosh_SOURCES) \ + $(testFloatAcosh_SOURCES) +DIST_SOURCES = $(libAcosh_la_SOURCES) $(testDoubleAcosh_SOURCES) \ + $(testFloatAcosh_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -219,17 +229,21 @@ HEAD = ../includes/acosh.h check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ -I $(top_builddir)/type - -# -# -*- Hyperbolic Acosine Tests -*- -# -testAcosh_SOURCES = testAcosh.c -testAcosh_CFLAGS = $(check_INCLUDES) -testAcosh_LDADD = $(top_builddir)/type/libDoubleComplex.la \ +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ $(top_builddir)/type/libFloatComplex.la \ $(top_builddir)/elementaryFunctions/acosh/libAcosh.la \ @LIBMATH@ + +# +# -*- Hyperbolic Acosine Tests -*- +# +testFloatAcosh_SOURCES = testFloatAcosh.c +testFloatAcosh_CFLAGS = $(check_INCLUDES) +testFloatAcosh_LDADD = $(check_LDADD) +testDoubleAcosh_SOURCES = testDoubleAcosh.c +testDoubleAcosh_CFLAGS = $(check_INCLUDES) +testDoubleAcosh_LDADD = $(check_LDADD) all: all-am .SUFFIXES: @@ -299,9 +313,12 @@ clean-checkPROGRAMS: echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done -testAcosh$(EXEEXT): $(testAcosh_OBJECTS) $(testAcosh_DEPENDENCIES) - @rm -f testAcosh$(EXEEXT) - $(testAcosh_LINK) $(testAcosh_OBJECTS) $(testAcosh_LDADD) $(LIBS) +testDoubleAcosh$(EXEEXT): $(testDoubleAcosh_OBJECTS) $(testDoubleAcosh_DEPENDENCIES) + @rm -f testDoubleAcosh$(EXEEXT) + $(testDoubleAcosh_LINK) $(testDoubleAcosh_OBJECTS) $(testDoubleAcosh_LDADD) $(LIBS) +testFloatAcosh$(EXEEXT): $(testFloatAcosh_OBJECTS) $(testFloatAcosh_DEPENDENCIES) + @rm -f testFloatAcosh$(EXEEXT) + $(testFloatAcosh_LINK) $(testFloatAcosh_OBJECTS) $(testFloatAcosh_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -317,7 +334,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libAcosh_la-sacoshs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libAcosh_la-zacosha.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libAcosh_la-zacoshs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testAcosh-testAcosh.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDoubleAcosh-testDoubleAcosh.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFloatAcosh-testFloatAcosh.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -396,19 +414,33 @@ libAcosh_la-zacosha.lo: zacosha.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libAcosh_la_CFLAGS) $(CFLAGS) -c -o libAcosh_la-zacosha.lo `test -f 'zacosha.c' || echo '$(srcdir)/'`zacosha.c -testAcosh-testAcosh.o: testAcosh.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testAcosh_CFLAGS) $(CFLAGS) -MT testAcosh-testAcosh.o -MD -MP -MF $(DEPDIR)/testAcosh-testAcosh.Tpo -c -o testAcosh-testAcosh.o `test -f 'testAcosh.c' || echo '$(srcdir)/'`testAcosh.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testAcosh-testAcosh.Tpo $(DEPDIR)/testAcosh-testAcosh.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testAcosh.c' object='testAcosh-testAcosh.o' libtool=no @AMDEPBACKSLASH@ +testDoubleAcosh-testDoubleAcosh.o: testDoubleAcosh.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleAcosh_CFLAGS) $(CFLAGS) -MT testDoubleAcosh-testDoubleAcosh.o -MD -MP -MF $(DEPDIR)/testDoubleAcosh-testDoubleAcosh.Tpo -c -o testDoubleAcosh-testDoubleAcosh.o `test -f 'testDoubleAcosh.c' || echo '$(srcdir)/'`testDoubleAcosh.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleAcosh-testDoubleAcosh.Tpo $(DEPDIR)/testDoubleAcosh-testDoubleAcosh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleAcosh.c' object='testDoubleAcosh-testDoubleAcosh.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleAcosh_CFLAGS) $(CFLAGS) -c -o testDoubleAcosh-testDoubleAcosh.o `test -f 'testDoubleAcosh.c' || echo '$(srcdir)/'`testDoubleAcosh.c + +testDoubleAcosh-testDoubleAcosh.obj: testDoubleAcosh.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleAcosh_CFLAGS) $(CFLAGS) -MT testDoubleAcosh-testDoubleAcosh.obj -MD -MP -MF $(DEPDIR)/testDoubleAcosh-testDoubleAcosh.Tpo -c -o testDoubleAcosh-testDoubleAcosh.obj `if test -f 'testDoubleAcosh.c'; then $(CYGPATH_W) 'testDoubleAcosh.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleAcosh.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleAcosh-testDoubleAcosh.Tpo $(DEPDIR)/testDoubleAcosh-testDoubleAcosh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleAcosh.c' object='testDoubleAcosh-testDoubleAcosh.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleAcosh_CFLAGS) $(CFLAGS) -c -o testDoubleAcosh-testDoubleAcosh.obj `if test -f 'testDoubleAcosh.c'; then $(CYGPATH_W) 'testDoubleAcosh.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleAcosh.c'; fi` + +testFloatAcosh-testFloatAcosh.o: testFloatAcosh.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatAcosh_CFLAGS) $(CFLAGS) -MT testFloatAcosh-testFloatAcosh.o -MD -MP -MF $(DEPDIR)/testFloatAcosh-testFloatAcosh.Tpo -c -o testFloatAcosh-testFloatAcosh.o `test -f 'testFloatAcosh.c' || echo '$(srcdir)/'`testFloatAcosh.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatAcosh-testFloatAcosh.Tpo $(DEPDIR)/testFloatAcosh-testFloatAcosh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatAcosh.c' object='testFloatAcosh-testFloatAcosh.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testAcosh_CFLAGS) $(CFLAGS) -c -o testAcosh-testAcosh.o `test -f 'testAcosh.c' || echo '$(srcdir)/'`testAcosh.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatAcosh_CFLAGS) $(CFLAGS) -c -o testFloatAcosh-testFloatAcosh.o `test -f 'testFloatAcosh.c' || echo '$(srcdir)/'`testFloatAcosh.c -testAcosh-testAcosh.obj: testAcosh.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testAcosh_CFLAGS) $(CFLAGS) -MT testAcosh-testAcosh.obj -MD -MP -MF $(DEPDIR)/testAcosh-testAcosh.Tpo -c -o testAcosh-testAcosh.obj `if test -f 'testAcosh.c'; then $(CYGPATH_W) 'testAcosh.c'; else $(CYGPATH_W) '$(srcdir)/testAcosh.c'; fi` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testAcosh-testAcosh.Tpo $(DEPDIR)/testAcosh-testAcosh.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testAcosh.c' object='testAcosh-testAcosh.obj' libtool=no @AMDEPBACKSLASH@ +testFloatAcosh-testFloatAcosh.obj: testFloatAcosh.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatAcosh_CFLAGS) $(CFLAGS) -MT testFloatAcosh-testFloatAcosh.obj -MD -MP -MF $(DEPDIR)/testFloatAcosh-testFloatAcosh.Tpo -c -o testFloatAcosh-testFloatAcosh.obj `if test -f 'testFloatAcosh.c'; then $(CYGPATH_W) 'testFloatAcosh.c'; else $(CYGPATH_W) '$(srcdir)/testFloatAcosh.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatAcosh-testFloatAcosh.Tpo $(DEPDIR)/testFloatAcosh-testFloatAcosh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatAcosh.c' object='testFloatAcosh-testFloatAcosh.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testAcosh_CFLAGS) $(CFLAGS) -c -o testAcosh-testAcosh.obj `if test -f 'testAcosh.c'; then $(CYGPATH_W) 'testAcosh.c'; else $(CYGPATH_W) '$(srcdir)/testAcosh.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatAcosh_CFLAGS) $(CFLAGS) -c -o testFloatAcosh-testFloatAcosh.obj `if test -f 'testFloatAcosh.c'; then $(CYGPATH_W) 'testFloatAcosh.c'; else $(CYGPATH_W) '$(srcdir)/testFloatAcosh.c'; fi` mostlyclean-libtool: -rm -f *.lo diff --git a/src/elementaryFunctions/acosh/sacoshs.c b/src/elementaryFunctions/acosh/sacoshs.c index 4163cb22..a9ef9811 100644 --- a/src/elementaryFunctions/acosh/sacoshs.c +++ b/src/elementaryFunctions/acosh/sacoshs.c @@ -1,18 +1,18 @@ /* -** -*- C -*- -** -** sacoshs.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Jan 5 10:25:44 2007 jofret -** Last update Thu Sep 6 10:43:12 2007 bruno -** -** Copyright INRIA 2007 -*/ + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ #include <math.h> #include "acosh.h" float sacoshs(float x) { - return (acosh(x)); + return (acoshf(x)); } diff --git a/src/elementaryFunctions/acosh/testAcosh.c b/src/elementaryFunctions/acosh/testAcosh.c deleted file mode 100644 index 491867e3..00000000 --- a/src/elementaryFunctions/acosh/testAcosh.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include "testAcosh.h" - -void sacoshsTest(void) { - printf(">> Float scalar\n"); - printf("sacoshs(0) = %f\n", sacoshs((float) 0)); - printf("sacoshs(PI) = %f\n", sacoshs(PI)); - printf("sacoshs(PI/2) = %f\n", sacoshs(PI/2)); - printf("sacoshs(PI/3) = %f\n", sacoshs(PI/3)); - printf("sacoshs(PI/4) = %f\n", sacoshs(PI/4)); - printf("sacoshs(PI/6) = %f\n", sacoshs(PI/6)); - printf("sacoshs(-PI) = %f\n", sacoshs(-PI)); - printf("sacoshs(-PI/2) = %f\n", sacoshs(-PI/2)); - printf("sacoshs(-PI/3) = %f\n", sacoshs(-PI/3)); - printf("sacoshs(-PI/4) = %f\n", sacoshs(-PI/4)); - printf("sacoshs(-PI/6) = %f\n", sacoshs(-PI/6)); -} - -void dacoshsTest(void) { - printf(">> Double scalar\n"); - printf("dacoshs(0) = %e\n", dacoshs((double) 0)); - printf("dacoshs(PI) = %e\n", dacoshs(PI)); - printf("dacoshs(PI/2) = %e\n", dacoshs(PI/2)); - printf("dacoshs(PI/3) = %e\n", dacoshs(PI/3)); - printf("dacoshs(PI/4) = %e\n", dacoshs(PI/4)); - printf("dacoshs(PI/6) = %e\n", dacoshs(PI/6)); - printf("dacoshs(-PI) = %e\n", dacoshs(-PI)); - printf("dacoshs(-PI/2) = %e\n", dacoshs(-PI/2)); - printf("dacoshs(-PI/3) = %e\n", dacoshs(-PI/3)); - printf("dacoshs(-PI/4) = %e\n", dacoshs(-PI/4)); - printf("dacoshs(-PI/6) = %e\n", dacoshs(-PI/6)); -} - -void cacoshsTest(void) { - floatComplex pi_pi = FloatComplex(PI, PI); - floatComplex pi_2_pi_2 = FloatComplex(PI/2, PI/2); - floatComplex pi_2_pi_3 = FloatComplex(PI/2, PI/3); - floatComplex pi_2_pi_4 = FloatComplex(PI/2, PI/4); - floatComplex out; - - printf(">> Float Complex scalar\n"); - out = cacoshs(pi_pi); - printf("cacoshs(PI + I*PI) = %f + I * %f\n", creals(out), cimags(out)); - out = cacoshs(pi_2_pi_2); - printf("cacoshs(PI/2 + I*PI/2) = %f + I * %f\n", creals(out), cimags(out)); - out = cacoshs(pi_2_pi_3); - printf("cacoshs(PI/2 + I*PI/3) = %f + I * %f\n", creals(out), cimags(out)); - out = cacoshs(pi_2_pi_4); - printf("cacoshs(PI/2 + I*PI/4) = %f + I * %f\n", creals(out), cimags(out)); -} - -void zacoshsTest(void) { - doubleComplex pi_pi = DoubleComplex(PI, PI); - doubleComplex pi_2_pi_2 = DoubleComplex(PI/2, PI/2); - doubleComplex pi_2_pi_3 = DoubleComplex(PI/2, PI/3); - doubleComplex pi_2_pi_4 = DoubleComplex(PI/2, PI/4); - doubleComplex out; - - printf(">> Double Complex scalar\n"); - out = zacoshs(pi_pi); - printf("zacoshs(PI + I*PI) = %e + I * %e\n", zreals(out), zimags(out)); - out = zacoshs(pi_2_pi_2); - printf("zacoshs(PI/2 + I*PI/2) = %e + I * %e\n", zreals(out), zimags(out)); - out = zacoshs(pi_2_pi_3); - printf("zacoshs(PI/2 + I*PI/3) = %e + I * %e\n", zreals(out), zimags(out)); - out = zacoshs(pi_2_pi_4); - printf("zacoshs(PI/2 + I*PI/4) = %e + I * %e\n", zreals(out), zimags(out)); -} - -void sacoshaTest(void) { - float out[5]; - float in[5] = {PI, PI/2, PI/3, PI/4, PI/6}; - int i = 0; - - printf(">> Float array\n"); - sacosha(in, 5, out); - for (i = 0 ; i < 5 ; ++i) - printf("sacosha(array) = %f\n", out[i]); -} - -void dacoshaTest(void) { - double out[5]; - double in[5] = {PI, PI/2, PI/3, PI/4, PI/6}; - int i = 0; - - printf(">> Double Array\n"); - dacosha(in, 5, out); - for (i = 0 ; i < 5 ; ++i) - printf("sacosha(array) = %f\n", out[i]); - -} - -void cacoshaTest(void) { - floatComplex in[4]; - floatComplex out[4]; - int i = 0; - - in[0] = FloatComplex(PI, PI); - in[1] = FloatComplex(PI/2, PI/2); - in[2] = FloatComplex(PI/2, PI/3); - in[3] = FloatComplex(PI/2, PI/4); - - cacosha(in, 4, out); - printf(">> Float Complex Array\n"); - for (i = 0 ; i < 4 ; ++i) - printf("cacosha(array) = %e + I * %e\n", creals(out[i]), cimags(out[i])); -} - -void zacoshaTest(void) { - doubleComplex in[4]; - doubleComplex out[4]; - int i = 0; - - in[0] = DoubleComplex(PI, PI); - in[1] = DoubleComplex(PI/2, PI/2); - in[2] = DoubleComplex(PI/2, PI/3); - in[3] = DoubleComplex(PI/2, PI/4); - - zacosha(in, 4, out); - printf(">> Double Complex Array\n"); - for (i = 0 ; i < 4 ; ++i) - printf("zacosha(array) = %e + I * %e\n", zreals(out[i]), zimags(out[i])); -} - -int testAcosh(void) { - printf("\n>>>> ArcCoshine Tests\n"); - sacoshsTest(); - dacoshsTest(); - cacoshsTest(); - zacoshsTest(); - sacoshaTest(); - dacoshaTest(); - cacoshaTest(); - zacoshaTest(); - return 0; -} - -int main(void) { - assert(testAcosh() == 0); - return 0; -} diff --git a/src/elementaryFunctions/acosh/testDoubleAcosh.c b/src/elementaryFunctions/acosh/testDoubleAcosh.c new file mode 100644 index 00000000..89dc8784 --- /dev/null +++ b/src/elementaryFunctions/acosh/testDoubleAcosh.c @@ -0,0 +1,88 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "testAcosh.h" + +void dacoshsTest(void) { + printf(">> Double scalar\n"); + printf("dacoshs(0) = %e\n", dacoshs(0.0)); + printf("dacoshs(PI) = %e\n", dacoshs(DPI)); + printf("dacoshs(PI/2) = %e\n", dacoshs(DPI/2)); + printf("dacoshs(PI/3) = %e\n", dacoshs(DPI/3)); + printf("dacoshs(PI/4) = %e\n", dacoshs(DPI/4)); + printf("dacoshs(PI/6) = %e\n", dacoshs(DPI/6)); + printf("dacoshs(-PI) = %e\n", dacoshs(-DPI)); + printf("dacoshs(-PI/2) = %e\n", dacoshs(-DPI/2)); + printf("dacoshs(-PI/3) = %e\n", dacoshs(-DPI/3)); + printf("dacoshs(-PI/4) = %e\n", dacoshs(-DPI/4)); + printf("dacoshs(-PI/6) = %e\n", dacoshs(-DPI/6)); +} + +void zacoshsTest(void) { + doubleComplex pi_pi = DoubleComplex(DPI, DPI); + doubleComplex pi_2_pi_2 = DoubleComplex(DPI/2, DPI/2); + doubleComplex pi_2_pi_3 = DoubleComplex(DPI/2, DPI/3); + doubleComplex pi_2_pi_4 = DoubleComplex(DPI/2, DPI/4); + doubleComplex out; + + printf(">> Double Complex scalar\n"); + out = zacoshs(pi_pi); + printf("zacoshs(PI + I*PI) = %e + I * %e\n", zreals(out), zimags(out)); + out = zacoshs(pi_2_pi_2); + printf("zacoshs(PI/2 + I*PI/2) = %e + I * %e\n", zreals(out), zimags(out)); + out = zacoshs(pi_2_pi_3); + printf("zacoshs(PI/2 + I*PI/3) = %e + I * %e\n", zreals(out), zimags(out)); + out = zacoshs(pi_2_pi_4); + printf("zacoshs(PI/2 + I*PI/4) = %e + I * %e\n", zreals(out), zimags(out)); +} + +void dacoshaTest(void) { + double out[5]; + double in[5] = {DPI, DPI/2, DPI/3, DPI/4, DPI/6}; + int i = 0; + + printf(">> Double Array\n"); + dacosha(in, 5, out); + for (i = 0 ; i < 5 ; ++i) + printf("sacosha(array) = %f\n", out[i]); + +} + +void zacoshaTest(void) { + doubleComplex in[4]; + doubleComplex out[4]; + int i = 0; + + in[0] = DoubleComplex(DPI, DPI); + in[1] = DoubleComplex(DPI/2, DPI/2); + in[2] = DoubleComplex(DPI/2, DPI/3); + in[3] = DoubleComplex(DPI/2, DPI/4); + + zacosha(in, 4, out); + printf(">> Double Complex Array\n"); + for (i = 0 ; i < 4 ; ++i) + printf("zacosha(array) = %e + I * %e\n", zreals(out[i]), zimags(out[i])); +} + +int testAcosh(void) { + printf("\n>>>> Double Hyperbolic ArcCosine Tests\n"); + dacoshsTest(); + zacoshsTest(); + dacoshaTest(); + zacoshaTest(); + return 0; +} + +int main(void) { + assert(testAcosh() == 0); + return 0; +} diff --git a/src/elementaryFunctions/acosh/testFloatAcosh.c b/src/elementaryFunctions/acosh/testFloatAcosh.c new file mode 100644 index 00000000..fa5fe48a --- /dev/null +++ b/src/elementaryFunctions/acosh/testFloatAcosh.c @@ -0,0 +1,87 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "testAcosh.h" + +void sacoshsTest(void) { + printf(">> Float scalar\n"); + printf("sacoshs(0) = %f\n", sacoshs(0.0f)); + printf("sacoshs(PI) = %f\n", sacoshs(FPI)); + printf("sacoshs(PI/2) = %f\n", sacoshs(FPI/2)); + printf("sacoshs(PI/3) = %f\n", sacoshs(FPI/3)); + printf("sacoshs(PI/4) = %f\n", sacoshs(FPI/4)); + printf("sacoshs(PI/6) = %f\n", sacoshs(FPI/6)); + printf("sacoshs(-PI) = %f\n", sacoshs(-FPI)); + printf("sacoshs(-PI/2) = %f\n", sacoshs(-FPI/2)); + printf("sacoshs(-PI/3) = %f\n", sacoshs(-FPI/3)); + printf("sacoshs(-PI/4) = %f\n", sacoshs(-FPI/4)); + printf("sacoshs(-PI/6) = %f\n", sacoshs(-FPI/6)); +} + +void cacoshsTest(void) { + floatComplex pi_pi = FloatComplex(FPI, FPI); + floatComplex pi_2_pi_2 = FloatComplex(FPI/2, FPI/2); + floatComplex pi_2_pi_3 = FloatComplex(FPI/2, FPI/3); + floatComplex pi_2_pi_4 = FloatComplex(FPI/2, FPI/4); + floatComplex out; + + printf(">> Float Complex scalar\n"); + out = cacoshs(pi_pi); + printf("cacoshs(PI + I*PI) = %f + I * %f\n", creals(out), cimags(out)); + out = cacoshs(pi_2_pi_2); + printf("cacoshs(PI/2 + I*PI/2) = %f + I * %f\n", creals(out), cimags(out)); + out = cacoshs(pi_2_pi_3); + printf("cacoshs(PI/2 + I*PI/3) = %f + I * %f\n", creals(out), cimags(out)); + out = cacoshs(pi_2_pi_4); + printf("cacoshs(PI/2 + I*PI/4) = %f + I * %f\n", creals(out), cimags(out)); +} + +void sacoshaTest(void) { + float out[5]; + float in[5] = {FPI, FPI/2, FPI/3, FPI/4, FPI/6}; + int i = 0; + + printf(">> Float array\n"); + sacosha(in, 5, out); + for (i = 0 ; i < 5 ; ++i) + printf("sacosha(array) = %f\n", out[i]); +} + +void cacoshaTest(void) { + floatComplex in[4]; + floatComplex out[4]; + int i = 0; + + in[0] = FloatComplex(FPI, FPI); + in[1] = FloatComplex(FPI/2, FPI/2); + in[2] = FloatComplex(FPI/2, FPI/3); + in[3] = FloatComplex(FPI/2, FPI/4); + + cacosha(in, 4, out); + printf(">> Float Complex Array\n"); + for (i = 0 ; i < 4 ; ++i) + printf("cacosha(array) = %e + I * %e\n", creals(out[i]), cimags(out[i])); +} + +int testAcosh(void) { + printf("\n>>>> Float Hyperbolic ArcCosine Tests\n"); + sacoshsTest(); + cacoshsTest(); + sacoshaTest(); + cacoshaTest(); + return 0; +} + +int main(void) { + assert(testAcosh() == 0); + return 0; +} diff --git a/src/elementaryFunctions/acosh/zacoshs.c b/src/elementaryFunctions/acosh/zacoshs.c index 31929163..fb9b408c 100644 --- a/src/elementaryFunctions/acosh/zacoshs.c +++ b/src/elementaryFunctions/acosh/zacoshs.c @@ -1,18 +1,18 @@ /* -** -*- C -*- -** -** zacoshs.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Jan 5 10:24:38 2007 jofret -** Last update Thu Sep 6 10:42:12 2007 bruno -** -** Copyright INRIA 2007 -*/ + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ #include "acosh.h" doubleComplex zacoshs(doubleComplex z) { /* FIXME: Dummy... */ - return (DoubleComplex(0,1)); + return z; } |