4
$\begingroup$

When I enter an indexed symbol into a ChebyshevT function with integer arithmetic like this:

ChebyshevT[1, 3 * a[4]]

I get the expected result:

3 a[4]

But when I use floating point arithmetic within it:

ChebyshevT[1, 3. * a[4]]

I quite surprisingly get:

3. a[4.]

instead of expected:

3. a[4]

what's happening there? Why did the index inside the symbol change at all?? This is not happening with other mathematical fuctions like Sin, Cos, etc.

Thank you in advance for your help, regards,

$\endgroup$
6
  • 2
    $\begingroup$ Indeed, this seems weird and inconsistent. The same thing happens in ChebyshevT, ChebyshevU, Gamma, LegendreP, HermiteH, GegenbauerC ... but not in JacobiSN, BesselJ, ExpIntegralE ... Perhaps you should report it to Wolfram Technical Support. $\endgroup$
    – Domen
    Commented May 26, 2023 at 11:10
  • 2
    $\begingroup$ That certainly looks like a bug. $\endgroup$ Commented May 26, 2023 at 14:07
  • 3
    $\begingroup$ You may be able to work around the issue by doing SetAttributes[a, NHoldAll]. $\endgroup$
    – Carl Woll
    Commented May 26, 2023 at 15:15
  • 1
    $\begingroup$ As for "consistency," the buggy results are for special functions evaluating to elementary functions. And it does happen for the Bessel function BesselJ[1/2, 3.*a[4]]. $\endgroup$
    – Michael E2
    Commented May 26, 2023 at 22:40
  • $\begingroup$ Thank you everybody for your help. I have just reported the issue to Wolfram Technical Support. I will let you know the answer as they reply me... $\endgroup$
    – Danel
    Commented May 27, 2023 at 7:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.