Re: A zillion times slower in version 5
- To: mathgroup at smc.vnet.net
- Subject: [mg46427] Re: A zillion times slower in version 5
- From: "Joshua A. Solomon" <J.A.Solomon at city.ac.uk>
- Date: Tue, 17 Feb 2004 07:46:45 -0500 (EST)
- References: <c0k3sd$8kn$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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
>