711 reputation
314
bio website
location
age
visits member for 2 years, 7 months
seen Aug 11 at 9:14

Oct
25
comment Is Abs[z]^2 a bad way to calculate the square modulus of z?
Awesome analysis! By slightly adjusting your code, I plotted the difference in the error between the functions Abs[z]^2 and Re[z]^2+Im[z]^2 when they are applied to the same argument, and indeed for most of the points you used Abs[z]^2 has a smaller error! This is really weird and counterintuitive to me, but at least now I know.
Oct
25
comment Why doesn't Mathematica simplify a square root of an expression that equals a square of a positive real?
Since I am trying to simplify a very long expression that contains multiple versions of the expression I'm asking about, and I don't want to go through my long expression manually.
Oct
25
comment Is Abs[z]^2 a bad way to calculate the square modulus of z?
Please do feel free to edit my posts, this was never an issue for me! (I corrected the mistakes, thank you :).
Oct
25
revised Is Abs[z]^2 a bad way to calculate the square modulus of z?
corrected spelling
Oct
25
asked Is Abs[z]^2 a bad way to calculate the square modulus of z?
Oct
25
comment Why doesn't Mathematica simplify a square root of an expression that equals a square of a positive real?
This is true, but why is the first simplification so hard that Mathematica doesn't find it? And is there a way to make it find it?
Oct
24
asked Why doesn't Mathematica simplify a square root of an expression that equals a square of a positive real?
Sep
11
awarded  Caucus
Aug
30
comment Probability and distribution from actual data
Related: scicomp.stackexchange.com/questions/267/…
Aug
14
answered Evaluation of self-defined functions
Jun
25
comment Calculating a limit with a result that is discontinuous in the parameters
@belisarius - Indeed in the example I gave in the question the different assumptions are equivalent to different directions. However, how about this example: 1/(1 + Exp[ϵ/T]) + 1/(1 + Exp[(ϵ - 1)/T]). Now there are different results for ϵ<0, 0<ϵ<1 and 1<ϵ, and I don't see how your comment applies here.
Jun
25
comment Calculating a limit with a result that is discontinuous in the parameters
@J.M. - You are correct, I will be satisfied, for example, with a Piecewise function as a result. BTW, why did you remove the limits tag from the question?
Jun
25
revised Calculating a limit with a result that is discontinuous in the parameters
add the assumption that ϵ is real
Jun
25
comment Calculating a limit with a result that is discontinuous in the parameters
@J.M. - Good point, however trying to use the assumption ϵ ∈ Reals still leaves the limit unevaluated (I edited the question to add this).
Jun
25
asked Calculating a limit with a result that is discontinuous in the parameters
Jun
6
comment Plotting the components of a function that returns a list in different colors without redundant evaluations of the function
You're right @Mr.Wizard, in your example memoizing saves evaluations, but it does not save two thirds of the evaluations (I got 715 instead of 953). Of course we can't expect exactly two thirds, since there may be some overhead, by I think that even asymptotically we won't get two thirds.
Jun
6
comment Plotting the components of a function that returns a list in different colors without redundant evaluations of the function
From @whuber's comment, I learned that memoizing doesn't actually save function evaluations.
Jun
6
comment Plotting the components of a function that returns a list in different colors without redundant evaluations of the function
You are correct. However, if I still want to plot all the components of f with a number of evaluations more close to 157, I need to use the approach described in @Mr.Wizard's answer.
Jun
6
accepted Plotting the components of a function that returns a list in different colors without redundant evaluations of the function
Jun
6
comment Plotting the components of a function that returns a list in different colors without redundant evaluations of the function
@whuber: My thoughts exactly. It seems that there is no way to make MMA's adaptive algorithm take into account all the values of a certain component that were already calculated as a result of evaluating f for the other components, and that's a shame. If evaluating f three (or more) times the necessary amount is more costly than the evaluations that the adaptive algorithm saves us (which is almost always the case for functions that take reasonably long to evaluate), this answer seems to be the best workaround. Accepted.