Parent Directory | Revision Log
Links to HEAD: | (view) (annotate) |
Links to snapshot-2007-08: | (view) (annotate) |
Sticky Tag: |
Merge LOG2 and LOG2-DD into one function.
Fix trac ticket #8: 2-arg log function can't compute some logs. Extend LOG2 function to handle more cases, and make LOG call LOG2 appropriately, and add LOG2-DD to handle the double-double-float cases.
o Remove unused code in ABS for double-double-float o Implement ABS for complex double-double-floats.
Just add some comment about the routines implementing accurate sin, cos, tan.
Add better trig arg reduction via Sun's fdlibm. lisp/Config.ppc_darwin o Compile e_rem_pio2.c and k_rem_pio2.c code/irrat.lisp: o Update the arg reduction code to support ppc. We call out to the C sin, cos, and tan functions, after the argument has been accurately reduced.
Add the trig argument reduction routines from Sun's fdlibm so we can accurately reduce the arg and therefore compute the value of trig functions accurately. lisp/Config.linux_gencgc: o Compile e_rem_pio2.c and k_rem_pio2.c code/irrat.lisp: o Disable %sin, %cos, %tan functions. o Implement %sin, %cos, and %tan to call the fdlibm routine __ieee754_rem_pio2 to do argument reduction before calling the sin, cos, tan vops. compiler/x86/float.lisp: o Disable the vops for %sin, %cos, and %tan, so the Lisp code in irrat.lisp is used.
This large checkin merges the double-double float support to HEAD. The merge is from the tag "double-double-irrat-end". The double-double branch is now obsolete. The code should build without double-double support (tested on sparc) as well as build with double-double support (tested also on sparc).
Don't produce a continuable error in INTEXP, if we're raising 1 to some power. (Maxima does this sometimes, and it's annoying to have CMUCL stop for this.)
It seems we need kernel::%sqrt to be defined for sparc. It's used, sometimes, during constant folding in the compiler. (What else is missing?)
Fix some issues with two-arg log function. (log 17 10f0), (log 17f0 10), and (log 17 10) returned different single-float results. I think this is allowed by ANSI CL, but I think it's unfortunate. Therefore, try to apply float contagion to the arguments before computing the log function. Also, if both args are single-floats or rationals, we coerce them to double-floats before computing the result. This makes (log 17 10) = (log 17.0 10). There are other cases still to be considered.
ASIN and ACOS were getting errors when given NaN's. Check for that case and dispatch to the real-valued C functions in that case. This fixes some errors in the asin and acos tests from ieeefp-tests (at common-lisp.net).
CMUCL was computing the values of asin, acos, and atanh on the branch cuts on the real line incorrectly. This shows up when calling these functions with real-valued args, not complex. The problem was the computed values were not continuous with the quadrants specified by ANSI CL. Issue noted by Bruno Haible, cmucl-imp, 2004-10-11. See also some tests on cmucl-imp, 2004-10-19.
EXPT sometimes returned NaN when the power was 0 instead of 1. Make it return 1 (of the right type) in these cases. We still produce a FP trap, if enabled, though. Is that right?
Merge in 19a-branch fix for the atanh bug.
Fix some issues with the complex functions with signed zeroes. See comment for full details, but the issue is that Lisp says mixing a real and a complex requires converting the real to complex before doing the operation. But Kahan's algorithms assume that this doesn't happen, like z-1 should not be computed as z-(1+0*i). One place where this was wrong was for acos(2 +/- 0i). Kahan says acos(2+0i) is +0 - i*acosh(2) and acos(2-0i) is +0 + i*acosh(2). We had this backwards for the above reason. I think this was caused by the erroneous deftransforms for real op complex which were removed sometime ago, causing these function to compute the wrong thing.
Chrisophe Rhodes noted that (log 19/3) was losing precision. Fix that by calling log2 instead of log to compute the result.
Fix typo in computing log of rational where the numerator and denominator are different lengths. Should be log, not log2.
Was losing precision for (log x) when x is a rational near 1. Handle this better by using %log1p when needed. Problem noted by Christophe Rhodes.
Allow computation of log's of big integers that might not fit in a single-float or double-float. Thus (log (expt 2 32768) 2) will return 32768.0 instead of causing an error.
Give a better error message for atan when given an arg that isn't REAL in the two arg case.
o Fix the declaration bug in complex-log-scaled o Remove the old special function routines o Add logb-finite to help optimize the use of logb o Remove some unneeded declarations since the compiler is smarter now than when this was originally written. o Add inhibit-warnings to coerce-to-complex-type since their unavoidable. o The cores of some routines are compiled with speed 3 and space 0 to get some maybe-inline routines inlined.
Change most PROCLAIMs to DECLAIMs.
Use only one of :sparc-v7, :sparc-v8, or :sparc-v9 when building to get the desired features. From Raymond Toy.
Use the fsqrt VOP on the SPARC V7 and up.
Kahan says (sqrt -0.0) returns -0.0.
Now have an inline verion of %log1p for the x86 port so don't need to call the C library version.
Fix float-trapping-nan-p which was returning T for quiet NaN and Nil of trapping NaN.
Return #C(0.0 0.0) rather than -0.0 for (sqrt -0.0).
Improved support for (complex single-float) and (complex double-float) types. Adds storage classes to the backend for these so they can be stored in registers or on the stack without consing; new primitive types etc. Also adds (simple-array (complex {single,double}-float)) array types to avoid consing and speed vectors operations. All these changes are conditional on the :complex-float feature. More work is needed to exploit these changes: improving the type dispatch in the various function; maybe compiler transforms or more VOPs to handle common functions inline.
Check the accrued exceptions (sticky-bits) within with-float-traps-masked; more reliable than the exceptions-byte on many ports.
New implementation of real-expt for the expt function; fixes bugs and improves the handling of special case.
New macro WITH-FLOAT-TRAPS-MASKED to execute a body of code with some floating point exceptions disabled. It avoids the overhead of {set,get}-floating-point-modes, saving some consing and generally giving smaller code. Exploit this new macro where {set,get}-floating-point-modes has been used.
In complex-tanh change tan -> %tan to avoid a compiler warning on the x86 port.
Inline scalb and better declare its 'n' argument so the compiler can generate inline code for this operation. Few other little cleanups.
initial post 1.3.7 merge
Werkowskis source kit 1.03.7
Merge fix from Douglas Crosher to make acosh and atanh return the right thing.
Fix headed boilerplate.
Removed %exp1m, %log1p, and %cbrt because nobody used them, and HPUX doens't have them. Added #+hpux defuns for %asinh, %acosh, and %atanh because HPUX doesn't have them either, but we want to use them.
Now that +0.0 and -0.0 are no longer eql, fixed atan to deal with them correctly.
Fixed atan to handle zeros better. It still isn't right because the compiler thinks that +0.0d0 and -0.0d0 are similar as a constant.
Move ISQRT to numbers.lisp
Merged new-alien changes onto trunk.
Fixed EXPT to deal with SINGLE-FLOAT x SINGLE-FLOAT arg type combination.
Fixed EXPT to handle double-float x ratio combination.
New file header with RCS header FILE-COMMENT.
Fixed EXPT to correctly return complex results for negative numbers raised to fractional powers.
Made the C callout stubs for the math library routines be inline, since the C call is pretty compact.
Made all the C stubs be exported and maybe-inline. Put the generic functions under (space 0) so that the stubs will be inline expanded. Changed some uses of INTEGER-DECODE-FLOAT to FLOAT-SIGN, since only the sign was being used. Note that EXPT is broken, since (expt -2.0 0.5) should be a complex, not 0.
Wrote the rest of the trigonometric functions and fixed the complex case of several others.
Moved phase, cis, and abs here from numbers. Commented out defconstant of e, because other code uses e as a local. I guess single letter constants are kind of stupid.
Initial revision
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.
ViewVC Help | |
Powered by ViewVC 1.1.5 |