mersenneforum.org December 2019
 Register FAQ Search Today's Posts Mark Forums Read

 2019-12-18, 21:59 #23 what   Dec 2019 Kansas 24 Posts I got mse of 8.27604×10^-6 (12 times better) Attached Thumbnails   Last fiddled with by what on 2019-12-18 at 22:52
 2019-12-24, 09:02 #24 dg211   Jun 2016 23·3 Posts Brackets I think there was some discussion earlier about whether expressions would be allowed which used brackets in such a way that they have subexpressions that can't be evaluated in a single pass without storing intermediate results. Could one of the people who has had a solution accepted please confirm whether an expression like (x - 1) * (x + 2) would be allowed for example?
2019-12-25, 00:23   #25
SmartMersenne

Sep 2017

7×19 Posts

Quote:
 Originally Posted by dg211 I think there was some discussion earlier about whether expressions would be allowed which used brackets in such a way that they have subexpressions that can't be evaluated in a single pass without storing intermediate results. Could one of the people who has had a solution accepted please confirm whether an expression like (x - 1) * (x + 2) would be allowed for example?
The point was not to store the results but saving operations by substitution. For example:

x*x*x*x*x*x*x*x requires 7 operations, but you can do it using only 3 operations if you were allowed to save and substitute the results:

y = x*x
z = y*y
z*z

so z would be x*x*x*x and z*z would give the x*x*x*x*x*x*x*x

In your case you can do it in 3 operations in any case, by finding the subexpressions and mutliply them or

x*x+x-2

or

(1+x)*x - 2

In computer language: keeping the intermediate results in registers is allowed, but you can't assign them to variables and reuse them later.

 2019-12-25, 01:10 #26 what   Dec 2019 Kansas 1016 Posts I wonder how someone got an error of only 1.803E-7. The best I have managed is 2.9E-6, and I can't think of anything to decrease it. Last fiddled with by what on 2019-12-25 at 02:04
2019-12-25, 03:26   #27
Dieter

Oct 2017

2·32·7 Posts

Quote:
 Originally Posted by SmartMersenne The point was not to store the results but saving operations by substitution. For example: x*x*x*x*x*x*x*x requires 7 operations, but you can do it using only 3 operations if you were allowed to save and substitute the results: y = x*x z = y*y z*z so z would be x*x*x*x and z*z would give the x*x*x*x*x*x*x*x In your case you can do it in 3 operations in any case, by finding the subexpressions and mutliply them or x*x+x-2 or (1+x)*x - 2 In computer language: keeping the intermediate results in registers is allowed, but you can't assign them to variables and reuse them later.
That‘s right. I have asked the puzzlemaster (9.12.):

„Is it allowed to write for example

y=x*x (one operation) and f =(a*y+b)*y+... (the other operations),

or have all 15 operations to be in the same expression?“

You can not define new variables.

2019-12-25, 03:57   #28
Dieter

Oct 2017

1768 Posts

Quote:
 Originally Posted by SmartMersenne The point was not to store the results but saving operations by substitution. For example: x*x*x*x*x*x*x*x requires 7 operations, but you can do it using only 3 operations if you were allowed to save and substitute the results: y = x*x z = y*y z*z so z would be x*x*x*x and z*z would give the x*x*x*x*x*x*x*x In your case you can do it in 3 operations in any case, by finding the subexpressions and mutliply them or x*x+x-2 or (1+x)*x - 2 In computer language: keeping the intermediate results in registers is allowed, but you can't assign them to variables and reuse them later.
In computer language: keeping the intermediate results in registers is allowed, but you can't assign them to variables and reuse them later.

You will say: in ONE Register.

Otherwise I could write:

movsd xmm1,x
mulsd xmm1,x (x*x in xmm1)

movsd xmm0,a
mulsd xmm0,xmm1
mulsd xmm0,xmm1

and so on. I think that this is not allowed.

2019-12-25, 10:25   #29
SmartMersenne

Sep 2017

2058 Posts

Quote:
 Originally Posted by Dieter In computer language: keeping the intermediate results in registers is allowed, but you can't assign them to variables and reuse them later. You will say: in ONE Register. Otherwise I could write: movsd xmm1,x mulsd xmm1,x (x*x in xmm1) movsd xmm0,a mulsd xmm0,xmm1 addsd xmm0,b (a*x*x+b in xmm0) mulsd xmm0,xmm1 addsd xmm0,c ((a*x*x+b)*x*x+c in xmm0) and so on. I think that this is not allowed.
Well, this is practically assigning it to a new variable and re-using it.

2019-12-26, 05:21   #30
SmartMersenne

Sep 2017

13310 Posts

Quote:
 Originally Posted by what I wonder how someone got an error of only 1.803E-7. The best I have managed is 2.9E-6, and I can't think of anything to decrease it.
It may be a bug in their integral computation

 2019-12-26, 14:36 #31 Dr Sardonicus     Feb 2017 Nowhere 590410 Posts I note that they corrected the MSE for their example from .125 to 1/6. I fault the statement of the problem, in that it did not specify the type(s) of constants that were acceptable. I guessed that decimal fractions were OK since the MSE bound and the original, incorrect MSE value for the example were stated as such. I note that they also changed the criteria for "bonus" asterisk(s). In the original statement of the problem, they referred to "elegant" solutions. In the current incarnation, they refer to smallest MSE to date.
2019-12-26, 21:24   #32
what

Dec 2019
Kansas

24 Posts

Quote:
 Originally Posted by SmartMersenne It may be a bug in their integral computation
Might just be

 2019-12-27, 20:51 #33 what   Dec 2019 Kansas 24 Posts I only managed to get the 1.803E-7 MSE after using 21 operations. I wonder what I'm missing

 Similar Threads Thread Thread Starter Forum Replies Last Post Xyzzy Puzzles 6 2019-01-06 23:07 Batalov Puzzles 4 2018-01-04 04:33 Xyzzy Puzzles 11 2017-01-24 12:27 Xyzzy Puzzles 15 2016-01-06 10:23 Xyzzy Puzzles 13 2015-01-02 19:41

All times are UTC. The time now is 13:47.

Mon Aug 15 13:47:43 UTC 2022 up 39 days, 8:35, 1 user, load averages: 0.92, 1.03, 1.02