2
$\begingroup$

I would appreciate an explanation of why DifferenceDelta produces a complicated expression for a simple quadratic. I see that this is caused by the Real value 0.1, but I do not understand the rationale. Note that even FullSimplify does not help much here.

f = Function[x, 15 + 2 x - 0.1 x^2]
DifferenceDelta[f[i], i]  
(* -((0.2 (-9.5 + 1. i) (-150. - 20. i + 1. i^2))/((-25.8114 + 1. i) (5.81139 + 1. i))) *)

Note: Mma 12.0 on up to date Win 10.

$\endgroup$
  • $\begingroup$ Good question. It is correct up to a some rounding error, though: DifferenceDelta[f[i], i] // Apart returns 1.9 - 0.2 i - 1.79755*10^-15/(-25.8114 + 1. i) + 1.79755*10^-15/( 5.81139 + 1. i). $\endgroup$ – Henrik Schumacher Mar 26 at 14:32
  • 1
    $\begingroup$ "Note that even FullSimplify does not help much here." - indeed. But, the situation is salvageable: With[{expr = DifferenceDelta[f[i], i]}, PolynomialQuotient[Numerator[expr], Denominator[expr], i]]. Alternatively: DiscreteShift[f[i], i] - f[i]. $\endgroup$ – J. M.'s technical difficulties Mar 26 at 14:33
  • $\begingroup$ Do you mean "Odd output from DifferenceDelta"? $\endgroup$ – user64494 Mar 26 at 15:38
0
$\begingroup$

The following works correctly.

f = Function[x, 15 + 2 x - 0.100000000000000000000* x^2];
DifferenceDelta[f[i], i] // FullSimplify
(*1.900000000000 - 0.2000000000000 i *)

The same phenomenon appears for other commands, e.g. Residue.

PS. To be clear,

g = Function[x, 15 + 2 x - 0.123456789101121314* x^2];
DifferenceDelta[g[i], i] // FullSimplify
(*1.8765432109 - 0.2469135782022 i*)

, but

g = Function[x, 15 + 2 x - 0.12345678910112131* x^2];
DifferenceDelta[g[i], i] // FullSimplify
 (*(-228. + i (-0.4 + i (5.87654 + (-0.246914 + 1.37065*10^-17 i) i)))/(-121.5 + 
  i (-16.2 + 1. i)) *)
|improve this answer|||||
$\endgroup$
  • $\begingroup$ Exact numbers work. $\endgroup$ – Alan Mar 26 at 15:37
  • $\begingroup$ @Alan: You open an opened door. Decimals with many digits work too as I demonstrate. $\endgroup$ – user64494 Mar 26 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.