# Fastmath error?

**URL:** <https://discourse.julialang.org/t/fastmath-error/64750>\
**Category:** New to Julia\
**Tags:** fast-math\
**Created:** [July 16, 2021, 1:41pm UTC](https://discourse.julialang.org/t/fastmath-error/64750 "2021-07-16T13:41:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Post date:** [July 16, 2021, 1:41pm UTC](https://discourse.julialang.org/t/fastmath-error/64750/1 "2021-07-16T13:41:24Z")

</div>

v1.6.1, when `--math-mode=fast`:

```julia
julia> f() = exp(1.0);

julia> f() - exp(1.0)
0.002427216033242807

```

which is obviously wrong. It’s wrong **even** in fastmath mode!

while when `--math-mode=ieee`, no problem:

```julia
julia> f() = exp(1.0);

julia> f() - exp(1.0)
0.0

```

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [July 16, 2021, 1:54pm UTC](https://discourse.julialang.org/t/fastmath-error/64750/2 "2021-07-16T13:54:50Z")

</div>

There was this discussion just now: [What's going on with exp() and --math-mode=fast? - #24 by Elrod](https://discourse.julialang.org/t/whats-going-on-with-exp-and-math-mode-fast/64619/24)

I think the general gist is `--math-mode=fast` is broken, don’t use it.

---

<div class="post-metadata">

**Author:** ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Post date:** [July 16, 2021, 1:56pm UTC](https://discourse.julialang.org/t/fastmath-error/64750/3 "2021-07-16T13:56:34Z")

</div>

thank you
