Skip to content

Commit

Permalink
Make takfp benchmark work with OpenDylan
Browse files Browse the repository at this point in the history
  • Loading branch information
abeaumont committed Mar 19, 2013
1 parent 72fdb66 commit 83ff28d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.rst
Expand Up @@ -15,18 +15,18 @@ In general, we want each example to be one file (if possible).
TODO
----

* ``fasta``, ``pidigits``, ``spellcheck``, ``takfp``, ``wc`` and ``wordfreq``
* ``fasta``, ``pidigits``, ``spellcheck``, ``wc`` and ``wordfreq``
have to be converted from GD supported single-file format to a dual-file
format compilable under OpenDylan.
* ``binary-trees``, ``fannkuch``, ``fasta``, ``fibonacci``, ``harmonic``,
``mandelbrot``, ``nestedloop`` and ``strcat`` should provide a default
command line argument value.
``mandelbrot``, ``nestedloop``, ``strcat`` and ``takfp`` should provide a
default command line argument value.
* ``nsieve`` provides an invalid default and should check for valid argument.
* ``nsieve`` and ``sieve`` benchmarks don't seem to work properly.
* ``fasta`` benchmark generates invalid output.
* ``k-nucleotide``, ``n-body`` and ``spectralnorm`` benchmarks don't provide exactly
expected output, due to lack of precision configuration support in the
control-string of ``format-out``.
* ``k-nucleotide``, ``n-body``, ``spectralnorm`` and ``takfp`` benchmarks
don't provide exactly expected output, due to lack of precision
configuration support in the control-string of ``format-out``.
* ``moments`` benchmark doesn't work due to lack of support for ``string-to-float``.
* ``pidigits`` benchmark doesn't work due to lack of extended integer support.
* Many benchmarks can still be optimized.
15 changes: 14 additions & 1 deletion takfp.dylan
@@ -1,5 +1,15 @@
module: takfp
define library takfp
use common-dylan;
use io;
end library;

define module takfp
use common-dylan, exclude: { format-to-string };
use format-out;
end module;

define constant <fp> = <single-float>;

begin
Expand All @@ -13,6 +23,9 @@ begin
end method;

let n = application-arguments()[0].string-to-integer;
format-out("%.1f\n", tak(3.0s0 * n, 2.0s0 * n, 1.0s0 * n));
// FIXME: "%.1f" is not supported as control-string, as a result 7 decimal
// digits are printed instead of 1.
//format-out("%.1f\n", tak(3.0s0 * n, 2.0s0 * n, 1.0s0 * n));
format-out("%=\n", tak(3.0s0 * n, 2.0s0 * n, 1.0s0 * n));
end;

3 changes: 3 additions & 0 deletions takfp.lid
@@ -0,0 +1,3 @@
library: takfp
executable: takfp
files: takfp

0 comments on commit 83ff28d

Please sign in to comment.