summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjofret2008-05-23 13:21:36 +0000
committerjofret2008-05-23 13:21:36 +0000
commitf750add3f85fa7a942d5356d1150298fcd2ae470 (patch)
tree7a40ad0a5caafd9852288cd8a9408eb5b9de8861 /src
parent1fb34f61c9770d2bdd217c0f10fa54c4395022a9 (diff)
downloadscilab2c-f750add3f85fa7a942d5356d1150298fcd2ae470.tar.gz
scilab2c-f750add3f85fa7a942d5356d1150298fcd2ae470.tar.bz2
scilab2c-f750add3f85fa7a942d5356d1150298fcd2ae470.zip
Correct dependancies
Diffstat (limited to 'src')
-rw-r--r--src/elementaryFunctions/log1p/Makefile.am3
-rw-r--r--src/elementaryFunctions/log1p/Makefile.in8
-rw-r--r--src/elementaryFunctions/log1p/dlog1ps.c23
-rw-r--r--src/elementaryFunctions/log1p/testDoubleLog1p.c3
4 files changed, 34 insertions, 3 deletions
diff --git a/src/elementaryFunctions/log1p/Makefile.am b/src/elementaryFunctions/log1p/Makefile.am
index 21cfab57..d5712aaf 100644
--- a/src/elementaryFunctions/log1p/Makefile.am
+++ b/src/elementaryFunctions/log1p/Makefile.am
@@ -39,8 +39,11 @@ 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/log1p/libLog1p.la \
+ $(top_builddir)/auxiliaryFunctions/pythag/libPythag.la \
$(top_builddir)/elementaryFunctions/log/libLog.la \
+ $(top_builddir)/elementaryFunctions/sqrt/libSqrt.la \
@LIBMATH@
check_PROGRAMS = testFloatLog1p testDoubleLog1p
diff --git a/src/elementaryFunctions/log1p/Makefile.in b/src/elementaryFunctions/log1p/Makefile.in
index 1c27ad08..e48893db 100644
--- a/src/elementaryFunctions/log1p/Makefile.in
+++ b/src/elementaryFunctions/log1p/Makefile.in
@@ -68,8 +68,11 @@ am_testDoubleLog1p_OBJECTS = \
testDoubleLog1p_OBJECTS = $(am_testDoubleLog1p_OBJECTS)
am__DEPENDENCIES_1 = $(top_builddir)/type/libDoubleComplex.la \
$(top_builddir)/type/libFloatComplex.la \
+ $(top_builddir)/lib/lapack/libscilapack.la \
$(top_builddir)/elementaryFunctions/log1p/libLog1p.la \
- $(top_builddir)/elementaryFunctions/log/libLog.la
+ $(top_builddir)/auxiliaryFunctions/pythag/libPythag.la \
+ $(top_builddir)/elementaryFunctions/log/libLog.la \
+ $(top_builddir)/elementaryFunctions/sqrt/libSqrt.la
testDoubleLog1p_DEPENDENCIES = $(am__DEPENDENCIES_1)
testDoubleLog1p_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleLog1p_CFLAGS) \
@@ -234,8 +237,11 @@ 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/log1p/libLog1p.la \
+ $(top_builddir)/auxiliaryFunctions/pythag/libPythag.la \
$(top_builddir)/elementaryFunctions/log/libLog.la \
+ $(top_builddir)/elementaryFunctions/sqrt/libSqrt.la \
@LIBMATH@
diff --git a/src/elementaryFunctions/log1p/dlog1ps.c b/src/elementaryFunctions/log1p/dlog1ps.c
index 741b1844..8275ea57 100644
--- a/src/elementaryFunctions/log1p/dlog1ps.c
+++ b/src/elementaryFunctions/log1p/dlog1ps.c
@@ -10,9 +10,28 @@
*
*/
-#include <math.h>
#include "log1p.h"
+#include "log.h"
double dlog1ps(double in) {
- return (log1p(in));
+ static double A = -1.0/3.0;
+ static double B = 0.5;
+
+ if(in < -1)
+ {/* got NaN */
+ return (in - in) / (in - in); /* NaN */
+ }
+ else if(A <= in && in <= B)
+ {/* use the function log((1+g)/(1-g)) with g = x/(x + 2) */
+ double Temp = 0;
+ Temp = in / ( in + 2);
+ /*
+return lnp1m1(Temp);
+ */
+ return 0;
+ }
+ else
+ {/* use the standard formula */
+ return dlogs(in + 1);
+ }
}
diff --git a/src/elementaryFunctions/log1p/testDoubleLog1p.c b/src/elementaryFunctions/log1p/testDoubleLog1p.c
index b9b1ca09..97d60996 100644
--- a/src/elementaryFunctions/log1p/testDoubleLog1p.c
+++ b/src/elementaryFunctions/log1p/testDoubleLog1p.c
@@ -16,6 +16,9 @@ void dlog1psTest(void) {
/* FIXME : Implement some test here ... */
printf(">> Double scalar\n");
printf("dlog1ps(0) = %e\n", dlog1ps((double) 0));
+ printf("dlog1ps(-1) = %e\n", dlog1ps(-1.0));
+ printf("dlog1ps(-2) = %e\n", dlog1ps(-2.0));
+ printf("dlog1ps(-0.9) = %e\n", dlog1ps(-0.9));
}
int testLog1p(void) {