Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#860 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@devmotion がすでに取り組んでいます。

2026年10月14日 から。

  • #861 @devmotion による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
領域
tooling

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Julia
スター
1k
フォーク
162
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaDiff/ForwardDiff.jl のほかの issue

JuliaDiff/ForwardDiff.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。