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

Dividing by a reciprocal gives a value where the quotient has none: 1/(1/x) is x

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

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp
領域
backend

調査の方向性

Start with O4 in SimplificationContract.md and reproduce the listed expressions using work/soundcheck. Trace the named rules in Common, CollapseMultipleFractions, Power, CommonDenominator, and Trigonometric, then compare with the rational canonical form issue #1618. Done means simplification preserves the original definedness conditions and regression checks cover the reported cases.

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

説明

What you ran:

"1/(1/x)".Simplify();
"(x^(-1))^(-1)".Simplify();
"a / csc(x)".Simplify();
"1 / sec(x)".Simplify();
"1 / cotan(x)".Simplify();
"a / (b / x)".Simplify();
"a / x^(-1)".Simplify();
"(y + 2) / y^(-1)".Simplify();

What it did: each answer has a value where the expression has none. Measured on master at dcf5ba7c:

expression Simplify at expression there answer there
1/(1/x) x x = 0 NaN 0
(x^(-1))^(-1) x x = 0 NaN 0
a / csc(x) sin(x) * a x = 0 NaN 0
1 / sec(x) cos(x) x = pi/2 NaN 0
1 / cotan(x) tan(x) x = 0 NaN 0
a / (b / x) a * x / b provided not b = 0 x = 0 NaN 0
a / x^(-1) a * x x = 0 NaN 0
(y + 2) / y^(-1) (2 + y) * y y = 0 NaN 0

The last one keeps b's condition and drops x's.

What it should have done: keep the condition the expression was defined under, as cancelling already does: (1/x)/(1/x) is 1 provided not x = 0. O4 of SimplificationContract.md forbids turning undefined into a value.

The rules that do it, found by applying each rule on its own and comparing both sides at sample points (work/soundcheck, for #1252): dividing-by-a-quotient-multiplies-by-its-reciprocal (Common), quotient-whose-denominator-is-a-quotient and quotient-of-two-quotients (CollapseMultipleFractions), a-power-of-a-power-multiplies-the-exponents (Power), a-quotient-of-symbolic-parts-is-grouped-pairwise (CommonDenominator, at all three levels), and a-quotient-by-a-cosecant-is-a-sine (Trigonometric). a-power-times-a-product-containing-its-own-base-raises-the-exponent widens too (y^0 * y → y^1), but Simplify keeps that condition by another route. #1618 is the same defect in the rational canonical form.

主要言語
C#
スター
831
フォーク
79
平均マージ
2時間 22分
マージ済み PR(30日)
507

環境構築

はじめの一歩

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

ASC-Community/AngouriMath のほかの issue

ASC-Community/AngouriMath の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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