JuliaArrays / JuliaArrays/StaticArrays.jl

Different numerical results on 1.10 and 1.9.4

Open
#1,222 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
844
Forks
159
Avg merge
3d 21h
Merged PRs (30d)
3

Description

Hi,

I just found out that 1.9.4 and 1.10 give different results for a matrix multiply:

using StaticArrays
rotmatrix2d(a) = @SMatrix [cos(a) sin(a); -sin(a) cos(a)]
rotate(a, p) = rotmatrix2d(a) * p 
rotate((pi / 4), SVector{2}(0.42095778959006, -0.42095778959006))
# Julia 1.10
[2.8053096100683734e-17, -0.5953242152248626]
# Julia 1.9.4
[7.419375817039376e-17, -0.5953242152248626]
# Julia 1.6.7
[2.8053096100683734e-17, -0.5953242152248626]
julia> versioninfo()
Julia Version 1.10.0-rc1
Commit 5aaa948543 (2023-11-03 07:44 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × AMD Ryzen 7 5800H with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
  Threads: 11 on 16 virtual cores
Environment:
  JULIA_PKG_OFFLINE = true
  JULIA_PKG_PRECOMPILE_AUTO = 0
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 8
# same machine
julia> versioninfo()
Julia Version 1.9.4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied StaticArrays matrix-multiplication example on Julia 1.10, 1.9.4, and 1.6.7 on the reported Windows setup. Trace the differing result through the relevant StaticArrays and Julia numerical behavior; done means determining whether the discrepancy is a bug and documenting or covering the confirmed behavior with a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.