Two Algebraically Equal Forms Return Answers Differing by 15 Digits ── The smaller root of a quadratic comes out with 0.59 correct digits from the naive form and 16 from the rationalised one ── The cause is that sqrt(b^2-4c) agrees with b to 15.83 digits ── Subtract two near-equals and exactly the agreeing digits vanish ── [Paper 368]
Abstract
It is tempting to think that mathematically identical formulae return identical answers. This paper asks whether that holds in finite precision──the answer is that it does not, and the gap reaches 15 digits. No new mathematical theorem and no new law is claimed. Scope of this paper (scope note): No new mathematical theorem and no new law is claimed──catastrophic cancellation, rationalisation, and floating-point arithmetic are all standard. We do not build numerical analysis──the general theory of rounding error and backward error analysis are not entered. They are named and no more. Implementation is not treated──arithmetic other than double precision, and compensated summation, are not the subject. Condition number is not treated──the conditioning of the problem itself is not the subject. Paper 330 treated the squaring of the condition number; what is treated here is the difference between two ways of writing one problem. We do not discuss root-finding──numerical methods for higher-degree equations are not the subject. We do not generalise──not every equivalent rewriting changes the digits. Only those in which cancellation occurs. Relation to earlier papers: Paper 330 showed the squaring of the condition number to be an identity rather than an approximation──there it was a property of the problem; here it is a property of how the problem is written. Paper 360 showed an exact formula that cannot be computed──there the trouble was the number of terms; here it is the subtraction of them. Paper 300 showed whether two things share a root is decidable──by that test, “mathematically equal” and “numerically equal” have distinct roots. Paper 355 showed an empirical law naming its own breakdown──here a formula names the b at which it breaks. What is added is giving the correct digits of both forms at five values, showing the gap reaching 15 digits, giving the causal 15.83-digit agreement as a number, confirming as a control that the two agree where no cancellation occurs, and putting the separator on whether two near-equals are subtracted. First, the smaller root of x^2+10^8x+1=0 is computed by two equivalent formulae (Section 2). Second, this is the core of the paper. The naive form returns 0.59 correct digits and the rationalised one 16 (Section 2). Third, the cause is that sqrt(b^2-4c) agrees with b to 15.83 digits (Section 3). Fourth, for small b the two agree (b=3 gives -0.3819660112501051 against -0.3819660112501052) (Section 3). Fifth, taking b from 10^2 to 10^10 drops the naive form from 12.91 digits to 0 (Section 2). Sixth, the separator is whether the formula subtracts two near-equals, not its complexity or the size of the numbers (Section 5). It is tempting to think that mathematically identical formulae return identical answers──in finite precision they do not. Write the smaller root of x^2+10^8x+1=0 two ways──the naive (-b+sqrt(b^2-4c))/2 and the rationalised 2c/(-b-sqrt(b^2-4c)) are algebraically identical and differ by a single sign. Yet the naive form returns 0.59 correct digits and the rationalised one 16. The naive form’s relative error is 25 per cent, so even its first digit is doubtful. The value it returns, -7.45x10^-9, is exactly half the double-precision spacing near 10^8 ── not a computed result but the residue of rounding. The cause can be named──at b=10^8, sqrt(b^2-4c) agrees with b to 15.83 digits (with c=1 and b^2=10^16, the term 4c is buried under double-precision resolution). Subtract two near-equals and exactly the agreeing digits vanish: 16-15.83=0.17, consistent as a count with the measured 0.59. Only the subtraction is broken; the square root itself is computed correctly. The rationalised form adds two quantities of the same sign, so nothing cancels. And the formula names where it breaks──taking b from 10^2 to 10^10 drops the naive form 12.91->8.95->5.12->0.59->0, about 2 digits per two decades, regularly. Since the danger grows as b^2/(4c) approaches the 16 digits of double precision, which formula to use is settled before computing. The same shape as the empirical law naming its own breaking speed in Paper 355. A control shows this is a matter of how it is written──at b=3 the two agree (-0.3819660112501051 against -0.3819660112501052), because there sqrt(b^2-4c) agrees with b to only 0.59 digits and subtracting destroys nothing. One thing separates them──whether the formula subtracts two near-equal quantities; not its complexity and not the size of the numbers. Quadruple precision survives b=10^8, but the same happens at b=10^16: adding digits moves the boundary, it does not remove it. To be said honestly──this paper performs no error analysis; it shows one example differing by 15 digits and that its cause is the agreement. What does not move is the structure: as many digits are lost as agreed. One last thing──“tidying up a formula” does not necessarily leave the answer unchanged. Algebraically it changes nothing; numerically it changes 15 digits. That a tidied formula reads well and that it returns the right answer are different properties. On the making of this work: The ideas and content of this work stem from the author's own considerations. Assistance from an AI (a large language model) was used for structuring, English translation, and checking the algebra. Any remaining errors or misinterpretations are solely the author's. Feedback and corrections are sincerely appreciated. ----- 数学的に同じ式は、同じ答を返すと考えたくなる。本稿が問うのは有限桁の計算でもそうかである──答えはそうならず、差は 15 桁に達する。新しい定理も法則も主張しない。 本稿の射程(射程注記):新しい定理も法則も主張しない──桁落ち(相殺による精度喪失)・有理化・浮動小数点演算はすべて既知である。数値解析を作らない──丸め誤差の一般論や後退誤差解析には立ち入らない。名前を挙げるにとどめる。実装を扱わない──倍精度以外の演算や補償付き総和は主題ではない。条件数を扱わない──問題の条件数そのものは主題ではない。論文330 は条件数の二乗化を扱ったが、本稿が扱うのは同じ問題を二通りに書いたときの差である。根の求解法を論じない──高次方程式の数値解法は主題ではない。一般化しない──全ての等価な書き換えが桁を変えるとは主張しない。相殺が起きる場合だけである。既刊との関係:論文330 は条件数が二乗になるのが近似ではなく恒等式であることを示した──そこでは問題の側の性質だった。ここでは同じ問題の書き方の側である。論文360 は厳密な式が計算できないことがあると示した──そこでは項数が問題だった。ここでは項の引き算が問題である。論文300 は同根か別根かが判定できることを示した──「数学的に等しい」と「数値的に等しい」は、その基準で別根である。論文355 は経験則が自分の破れを指すことを示した──ここでは式が自分の壊れる b を指す。加えたのは、二つの式の有効桁を五点で数に出したこと、差が 15 桁に達することを示したこと、原因である 15.83 桁の一致を数で示したこと、桁落ちしない領域で両式が一致することを対照として確かめたこと、分離子を「ほとんど等しい二つを引くか」に置いたことである。 第一に、x^2+10^8x+1=0 の小さいほうの根を、二つの等価な式で計算する(第2節)。 第二に、これが本稿の芯である。素朴な式は有効桁 0.59 桁、有理化した式は 16 桁を返す(第2節)。 第三に、原因は sqrt(b^2-4c) が b と 15.83 桁一致していることである(第3節)。 第四に、b が小さければ両式は一致する(b=3 で -0.3819660112501051 対 -0.3819660112501052)(第3節)。 第五に、b を 10^2 から 10^10 へ動かすと、素朴な式の有効桁は 12.91 から 0 へ落ちる(第2節)。 第六に、分離子は「ほとんど等しい二つを引くか」であって、式の複雑さでも桁数でもない(第5節)。 数学的に同じ式は、同じ答を返すと考えたくなる──有限桁の計算では、そうならない。 x^2+10^8x+1=0 の小さいほうの根を二通りに書く──素朴な (-b+sqrt(b^2-4c))/2 と、有理化した 2c/(-b-sqrt(b^2-4c)) は代数的に厳密に等しく、符号が一つ違うだけである。ところが素朴な式は有効桁 0.59 桁、有理化した式は 16 桁を返す。素朴な式の相対誤差は 25 パーセントで、最初の一桁すら怪しい。返ってくる -7.45x10^-9 は 10^8 付近の浮動小数の刻み幅そのもので、計算した結果ではなく丸めの残骸である。原因は名指しできる──b=10^8 では sqrt(b^2-4c) が b と 15.83 桁まで一致している(c=1 に対して b^2=10^16 だから、4c は倍精度の分解能に埋もれる)。ほとんど等しい二つを引けば、一致していた桁がそのまま消える。16-15.83=0.17 桁という勘定は、実測の 0.59 桁と桁として合う。壊れているのは引き算だけで、平方根そのものは正しく計算されている。有理化した式は同符号どうしの和に変えるので、相殺が起きない。そして式は自分の壊れる場所を指す──b を 10^2 から 10^10 へ動かすと素朴な式の有効桁は 12.91->8.95->5.12->0.59->0 と、二桁増えるごとに約 2 桁ずつ規則的に減る。 b^2/(4c) が倍精度の 16 桁に近づくほど危ないのだから、計算する前に、どちらの式を使うべきかが決まる。論文355 で経験則が自分の破れる速度を指したのと同じ形である。対照が、これが書き方の問題であることを示す──b=3 では両式が一致する(-0.3819660112501051 対 -0.3819660112501052)。そこでは sqrt(b^2-4c) と b の一致が 0.59 桁しかなく、引いても何も消えない。分けているものは一つ──式がほとんど等しい二つを引くかどうかであって、式の複雑さでも扱う数の大きさでもない。精度を上げれば b=10^8 では耐えるが b=10^16 で同じことが起きる。桁を増やすのは境目を動かすだけで、消すことではない。正直に言えば──本稿は誤差解析をしておらず、一つの例で有効桁が 15 桁違うことと、その原因が一致度にあることを示しただけである。最後に一つ──「式を整理する」という操作は、答を変えないとはかぎらない。代数的には変えないが、数値的には 15 桁変える。整理した式が読みやすいことと、正しい答を返すことは、別の性質である。 作成にあたって:本稿の着想と内容は、著者自身の考察に基づくものです。文章の構成整理や英訳、数式の確認には AI(大規模言語モデル)の助力を得ました。最終的な内容の解釈や誤りがあれば、それらはすべて著者の責に帰します。お気づきの点があれば、ご教示いただければ幸いです。