MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

clip

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115548] clip
  • From: oliver <oliver.knill at gmail.com>
  • Date: Fri, 14 Jan 2011 06:18:23 -0500 (EST)

Just add a few more 0 to the argument and the accuracy will increase.
If you still suspicious, build your own Clip function.
Clip1[x_]:=Sign[x]*Min[Abs[x],1]
will do and refers to basic functions and works better.
Strangely enough, Clip1 has no problem with your example, but
it has also hick-ups with numbers smaller than 1, if not more 0 are
given. Try this out:

Clip[1.00000000000000036]
Clip[1.000000000000000360000]
Clip1[x_]:=Sign[x]*Min[Abs[x],1]
Clip1[1.00000000000000036]
Clip1[0.9999999999999966]
Clip1[0.9999999999999966000]

But there are some fundamental problems with accuracy. In the second
last example, it should
render the result at least in the same accuracy. All involved function
Sign, Min and Abs are
unproblematic with respect to accuracy.



  • Prev by Date: fill in harberger triangle
  • Next by Date: avoiding non-machine numbers
  • Previous by thread: Re: fill in harberger triangle
  • Next by thread: Re: clip