Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower accuracy and faster math #583

Closed
mattfidler opened this issue Sep 14, 2023 · 9 comments · Fixed by #611
Closed

Lower accuracy and faster math #583

mattfidler opened this issue Sep 14, 2023 · 9 comments · Fixed by #611

Comments

@mattfidler
Copy link
Contributor

Because ode optimization may be spending too much time in exp() when it could be reduced to match the accuracy of the ode solving method.

@mattfidler
Copy link
Contributor Author

@mattfidler
Copy link
Contributor Author

Julia uses the fastmath from the compiler

https://github.com/JuliaLang/julia/blob/master/base/fastmath.jl

@mattfidler
Copy link
Contributor Author

It also means that the protection options should be turned off because NaN and infinite results cannot be used/found.

@mattfidler
Copy link
Contributor Author

And functions like is.finite is.nan will only return a single type of value

@mattfidler
Copy link
Contributor Author

@mattfidler
Copy link
Contributor Author

Upon further investigation, this option is available already, but not well known (since I didn't know it either).

You can use:

options(rxode2.compile.O="fast")

And it will turn on fast math as well as some other non-IEEE compliant options.

Perhaps this should make it into the speed vignette.

@mattfidler
Copy link
Contributor Author

This works for both clang and gcc compiler.s

@mattfidler
Copy link
Contributor Author

Probably intel too. Add to Speed vignette.

@mattfidler
Copy link
Contributor Author

This is what I got on my unbuntu flavored linux laptop:

image

So it is faster but not hugely different. It could add up with a long running problem though...

@mattfidler mattfidler linked a pull request Dec 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant