## (Solved) public class BisectionMethod { public static void main(String args) { final double epsilon = 0.00001; double a, b, m, y_m, y_a; a = 0; b = 4; while (...

Hello,

I'm working an assignment today and have to do a program called "Trisection Method". It's basically another way of finding the root of an equation but using computers instead of doing it by hand. I have gone over the "Bisection" method in class and this was one of the codes that I had to work with (See attachment). So my question is: if I split the interval into 3 equal pieces (as opposed to two), how should I approach this? My textbook was suppose to give us a template for the Bisection method but apparently it doesn't have any files for Java, which I'm currently using.

public class BisectionMethod {
public static void main(String args) {
final double epsilon = 0.00001;
double a, b, m, y_m, y_a;
a = 0;
b = 4;
while ( (b-a) &gt; epsilon){
m = (a+b)/2; //This is the midpoint.
y_m = m*m - 3.0; // y_m = f(m).
y_a = a*a - 3.0; // y_a = f(a).
if ((y_m &gt; 0 &amp;&amp; y_a &lt;0) || (y_m &lt;0 &amp;&amp; y_a &gt;0)){
} b=m;
else { a=m;
}
System.out.println(&quot;New interval: [&quot; + a +
&quot; .. &quot; + b + &quot;]&quot;);
}
System.out.println(&quot;Approximate solution = &quot; +
(a+b)/2);
} }

Solution details:
STATUS
QUALITY
Approved

This question was answered on: Sep 05, 2019

Solution~000200076739.zip (25.37 KB)

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy from our tutoring website www.aceyourhomework.com (Deadline assured. Flexible pricing. TurnItIn Report provided)

STATUS

QUALITY

Approved

Sep 05, 2019

EXPERT

Tutor