1 16 package org.apache.commons.math.analysis; 17 18 import java.io.Serializable ; 19 20 import org.apache.commons.math.FunctionEvaluationException; 21 22 27 public class QuinticFunction implements DifferentiableUnivariateRealFunction, Serializable { 28 29 static final long serialVersionUID = -8866263034920607152L; 30 31 34 public double value(double x) throws FunctionEvaluationException { 35 return (x-1)*(x-0.5)*x*(x+0.5)*(x+1); 36 } 37 38 public UnivariateRealFunction derivative() { 39 return new UnivariateRealFunction() { 40 public double value(double x) throws FunctionEvaluationException { 41 return (5*x*x-3.75)*x*x+0.25; 42 } 43 }; 44 } 45 } 46 | Popular Tags |