From: Michael Pujos
Subject: trigonometric functions problems
Date: 
Message-ID: <va93dp7m8zt.fsf@miraval.emi.u-bordeaux.fr>
I always have this note with trigo functions. Anyone know how to
interpret it and how to remove the note ?


In: DEFUN ROTATE
  (COS-SF ANGLE)
--> COERCE 
==>
  (COS ANGLE)
Note: Unable to avoid inline argument range check
because the argument range (SINGLE-FLOAT) was not within 2^64

-- 
Il fait bo

From: Raymond Toy
Subject: Re: trigonometric functions problems
Date: 
Message-ID: <4nu2hncaxu.fsf@rtp.ericsson.se>
>>>>> "Michael" == Michael Pujos <·····@miraval.emi.u-bordeaux.fr> writes:

    Michael> I always have this note with trigo functions. Anyone know how to
    Michael> interpret it and how to remove the note ?


    Michael> In: DEFUN ROTATE
    Michael>   (COS-SF ANGLE)
    --> COERCE 
    Michael> ==>
    Michael>   (COS ANGLE)
    Michael> Note: Unable to avoid inline argument range check
    Michael> because the argument range (SINGLE-FLOAT) was not within 2^64

Why do you care?

This note, which only happens for the x86 port of CMUCL, says that it
can't prove that |ANGLE| < 2^64.  If it could, CMUCL would use an FP
instruction or two to compute it.  If it can't, it calls out to the
cos function to compute it, presumably more carefully and
accurately.[1]

So if you really want to get rid of this note, put something like

(declare (type (single-float <low-limit> <high-limit>) angle))

where <low-limit> and <high-limit> are the appropriate limits of ANGLE
in your code.

Ray

Footnotes: 
[1]  The last time I looked, that was not the case, but that may have
     changed.
From: Tim Bradshaw
Subject: Re: trigonometric functions problems
Date: 
Message-ID: <ey3aejf2bbz.fsf@cley.com>
* Raymond Toy wrote:

> Why do you care?

That's a silly question: Because it's important that things compile
without a vast slew of warnings from the compiler, so when you do get
warnings you know to listen to them!

--tim
From: Raymond Toy
Subject: Re: trigonometric functions problems
Date: 
Message-ID: <4ng0t6ddwm.fsf@rtp.ericsson.se>
>>>>> "Tim" == Tim Bradshaw <···@cley.com> writes:

    Tim> * Raymond Toy wrote:
    >> Why do you care?

    Tim> That's a silly question: Because it's important that things compile
    Tim> without a vast slew of warnings from the compiler, so when you do get
    Tim> warnings you know to listen to them!

Well, I meant this one warning in particular.

In general, when I'm compiling for speed, I do listen to every
warning and remove them if it makes sense to do so, and if profiling
says this is the bottleneck.  If it's not a bottleneck, I usually
ignore the warnings unless they say the code is broken in some way.

So I agree with everything you've said.

Ray