You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iirc @FreezyLemon went about and changed most of existing at-the-time tests to not use exact precision and to also rely on approx crate where suitable. By also adding a boiler for macro generation of test suites, it places a default tolerance on most of the tests, but the macro is designed to make it more ergonomic to write tests for parametrized distributions. This added significant consistency across testing precision, especially when not requiring the use of special functions.
That default precision is not used in the special functions testing. The default was set to crate::consts::ACC which is set at 1e-10.
There's still some usage of the statrs::prec module, and erf has some regions where it tests within 1e-9. This affects the cdf for Normal and for sufficiently large dof, StudentsT. I wish to change all instances of float comparison to use approx and to have clearly denoted defaults.
Further, it means we have to reduce the default precision on the tests to pass them or change some of the special function implementation.
regarding alternatives
erf is a GCC builtin that GSL binds to, which means not pure rust and linking to system libs.
rust-lang/libm uses a MUSL implementation that passes our tests at higher precision, we could perhaps think of delegating special function work to another crate, perhaps special since it uses libm
spec_math is a direct CEPHES rewrite, CEPHES is MIT Licensed.
The text was updated successfully, but these errors were encountered:
I wish to change all instances of float comparison to use approx and to have clearly denoted defaults.
I think this makes sense, but I would create a pub(crate) wrapper around approx (like statrs::prec) to do this. This would be helpful in case approx changes default values or if a switch away from approx is wanted for whatever reason.
iirc @FreezyLemon went about and changed most of existing at-the-time tests to not use exact precision and to also rely on
approx
crate where suitable. By also adding a boiler for macro generation of test suites, it places a default tolerance on most of the tests, but the macro is designed to make it more ergonomic to write tests for parametrized distributions. This added significant consistency across testing precision, especially when not requiring the use of special functions.That default precision is not used in the special functions testing. The default was set to
crate::consts::ACC
which is set at 1e-10.There's still some usage of the
statrs::prec
module, anderf
has some regions where it tests within 1e-9. This affects the cdf forNormal
and for sufficiently large dof,StudentsT
. I wish to change all instances of float comparison to useapprox
and to have clearly denoted defaults.Further, it means we have to reduce the default precision on the tests to pass them or change some of the special function implementation.
regarding alternatives
erf
is a GCC builtin that GSL binds to, which means not pure rust and linking to system libs.special
since it uses libmspec_math
is a direct CEPHES rewrite, CEPHES is MIT Licensed.The text was updated successfully, but these errors were encountered: