Skip to content

default test tolerances assume Float64 precision and numbers ~ 1 #269

Open
@stevengj

Description

@stevengj

The default test tolerances here seem wrong:

function test_scalar(f, z; rtol=1e-9, atol=1e-9, fdm=_fdm, fkwargs=NamedTuple(), check_inferred=true, kwargs...)

  1. The default rtol = 1e-9 assumes double precision. Better to follow isapprox here and use sqrt(eps(float(T)))?
  2. By setting a nonzero default atol you are implicitly assuming quantities of order unity. This corresponds to an absurdly large tolerance if the functions happen to be scaled to have very small magnitude. Better to follow isapprox here and default to atol = 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions