Skip to content

Commit cd2adac

Browse files
committed
Small optical change of the erf reporter
* The code of the `erf` reporter has been slightly changed to be a bit more concise.
1 parent f534610 commit cd2adac

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

SocNetABM.nlogo

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,13 @@ end
404404
; negative domain, therefore the argument (x) must be smaller than 0. For
405405
; sources see infotab.
406406
to-report erf [x]
407-
report exp ( 0 - x ^ 2 - 1.26551223 + 1.00002368 / (1 - .5 * x)
408-
+ .37409196 / (1 - .5 * x) ^ 2 + 0.09678418 / (1 - .5 * x) ^ 3
409-
- .18628806 / (1 - .5 * x) ^ 4 + .27886807 / (1 - .5 * x) ^ 5
410-
- 1.13520398 / ( 1 - .5 * x) ^ 6 + 1.48851587 / (1 - .5 * x) ^ 7
411-
- .82215223 / (1 - .5 * x) ^ 8 + .17087277 / (1 - .5 * x) ^ 9)
412-
/ (1 - .5 * x) - 1
407+
let t (1 - .5 * x)
408+
report exp ( 0 - x ^ 2 - 1.26551223 + 1.00002368 / t
409+
+ .37409196 / t ^ 2 + 0.09678418 / t ^ 3
410+
- .18628806 / t ^ 4 + .27886807 / t ^ 5
411+
- 1.13520398 / t ^ 6 + 1.48851587 / t ^ 7
412+
- .82215223 / t ^ 8 + .17087277 / t ^ 9)
413+
/ t - 1
413414
end
414415
@#$#@#$#@
415416
GRAPHICS-WINDOW

0 commit comments

Comments
 (0)