<commit_before>package ode

import (
	"errors"
	"math"
)

// DormandPrince is an integrator based on the Dormand–Prince method.
//
// https://en.wikipedia.org/wiki/Dormand–Prince_method
type DormandPrince struct {
	config Config
}

// NewDormandPrince creates a new Dormand–Prince integrator.
func NewDormandPrince(config *Config) (*DormandPrince, error) {
	if err := config.verify(); err != nil {
		return nil, err
	}
	return &DormandPrince{config: *config}, nil
}

// Compute integrates the system of differential equations y' = f(x, y). The
// derivative function should evaluate f(x, y) given x and y in its first and
// second arguments, respectively, and store the result in its third argument.
// The initial value of y is given by initial. The first and last elements of
// the points array specify the interval of integration; hence, points should
// contain at least two elements. If points contain more than two elements, the
// solution is returned at exactly those points; otherwise, apart from the
// endpoints, the solution is also given a number of intermediary points that
// the algorithm internally goes through. The solution is returned in the first
// output of the function while the corresponding points in the second one.
func (self *DormandPrince) Compute(derivative func(float64, []float64, []float64),
	points []float64, initial []float64) ([]float64, []float64, *Stats, error) {

	const (
		c2 = 1.0 / 5
		c3 = 3.0 / 10
		c4 = 4.0 / 5
		c5 = 8.0 / 9

		a21 = 1.0 / 5
		a31 = 3.0 / 40
		a32 = 9.0 / 40
		a41 = 44.0 / 45
		a42 = -56.0 / 15
		a43 = 32.0 / 9
		a51 = 19372.0 / 6561
		a52 = -25360.0 / 2187
		a53 = 64448.0 / 6561
		a54 = -212.0 / 729
		a61 = 9017.0 / 3168
		a62 = -355.0 / 33
		a63 = 46732.0 / 5247
		a64 = 49.0 / 176
		a65 = -5103.0 / 18656
		a71 = 35.0 / 384
		a73 = 500.0 / 1113
		a74 = 125.0 / 192
		a75 = -2187.0 / 6784
		a76 = 11.0 / 84<commit_msg>Fixed a typo<commit_after>package ode

import (
	"errors"
	"math"
)

// DormandPrince is an integrator based on the Dormand–Prince method.
//
// https://en.wikipedia.org/wiki/Dormand–Prince_method
type DormandPrince struct {
	config Config
}

// NewDormandPrince creates a new Dormand–Prince integrator.
func NewDormandPrince(config *Config) (*DormandPrince, error) {
	if err := config.verify(); err != nil {
		return nil, err
	}
	return &DormandPrince{config: *config}, nil
}

// Compute integrates the system of differential equations y' = f(x, y). The
// derivative function should evaluate f(x, y) given x and y in its first and
// second arguments, respectively, and store the result in its third argument.
// The initial value of y is given by initial. The first and last elements of
// the points array specify the interval of integration; hence, points should
// contain at least two elements. If points contain more than two elements, the
// solution is returned at exactly those points; otherwise, apart from the
// endpoints, the solution is also given at a number of intermediary points that
// the algorithm internally goes through. The solution is returned in the first
// output of the function while the corresponding points in the second one.
func (self *DormandPrince) Compute(derivative func(float64, []float64, []float64),
	points []float64, initial []float64) ([]float64, []float64, *Stats, error) {

	const (
		c2 = 1.0 / 5
		c3 = 3.0 / 10
		c4 = 4.0 / 5
		c5 = 8.0 / 9

		a21 = 1.0 / 5
		a31 = 3.0 / 40
		a32 = 9.0 / 40
		a41 = 44.0 / 45
		a42 = -56.0 / 15
		a43 = 32.0 / 9
		a51 = 19372.0 / 6561
		a52 = -25360.0 / 2187
		a53 = 64448.0 / 6561
		a54 = -212.0 / 729
		a61 = 9017.0 / 3168
		a62 = -355.0 / 33
		a63 = 46732.0 / 5247
		a64 = 49.0 / 176
		a65 = -5103.0 / 18656
		a71 = 35.0 / 384
		a73 = 500.0 / 1113
		a74 = 125.0 / 192
		a75 = -2187.0 / 6784
		a76 = 11.0 / 84
{'fraction_non_alphanumeric': 0.10976253298153034, 'fraction_numerical': 0.11029023746701846, 'mean_word_length': 2.8683673469387756, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '628306', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1304, 'n_words': 508}