Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#1,648 19 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 分钟
30 天内合并 PR
507

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ASC-Community/AngouriMath 的其他 Issue

查看 ASC-Community/AngouriMath 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。