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:
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.
status fixcommited
done
Applied the patches, thank you.
commit b90e13dea92ee66 f06f66baf17c3e3 e23c89575f
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>