Joe
Reputation
726
Next privilege 1,000 Rep.
See vote count; VIP usercard
Badges
4 15
Newest
Impact
~8k people reached

• 0 posts edited
• 1 helpful flag
• 61 votes cast

# 81 Actions

 Oct31 comment Why doesn't Mathematica simplify a square root of an expression that equals a square of a positive real? Nice! Then I just add /.{r -> Sqrt[x^2 + y^2], t -> ArcTan[x, y]} and simplify again and I have the simplified expression in my original variables. On the other hand, I have this expression appearing multiple times with different variables instead of x and y, and I'm not sure if your approach can be generalized to such a case. Oct25 accepted Is Abs[z]^2 a bad way to calculate the square modulus of z? Oct25 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. Oct25 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. Oct25 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 :). Oct25 revised Is Abs[z]^2 a bad way to calculate the square modulus of z? corrected spelling Oct25 asked Is Abs[z]^2 a bad way to calculate the square modulus of z? Oct25 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? Oct24 asked Why doesn't Mathematica simplify a square root of an expression that equals a square of a positive real? Sep11 awarded Caucus Aug30 comment Probability and distribution from actual data Aug14 answered Evaluation of self-defined functions Jun25 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. Jun25 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? Jun25 revised Calculating a limit with a result that is discontinuous in the parameters add the assumption that ϵ is real Jun25 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). Jun25 asked Calculating a limit with a result that is discontinuous in the parameters Jun6 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. Jun6 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. Jun6 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.