Comment 2 for bug 741564

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote : [Christophe Rhodes] [Sbcl-commits] master: Make EXPT use double-precision throughout in more cases

 status fixcommited
 done

Applied the patches, thank you.

commit b90e13dea92ee66f06f66baf17c3e3e23c89575f
Author: Lutz Euler <email address hidden>
Date: Fri Jul 1 18:06:17 2011 +0200

    Make EXPT use double-precision throughout in more cases

    lp#741564 notes that a Maxima test case fails because the result of
    (EXPT <fixnum> <(complex double)>) is much less precise than expected.
    This is caused by EXPT using an intermediate single-float value here.

    This behaviour actually occurs for all the following combinations
    of argument types:

      (EXPT <(or rational single-float)> <(complex double-float)>)

      (EXPT <(or (complex rational) (complex single-float))>
            <(or (complex double-float) double-float)>)

    In all these cases the first step EXPT does is to calculate (LOG BASE)
    in single precision.

    Refine the type dispatch clauses in EXPT to separate these cases
    and coerce BASE to DOUBLE-FLOAT or (COMPLEX DOUBLE-FLOAT) there,
    as appropriate, before applying LOG. Add tests.

    Fixes lp#741564.

    Signed-off-by: Christophe Rhodes <email address hidden>