FPBench Logo

FPBench Tools

Interpreters and exporters for FPCore

FPBench includes an FPCore reference interpreter and an exporter to C.

The FPCore reference interpreter

The reference interpreter is located in the tools/ directory of the FPBench codebase, and can be run with:

racket tools/fpcore.rkt arguments ... < file.fpcore

The arguments in this case are real numbers using the standard floating-point number syntax. For example, running:

racket tools/fpcore.rkt 1.0 2.0
(FPCore (x y) (+ x y))

produces output 3.0.

Export to C

The FPCore exporter to C is located in the tools/ directory of the FPBench codebase, and can be run with:

racket tools/core2c.rkt < file.fpcore > file.c

The arguments in this case are real numbers using the standard floating-point number syntax. For example, running:

racket tools/core2c.rkt > example.c
(FPCore (x y) (+ x y))

produces the C code:

#include <math.h>

double ex0(double x, double y) {
	return (x + y);
}