- #1

#### member 428835

Just like the title says. Is this due to roundoff?

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- #1

Just like the title says. Is this due to roundoff?

- #2

- 20,004

- 10,663

You really cannot expect us to be able to help you unless you give a specific example of code.

- #3

- #4

Mentor

- 14,543

- 8,721

Its well known in computerdom that some numbers can't be represented properly in floating pt format so if Mathematica does a numerical computation with them them then computational error will creep into the calculation.

As an example, if you had some expression like ##3.0*sin(x)*(1.0/3.0)## and Mathematica symbolically reduces it to sin(x) then that result might be different from ##(3.0*sin(x)) / 3.0## where Mathematica didn't see the ONES identity and did the numerical computations of 3.0 * sin(x) then dividing by 3.0.

For larger numbers the result difference might be more pronounced as floating pt numbers kep to a certain limited digit precision.

- #5

Its well known in computerdom that some numbers can't be represented properly in floating pt format so if Mathematica does a numerical computation with them them then computational error will creep into the calculation.

As an example, if you had some expression like ##3.0*sin(x)*(1.0/3.0)## and Mathematica symbolically reduces it to sin(x) then that result might be different from ##(3.0*sin(x)) / 3.0## where Mathematica didn't see the ONES identity and did the numerical computations of 3.0 * sin(x) then dividing by 3.0.

For larger numbers the result difference might be more pronounced as floating pt numbers kep to a certain limited digit precision.

I'm not sure how to illustrate it with a simpler example, which shows how little I know about the issue. I can say when I plot a function (takes a lot of code to construct) one plot has max of 50 and the other has max 6000. Do you want me to post the code or pictures so you can see?

- #6

Mentor

- 34,463

- 12,436

- #7

Mentor

- 4,735

- 3,730

What Every Computer Scientist Should Know About Floating-Point Arithmetic

https://www.itu.dk/~sestoft/bachelor/IEEE754_article.pdf

I think that Dale is trying to tell you something about your understanding of what Mathematica does behind the scenes. Consider it seriously.

Share:

- Replies
- 10

- Views
- 1K

- Replies
- 4

- Views
- 832

- Replies
- 0

- Views
- 561

- Replies
- 4

- Views
- 1K

Mathematica
Running a matrix of integrals in parallel

- Replies
- 4

- Views
- 1K

- Replies
- 11

- Views
- 2K

- Replies
- 7

- Views
- 1K

Mathematica
Problem with line integrals in Mathematica

- Replies
- 9

- Views
- 2K

- Replies
- 3

- Views
- 2K

- Replies
- 3

- Views
- 2K