MathGroup Archive 2004

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

Search the Archive

Re: A zillion times slower in version 5


David Whitoff, at Wolfram, replies:

Evaluate $MaxPrecision=10^6 to restore Version 4 behavior.

Otherwise 1-Exp[-(10^((x-a)/20))^b] will compute a result
with a precision of about 5x10^8

Another possible solution is to rearrange the calculation
so that subtracting an astonomically tiny quantity from
an exact number doesn't come up, such as by using

bug[x_, {a_, b_, c_, d_}] :=
             c + (1 - c - d)(1.0 - Exp[-(10^((x - a)/20))^b])

> In[1]:= bug[x_,{a_,b_,c_,d_}]:=c+(1-c-d)(1-Exp[-(10^((x-a)/20))^b])
>
> Using Mathematica 4...
>
> In[2]:= {$Version, $ReleaseNumber}
> Out[2]:= {4.1 for Mac OS X (November 5, 2001),5}
>
> In[3]:= Timing[bug[-8,{-60,3.5,0.5,0.01}]]
> Out[3]:= {0. Second,0.99}
>
> Using Mathematica 5...
>
> In[2]:= {$Version, $ReleaseNumber}
> Out[2]:= {5.0 for Mac OS X (June 10, 2003),0}
>
> In[3]:= Timing[bug[-8,{-60,3.5,0.5,0.01}]]
> Out[3]:= {6.21 Second,0.99}
>
> Six seconds! What is it doing? What is the best way to streamline this?
>
> js
>



  • Prev by Date: Re:
  • Next by Date: Re: output in NMinimize on each step?
  • Previous by thread: Re: A zillion times slower in version 5
  • Next by thread: Understanding Flatten