[math-fun] "LHS Sometimes returns precision errors? What the bleep is it doing numerics for an identity map?"
Brad, there's a really interesting answer. E.g., In[68]:= Sin[π/34] // FunctionExpand Out[68]= 1/(4 Sqrt[2/( 15 + Sqrt[17] - Sqrt[2 (17 - Sqrt[17])] - Sqrt[ 2 (34 + 6 Sqrt[17] + Sqrt[2 (17 - Sqrt[17])] - Sqrt[ 34 (17 - Sqrt[17])] + 8 Sqrt[2 (17 + Sqrt[17])])])]) (Rather cumbrous, Now undo it.) In[69]:= ArcSin@% // FullSimplify // Timing Out[69]= {0.312125, π/34} How could it take .3 sec to look that up? Alternatively, how could it get π/34 so quickly? Or at all? Here Mathematica recognizes Macsyma's nicer rendition: In[70]:= ArcSin[(-\[Sqrt](\[Sqrt]17 + 3) \[Sqrt](4 \[Sqrt]17 - 2 \[Sqrt](34 - 2 \[Sqrt]17)) + \[Sqrt](34 - 2 \[Sqrt]17) + \[Sqrt]17 - 1)/16] // FullSimplify // Timing Out[70]= {0.948516, π/34} even though it wasn't able to simplify its version to Macsyma's. So where did it get the notion of π/34? It guessed it numerically! It is then fairly routine to show that the two surds are identical, or that Macsyma's satisfies In[72]:= MinimalPolynomial[Sin[π/34], x] // Timing Out[72]= {0.002874, 1 - 8 x - 40 x^2 + 80 x^3 + 240 x^4 - 192 x^5 - 448 x^6 + 128 x^7 + 256 x^8} At least this is how Macsyma did it. Without even requiring a ratsimp or radcan. —rwg
Hi Bill, Thanks for this. I was just wondering about Pi/34, and didn’t know that such elegant expressions even existed. Truly amazing trigonometry! Cheers — Brad
On Oct 19, 2019, at 12:46 AM, Bill Gosper <billgosper@gmail.com> wrote:
Brad, there's a really interesting answer. E.g., In[68]:= Sin[π/34] // FunctionExpand
Out[68]= 1/(4 Sqrt[2/( 15 + Sqrt[17] - Sqrt[2 (17 - Sqrt[17])] - Sqrt[ 2 (34 + 6 Sqrt[17] + Sqrt[2 (17 - Sqrt[17])] - Sqrt[ 34 (17 - Sqrt[17])] + 8 Sqrt[2 (17 + Sqrt[17])])])])
(Rather cumbrous, Now undo it.)
In[69]:= ArcSin@% // FullSimplify // Timing
Out[69]= {0.312125, π/34}
How could it take .3 sec to look that up? Alternatively, how could it get π/34 so quickly? Or at all?
Here Mathematica recognizes Macsyma's nicer rendition: In[70]:= ArcSin[(-\[Sqrt](\[Sqrt]17 + 3) \[Sqrt](4 \[Sqrt]17 - 2 \[Sqrt](34 - 2 \[Sqrt]17)) + \[Sqrt](34 - 2 \[Sqrt]17) + \[Sqrt]17 - 1)/16] // FullSimplify // Timing
Out[70]= {0.948516, π/34}
even though it wasn't able to simplify its version to Macsyma's. So where did it get the notion of π/34? It guessed it numerically! It is then fairly routine to show that the two surds are identical, or that Macsyma's satisfies In[72]:= MinimalPolynomial[Sin[π/34], x] // Timing
Out[72]= {0.002874, 1 - 8 x - 40 x^2 + 80 x^3 + 240 x^4 - 192 x^5 - 448 x^6 + 128 x^7 + 256 x^8}
At least this is how Macsyma did it. Without even requiring a ratsimp or radcan. —rwg _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
Some googling gave me https://nanopdf.com/download/sines-and-cosines-for-fractions-of_pdf from which Sin[π/34] can be derived simply. Arie Bos
-----Oorspronkelijk bericht----- Van: math-fun <math-fun-bounces@mailman.xmission.com> Namens Bill Gosper Verzonden: zaterdag 19 oktober 2019 07:46 Aan: math-fun@mailman.xmission.com CC: Wolfram Technical Support <support@wolfram.com> Onderwerp: [math-fun] "LHS Sometimes returns precision errors? What the bleep is it doing numerics for an identity map?" Urgentie: Hoog
Brad, there's a really interesting answer. E.g., In[68]:= Sin[π/34] // FunctionExpand
Out[68]= 1/(4 Sqrt[2/( 15 + Sqrt[17] - Sqrt[2 (17 - Sqrt[17])] - Sqrt[ 2 (34 + 6 Sqrt[17] + Sqrt[2 (17 - Sqrt[17])] - Sqrt[ 34 (17 - Sqrt[17])] + 8 Sqrt[2 (17 + Sqrt[17])])])])
(Rather cumbrous, Now undo it.)
In[69]:= ArcSin@% // FullSimplify // Timing
Out[69]= {0.312125, π/34}
How could it take .3 sec to look that up? Alternatively, how could it get π/34 so quickly? Or at all?
Here Mathematica recognizes Macsyma's nicer rendition: In[70]:= ArcSin[(-\[Sqrt](\[Sqrt]17 + 3) \[Sqrt](4 \[Sqrt]17 - 2 \[Sqrt](34 - 2 \[Sqrt]17)) + \[Sqrt](34 - 2 \[Sqrt]17) + \[Sqrt]17 - 1)/16] // FullSimplify // Timing
Out[70]= {0.948516, π/34}
even though it wasn't able to simplify its version to Macsyma's. So where did it get the notion of π/34? It guessed it numerically! It is then fairly routine to show that the two surds are identical, or that Macsyma's satisfies In[72]:= MinimalPolynomial[Sin[π/34], x] // Timing
Out[72]= {0.002874, 1 - 8 x - 40 x^2 + 80 x^3 + 240 x^4 - 192 x^5 - 448 x^6 + 128 x^7 + 256 x^8}
At least this is how Macsyma did it. Without even requiring a ratsimp or radcan. —rwg _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
It looks like yesterday's exposé didn't give away any Wolfram trade secrets— only Macsyma's, which were never secret. (Dialog) In[115]:= Developer`TrigToRadicals@Sin[π/14] (Dialog) Out[115]= 1/2 (1/ 3 (1/2 (1 - I Sqrt[7]) - ( 1/2 (-1 + I Sqrt[7]) + 1/2 (-1 - I Sqrt[7]) (1/2 (-1 + I Sqrt[3]) + 1/4 (-1 + I Sqrt[3])^2))/(6 + 3/4 (-1 + I Sqrt[3]) (-1 + I Sqrt[7]) + 1/2 (-1 - I Sqrt[7]) (1 + 3/4 (-1 + I Sqrt[3])^2))^( 1/3) - (6 + 3/4 (-1 + I Sqrt[3]) (-1 + I Sqrt[7]) + 1/2 (-1 - I Sqrt[7]) (1 + 3/4 (-1 + I Sqrt[3])^2))^(1/3)) + 1/3 (1/2 (1 + I Sqrt[7]) - ((-1 + I Sqrt[3]) (1/2 (-1 - I Sqrt[7]) + 1/2 (-1 + I Sqrt[7]) (1/2 (-1 + I Sqrt[3]) + 1/4 (-1 + I Sqrt[3])^2)))/( 2 (6 + 3/4 (-1 + I Sqrt[3]) (-1 - I Sqrt[7]) + 1/2 (-1 + I Sqrt[7]) (1 + 3/4 (-1 + I Sqrt[3])^2))^(1/3)) - 1/4 (-1 + I Sqrt[3])^2 (6 + 3/4 (-1 + I Sqrt[3]) (-1 - I Sqrt[7]) + 1/2 (-1 + I Sqrt[7]) (1 + 3/4 (-1 + I Sqrt[3])^2))^(1/3))) (Dialog) In[116]:= FullSimplify[ArcSin@%] // tim During evaluation of (Dialog) In[116]:= 1427.83026,2 Nearly 20 minutes!? (Dialog) Out[116]= \[Pi]/14 Whereas you can just guess it numerically: (Dialog) In[117]:= ArcSin@N[%115, 33]/π (Dialog) Out[117]= 0.0714285714285714285714285714285714 + 0.\[CenterDot]10^-35 I (Dialog) In[118]:= Rationalize@% (Dialog) Out[118]= 1/14 and then check polynomial satisfaction. —rwg On Fri, Oct 18, 2019 at 10:46 PM Bill Gosper <billgosper@gmail.com> wrote:
Brad, there's a really interesting answer. E.g., In[68]:= Sin[π/34] // FunctionExpand
Out[68]= 1/(4 Sqrt[2/( 15 + Sqrt[17] - Sqrt[2 (17 - Sqrt[17])] - Sqrt[ 2 (34 + 6 Sqrt[17] + Sqrt[2 (17 - Sqrt[17])] - Sqrt[ 34 (17 - Sqrt[17])] + 8 Sqrt[2 (17 + Sqrt[17])])])])
(Rather cumbrous, Now undo it.)
In[69]:= ArcSin@% // FullSimplify // Timing
Out[69]= {0.312125, π/34}
How could it take .3 sec to look that up? Alternatively, how could it get π/34 so quickly? Or at all?
Here Mathematica recognizes Macsyma's nicer rendition: In[70]:= ArcSin[(-\[Sqrt](\[Sqrt]17 + 3) \[Sqrt](4 \[Sqrt]17 - 2 \[Sqrt](34 - 2 \[Sqrt]17)) + \[Sqrt](34 - 2 \[Sqrt]17) + \[Sqrt]17 - 1)/16] // FullSimplify // Timing
Out[70]= {0.948516, π/34}
even though it wasn't able to simplify its version to Macsyma's. So where did it get the notion of π/34? It guessed it numerically! It is then fairly routine to show that the two surds are identical, or that Macsyma's satisfies In[72]:= MinimalPolynomial[Sin[π/34], x] // Timing
Out[72]= {0.002874, 1 - 8 x - 40 x^2 + 80 x^3 + 240 x^4 - 192 x^5 - 448 x^6 + 128 x^7 + 256 x^8}
At least this is how Macsyma did it. Without even requiring a ratsimp or radcan. —rwg
Just for grins, switching to Maple, sin(Pi/34) = (1/8)*sqrt(2)*sqrt(15+sqrt(17)-sqrt(34-2*sqrt(17))-sqrt(68+12*sqrt(17)+2*sqrt(34-2*sqrt(17))-2*sqrt(578-34*sqrt(17))+16*sqrt(34+2*sqrt(17)))) and the minimal polynomial Bill Gosper gives factors over Q(sqrt(17)). The quartic factor 16*x^4-(4*sqrt(17)-4)*x^3-(2*sqrt(17)+6)*x^2-(-2*sqrt(17)-4)*x-1 has sin(Pi/34) as a root. The other roots are sin(9*Pi/34), sin(13*Pi/34), sin(15*Pi/34) and -sin(19*Pi/34). On Sat, Oct 19, 2019 at 12:47 AM Bill Gosper <billgosper@gmail.com> wrote:
Brad, there's a really interesting answer. E.g., In[68]:= Sin[π/34] // FunctionExpand
Out[68]= 1/(4 Sqrt[2/( 15 + Sqrt[17] - Sqrt[2 (17 - Sqrt[17])] - Sqrt[ 2 (34 + 6 Sqrt[17] + Sqrt[2 (17 - Sqrt[17])] - Sqrt[ 34 (17 - Sqrt[17])] + 8 Sqrt[2 (17 + Sqrt[17])])])])
(Rather cumbrous, Now undo it.)
In[69]:= ArcSin@% // FullSimplify // Timing
Out[69]= {0.312125, π/34}
How could it take .3 sec to look that up? Alternatively, how could it get π/34 so quickly? Or at all?
Here Mathematica recognizes Macsyma's nicer rendition: In[70]:= ArcSin[(-\[Sqrt](\[Sqrt]17 + 3) \[Sqrt](4 \[Sqrt]17 - 2 \[Sqrt](34 - 2 \[Sqrt]17)) + \[Sqrt](34 - 2 \[Sqrt]17) + \[Sqrt]17 - 1)/16] // FullSimplify // Timing
Out[70]= {0.948516, π/34}
even though it wasn't able to simplify its version to Macsyma's. So where did it get the notion of π/34? It guessed it numerically! It is then fairly routine to show that the two surds are identical, or that Macsyma's satisfies In[72]:= MinimalPolynomial[Sin[π/34], x] // Timing
Out[72]= {0.002874, 1 - 8 x - 40 x^2 + 80 x^3 + 240 x^4 - 192 x^5 - 448 x^6 + 128 x^7 + 256 x^8}
At least this is how Macsyma did it. Without even requiring a ratsimp or radcan. —rwg _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
participants (4)
-
Bill Gosper -
bradklee@gmail.com -
James Buddenhagen -
R B