diff options
author | jofret | 2008-06-17 07:34:49 +0000 |
---|---|---|
committer | jofret | 2008-06-17 07:34:49 +0000 |
commit | 0875b69081acb888ddea12c33849921b46fc7b87 (patch) | |
tree | cf3be2d236634d58110487ffe6cb6330f9aa5433 /src/elementaryFunctions | |
parent | 91772265a76ef33d968c10cf3ae35c165b9179db (diff) | |
download | scilab2c-0875b69081acb888ddea12c33849921b46fc7b87.tar.gz scilab2c-0875b69081acb888ddea12c33849921b46fc7b87.tar.bz2 scilab2c-0875b69081acb888ddea12c33849921b46fc7b87.zip |
Update dependencies on lnp1m1
Diffstat (limited to 'src/elementaryFunctions')
-rw-r--r-- | src/elementaryFunctions/log/Makefile.am | 1 | ||||
-rw-r--r-- | src/elementaryFunctions/log/Makefile.in | 2 | ||||
-rw-r--r-- | src/elementaryFunctions/log/testDoubleLog.c | 19 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/elementaryFunctions/log/Makefile.am b/src/elementaryFunctions/log/Makefile.am index 61c96d10..9439b345 100644 --- a/src/elementaryFunctions/log/Makefile.am +++ b/src/elementaryFunctions/log/Makefile.am @@ -44,6 +44,7 @@ check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ $(top_builddir)/elementaryFunctions/log/libLog.la \ $(top_builddir)/elementaryFunctions/sqrt/libSqrt.la \ $(top_builddir)/elementaryFunctions/log1p/libLog1p.la \ + $(top_builddir)/elementaryFunctions/lnp1m1/libLnp1m1.la \ $(top_builddir)/auxiliaryFunctions/abs/libAbs.la \ $(top_builddir)/auxiliaryFunctions/pythag/libPythag.la \ @LIBMATH@ diff --git a/src/elementaryFunctions/log/Makefile.in b/src/elementaryFunctions/log/Makefile.in index d99ff7b9..566df853 100644 --- a/src/elementaryFunctions/log/Makefile.in +++ b/src/elementaryFunctions/log/Makefile.in @@ -70,6 +70,7 @@ am__DEPENDENCIES_1 = $(top_builddir)/type/libDoubleComplex.la \ $(top_builddir)/elementaryFunctions/log/libLog.la \ $(top_builddir)/elementaryFunctions/sqrt/libSqrt.la \ $(top_builddir)/elementaryFunctions/log1p/libLog1p.la \ + $(top_builddir)/elementaryFunctions/lnp1m1/libLnp1m1.la \ $(top_builddir)/auxiliaryFunctions/abs/libAbs.la \ $(top_builddir)/auxiliaryFunctions/pythag/libPythag.la testDoubleLog_DEPENDENCIES = $(am__DEPENDENCIES_1) @@ -241,6 +242,7 @@ check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ $(top_builddir)/elementaryFunctions/log/libLog.la \ $(top_builddir)/elementaryFunctions/sqrt/libSqrt.la \ $(top_builddir)/elementaryFunctions/log1p/libLog1p.la \ + $(top_builddir)/elementaryFunctions/lnp1m1/libLnp1m1.la \ $(top_builddir)/auxiliaryFunctions/abs/libAbs.la \ $(top_builddir)/auxiliaryFunctions/pythag/libPythag.la \ @LIBMATH@ diff --git a/src/elementaryFunctions/log/testDoubleLog.c b/src/elementaryFunctions/log/testDoubleLog.c index 92c803e8..2f0c75b0 100644 --- a/src/elementaryFunctions/log/testDoubleLog.c +++ b/src/elementaryFunctions/log/testDoubleLog.c @@ -10,6 +10,8 @@ * */ +#include <assert.h> +#include <math.h> #include "testLog.h" void dlogsTest(void) { @@ -20,18 +22,27 @@ void dlogsTest(void) { while (value <= maxValue) { printf("dlogs(%e) = %e\n", value, dlogs(value)); + assert(dlogs(value) == log(value)); value += increment; } } void zlogsTest(void) { + doubleComplex z; doubleComplex result; + double real_z = 0; + double imag_z = 1; + double increment = 1e-3; printf(">> Complex Double scalar\n"); - result = zlogs(DoubleComplex(-0.1, 0)); - printf("dlogs(-0.1) = %e + %e I \n", zreals(result), zimags(result)); - result = zlogs(DoubleComplex(0, 0)); - printf("dlogs(-0.1) = %e + %e I \n", zreals(result), zimags(result)); + while (imag_z > 0) + { + z = DoubleComplex(real_z, imag_z); + result = zlogs(z); + printf("dlogs(%e + %e I) = %e + %e I \n", real_z, imag_z, zreals(result), zimags(result)); + real_z += increment; + imag_z -= increment; + } } int testLog(void) { |