Skip to content

Remove unnecessary computation#22

Open
ssowonny wants to merge 1 commit intoclbustos:masterfrom
ssowonny:master
Open

Remove unnecessary computation#22
ssowonny wants to merge 1 commit intoclbustos:masterfrom
ssowonny:master

Conversation

@ssowonny
Copy link
Copy Markdown

I don't think this line is required. Or please let me know if I miss something.

@envp
Copy link
Copy Markdown
Contributor

envp commented Mar 3, 2016

The code you refer to is not unnecessary. The purpose it serves is to execute the second statement only if the first returns true, so that the who expression is truthy.

See here for a running example.

The reason for having that tidbit there is to exploit the symmetry of the error-function so that only values for qn <= 0.5 need to be computed.

@ssowonny
Copy link
Copy Markdown
Author

ssowonny commented Mar 3, 2016

But the updated value doesn't effect the final value. Even if the first
statement is true, the w3 value is same.

2016년 3월 3일 (목) 오후 10:07, Vaibhav Yenamandra notifications@github.com님이
작성:

The code you refer to is not unnecessary. The purpose it serves is to
execute the second statement only if the first returns true, so that the
who expression is truthy.

See here http://ideone.com/c3D6Ki for a running example.

The reason for having that tidbit there is to exploit the symmetry of the
error-function so that only values for qn <= 0.5 need to be computed.


Reply to this email directly or view it on GitHub
#22 (comment).

@envp
Copy link
Copy Markdown
Contributor

envp commented Mar 4, 2016

Ah, my bad there. w3 is defined as a function of w1*(1-w1), so updating w1 to be < 0.5 wont matter as such. So you're right

With that in mind, thanks for noting this @ssowonny!

The Sciruby files also suffer from this issue, I think its better to post this there for completeness. Since the Sciruby fork is ahead in terms of commits & functionality.

@ssowonny
Copy link
Copy Markdown
Author

ssowonny commented Mar 8, 2016

I posted it on the repository. Thanks 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants