> restart:

> grtw();

`GRTensorII Version 1.79 (R6)`

`2 February 2001`

`Developed by Peter Musgrave, Denis Pollney and Kay...

`Copyright 1994-2001 by the authors.`

`Latest version available from: http://grtensor.phy...

`e:/Grtii(6)/Metrics`

> with(codegen,cost):

First note how cost counts:

> C:=x+y;

C := x+y

> codegen[cost](C);

additions

> C1:=x+y+z;

C1 := x+y+z

> codegen[cost](C1);

2*additions

> interface(labelling=false):

> qload(fourd);

`Default spacetime` = fourd

`For the fourd spacetime:`

Coordinates

x(up)

`x `^a = vector([x1, x2, x3, x4])

`Line element`

` ds`^2 = a(x1,x2,x3,x4)*` d`*x1^`2 `+2*b(x1,x2,x3,...
` ds`^2 = a(x1,x2,x3,x4)*` d`*x1^`2 `+2*b(x1,x2,x3,...

> grOptionDefaultSimp:=0:

> grdef(`RR11:=g{^c ^d}*R{c $x1 $x1 d}`):

Created definition for RR11

> grdef(`RR12:=g{^c ^d}*R{c $x1 $x2 d}`):

Created definition for RR12

> grcalc(RR11):

`CPU Time ` = .170

> codegen[cost](numer(grcomponent(RR11,[])));

9989*additions+83658*functions+79044*multiplication...

9989 additions=9990 terms

> grcalc(RR12):

`CPU Time ` = .40e-1

> codegen[cost](numer(grcomponent(RR12,[])));

13279*additions+111735*functions+103936*multiplicat...

13279 additions=13280 terms

>