Changeset 1011
- Timestamp:
- Oct 6, 2011, 9:18:17 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.gitignore
r985 r1011 61 61 test/sandbox 62 62 test/math/pi 63 test/math/poly 63 64 test/math/remez 64 65 tools/make-font -
trunk/test/math/Makefile.am
r1009 r1011 4 4 all-local: $(noinst_PROGRAMS) 5 5 test x$(MAKE_FSELF) = xno || make_fself pi$(EXEEXT) pi.self 6 test x$(MAKE_FSELF) = xno || make_fself poly$(EXEEXT) pi.self 6 7 test x$(MAKE_FSELF) = xno || make_fself remez$(EXEEXT) remez.self 7 8 … … 10 11 $(noinst_PROGRAMS:%$(EXEEXT)=%.exe) 11 12 12 noinst_PROGRAMS = pi remez13 noinst_PROGRAMS = pi poly remez 13 14 14 15 pi_SOURCES = pi.cpp … … 17 18 pi_DEPENDENCIES = $(top_builddir)/src/liblol.a 18 19 20 poly_SOURCES = poly.cpp 21 poly_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ 22 poly_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@ 23 poly_DEPENDENCIES = $(top_builddir)/src/liblol.a 24 19 25 remez_SOURCES = remez.cpp remez-matrix.h remez-solver.h 20 26 remez_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ -
trunk/test/math/remez.cpp
r1010 r1011 27 27 static real myfun(real const &x) 28 28 { 29 static real const a0 = real::R_1; 30 static real const a1 = real(-11184811) >> 26; 31 static real const b1 = real(-1) / real(6); 32 static real const b2 = real(1) / real(120); 29 33 real y = sqrt(x); 30 34 if (!y) 31 return real::R_PI_2;32 return sin(real::R_PI_2 * y) / y;35 return b2; 36 return ((sin(y) / y - a0) / x - a1) / x; 33 37 } 34 38 … … 40 44 int main(int argc, char **argv) 41 45 { 42 RemezSolver<4> solver; 43 solver.Run(0, 1, myfun, myfun, 15); 46 RemezSolver<3> solver; 47 //solver.Run(0, 1, myfun, myfun, 15); 48 solver.Run(0, real::R_PI * real::R_PI >> 2, myfun, myfun, 15); 44 49 //solver.Run(-1, 1, myfun, myfun, 15); 45 50 //solver.Run(0, real::R_PI * real::R_PI >> 4, myfun, myfun, 15);
Note: See TracChangeset
for help on using the changeset viewer.