0
$\begingroup$

I should state that I am a Mathematica beginner but I checked the questions about machine vs arbitrary precision (such as: this one ) and I continue to have the following issue while trying to evaluate an expression:

After various calculations which include square roots and integrals, I arrive at a function foo[x_] which I want it to return a number. On the contrary, it returns a numerical expression as shown below, together with the return values of different tests I made. enter image description here

My end goal is to use foo to calculate other expressions, as well as to Plot this it, which I cannot do at the moment. Any suggestions? Thanks in advance!

$\endgroup$
  • 1
    $\begingroup$ Probably some problem with the definition of foo, which you do not provide... $\endgroup$ – Oleksandr R. Sep 23 '15 at 12:11
  • 1
    $\begingroup$ Greetings! Make the most of Mma.SE and take the tour. Help us to help you, write an excellent question. Edit if improvable, show due diligence, give brief context, include minimum working examples of code and data in formatted form. As you receive give back, vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. $\endgroup$ – rhermans Sep 23 '15 at 12:24
  • 1
    $\begingroup$ You should definitely share the code for foo in formatted form so people can Copy&Paste it and test by themselves and try to reproduce your problem. Help us to help you, as it is, we can hardly do anything for you. $\endgroup$ – rhermans Sep 23 '15 at 12:30
  • $\begingroup$ My guess would be that you have an invisible character somewhere in your code. It might provide some insight if you'd apply FullForm to some of your inputs and results. $\endgroup$ – Sjoerd C. de Vries Sep 23 '15 at 13:06
2
$\begingroup$

Thank you all for your quick replies. By checking your comments, I went back to the initial functions that formed the problematic final expression and was indeed a formatting error. The problematic function in full form is the following: problematic

I assume that the \.08 character is what is causing the problem as when I rewritten the Cos[y] factor the problem was gone for this function (as well as for the final complete expression) as shown below. enter image description here

So finally it wasn't a machine precision error but a formatting error. Once again thanks for your replies.

$\endgroup$

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