Closed gkdgoutam closed 5 years ago
Perhaps this is because use of brackets forces FORM to insert new lines, though I'm not sure if this is intended or not. Note that Fortran standards (I guess even in Fortran 2018) have a limitation of continuation lines for a single statement, so FORM has to split a long expression anyway (see also the ContinuationLines
setup parameter). In the #write
instruction, you can specify an expression name for continuous lines:
S x1,...,x4;
L F = (x1+...+x4)^3;
B x1,x2;
.sort
Format DoubleFortran;
#write " expr = %E", F(expr)
.end
expr = + x2 * ( 3*x4**2 + 6*x3*x4 + 3*x3**2 )
expr = expr + x2**2 * ( 3*x4 + 3*x3 )
expr = expr + x2**3 * ( 1 )
expr = expr + x1 * ( 3*x4**2 + 6*x3*x4 + 3*x3**2 )
expr = expr + x1*x2 * ( 6*x4 + 6*x3 )
expr = expr + x1*x2**2 * ( 3 )
expr = expr + x1**2 * ( 3*x4 + 3*x3 )
expr = expr + x1**2*x2 * ( 3 )
expr = expr + x1**3 * ( 1 )
expr = expr + x4**3 + 3*x3*x4**2 + 3*x3**2*x4 + x3**3
To compactify code for numerical computation, #optimize
probably does a better job than bracket
.
Indeed these appear due to new lines inserted after the bracket is taken. But putting expression name does the job. Thanks.
Hi, I am trying to export an expression into in DoubleFortran output.
The output I am getting has the following weird form
I want to know why this pattern
_=_
is coming which probably should not come! Is there any bug in this? I would have expected&
in place of_=_
. If I remove the linesthe number of such occurrences are reduced but not zero.
Thanks.