Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Timing in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74745] Re: Timing in Mathematica
  • From: "dimitris" <dimmechan at yahoo.com>
  • Date: Tue, 3 Apr 2007 00:29:59 -0400 (EDT)
  • References: <euqnqt$8br$1@smc.vnet.net>

It is very easy.

Let for example

foo = {x^n, Cos[x], Log[x]/x, Log[Sin[x]^2]*Tan[x], BesselJ[n, x],
(2*x)/((x + 1)*(x^3 + 3*x^2 + 2*x + 1))}
{x^n, Cos[x], Log[x]/x, Log[Sin[x]^2]*Tan[x], BesselJ[n, x], (2*x)/((1
+ x)*(1 + 2*x + 3*x^2 + x^3))}

Then

InputForm[(Timing[Integrate[#1, x]] & ) /@ foo]
{{0.031*Second, x^(1 + n)/(1 + n)}, {0.015999999999999986*Second,
Sin[x]}, {0.*Second, Log[x]^2/2},
  {0.9530000000000001*Second, Log[Sec[x/2]^2]^2 + 2*Log[Sec[x/
2]^2]*Log[(Cos[x]*Sec[x/2]^2)/2] +
    Log[Sec[x/2]^2]*Log[Sin[x]^2] - 2*Log[Sec[x/2]^2]*Log[-1 + Tan[x/
2]^2] - Log[Sin[x]^2]*Log[-1 + Tan[x/2]^2] +
    Log[Tan[x/2]^2]*Log[-1 + Tan[x/2]^2] + 2*PolyLog[2, Sec[x/2]^2/2]
+ PolyLog[2, Cos[x]*Sec[x/2]^2] +
    PolyLog[2, -Tan[x/2]^2]}, {0.030999999999999917*Second, 2^(-1 -
n)*x^(1 + n)*Gamma[(1 + n)/2]*
    HypergeometricPFQRegularized[{(1 + n)/2}, {1 + n, (3 + n)/2}, -
(x^2/4)]},
  {0.016000000000000014*Second, 2*(-Log[1 + x] + RootSum[1 + 2*#1 +
3*#1^2 + #1^3 & ,
      (Log[x - #1] + 2*Log[x - #1]*#1 + Log[x - #1]*#1^2)/(2 + 6*#1 +
3*#1^2) & ])}}


Regards
Dimitris

=CF/=C7 amitsoni.1984 at gmail.com =DD=E3=F1=E1=F8=E5:

> Hi,
>
> I am using Timing[.......] to calculate the time taken by an
> expression in Mathematica. But it is not showing values below 0.01
> seconds. For values below 0.01s it just shows 0. Second
>
> Is it possible to get the value of time lower than 0.01s by somehow
> lowering the least count. I am using Mathematica 5.2 on Windows. I was
> getting lower values of time on Mathematica(5.2) on a Linux computer.
>
> Thank you,
> Amit



  • Prev by Date: Re: Simplification with Integers assumption
  • Next by Date: Re: Closing All Input Cells at Once- KB shortcuts
  • Previous by thread: Re: Timing in Mathematica
  • Next by thread: Re: Timing in Mathematica