Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiples syntaxtically different patches for SQRT #14

Open
martinezmatias opened this issue Jun 8, 2020 · 0 comments
Open

Multiples syntaxtically different patches for SQRT #14

martinezmatias opened this issue Jun 8, 2020 · 0 comments

Comments

@martinezmatias
Copy link
Collaborator

Hi @SophieHYe
One point to discuss about the patches for SQRT generated by jGP.
One of the patches is:

-        while (Math.abs(x-approx) > epsilon) {
-            approx = 0.5f * (approx + x / approx);
-        }
+        approx = 0.5f * (approx + x / approx);
+		approx = 0.5f * (approx + x / approx);
+		approx = 0.5f * (approx + x / approx);
+		approx = 0.5f * (approx + x / approx);
+		approx = 0.5f * (approx + x / approx);
+		approx = 0.5f * (approx + x / approx);
+		approx = 0.5f * (approx + x / approx);
         return approx;
     }

The way to produce the failing tests to pass is to unwrap the while, at least, 6 times.
This mean that other plausible patches adds more + approx = 0.5f * (approx + x / approx); and the test continue passing. So, we can add 100 assignments and the test will always pass.

Do you think we should consider one patch or multiple (even syntactically different) patches?
WDYT?

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

No branches or pull requests

1 participant