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:
Variation 2:
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:

Variation 2:

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?