Skip to content

Commit e8602de

Browse files
committed
test: add float example from the Madrid workshop
1 parent 9ebc2e2 commit e8602de

File tree

2 files changed

+84
-8
lines changed

2 files changed

+84
-8
lines changed

check/features.frm

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,82 @@ assert result("F", 3) =~ expr("
595595
& x1**2*x2 + x1**3
596596
")
597597
*--#] Format_noreset_linelen :
598+
*--#[ Float_1 :
599+
#-
600+
* Example from the FORM Workshop (Madrid 2023) slides, also in the manual.
601+
602+
#StartFloat 500,15
603+
604+
Local F1 =
605+
-mzv_(8,1,1,5)
606+
+29056868/39414375*mzv_(2)^6*mzv_(3)
607+
-47576/40425*mzv_(2)^5*mzv_(5)
608+
-163291/18375*mzv_(2)^4*mzv_(7)
609+
-4/105*mzv_(2)^3*mzv_(3)^3
610+
-450797/11025*mzv_(2)^3*mzv_(9)
611+
+7/5*mzv_(2)^2*mzv_(3)^2*mzv_(5)
612+
+16/25*mzv_(2)^2*mzv_(3)*mzv_(5,3)
613+
+454049/1400*mzv_(2)^2*mzv_(11)
614+
-16/25*mzv_(2)^2*mzv_(5,3,3)
615+
+3*mzv_(2)*mzv_(3)^2*mzv_(7)
616+
+61/14*mzv_(2)*mzv_(3)*mzv_(5)^2
617+
+2/7*mzv_(2)*mzv_(3)*mzv_(7,3)
618+
+2172853/420*mzv_(2)*mzv_(13)
619+
-2/7*mzv_(2)*mzv_(7,3,3)
620+
+1/7*mzv_(2)*mzv_(5,5,3)
621+
-33/4*mzv_(3)^2*mzv_(9)
622+
-133/6*mzv_(3)*mzv_(5)*mzv_(7)
623+
-25/9*mzv_(3)*mzv_(9,3)
624+
-244/105*mzv_(5)^3
625+
-359/105*mzv_(5)*mzv_(7,3)
626+
+3/10*mzv_(7)*mzv_(5,3)
627+
+89/18*mzv_(9,3,3)
628+
+569/105*mzv_(7,3,5);
629+
L F2 = mzv_(15);
630+
Evaluate mzv_;
631+
Print;
632+
.sort
633+
634+
Skip F1,F2;
635+
Local X = F1/F2;
636+
ToRational;
637+
Print;
638+
.sort
639+
640+
#EndFloat
641+
Local G1 = F1;
642+
Local G2 = F2;
643+
644+
Print G1,G2;
645+
.end
646+
#pend_if wordsize == 2
647+
assert succeeded?
648+
assert result("X") =~ expr("229903169/25200")
649+
assert stdout =~ exact_pattern(<<'EOF')
650+
F1 =
651+
9.1234206877960755900164875575406726239325002222490534540605137258846994\
652+
916348297032751308227224952419629422497720599224543719959652966613231560\
653+
6913926e+03;
654+
EOF
655+
assert stdout =~ exact_pattern(<<'EOF')
656+
F2 =
657+
1.0000305882363070204935517285106450625876279487068581775065699328933322\
658+
671563422795730723343470175484943669684442492832530297757588781904321794\
659+
40477e+00;
660+
EOF
661+
assert stdout =~ exact_pattern(<<'EOF')
662+
G1 =
663+
float_(10,10,1,225649930152063087544280124519603661924016376904153173222\
664+
961313295752588365049496190204609112667217257624737508104376810254484309\
665+
3830597279756558899541412580219255737022507716035);
666+
EOF
667+
assert stdout =~ exact_pattern(<<'EOF')
668+
G2 =
669+
float_(10,10,1,247337966873870703631573653423368526098272821023387457752\
670+
643030990710929556575503489173572446024607642191456056189912528713904095\
671+
704444384800390830056125051605311704862654126);
672+
EOF
673+
*--#] Float_1 :
598674
*--#[ evaluate_symbol :
599675
#-
600676
#StartFloat 64

doc/manual/float.tex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ \chapter{Floating point}
9797
.sort
9898
9999
F1 =
100-
9.1234206877960755900164875575406726239325002222490534540605137258846994\
101-
916348297032751308227224952419629422497720599224543719959652966613231560\
102-
6913925597e+0;
100+
9.1234206877960755900164875575406726239325002222490534540605137258846994\
101+
916348297032751308227224952419629422497720599224543719959652966613231560\
102+
6913926e+03;
103103
104104
F2 =
105-
1.0000305882363070204935517285106450625876279487068581775065699328933322\
106-
671563422795730723343470175484943669684442492832530297757588781904321794\
107-
4047700034253;
105+
1.0000305882363070204935517285106450625876279487068581775065699328933322\
106+
671563422795730723343470175484943669684442492832530297757588781904321794\
107+
40477e+00;
108108
109109
Skip F1,F2;
110110
L X = F1/F2;
@@ -122,10 +122,10 @@ \chapter{Floating point}
122122
maximum weight for MZVs and Euler sums. The functions are only evaluated
123123
when the proper command is given. In the second module we divide the
124124
numbers and convert the result to a rational. It is a good idea to try this
125-
with various precisions to see whether this is stable. With 100 bits the
125+
with various precisions to see whether this is stable. With 60 bits the
126126
final answer would be
127127
\begin{verbatim}
128-
24136499874427167202968388241342/2645634679509635700210944273;
128+
145537942402475031/15952490572234;
129129
\end{verbatim}
130130
while at 150 bits we have already the same answer as with 500 bits. The
131131
fraction that is obtained by this program can be proven to be correct.

0 commit comments

Comments
 (0)