Skip to content

Domain error when evaluating interpolation with broadcasting #36

@hersle

Description

@hersle

Hi, and first and foremost thank you for this fantastic package. For reasons I do not understand, this particular example crashes:

using FastChebInterp
x = chebpoints(50, 1.0, 100.0)
c = chebinterp(sin.(x), 1.0, 100.0)
c(100.0) # works
map(c, [100.0]) # works
c.([100.0]) # fails

On my computer, the last line fails with:

ERROR: ArgumentError: [100.0] not in domain [1.0] to [100.0]
Stacktrace:
  [1] ChebPoly
    @ ~/.julia/packages/FastChebInterp/nxaLC/src/eval.jl:65 [inlined]
  [2] ChebPoly
    @ ~/.julia/packages/FastChebInterp/nxaLC/src/eval.jl:70 [inlined]
  [3] _broadcast_getindex_evalf
    @ ./broadcast.jl:709 [inlined]
  [4] _broadcast_getindex
    @ ./broadcast.jl:682 [inlined]
  [5] getindex
    @ ./broadcast.jl:636 [inlined]
  [6] macro expansion
    @ ./broadcast.jl:1004 [inlined]
  [7] macro expansion
    @ ./simdloop.jl:77 [inlined]
  [8] copyto!
    @ ./broadcast.jl:1003 [inlined]
  [9] copyto!
    @ ./broadcast.jl:956 [inlined]
 [10] copy
    @ ./broadcast.jl:928 [inlined]
 [11] materialize(bc::Base.Broadcast.Broadcasted{…})
    @ Base.Broadcast ./broadcast.jl:903
 [12] top-level scope
    @ REPL[10]:5

Is there some floating point error introduced by the broadcasting/SIMD operation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions