flat assembler
Message board for the users of flat assembler.
 flat assembler > Heap > What is the best pie you can get with 9 digits? Goto page Previous  1, 2, 3 ... 25, 26, 27, 28, 29  Next
Author
Tomasz Grysztar
Assembly Artist

Joined: 16 Jun 2003
Posts: 6686
Location: Kraków, Poland
 YONG wrote: So, please also try: {1, 4, 5, 6, 7, 9}, {1, 3, 5, 7, 8, 9}, {1, 2, 3, 5, 7, 9}, and {1, 2, 3, 4, 5, 7} for 924269.
I have not run full searches here but did a quick peeks at initial results for some of the sets and the best one I saw is:
 Code: [RPN] 13 5 9 8 / ^ ^ 7 / = 13^(5^(9/8))/7 = 924271.83467746343...
It has been found quite early in the scan, so there might still be better ones out there. But I think that we really need a native implementation to make these searches in reasonable time.
06 Jan 2017, 12:21
bitRAKE

Joined: 21 Jul 2003
Posts: 2624
Location: dank orb
 YONG wrote: In (278^4+-1)/59^6+3, there is no need to write "+-1". Just write "-1". The expression ( 6 / 8 )^5 * (3/9)^1 * (7/4)^2 gives 0.24224853515. Something is wrong with your program.
I wrote +- because there are two solutions with five significant digits +1 and -1.

The other error is clerical in nature, human. Although my program works, it's output needs massaging as I didn't spend any time on that part of it. Also, that machine is not connected to any sort of network, so did a screen scrap with my tired eyes, lol.

Also, I've been unable to find anything interesting along sub-branches you've suggested.

_________________
The generation of random numbers is too important to be left to chance - Robert R Coveyou
09 Jan 2017, 07:37
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
 Tomasz Grysztar wrote: [RPN] 13 5 9 8 / ^ ^ 7 / = 13^( 5^( 9 / 8 )) / 7 = 924271.83467746343...
924271 is not close enough.
09 Jan 2017, 09:25
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
 bitRAKE wrote: I wrote +- because there are two solutions with five significant digits +1 and -1.
I see. Both solutions are correct to 3 decimal places.

(278^4+1)/59^6+3 = 3.141601258 ...
(278^4-1)/59^6+3 = 3.141601258 ...

In fact, I believe we may try all possibilities of the expression

(a/b)^c * (d/e)^f * (g/h)^i

to see if there are any good approximations.

 bitRAKE wrote: I've been unable to find anything interesting along sub-branches you've suggested.
Luck is not on our side!

09 Jan 2017, 09:37
bitRAKE

Joined: 21 Jul 2003
Posts: 2624
Location: dank orb
 YONG wrote: In fact, I believe we may try all possibilities of the expression (a/b)^c * (d/e)^f * (g/h)^i to see if there are any good approximations.
That's a pattern I've exhausted, and posted the best solution.

Think I'll just convert Tomasz' code to x86 and see how far it goes.

_________________
The generation of random numbers is too important to be left to chance - Robert R Coveyou
25 Jan 2017, 05:00
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
 bitRAKE wrote: Think I'll just convert Tomasz' code to x86 and see how far it goes.
That is great news! Good luck!

25 Jan 2017, 05:12
bitRAKE

Joined: 21 Jul 2003
Posts: 2624
Location: dank orb
[ (9/8) + 7/((6*5)/4)^3 + 2 ]^1 = 3.14159(259)

Still debugging code, but looks good.
06 Feb 2017, 10:31
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
Brilliant!

So, the best answers as of now are still correct to 6 decimal places:

bitRAKE: [ ( 9 / 8 ) + 7/((6*5)/4)^3 + 2 ]^1 = 3.14159259259 ...
T.G.: (2+6*9/743)*8^(1/5) = 3.14159288348 ...
YONG: 3^1 + (4^2)/((9+5)*8 + 7 - 6) = 3.14159292035 ...

06 Feb 2017, 10:46
bitRAKE

Joined: 21 Jul 2003
Posts: 2624
Location: dank orb
Some interesting results:
 Code: ; Trying to approximate PI: 3.141592653589793238462643383279503... ; ; Returned equations: ; ; 6:  3 26 1 4 - 5 / ^ + = 3+26^((1-4)/5)                       (complete) ;   = 3.1415 84591 ; 7:  5 3 6 4 + 2 ^ 71 / - / =  5/( 3 - (6+4)^2/71 )            (complete) ;   = 3.141592 92035 ; 8:  631 2 7 5 / 4 / 8 - ^ * = 631*2^(7/5/4 - 8) ;   = 3.141592 79624
Only one thru seven is needed to produce an approximation to six digits. Eight hasn't finished, yet.

Regarding the code, I think the dispatcher can be improved greatly - allowing nine to be completed in less than a day. I'm fairly confident most the bugs are gone.

_________________
The generation of random numbers is too important to be left to chance - Robert R Coveyou
07 Feb 2017, 05:22
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
 bitRAKE wrote: Regarding the code, I think the dispatcher can be improved greatly - allowing nine to be completed in less than a day. I'm fairly confident most the bugs are gone.
Any chance that I could get the Linux version of the code?

I am using GalliumOS right now.

07 Feb 2017, 07:27
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 15324
Location: Bigweld Industries
 YONG wrote: Any chance that I could get the Linux version of the code?
It would by easy to convert. But you would have to actually write some code

07 Feb 2017, 08:28
bitRAKE

Joined: 21 Jul 2003
Posts: 2624
Location: dank orb
Seven digits of percision is possible with [1-8] equation.

( 2*8 )/(4^(73/56) - 1)

It would be unusual if [1-9] equation could not improve on this result.
07 Feb 2017, 13:52
bitRAKE

Joined: 21 Jul 2003
Posts: 2624
Location: dank orb
 YONG wrote: Any chance that I could get the Linux version of the code?
The OS is only used to output a string of length (could be changed to null terminated with single instruction). Also, there is an exception handler (like try/catch in other languages). All other code is non ABI specific.

In fact, Heap's algorithm has the nice property of all state being in the update array. notice how only RAX needs to be cleared after the CALL. The Partitions routine was designed in a similar manner - easing pressure on Dispatcher interface. I have more general (thread-safe) versions of these routines as well.

_________________
The generation of random numbers is too important to be left to chance - Robert R Coveyou
07 Feb 2017, 14:22
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
 bitRAKE wrote: Seven digits of percision is possible with [1-8] equation. ( 2*8 )/(4^(73/56) - 1)
That expression does not count because the digit "9" is missing. Sorry for that.

In fact, my earlier attempt that requires one more digit can also give 7 decimal places:

(6^3 * 4279 + 5)^(1/(8+4)) = 924269^(1/12) = 3.14159260217 ...

We should stick to the rules!

08 Feb 2017, 03:08
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E

bitRAKE wrote:
 YONG wrote: Any chance that I could get the Linux version of the code?
The OS is only used to output a string of length (could be changed to null terminated with single instruction). Also, there is an exception handler (like try/catch in other languages). All other code is non ABI specific.

In fact, Heap's algorithm has the nice property of all state being in the update array. notice how only RAX needs to be cleared after the CALL. The Partitions routine was designed in a similar manner - easing pressure on Dispatcher interface. I have more general (thread-safe) versions of these routines as well.

Thanks for the info. I don't have time to do coding right now. Maybe I'll try coding the Linux version later.

08 Feb 2017, 03:10
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
So, the best answers as of now are still correct to 6 decimal places:

bitRAKE: [ ( 9 / 8 ) + 7/((6*5)/4)^3 + 2 ]^1 = 3.14159259259 ...
T.G.: (2+6*9/743)*8^(1/5) = 3.14159288348 ...
YONG: 3^1 + (4^2)/((9+5)*8 + 7 - 6) = 3.14159292035 ...

08 Feb 2017, 03:15
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 15324
Location: Bigweld Industries
In terms of ratio bitRAKE is the closest.
08 Feb 2017, 03:26
sleepsleep

Joined: 05 Oct 2006
Posts: 6961
Location: ˛　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣ Posts: 6699
the actual pi is what divide by what?
08 Feb 2017, 04:48
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
 sleepsleep wrote: the actual pi is what divide by what?
The circumference of a circle divided by its diameter.

08 Feb 2017, 05:03
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
 revolution wrote: In terms of ratio bitRAKE is the closest.
Correct. That's why his expression currently tops the list of best answers.

08 Feb 2017, 05:04
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------Blog General----------------MainDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsCompiler InternalsIDE DevelopmentOS ConstructionNon-x86 architecturesHigh Level LanguagesProgramming Language DesignProjects and IdeasExamples and Tutorials Other----------------FeedbackHeapTest Area
Goto page Previous  1, 2, 3 ... 25, 26, 27, 28, 29  Next

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou can attach files in this forumYou can download files in this forum