From 4a7460f45c1b578b20b7eb03cd7774ebbd35fc46 Mon Sep 17 00:00:00 2001 From: "S. Gilles" Date: Thu, 1 Mar 2018 09:57:49 -0500 Subject: [PATCH] update documentation, tweak mpfr constants With this setup, on my i5 desktop, checker/obj/checker -e -s -f sin takes a hair under 200 minutes of wall time. This is acceptable for starting real work. --- .gitignore | 1 + README | 29 ++++++++++++++++++++--------- impl-mpfr/impl-mpfr.c | 6 +++--- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 2423faa..40c15bb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ impl-* core obj +*.log diff --git a/README b/README index 125e9c5..b92590a 100644 --- a/README +++ b/README @@ -11,32 +11,42 @@ There are byte sequences f(x0), f(x1), ..., f(xN). - A checker program. It is responsible for starting all the - impl-XYZs, feeding them all the x values, and then making sure - they return equivalent f(x) values. If two impls disagree, the + impl-XYZs, feeding them all the xi values, and then making sure + they return equivalent f(xi) values. If two impls disagree, the checker prints out a diagnostic to stdout. To compile everything, go into each directory and run `make' or `mbld' or whatever. If you like, you can run `make' in the main directory. -To test a bunch of random values, do something like: +To test a bunch of random values with single precision, on the sine +function, do something like: - checker/obj/checker -s sin -r + checker/obj/checker -s -f sin + +To use a specific seed for the random values (by default the seed +is the current time): + + checker/obj/checker -s -f sin -r 12345 To exhaustively test every possible single-precision floating point input: - checker/obj/checker -s cos -e + checker/obj/checker -s -f sin -e To use double-precision instead (it's not recommended to attempt to exhaust double-precision): - checker/obj/checker -d -f exp1m -r + checker/obj/checker -d -f exp1m -To figure out what functions are supported: +To figure out what functions are supported (legal values for -f): checker/obj/checker -l +To see all options: + + checker/obj/checker -h + ---- On the internal side, an impl program is invoked via: @@ -46,7 +56,7 @@ On the internal side, an impl program is invoked via: where -s and -d specify single/double precision, and num_inputs describes how much data will be sent in and out for each iteration. Different functions may take different numbers of arguments (e.g. -sin and atan2). +sin vs. atan2). num_inputs is entirely for speed concerns: it is desirable to exhaustively test single-precision inputs. However, if values are @@ -56,7 +66,8 @@ reading, writing, and waiting for new input. The checker has to have some way of finding the impl programs. It does this in the dumbest way possible: walking through all files in "." and checking if they are 1) executable and 2) the name starts -with "impl-". +with "impl-". Therefore, you should probably run the checker from +the root directory. Since multi-byte data is written and read over channels, endian-ness is a concern. This was written and run on little-endian machines. diff --git a/impl-mpfr/impl-mpfr.c b/impl-mpfr/impl-mpfr.c index 46a20c3..898af5c 100644 --- a/impl-mpfr/impl-mpfr.c +++ b/impl-mpfr/impl-mpfr.c @@ -152,9 +152,9 @@ void io_loop(action a, size_t n) _exit(1); } - /* I'm pretty sure 110 precision is enough */ - mpfr_init2(x, 110); - mpfr_init2(y, 110); + /* I'm pretty sure 53 precision would be enough */ + mpfr_init2(x, 75); + mpfr_init2(y, 75); while (1) { read_buf(in_buf, in_sz * n); -- 2.11.4.GIT