diff options
author | jofret | 2008-05-15 09:45:12 +0000 |
---|---|---|
committer | jofret | 2008-05-15 09:45:12 +0000 |
commit | c5b6fb6f4fb83302d15a6bd7723a6815e6a2b56c (patch) | |
tree | bf0949e992fcbe39687d856ce6e29879c084877e /src/elementaryFunctions/asinh | |
parent | 9cbfc0bb63f940f5f0e096e2c2d45e7ebbf54ba3 (diff) | |
download | scilab2c-c5b6fb6f4fb83302d15a6bd7723a6815e6a2b56c.tar.gz scilab2c-c5b6fb6f4fb83302d15a6bd7723a6815e6a2b56c.tar.bz2 scilab2c-c5b6fb6f4fb83302d15a6bd7723a6815e6a2b56c.zip |
* ASINH Mapped to emulate scilab behaviour
this mean it does not call the C library if scilab
use another algorithm instead.
Diffstat (limited to 'src/elementaryFunctions/asinh')
-rw-r--r-- | src/elementaryFunctions/asinh/Makefile.am | 7 | ||||
-rw-r--r-- | src/elementaryFunctions/asinh/Makefile.in | 16 | ||||
-rw-r--r-- | src/elementaryFunctions/asinh/casinha.c | 20 | ||||
-rw-r--r-- | src/elementaryFunctions/asinh/casinhs.c | 32 | ||||
-rw-r--r-- | src/elementaryFunctions/asinh/dasinha.c | 20 | ||||
-rw-r--r-- | src/elementaryFunctions/asinh/dasinhs.c | 29 | ||||
-rw-r--r-- | src/elementaryFunctions/asinh/sasinha.c | 20 | ||||
-rw-r--r-- | src/elementaryFunctions/asinh/sasinhs.c | 10 | ||||
-rw-r--r-- | src/elementaryFunctions/asinh/zasinha.c | 20 | ||||
-rw-r--r-- | src/elementaryFunctions/asinh/zasinhs.c | 12 |
10 files changed, 117 insertions, 69 deletions
diff --git a/src/elementaryFunctions/asinh/Makefile.am b/src/elementaryFunctions/asinh/Makefile.am index 91132334..1df8df93 100644 --- a/src/elementaryFunctions/asinh/Makefile.am +++ b/src/elementaryFunctions/asinh/Makefile.am @@ -39,7 +39,14 @@ check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/lapack/libscilapack.la \ $(top_builddir)/elementaryFunctions/asinh/libAsinh.la \ + $(top_builddir)/elementaryFunctions/asin/libAsin.la \ + $(top_builddir)/elementaryFunctions/log1p/libLog1p.la \ + $(top_builddir)/elementaryFunctions/log/libLog.la \ + $(top_builddir)/elementaryFunctions/atan/libAtan.la \ + $(top_builddir)/elementaryFunctions/sqrt/libSqrt.la \ + $(top_builddir)/auxiliaryFunctions/abs/libAbs.la \ @LIBMATH@ check_PROGRAMS = testFloatAsinh testDoubleAsinh diff --git a/src/elementaryFunctions/asinh/Makefile.in b/src/elementaryFunctions/asinh/Makefile.in index 8bcbe09f..58ec0f71 100644 --- a/src/elementaryFunctions/asinh/Makefile.in +++ b/src/elementaryFunctions/asinh/Makefile.in @@ -68,7 +68,14 @@ am_testDoubleAsinh_OBJECTS = \ testDoubleAsinh_OBJECTS = $(am_testDoubleAsinh_OBJECTS) am__DEPENDENCIES_1 = $(top_builddir)/type/libDoubleComplex.la \ $(top_builddir)/type/libFloatComplex.la \ - $(top_builddir)/elementaryFunctions/asinh/libAsinh.la + $(top_builddir)/lib/lapack/libscilapack.la \ + $(top_builddir)/elementaryFunctions/asinh/libAsinh.la \ + $(top_builddir)/elementaryFunctions/asin/libAsin.la \ + $(top_builddir)/elementaryFunctions/log1p/libLog1p.la \ + $(top_builddir)/elementaryFunctions/log/libLog.la \ + $(top_builddir)/elementaryFunctions/atan/libAtan.la \ + $(top_builddir)/elementaryFunctions/sqrt/libSqrt.la \ + $(top_builddir)/auxiliaryFunctions/abs/libAbs.la testDoubleAsinh_DEPENDENCIES = $(am__DEPENDENCIES_1) testDoubleAsinh_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleAsinh_CFLAGS) \ @@ -233,7 +240,14 @@ check_INCLUDES = -I $(top_builddir)/elementaryFunctions/includes \ check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/lapack/libscilapack.la \ $(top_builddir)/elementaryFunctions/asinh/libAsinh.la \ + $(top_builddir)/elementaryFunctions/asin/libAsin.la \ + $(top_builddir)/elementaryFunctions/log1p/libLog1p.la \ + $(top_builddir)/elementaryFunctions/log/libLog.la \ + $(top_builddir)/elementaryFunctions/atan/libAtan.la \ + $(top_builddir)/elementaryFunctions/sqrt/libSqrt.la \ + $(top_builddir)/auxiliaryFunctions/abs/libAbs.la \ @LIBMATH@ diff --git a/src/elementaryFunctions/asinh/casinha.c b/src/elementaryFunctions/asinh/casinha.c index 32fc2aca..76108aaf 100644 --- a/src/elementaryFunctions/asinh/casinha.c +++ b/src/elementaryFunctions/asinh/casinha.c @@ -1,14 +1,14 @@ /* -** -*- C -*- -** -** casinha.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Jan 5 10:23:49 2007 jofret -** Last update Mon Oct 22 09:58:15 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 "asinh.h" diff --git a/src/elementaryFunctions/asinh/casinhs.c b/src/elementaryFunctions/asinh/casinhs.c index c191de36..c2647ea8 100644 --- a/src/elementaryFunctions/asinh/casinhs.c +++ b/src/elementaryFunctions/asinh/casinhs.c @@ -1,18 +1,26 @@ /* -** -*- C -*- -** -** casinhs.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Jan 5 11:29:45 2007 jofret -** Last update Thu Sep 6 11:23:00 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 + * + */ + +// +// METHOD +// based on the formula asinh(z) = -i asin(i z) +// #include "asinh.h" +#include "asin.h" floatComplex casinhs(floatComplex z) { - /* FIXME: Dummy... */ - return z; + floatComplex i_z = FloatComplex(-cimags(z), creals(z)); + floatComplex asin_i_z = casins(i_z); + + return FloatComplex(cimags(asin_i_z), creals(asin_i_z)); } diff --git a/src/elementaryFunctions/asinh/dasinha.c b/src/elementaryFunctions/asinh/dasinha.c index 8e2acc75..0b6caf84 100644 --- a/src/elementaryFunctions/asinh/dasinha.c +++ b/src/elementaryFunctions/asinh/dasinha.c @@ -1,14 +1,14 @@ /* -** -*- C -*- -** -** dasinha.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Jan 5 11:29:20 2007 jofret -** Last update Mon Oct 22 09:58:05 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 "asinh.h" diff --git a/src/elementaryFunctions/asinh/dasinhs.c b/src/elementaryFunctions/asinh/dasinhs.c index 1d55e721..90caa466 100644 --- a/src/elementaryFunctions/asinh/dasinhs.c +++ b/src/elementaryFunctions/asinh/dasinhs.c @@ -1,19 +1,24 @@ /* -** -*- C -*- -** -** dasinhs.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Jan 5 10:26:21 2007 jofret -** Last update Thu Sep 6 11:21:22 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 + * + */ +// +// METHOD +// based on the formula asinh(z) = -i asin(i z) +// In real case asinh(z) = imag(asin(i z)) +// -#include <math.h> #include "asinh.h" +#include "asin.h" double dasinhs(double x) { - return (asinh(x)); + return zimags(zasins(DoubleComplex(0.0, x))); } diff --git a/src/elementaryFunctions/asinh/sasinha.c b/src/elementaryFunctions/asinh/sasinha.c index 16916ef1..e5dc9a32 100644 --- a/src/elementaryFunctions/asinh/sasinha.c +++ b/src/elementaryFunctions/asinh/sasinha.c @@ -1,14 +1,14 @@ /* -** -*- C -*- -** -** sasinha.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Jan 5 10:25:57 2007 jofret -** Last update Mon Oct 22 09:57:55 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 "asinh.h" diff --git a/src/elementaryFunctions/asinh/sasinhs.c b/src/elementaryFunctions/asinh/sasinhs.c index cc685aeb..623ff72d 100644 --- a/src/elementaryFunctions/asinh/sasinhs.c +++ b/src/elementaryFunctions/asinh/sasinhs.c @@ -10,9 +10,15 @@ * */ -#include <math.h> +// +// METHOD +// based on the formula asinh(z) = -i asin(i z) +// In real case asinh(z) = imag(asin(i z)) +// + #include "asinh.h" +#include "asin.h" float sasinhs(float x) { - return (asinhf(x)); + return cimags(casins(FloatComplex(0.0f, x))); } diff --git a/src/elementaryFunctions/asinh/zasinha.c b/src/elementaryFunctions/asinh/zasinha.c index 49b15bf3..4ce24bd8 100644 --- a/src/elementaryFunctions/asinh/zasinha.c +++ b/src/elementaryFunctions/asinh/zasinha.c @@ -1,14 +1,14 @@ /* -** -*- C -*- -** -** zasinha.c -** Made by Bruno JOFRET <bruno.jofret@inria.fr> -** -** Started on Fri Jan 5 10:25:14 2007 jofret -** Last update Mon Oct 22 09:57:45 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 "asinh.h" diff --git a/src/elementaryFunctions/asinh/zasinhs.c b/src/elementaryFunctions/asinh/zasinhs.c index 58dac9c7..320e185b 100644 --- a/src/elementaryFunctions/asinh/zasinhs.c +++ b/src/elementaryFunctions/asinh/zasinhs.c @@ -10,9 +10,17 @@ * */ +// +// METHOD +// based on the formula asinh(z) = -i asin(i z) +// + #include "asinh.h" +#include "asin.h" doubleComplex zasinhs(doubleComplex z) { - /* FIXME: Dummy... */ - return z; + doubleComplex i_z = DoubleComplex(-zimags(z), zreals(z)); + doubleComplex asin_i_z = zasins(i_z); + + return DoubleComplex(zimags(asin_i_z), zreals(asin_i_z)); } |