Something is puzzling me.

Here are two code snippets:

c=c+a
d=c+@seed
pz=pz^2+d
`

and

pz=pz^2+c+a+@seed

According to my understanding, these should produce the same result.

They do not.

Here's the formula:

class OM_ForumQuestion(common.ulb:DivergentFormula) {
public:
complex func Init(complex pz)
fpixel=pz
a=(0,0)
c=@seed
return pz
endfunc
private:
complex c
complex fpixel
complex a
complex func Iterate(complex pz)
float b=@p1
c=c-@p2*b
a=@p2+cotanh(pz/fpixel)
if @v==0
c=c+a
d=c+@seed
pz=pz^2+d
elseif @v==1
pz=pz^2+c+a+@seed
endif
return pz
endfunc
default:
title="Forum Question"
param v
caption="Variation"
enum="1""2"
endparam
param seed
caption="Seed"
default=(-0.5,0)
endparam
param p1
caption="Parameter 1"
default=0.7
endparam
param p2
caption="Parameter 2"
default=(0.01,0)
endparam
param p_power
visible=false
endparam
float param p_bailout
caption="Bailout"
default=128.0
exponential=true
endparam
}

and these are the two results:

Variation 1:
69eeedc7f4106.png

Variation 2:
69eeedfb61e6d.png

This is not a problem, because both variations are interesting, but I'd like to know why there is a difference. I'm guessing there is something glaringly obvious that I'm missing. Any suggestions?

Something is puzzling me. Here are two code snippets: ``` c=c+a d=c+@seed pz=pz^2+d ```` and ```` pz=pz^2+c+a+@seed ```` According to my understanding, these should produce the same result. They do not. Here's the formula: ```` class OM_ForumQuestion(common.ulb:DivergentFormula) { public: complex func Init(complex pz) fpixel=pz a=(0,0) c=@seed return pz endfunc private: complex c complex fpixel complex a complex func Iterate(complex pz) float b=@p1 c=c-@p2*b a=@p2+cotanh(pz/fpixel) if @v==0 c=c+a d=c+@seed pz=pz^2+d elseif @v==1 pz=pz^2+c+a+@seed endif return pz endfunc default: title="Forum Question" param v caption="Variation" enum="1""2" endparam param seed caption="Seed" default=(-0.5,0) endparam param p1 caption="Parameter 1" default=0.7 endparam param p2 caption="Parameter 2" default=(0.01,0) endparam param p_power visible=false endparam float param p_bailout caption="Bailout" default=128.0 exponential=true endparam } ```` and these are the two results: Variation 1: ![69eeedc7f4106.png](serve/attachment&path=69eeedc7f4106.png) Variation 2: ![69eeedfb61e6d.png](serve/attachment&path=69eeedfb61e6d.png) This is not a problem, because both variations are interesting, but I'd like to know why there is a difference. I'm guessing there is something glaringly obvious that I'm missing. Any suggestions?
 
0
reply

The second version does not change c, which will be important in following iterations.

The second version does not change c, which will be important in following iterations.
 
0
reply

Ah, thank you Jim! It is indeed obvious now you point it out smile

Ah, thank you Jim! It is indeed obvious now you point it out ]:)
 
0
reply
18
views
2
replies
2
followers
live preview
Enter at least 10 characters.
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft