Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Commit [b90e13] Maximize Restore History

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 <csr21@cantab.net>

Lutz Euler Lutz Euler 2011-07-01

Christophe Rhodes Christophe Rhodes 2011-11-20

changed src/code/irrat.lisp
changed tests/arith.pure.lisp
changed NEWS
src/code/irrat.lisp Diff Switch to side-by-side view
Loading...
tests/arith.pure.lisp Diff Switch to side-by-side view
Loading...
NEWS Diff Switch to side-by-side view
Loading...