## unexpected order of evaluation

### Re: unexpected order of evaluation

srvaldez

Please remember that when you are trying to get ArcCot working in bigfloat-05 that the last arccot should be - Arccot (-20, 239).

You have - Arccot (20, 239).

The value of x in that function immediately is

-.10000000000000000000000000000000000000000000000000000000000000e-00017

after

x=1 : x=x/d

which throws everything off.

I messed about a bit, but couldn't get x to be .0041841004184100418410041841004184100418410041841004 or thereabouts which it should be.

Please remember that when you are trying to get ArcCot working in bigfloat-05 that the last arccot should be - Arccot (-20, 239).

You have - Arccot (20, 239).

The value of x in that function immediately is

-.10000000000000000000000000000000000000000000000000000000000000e-00017

after

x=1 : x=x/d

which throws everything off.

I messed about a bit, but couldn't get x to be .0041841004184100418410041841004184100418410041841004 or thereabouts which it should be.

### Re: unexpected order of evaluation

dodicat

I am confused, I just downloaded my program from the link that I posted, set the precision to 1000 and checked the result against that given by the pari/gp calculator http://pari.math.u-bordeaux.fr/, the relative error was -5.003865326277570842 E-1007

would you please re-download the program and try again ?

let me know what happens

<edit> the reason that I do x=1 : x=x/d is so that x will be set to bigfloat 1, a bigfloat divided by an integer will give full bigfloat precision, but x=1/d will set x to the double precision of 1/d

you could do x=bigfloat(1)/d and it would work

you can also use quoted literals to assign bigfloat constants to a bigfloat variable: x="1" for example

I am confused, I just downloaded my program from the link that I posted, set the precision to 1000 and checked the result against that given by the pari/gp calculator http://pari.math.u-bordeaux.fr/, the relative error was -5.003865326277570842 E-1007

would you please re-download the program and try again ?

let me know what happens

<edit> the reason that I do x=1 : x=x/d is so that x will be set to bigfloat 1, a bigfloat divided by an integer will give full bigfloat precision, but x=1/d will set x to the double precision of 1/d

you could do x=bigfloat(1)/d and it would work

you can also use quoted literals to assign bigfloat constants to a bigfloat variable: x="1" for example

### Re: unexpected order of evaluation

also, in the arccot example function I used the non-overloaded multiply and divide so that I could limit the precision and speed things up

I implemented that trick in the fpatn function and for precision 2000 or greater it's significantly faster than without the trick

I implemented that trick in the fpatn function and for precision 2000 or greater it's significantly faster than without the trick

### Re: unexpected order of evaluation

I downloaded again.

result:
This is with 64 bit windows compiler.

The 32 bit compiler:below

result:

Code: Select all

```
NUMBER_OF_DIGITS = 50
d = 239
lim= 12
pr= 0.4326756663205261
d = 57
lim= 15
pr= 0.3461405330564209
d = 18
lim= 21
pr= 0.2472432378974435
-.10000000000000000000000000000000000000000000000000000000000000e-00019
0.003606299869716167
```

The 32 bit compiler:below

Code: Select all

```
NUMBER_OF_DIGITS = 50
d = 239
lim= 12
pr= 0.4326756663205261
d = 57
lim= 15
pr= 0.3461405330564209
d = 18
lim= 21
pr= 0.2472432378974435
-.10000000000000000000000000000000000000000000000000000000000000e-42949672
0.003194000224539195
```

### Re: unexpected order of evaluation

dodicat

since the compile command is at the top of file via #cmdline I can discount that as the problem, what version of FB are you using?

since the compile command is at the top of file via #cmdline I can discount that as the problem, what version of FB are you using?

### Re: unexpected order of evaluation

I as using 1.10.1

### Re: unexpected order of evaluation

I just downloaded FB-1.10.1-mingw-w64 gcc 11.2.0 and had no problem, I am stumped, try the following and tell me what you get

? pie-"3.14159265358979323846264338327950288419716939937510582096978610"

instead of ? pie

my suspicion is that the conversion to string is not working right, my guess is that it could be because of different text encoding

try compiling from the CLI

? pie-"3.14159265358979323846264338327950288419716939937510582096978610"

instead of ? pie

my suspicion is that the conversion to string is not working right, my guess is that it could be because of different text encoding

try compiling from the CLI

### Re: unexpected order of evaluation

It just freezes.

I tried with 1.2 (version shown at the end), not subtracting the string
I have a command line editor, still the same direct from command line.

I tried with 1.2 (version shown at the end), not subtracting the string

Code: Select all

```
NUMBER_OF_DIGITS = 50
d = 239
lim= 12
pr= 0.4326756663205261
d = 57
lim= 15
pr= 0.3461405330564209
d = 18
lim= 21
pr= 0.2472432378974435
-.10000000000000000000000000000000000000000000000000000000000000e-42949672
0.00383829977363348
1.20.0
```

Last edited by dodicat on Sep 11, 2024 19:39, edited 1 time in total.

### Re: unexpected order of evaluation

compile the original file from the download using the CLI

I think that your editor is changing the text encoding and causing problems

I think that your editor is changing the text encoding and causing problems

### Re: unexpected order of evaluation

I tried notepad, wordpad, and direct command line.

### Re: unexpected order of evaluation

Ok, last resort

here's the compiled executable https://u.pcloud.link/publink/show?code ... 2sAhGYURL7

be sure to check for viruses

I forgot to put a sleep at the end so run from the console

here's the compiled executable https://u.pcloud.link/publink/show?code ... 2sAhGYURL7

be sure to check for viruses

I forgot to put a sleep at the end so run from the console

### Re: unexpected order of evaluation

I used the built in

i=__builtin_clz(fac3(0))

instead of the naked asm.

OK now.

i=__builtin_clz(fac3(0))

instead of the naked asm.

OK now.

Code: Select all

```
NUMBER_OF_DIGITS = 50
d = 239
lim= 12
pr= 0.4326756663205261
d = 57
lim= 15
pr= 0.3461405330564209
d = 18
lim= 21
pr= 0.2472432378974435
3.14159265358979323846264338327950288419716939937510582096978610e+00000
0.003082999959588051
```

### Re: unexpected order of evaluation

Ok, will change that

thanks dodicat for the debug session

now the question is why the naked function didn't work for you

thanks dodicat for the debug session

now the question is why the naked function didn't work for you

### Re: unexpected order of evaluation

probably because I am sitting here with my clothes on.