On Sun, Apr 10, 2011 at 12:55:58PM +0200, David Allsopp wrote:
> Bob Tennent wrote:
> 
> > It should be functionally identical to musixflx.c (up to round-off error).
> 
> Is this just a throw-away line or are there actual systemic differences in
> the precision of the floating point variables used? Floating point
> calculations are a CPU function - it would be beneficial if the results
> strived to be *identical* on the same architecture (a guarantee which TeX
> provides). 
See Remark 1 below.

>I'm not terribly familiar with Lua, but I would anticipate that C will be more
>flexible here - both scripts should use the same floating point representation
>for calculations which will eliminate all sources of non-algorithmic rounding
>error (if necessary, the C script could be changed).
See Remark 2 below.

> Are there options available for producing native executables from Lua scripts
> on at least the major three platforms? If there are, then it would seem an
> excellent time to look towards dumping the C script entirely - the ability to
> produce a native executable would mean that anyone using MusiXTeX on a system
> which doesn't have LuaTeX instead would not have to install a Lua interpreter
> so it wouldn't make the installation of LuaTeX any harder.
See Remark 3 below.

1. Identical results on the same architecture requires switching off *all*
    optimization in the C compiler.  Not even a widely disseminated
    software package such as BLAS (Basic Linear Algebra Subroutines)
    promises identical runs nowadays, even for two runs on the same
    machine.  One should not write software that behaves qualitatively 
    differently depending on what happens in the sixteenth decimal place.

2. Lua is written in C; in fact, the C code for a customized version of
    the Lua interpreter is compiled and linked into the LuaTeX 
    executable.  Lua's "number" and C's "double" is one and the same.

3. There is a strong possibility that LuaTeX will become the default
    TeX engine in most distributions.  I.e. when you type latex,
    or etex, or pdftex, or luatex, in all cases the actual executable
    will be luatex, although what it actually does will depend on which
    of the four names you used.  (If you type tex, you should still get
    an executable generated from Knuth's cweb source, by the terms of
    his licence.)  I.e. if you have TeX, you will have luatex without
    lifting a finger.

4. I can find only one place where musixflx may possibly, even though 
    he probability is remote, be roundoff-sensitive:
        If the overhang is less than half the barlength, include the 
        latest bar in the line, and shrink the line accordingly.
    It is possible (though the probability is less than that of my winning
    the lottery if I buy only one ticket) that the overhang on musixflx.c
    could be 0.4999999999999999 and on musixflx.lua 0.5000000000000000,
    or vice versa.
    I suspect that on PMX-generated scores no decision on line breaking
    is left to musixflx, so this conditional should not be encountered
    in that case.

Dirk
-------------------------------
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music

Reply via email to