Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`fma` and `muladd` ignore NaN-safe mode

Đang mở
#860 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@devmotion đang làm issue này rồi.

Từ ngày 14/10/2026.

  • #861 của @devmotion — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
tooling

Hướng nghiên cứu

Start by reproducing the four REPL examples with nansafe_mode = true and confirm fma and muladd differ from x * y + z. The issue names the methods for three dual arguments and for dual-real-dual arguments as the ones using fma/muladd directly, so begin there and compare them with the NaN-safe multiplication path. Done means both functions return the same partials as x * y + z in all four cases.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

With NaN-safe mode enabled (nansafe_mode = true), fma and muladd propagate NaN partials for dual numbers with zero partials, unlike the equivalent x * y + z:

julia> using ForwardDiff: Dual  # nansafe_mode = true

julia> x, y, z = Dual(Inf, 0.0), Dual(2.0, 0.0), Dual(0.0, 0.0);

julia> x * y + z
Dual{Nothing}(Inf,0.0)

julia> muladd(x, y, z)
Dual{Nothing}(Inf,NaN)

julia> fma(x, y, z)
Dual{Nothing}(Inf,NaN)

julia> x, y, z = Dual(1.0, 0.0), Inf, Dual(0.0, 1.0);

julia> x * y + z
Dual{Nothing}(Inf,1.0)

julia> muladd(x, y, z)
Dual{Nothing}(Inf,NaN)

julia> fma(x, y, z)
Dual{Nothing}(Inf,NaN)

The methods for three dual arguments, and for dual-real-dual arguments, compute the partials with fma/muladd directly instead of going through the NaN-safe multiplication. Related: #857, #858.

ForwardDiff master (a3c0f4f), Julia 1.13.1, macOS aarch64.

Ngôn ngữ chính
Julia
Star
1k
Fork
162
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của JuliaDiff/ForwardDiff.jl

Tất cả issue của JuliaDiff/ForwardDiff.jl

Issue tương tự

Thêm issue về Julia

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.