<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package integral;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

public class SimsonQuadrature extends Quadrature {
	public SimsonQuadrature(Double eps) {
		super(eps);
	}
	protected Double rule(Function&lt;Double, Double&gt; f, Double a, Double b)  {
		return (b - a)/6 * (f.value(a) + 4*f.value((a + b)/2) + f.value(b));
	}
	
	public static void main(String[] args) {
        try {
            String name = "SimsonQuadrature";
            IntegralService integral = new SimsonQuadrature(Double.valueOf(args[0]));
            IntegralService stub =
                (IntegralService) UnicastRemoteObject.exportObject(integral, 0);
            Registry registry = LocateRegistry.getRegistry();
            registry.rebind(name, stub);
            System.out.println("SimsonQuadrature bound");
        } catch (Exception e) {
            System.err.println("SimsonQuadrature exception:");
            e.printStackTrace();
        }

	}

}
</pre></body></html>