Skip to content

Writing a Custom Plugin

This tutorial walks through building a simple plugin from scratch. We'll create a plugin that counts how many mutations are accepted vs rejected during the search, which is useful for diagnosing whether the search is exploring effectively.

Defining the plugin

A plugin has two parts: an immutable config struct (subtyping AbstractPlugin) and a mutable state object returned by init_plugin_state.

julia
using SymbolicRegression
using SymbolicRegression: AbstractPlugin, MutationEvent, AbstractMutation
using SymbolicRegression: machine, fit!, report
using Test

struct MutationCounterPlugin <: AbstractPlugin end

mutable struct MutationCounterState
    accepted::Int
    rejected::Int
end

Implementing the hooks

Create the state once per output at search start:

julia
function SymbolicRegression.init_plugin_state(::MutationCounterPlugin, options, dataset)
    return MutationCounterState(0, 0)
end

The on_mutation_end! hook fires on the worker after each mutation's accept/reject decision. We increment the appropriate counter:

julia
function SymbolicRegression.on_mutation_end!(
    state::MutationCounterState,
    ::MutationCounterPlugin,
    ::AbstractMutation,
    event::MutationEvent,
    dataset,
    options,
)
    if event.accepted
        state.accepted += 1
    else
        state.rejected += 1
    end
    return nothing
end

Pass the plugin to SRRegressor via the plugins keyword. All default plugins (like AdaptiveParsimonyPlugin) are still active alongside yours.

julia
X = 2randn(100, 5)
y = @. cos(X[:, 1]) + X[:, 2]^2

model = SRRegressor(;
    binary_operators=[+, -, *, /],
    unary_operators=[cos],
    plugins=(MutationCounterPlugin(),),
    niterations=5,
)
mach = machine(model, X, y)
fit!(mach)
SymbolicRegression.MLJInterfaceModule.Machine{SRRegressor{DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}, Nothing}, Tuple{Matrix{Float64}, Vector{Float64}}}(SRRegressor{DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}, Nothing}(nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, false, :log, nothing, true, true, nothing, nothing, nothing, true, Optim.BFGS{LineSearches.InitialStatic{Float64}, LineSearches.BackTracking{Float64, Int64}, Nothing, Nothing, Optim.Flat}(LineSearches.InitialStatic{Float64}(1.0, false), LineSearches.BackTracking{Float64, Int64}(0.0001, 0.5, 0.1, 1000, 3, Inf, nothing), nothing, nothing, Optim.Flat()), 2, 0.14, nothing, nothing, nothing, true, true, true, nothing, nothing, nothing, nothing, nothing, nothing, IOStream(<fd 8>), nothing, nothing, false, false, nothing, false, nothing, nothing, 5, nothing, nothing, true, nothing, nothing, nothing, false, "pysr_trace.jsonl", PopMember, (Main.MutationCounterPlugin(),), nothing, true, nothing, nothing, nothing, nothing, false, nothing, nothing, [cos], Function[+, -, *, /], 5, :multithreading, nothing, nothing, nothing, nothing, nothing, nothing, nothing, true, nothing, Nothing, nothing, SymbolicRegression.MLJInterfaceModule.choose_best, DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}), ([1.7928394986799168 1.661617840098342 … -1.360423602900896 -3.5438993538884818; -1.0510486262364733 0.2842355645531272 … 0.6221611573589212 0.6443456137271191; … ; -2.403541426507712 2.3567672271701126 … -0.711172273409159 -1.8902236182815573; -0.3204568870651959 -1.1852030299168697 … -2.1969496282060663 -1.9533272824352788], [2.540750754113591, 0.5774510278940178, -0.31326457792521684, 0.22046336509484563, 2.3757665103582175, 4.42587712875211, 5.549122126741861, 5.201089511555046, 7.394001301620955, 3.0403753813699543  …  2.5951663284048188, 9.446696403624356, 7.877777170474388, 1.5454785775006517, 10.951258584451358, 3.80227128446924, 4.352766097406586, 0.09186038468447266, 4.814570573390618, 2.3537978197444334]), SymbolicRegression.MLJInterfaceModule.SRFitResult{SRRegressor{DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}, Nothing}, Tuple{Vector{Vector{Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}}}, HallOfFame{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}}, Options{SymbolicRegression.CoreModule.OptionsStructModule.ComplexityMapping{Int64, Int64, 2}, OperatorEnum, Tuple{Int64, Int64}, Tuple{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, Node{T, 2} where T, Expression, @NamedTuple{}, Tuple{Main.MutationCounterPlugin, SimulatedAnnealingPlugin, AdaptiveParsimonyPlugin, AdaptiveMutationWeightsPlugin}, PopMember, false, false, nothing, Nothing, 5, false, Symbol, Nothing}, Nothing, Nothing, SymbolicRegression.MLJInterfaceModule.SRFitResultTypes{Float64, Matrix{Float64}, Vector{Float64}, Nothing, Tuple{Vector{Vector{Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}}}, HallOfFame{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}}, Vector{DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}}, DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}, Nothing, Nothing}}(SRRegressor{DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}, Nothing}(nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, false, :log, nothing, true, true, nothing, nothing, nothing, true, Optim.BFGS{LineSearches.InitialStatic{Float64}, LineSearches.BackTracking{Float64, Int64}, Nothing, Nothing, Optim.Flat}(LineSearches.InitialStatic{Float64}(1.0, false), LineSearches.BackTracking{Float64, Int64}(0.0001, 0.5, 0.1, 1000, 3, Inf, nothing), nothing, nothing, Optim.Flat()), 2, 0.14, nothing, nothing, nothing, true, true, true, nothing, nothing, nothing, nothing, nothing, nothing, IOStream(<fd 8>), nothing, nothing, false, false, nothing, false, nothing, nothing, 5, nothing, nothing, true, nothing, nothing, nothing, false, "pysr_trace.jsonl", PopMember, (Main.MutationCounterPlugin(),), nothing, true, nothing, nothing, nothing, nothing, false, nothing, nothing, [cos], Function[+, -, *, /], 5, :multithreading, nothing, nothing, nothing, nothing, nothing, nothing, nothing, true, nothing, Nothing, nothing, SymbolicRegression.MLJInterfaceModule.choose_best, DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}), (Vector{Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}}[[Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (4.382571752005967), loss = 16.921801793093913, cost = 0.5260421694421854), PopMember(tree = (4.382571752005967), loss = 16.921801793093913, cost = 0.5260421694421854), PopMember(tree = ((-9.103467580740325 - (x5 * -0.06811988940004719)) / -1.6912858760029834), loss = 18.76037285499631, cost = 0.5831971888604767), PopMember(tree = (4.382571752005967), loss = 16.921801793093913, cost = 0.5260421694421854), PopMember(tree = (3.930714913379413), loss = 16.717627190474634, cost = 0.5196950645522868), PopMember(tree = (5.382571752005967), loss = 18.82551547035961, cost = 0.5852222546973094), PopMember(tree = (3.930714913424334), loss = 16.71762719047463, cost = 0.5196950645522866), PopMember(tree = (4.382571752005967), loss = 16.921801793093913, cost = 0.5260421694421854), PopMember(tree = (3.382571752005967), loss = 17.018088115828206, cost = 0.5290353888828853), PopMember(tree = (3.9307149133949673), loss = 16.71762719047463, cost = 0.5196950645522866)  …  PopMember(tree = (1.6912858760029834), loss = 21.732669603891157, cost = 0.6755959445682002), PopMember(tree = (4.382571752005967), loss = 16.921801793093913, cost = 0.5260421694421854), PopMember(tree = (4.382571752005967), loss = 16.921801793093913, cost = 0.5260421694421854), PopMember(tree = (2.6912858760029836), loss = 18.25381152915089, cost = 0.5674498930310228), PopMember(tree = (4.382571752005967), loss = 16.921801793093913, cost = 0.5260421694421854), PopMember(tree = (4.382571752005967), loss = 16.921801793093913, cost = 0.5260421694421854), PopMember(tree = (4.382571752005967), loss = 16.921801793093913, cost = 0.5260421694421854), PopMember(tree = (-4.382571752005967), loss = 85.82836237124435, cost = 2.6681164626254907), PopMember(tree = (6.073857628008949), loss = 21.310687885771276, cost = 0.6624779455998328), PopMember(tree = (4.382571752005967), loss = 16.921801793093913, cost = 0.5260421694421854)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (((x2 * x2) + (x3 + 0.25994422740069184)) - x3), loss = 0.4488072065260409, cost = 0.013951913600512603), PopMember(tree = (((x2 * 0.25994422740069184) - x3) + (x3 + 0.25994422740069184)), loss = 31.014479969474895, cost = 0.9641363565623483), PopMember(tree = ((((x2 * x2) - x3) + (x3 + 0.25994422740069184)) + 0.0), loss = 0.4488072065260409, cost = 0.013951913600512603), PopMember(tree = (((((x2 * x2) - x3) + 0.25994422740069184) + x3) + 0.0), loss = 0.4488072065260409, cost = 0.013951913600512603), PopMember(tree = (((x2 * x2) - x3) + (x3 + 0.25994422740069184)), loss = 0.4488072065260409, cost = 0.013951913600512603), PopMember(tree = (((x2 * x3) - x3) + (x3 + 0.25994422740069184)), loss = 37.83018213335156, cost = 1.1760137202376943), PopMember(tree = (((x2 * x2) + (((0.25994422740069184 - x2) + x3) + 0.25994422740069184)) - x3), loss = 4.445223718865065, cost = 0.13818712435705105), PopMember(tree = (((x2 * x2) - x3) + ((x3 + 0.5198884548013837) - 0.25994422740069184)), loss = 0.4488072065260409, cost = 0.013951913600512603), PopMember(tree = (0.25994422740069184), loss = 30.192184619469103, cost = 0.9385739468894136), PopMember(tree = ((((x2 * x2) - ((((x2 * x2) - x3) + 0.25994422740069184) + x3)) + (x3 + 0.25994422740069184)) + 0.0), loss = 38.492150637137335, cost = 1.1965921049801502)  …  PopMember(tree = (((((x2 * x2) - x2) + 0.25994422740069184) + x3) + 0.0), loss = 7.131449798388246, cost = 0.22169290061908298), PopMember(tree = (((x2 * x2) - x3) + (((x3 + 0.25994422740069184) + x2) - 0.25994422740069184)), loss = 4.122018322800679, cost = 0.12813975057262827), PopMember(tree = (((x3 + 0.5198884548013837) - 0.25994422740069184) + 0.25994422740069184), loss = 34.53269012761524, cost = 1.07350573263535), PopMember(tree = (((x2 * x2) - x3) + ((x3 + 0.5198884548013837) - 0.25994422740069184)), loss = 0.4488072065260409, cost = 0.013951913600512603), PopMember(tree = (((x2 * x2) - x3) + ((x3 + 0.5895896579052864) - 0.4082323867504589)), loss = 0.44263129683360064, cost = 0.013759925242971613), PopMember(tree = (((x2 * x2) - x3) + (x3 + 0.25994422740069184)), loss = 0.4488072065260409, cost = 0.013951913600512603), PopMember(tree = (((x2 * x2) + (x3 + 0.25994422740069184)) - x3), loss = 0.4488072065260409, cost = 0.013951913600512603), PopMember(tree = (((x2 * (x2 - -0.4959193921292002)) - x3) + (x3 + 0.25994422740069184)), loss = 1.3110289853768748, cost = 0.040755502286446796), PopMember(tree = (((x2 * 0.25994422740069184) + (x3 + 0.25994422740069184)) - x3), loss = 31.014479969474895, cost = 0.9641363565623483), PopMember(tree = (((x2 * x2) - x3) + ((x3 + 0.25994422740069184) + (((((x2 * x2) - x3) + (x3 + 0.25994422740069184)) + 0.0) - 0.25994422740069184))), loss = 31.182290153543434, cost = 0.9693530134149262)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = ((x2 - (x2 + -0.14321597579486323)) + x2), loss = 37.008893509538495, cost = 1.1504826063119225), PopMember(tree = (((x2 * x2) - (x2 + 0.006729435794707389)) + x2), loss = 0.478007906163642, cost = 0.014859665598462512), PopMember(tree = (x2 + ((x2 * x2) - (x2 + -0.14321597579486323))), loss = 0.4440860552451179, cost = 0.01380514881196065), PopMember(tree = (((x2 * x2) - (x2 + -0.18135727115418387)) + x2), loss = 0.4426312968336007, cost = 0.013759925242971614), PopMember(tree = (((x2 * x2) - (x2 + ((((x2 * x2) - (x2 + -0.14321597579486323)) + x2) * 0.18368593390361318))) + x2), loss = 1.8093663944580274, cost = 0.05624714407451182), PopMember(tree = (((x2 * x2) - (x2 + -0.14321597579486323)) + x2), loss = 0.4440860552451179, cost = 0.01380514881196065), PopMember(tree = (((x2 * x2) - (x2 + ((x2 + 0.040469958108749954) * 0.18368593390361318))) + x2), loss = 0.6235788189110536, cost = 0.019384977955009534), PopMember(tree = (((x2 * x2) - (x2 + -0.9296239245344647)) + x2), loss = 1.002534281397855, cost = 0.031165434672678963), PopMember(tree = (((x2 * x2) - (x2 + (((x2 * x2) - (x2 + -0.14321597579486323)) * 0.18368593390361318))) + x2), loss = 1.9952329247690777, cost = 0.062025112285404096), PopMember(tree = (((x2 * x2) - (x2 + -0.14321597579486323)) + x2), loss = 0.4440860552451179, cost = 0.01380514881196065)  …  PopMember(tree = (((x2 * x2) + x2) - (x2 + -0.14321597579486323)), loss = 0.444086055245118, cost = 0.013805148811960653), PopMember(tree = (x2), loss = 38.124118852021816, cost = 1.1851512288232824), PopMember(tree = (((x2 * x2) - (x2 + -0.14321597579486323)) + (((x2 * x2) - (x2 + -0.14321597579486323)) + x2)), loss = 37.56718054683914, cost = 1.1678378813508332), PopMember(tree = (((x2 * x2) - -0.9633644468485073) + x2), loss = 4.6343798766464435, cost = 0.14406735607346757), PopMember(tree = (((x2 * x2) - (x2 + -0.18135727058417014)) + x2), loss = 0.44263129683360075, cost = 0.013759925242971616), PopMember(tree = (x2 + -0.7796785129448941), loss = 44.91505025724545, cost = 1.3962585525359874), PopMember(tree = (-0.7796785129448941), loss = 38.905433421174564, cost = 1.2094396832088927), PopMember(tree = (((x2 * x2) - (x2 + -0.1813572708710422)) + x2), loss = 0.4426312968336007, cost = 0.013759925242971614), PopMember(tree = (x2), loss = 38.124118852021816, cost = 1.1851512288232824), PopMember(tree = (((x2 * (x2 * x2)) - (x2 + -0.14321597579486323)) + x2), loss = 437.7086188917998, cost = 13.606895665174115)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (cos((x1 + 0.4846766695137085) - 0.2666209297930546) + (x2 * ((x1 - 0.1333104648965273) + 0.4846766695137085))), loss = 39.76391656728722, cost = 1.2361270503186386), PopMember(tree = (cos(x2 - 0.1333104648965273) + (x2 * x2)), loss = 1.044539860641847, cost = 0.032471247511309614), PopMember(tree = (cos(((x1 - 0.1333104648965273) + 0.4846766695137085) - ((x1 + 0.35136620461718127) - 0.1333104648965273)) + (x2 * x2)), loss = 1.0983588156837791, cost = 0.03414429865642606), PopMember(tree = (cos((x1 + 0.35136620461718127) - (cos(((x1 - 0.1333104648965273) + 0.4846766695137085) - 0.1333104648965273) + (x2 * x2))) + (x2 * x2)), loss = 0.8316037205129756, cost = 0.0258517757508171), PopMember(tree = ((cos((x1 + 0.4846766695137085) - 0.2666209297930546) + (x2 * x2)) - x1), loss = 3.2937687642378446, cost = 0.1023922444882738), PopMember(tree = (cos(((x1 - 0.1333104648965273) + 0.4846766695137085) - 0.1333104648965273) + x2), loss = 36.30245099974293, cost = 1.1285216736061212), PopMember(tree = ((x2 * x2) + 0.9389033677488263), loss = 1.0165073853027504, cost = 0.0315998116959917), PopMember(tree = ((cos((x1 + 0.4846766695137085) - 0.1333104648965273) - 0.1333104648965273) + (x2 * x2)), loss = 0.07544887628112847, cost = 0.002345452986992069), PopMember(tree = (cos(((x1 - 0.1333104648965273) + cos(x5 * -1.2773569178437016)) - 0.1333104648965273) + (x2 * x2)), loss = 0.27316500771355945, cost = 0.00849178562840614), PopMember(tree = (cos(((x1 - -0.4708410512850154) + x1) - -0.30907084915507727) + (x2 * x2)), loss = 0.8512220915590415, cost = 0.026461645231158494)  …  PopMember(tree = (cos((x1 + 0.4846766695137085) - 0.1333104648965273) + (x2 * x2)), loss = 0.0625827153641668, cost = 0.0019454871155141884), PopMember(tree = (cos(((x1 - 0.1333104648965273) + 0.4846766695137085) - 0.1333104648965273) + (x2 * x2)), loss = 0.024489825997308555, cost = 0.0007613067068391898), PopMember(tree = (cos((x1 - -0.5942020188494991) + x2) + (x2 * x2)), loss = 0.8703993334279942, cost = 0.027057801482130453), PopMember(tree = ((x2 * x2) + 0.7630790679401758), loss = 0.7810315456921118, cost = 0.02427965613368307), PopMember(tree = (cos(((x1 + 0.4846766695137085) - x2) - 0.1333104648965273) + (x2 * x2)), loss = 0.9655220962799831, cost = 0.03001484974128311), PopMember(tree = ((cos((x1 + 0.4846766695137085) - 0.1333104648965273) - 0.1333104648965273) + (x2 * x2)), loss = 0.07544887628112847, cost = 0.002345452986992069), PopMember(tree = (cos((x1 + 0.35136620461718127) - 0.1333104648965273) + (x2 * x2)), loss = 0.024489825997308565, cost = 0.0007613067068391902), PopMember(tree = (0.1333104648965273), loss = 31.137907735784424, cost = 0.967973312623692), PopMember(tree = ((x2 * x2) + 0.9911273118735078), loss = 1.0983588156837791, cost = 0.03414429865642606), PopMember(tree = (cos((x1 - 0.2666209297930546) + 0.4846766695137085) + (x2 * (x2 * x2))), loss = 441.1152253386803, cost = 13.712795655474444)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = ((x2 * ((x2 * x2) + cos(x1))) + cos(x1)), loss = 447.6681259629371, cost = 13.91650339905113), PopMember(tree = ((x2 * x2) + cos(x1)), loss = 0.0, cost = 0.0), PopMember(tree = (x1), loss = 37.52929918211306, cost = 1.166660276535129), PopMember(tree = ((x2 * x2) + cos(x1)), loss = 0.0, cost = 0.0), PopMember(tree = (((x2 * x2) + cos(x1)) - x5), loss = 4.016586452646668, cost = 0.12486222667876032), PopMember(tree = ((x2 + cos(x1)) * x2), loss = 2.207561295621556, cost = 0.06862569053369363), PopMember(tree = (((x2 * x2) * x2) + cos(x1)), loss = 440.37279051194446, cost = 13.689715842124725), PopMember(tree = (x2), loss = 38.124118852021816, cost = 1.1851512288232824), PopMember(tree = ((x2 * x2) + cos(x2 - 1.1096630147760485)), loss = 1.1206235904139326, cost = 0.034836435968066924), PopMember(tree = ((x2 * x2) + cos(cos(x1))), loss = 0.8537106754238011, cost = 0.0265390069726009)  …  PopMember(tree = ((x2 * x2) + cos(x1)), loss = 0.0, cost = 0.0), PopMember(tree = ((((x2 * x2) + cos(x1)) * x2) + cos(x1)), loss = 447.6681259629371, cost = 13.91650339905113), PopMember(tree = ((x2 * x2) - cos(x1)), loss = 1.902087026533144, cost = 0.05912951812930963), PopMember(tree = ((x2 * ((x2 * x2) + cos(x1))) + cos(x1)), loss = 447.6681259629371, cost = 13.91650339905113), PopMember(tree = (x2), loss = 38.124118852021816, cost = 1.1851512288232824), PopMember(tree = (x2 * (x2 + cos(x1))), loss = 2.207561295621556, cost = 0.06862569053369363), PopMember(tree = (x2 * (x2 + cos(x1))), loss = 2.207561295621556, cost = 0.06862569053369363), PopMember(tree = ((x2 * x2) + cos(x1)), loss = 0.0, cost = 0.0), PopMember(tree = ((x2 * x2) + cos((x2 * x2) + cos(x1))), loss = 1.2178338965322297, cost = 0.03785837895900054), PopMember(tree = ((cos(x1) * x2) + cos(x1)), loss = 28.828524084981265, cost = 0.8961823059332222)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (x2 - x2), loss = 32.16814692068846, cost = 1.0), PopMember(tree = (cos(x2 - cos(x2 - x2))), loss = 34.45413674362848, cost = 1.0710637708966015), PopMember(tree = (x2), loss = 38.124118852021816, cost = 1.1851512288232824), PopMember(tree = (cos(x2 - cos(x2 - x2))), loss = 34.45413674362848, cost = 1.0710637708966015), PopMember(tree = (cos((x2 - x2) - x2)), loss = 37.05679982069675, cost = 1.15197185315217), PopMember(tree = (x2), loss = 38.124118852021816, cost = 1.1851512288232824), PopMember(tree = (cos(x2 - x2) - x2), loss = 26.918264324350467, cost = 0.836798724860287), PopMember(tree = (cos(cos(x2 - x2))), loss = 28.212524839603333, cost = 0.8770329515455824), PopMember(tree = (cos(x2 + x2)), loss = 32.155950651632224, cost = 0.9996208588239073), PopMember(tree = (cos(x2 - x2)), loss = 25.306717093942233, cost = 0.7867011163663457)  …  PopMember(tree = (cos(x2 - x2)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x2 - x2) * x1), loss = 37.52929918211306, cost = 1.166660276535129), PopMember(tree = (x2 - x2), loss = 32.16814692068846, cost = 1.0), PopMember(tree = (cos(x2 - x2)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x2 - x2)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x2 - x2)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x2 - x2)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x2 - cos(x2 - x2))), loss = 34.45413674362848, cost = 1.0710637708966015), PopMember(tree = (cos(x2 - x2)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(cos(x2 - x2))), loss = 28.212524839603333, cost = 0.8770329515455824)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = ((x2 * x2) - -0.3085179441780157), loss = 0.45880113359804026, cost = 0.014262591336990234), PopMember(tree = ((x2 * (x2 + 0.015386045965304806)) - -0.18188658096151145), loss = 0.4417439900288375, cost = 0.013732341844806005), PopMember(tree = (((x2 * x2) + 0.06584937161450233) - -0.37436731579251803), loss = 0.5096394942175116, cost = 0.015842985779505523), PopMember(tree = ((x2 * (x2 + 0.06317487757589653)) - -0.37436731579251803), loss = 0.48672261530138533, cost = 0.01513057673174071), PopMember(tree = ((x2 * -0.25828120379744246) - -3.921829539241742), loss = 16.467589565600218, cost = 0.5119222318339182), PopMember(tree = ((((x2 * x2) - -0.5342698138065878) + -0.020437100469108016) - 0.3324754421843461), loss = 0.44263129683360064, cost = 0.013759925242971613), PopMember(tree = ((x2 * (x2 + 0.01538604596517335)) - -0.18188658096093613), loss = 0.44174399002883746, cost = 0.013732341844806003), PopMember(tree = ((x2 * (x2 + 0.06584937161450233)) - -0.3639449618732752), loss = 0.4838050405362499, cost = 0.015039879099317904), PopMember(tree = (3.9307149133843597), loss = 16.71762719047463, cost = 0.5196950645522866), PopMember(tree = (((x2 * x2) + -0.06358033651067801) - -0.24493760766275413), loss = 0.44263129683360075, cost = 0.013759925242971616)  …  PopMember(tree = ((x2 * -0.620556285891726) - -0.37436731579251803), loss = 29.45573182281272, cost = 0.9156800948291091), PopMember(tree = (((x2 * (x2 + 0.06584937161450233)) - -0.620556285891726) - (x2 + 0.06584937161450233)), loss = 3.9855914634325496, cost = 0.12389869622453374), PopMember(tree = ((x2 * (x2 + 0.06317487757589653)) - -0.37436731579251803), loss = 0.48672261530138533, cost = 0.01513057673174071), PopMember(tree = (((x2 - -0.620556285891726) * (x2 + 0.06584937161450233)) - 0.24618897009920793), loss = 2.297767685237106, cost = 0.07142990520723255), PopMember(tree = ((x2 * ((x2 + 0.06584937161450233) - -0.620556285891726)) - 0.24618897009920793), loss = 2.3329695947817335, cost = 0.07252421473122903), PopMember(tree = ((((x2 * x2) - -0.620556285891726) + 0.06584937161450233) - 0.24618897009920793), loss = 0.5096394942175118, cost = 0.015842985779505527), PopMember(tree = ((x2 * (x2 + 0.06584937161450233)) - -0.37436731579251803), loss = 0.48767243258905046, cost = 0.015160103371556393), PopMember(tree = ((x2 * x2) - -0.3085179441780157), loss = 0.45880113359804026, cost = 0.014262591336990234), PopMember(tree = (((x2 - -0.620556285891726) * (x2 + 0.06584937161450233)) - 0.24618897009920793), loss = 2.297767685237106, cost = 0.07142990520723255), PopMember(tree = ((x2 * (x2 + 0.015386045966083336)) - -0.18188658096171667), loss = 0.44174399002883746, cost = 0.013732341844806003)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (((((0.14529131926504416 / x3) / x3) + (0.14529131926504416 / x4)) * 0.8018618329349255) + 4.065973355070239), loss = 12449.724265348352, cost = 387.0202500642491), PopMember(tree = ((((0.14529131926504416 / x3) + (((0.14529131926504416 / x3) + (0.14529131926504416 / x4)) / x4)) * 0.8018618329349255) + 4.065973355070239), loss = 170.80257422211412, cost = 5.309680244971308), PopMember(tree = ((((((0.14529131926504416 / x3) + (0.14529131926504416 / x4)) * 0.895467382395878) * ((0.14529131926504416 / x3) + (0.14529131926504416 / x4))) * 0.895467382395878) + 4.065973355070239), loss = 243.58876018089174, cost = 7.572359103602307), PopMember(tree = ((((0.1565819613900264 / x3) + (0.1343655521136414 / x4)) * 0.7915301626655556) + 3.867285677214262), loss = 14.460464378988554, cost = 0.4495274289389833), PopMember(tree = (((0.14529131926504416 / x4) * 0.8018618329349255) + 4.065973355070239), loss = 16.427793684613192, cost = 0.5106851111167956), PopMember(tree = ((((0.14529131926504416 / x3) + (0.14529131926504416 / x4)) * 0.8018618329349255) + 4.065973355070239), loss = 14.507723307832913, cost = 0.4509965508303026), PopMember(tree = ((((0.14529131926504416 / x3) + 0.14529131926504416) * 0.8018618329349255) + 4.065973355070239), loss = 14.83660367084954, cost = 0.4612203403394556), PopMember(tree = ((((0.14529131926504416 / x3) + ((0.14529131926504416 / x4) / x4)) * 0.8018618329349255) + 4.065973355070239), loss = 163.326265132036, cost = 5.077266823442515), PopMember(tree = (((((0.14529131926504416 / x3) * 0.895467382395878) + (0.14529131926504416 / x4)) * 0.895467382395878) + 4.065973355070239), loss = 14.518457522330223, cost = 0.4513302416246084), PopMember(tree = ((((0.14529131926504416 / x3) + (0.14529131926504416 / x4)) * 0.8018618329349255) + 4.065973355070239), loss = 14.507723307832913, cost = 0.4509965508303026)  …  PopMember(tree = ((((0.14529131926504416 / x3) + ((0.14529131926504416 / x3) + (0.14529131926504416 / x4))) * 0.8018618329349255) + 4.065973355070239), loss = 16.040865766259923, cost = 0.49865681743524626), PopMember(tree = ((((0.14529131926504416 / x3) + 0.015715795231634445) * 0.8018618329349255) + 4.065973355070239), loss = 14.782735901044408, cost = 0.4595457717067661), PopMember(tree = ((((0.14529131926504416 / x4) + 0.14529131926504416) * 0.8018618329349255) + 4.065973355070239), loss = 16.472940019170185, cost = 0.5120885595239514), PopMember(tree = (((0.14529131926504416 / x3) + ((0.14529131926504416 / x4) * 0.8018618329349255)) + 4.065973355070239), loss = 14.565340649342799, cost = 0.4527876810950313), PopMember(tree = (4.182476918645641), loss = 16.781011297773475, cost = 0.5216654642602686), PopMember(tree = (((((0.14529131926504416 / x3) + (0.14529131926504416 / x4)) * 0.895467382395878) + 4.065973355070239) * 0.895467382395878), loss = 14.522681230656529, cost = 0.45146154257696725), PopMember(tree = ((((0.14529131926504416 / x3) + (0.14529131926504416 / x4)) * 0.8018618329349255) + 4.065973355070239), loss = 14.507723307832913, cost = 0.4509965508303026), PopMember(tree = (4.867835188005164), loss = 17.595821599601077, cost = 0.5469951888426806), PopMember(tree = (((((0.14529131926504416 / x3) * 0.895467382395878) + (0.14529131926504416 / x4)) * 0.895467382395878) + 4.065973355070239), loss = 14.518457522330223, cost = 0.4513302416246084), PopMember(tree = ((((0.14529131926504416 / x3) + (0.14529131926504416 / x4)) + 4.065973355070239) * 0.8018618329349255), loss = 14.842694373254481, cost = 0.46140967988767256)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2), loss = 38.124118852021816, cost = 1.1851512288232824), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408)  …  PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2), loss = 38.124118852021816, cost = 1.1851512288232824), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (x2 * (x2 * x2)), loss = 439.1447441878536, cost = 13.651539992980581)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (cos(x2) * (cos(x2 * -0.5828627146151538) + (-0.5828627146151538 - (x2 * x2)))), loss = 7.869846651725453, cost = 0.24464718689356893), PopMember(tree = (cos(x2) * ((x2 * 0.09510674521420748) + (-0.43125008351772076 - (x2 * x2)))), loss = 8.308766623139887, cost = 0.25829173945348494), PopMember(tree = (cos(x2) * ((cos(x2 * -0.5828627146151538) + -0.5828627146151538) - (x2 * x2))), loss = 7.869846651725453, cost = 0.24464718689356893), PopMember(tree = (x2 * (cos(x2 * -0.5828627146151538) + (-0.5828627146151538 - (x2 * x2)))), loss = 371.86031922106747, cost = 11.559892465608925), PopMember(tree = ((x2 * 0.18019410876161515) * (cos(x2 * 3.866530738810181) + (6.472585718483972 - (x2 * x2)))), loss = 27.375196205007914, cost = 0.8510032073809626), PopMember(tree = (cos(x2) * (cos((x2 * -0.5828627146151538) + -0.5828627146151538) - (x2 * x2))), loss = 8.28944439911107, cost = 0.25769107619251264), PopMember(tree = (cos(x2) * ((cos(x2 * -0.5828627146151538) + -0.5828627146151538) - (x2 * x2))), loss = 7.869846651725453, cost = 0.24464718689356893), PopMember(tree = (cos(x2) * (cos(x2 * -0.5828627146151538) + (-0.5828627146151538 - (x2 * x2)))), loss = 7.869846651725453, cost = 0.24464718689356893), PopMember(tree = (cos(x2) * (cos(x2) - (x2 * x2))), loss = 7.854594608795914, cost = 0.24417305193742292), PopMember(tree = (cos(x2) * ((cos(cos(x2)) + -0.5828627146151538) - (x2 * x2))), loss = 8.515065606674831, cost = 0.2647048842343634)  …  PopMember(tree = (cos(x2) * (-0.5828627146151538 - (cos(x2 * -0.5828627146151538) + (x2 * x2)))), loss = 9.299225283730697, cost = 0.2890817835002501), PopMember(tree = (cos(x2) * (cos(x2 * -0.5828627146151538) + (-0.5828627146151538 - (cos(x2) * x2)))), loss = 31.96260131042004, cost = 0.9936102750719463), PopMember(tree = (cos(x2) * (cos(x2 * -0.5828627146151538) + (x2 - (x2 * x2)))), loss = 9.850148670694807, cost = 0.3062081473011376), PopMember(tree = (cos(x2) * ((x2 * x2) + (-0.5828627146151538 - (x2 * x2)))), loss = 29.775931905816574, cost = 0.9256340434912225), PopMember(tree = ((cos(x2) * ((cos(x2 * -0.5828627146151538) + -0.5828627146151538) - (x2 * x2))) + 0.055500073875026736), loss = 7.70896552582631, cost = 0.23964593126340158), PopMember(tree = (x2 * ((cos(x2 * -0.5828627146151538) + -0.5828627146151538) - (x2 * x2))), loss = 371.86031922106747, cost = 11.559892465608925), PopMember(tree = (cos(x2) * (((cos(x2) * -0.5828627146151538) + -0.5828627146151538) - (x2 * x2))), loss = 9.01666724723804, cost = 0.2802980000516942), PopMember(tree = (cos(x2) * (cos(x2 * -0.5828627146151538) + (-0.5828627146151538 - x2))), loss = 30.135045662465526, cost = 0.9367976879975212), PopMember(tree = (cos(x2) * (cos(x2 * -0.5828627146151538) + ((x2 * -0.05942573068684557) - (x2 * x2)))), loss = 8.238459527456811, cost = 0.2561061272123938), PopMember(tree = (cos(x2) * ((cos(x2 * -0.5828627146151538) + 0.6742303211163405) - (x2 * x2))), loss = 9.024863722688632, cost = 0.280552801034505)], 27)  …  Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = ((cos(x2 + (x2 * 5.962334956702034)) * 0.9117702791849576) + 3.936282417700193), loss = 16.32690787910208, cost = 0.5075489091540326), PopMember(tree = (cos(cos(x2 + (x2 * -1.0170313614920419)) * x2) + 1.0483800110324994), loss = 29.93614300013528, cost = 0.9306144700825867), PopMember(tree = (cos(cos(x2 + 1.084394789662552) * 1.0483800110324994) + 1.0483800110324994), loss = 21.312829274167186, cost = 0.6625445141964382), PopMember(tree = (cos(x2 + (x2 * -15.885406837224084)) + 3.8462020754859707), loss = 16.52995392012777, cost = 0.5138609308420181), PopMember(tree = (cos(cos(x2 + -1.0662353499814248) * 1.0483800110324994) + 1.0483800110324994), loss = 21.185472793822573, cost = 0.6585854275677115), PopMember(tree = (cos(cos(x2 + ((cos(cos(x2 + (x2 * -1.0170313614920419))) * x2) * 1.0483800110324994)) * 1.0483800110324994) + 1.0483800110324994), loss = 21.185605412055555, cost = 0.6585895502246153), PopMember(tree = (cos(cos(x2 + (cos(x2) * -1.0170313614920419)) * 1.0483800110324994) + 1.0483800110324994), loss = 20.97283946619423, cost = 0.6519753692341497), PopMember(tree = (cos(cos(x2 + 1.0483800110324994) * 1.0483800110324994) + 1.0483800110324994), loss = 21.324824942350595, cost = 0.6629174193629368), PopMember(tree = (cos(cos(x2 + (x2 * -1.0170313614920419)) * 1.0483800110324994) + 1.0483800110324994), loss = 22.391403034245695, cost = 0.6960737617075792), PopMember(tree = (0.031348649540457574), loss = 31.92268444999091, cost = 0.9923693935089658)  …  PopMember(tree = ((x2 * -1.0170313614920419) + 1.0483800110324994), loss = 26.73280541008218, cost = 0.8310334280676075), PopMember(tree = (cos((x2 + (x2 * -1.0170313614920419)) * cos(x2 * -1.0170313614920419)) + 1.0483800110324994), loss = 20.264597404840917, cost = 0.6299584944946905), PopMember(tree = ((cos(cos(x2 + (x2 * -1.0170313614920419))) * 1.0483800110324994) + 1.0483800110324994), loss = 22.074617959104767, cost = 0.686225974207666), PopMember(tree = (cos((x2 + 3.8354396488572413) * -0.8456210376057838) + 4.083333073978892), loss = 12.416382354006876, cost = 0.38598376165776177), PopMember(tree = ((cos(x2 + (x2 * -1.0170313614920419)) * 1.0483800110324994) + 1.0483800110324994), loss = 20.0880422595279, cost = 0.6244699860721097), PopMember(tree = (cos(x2 + (x2 * -1.0170313614920419)) * 1.547355621461516), loss = 22.409321424292617, cost = 0.6966307844696021), PopMember(tree = (((x2 + (x2 * -1.0170313614920419)) * 0.24897665980300976) + 1.0483800110324994), loss = 25.016498016609436, cost = 0.7776791768045692), PopMember(tree = ((cos(x2 + ((x2 + x1) * -1.0170313614920419)) * 0.4989756104290166) + 1.0483800110324994), loss = 24.133946255579414, cost = 0.7502435970303913), PopMember(tree = (cos(cos(x2 + (x2 * -1.0170313614920419)) * 1.0483800110324994) + 1.0483800110324994), loss = 22.391403034245695, cost = 0.6960737617075792), PopMember(tree = (cos(cos(cos(x2 + (x2 * -1.8957420984435696)) * 0.23492895514006992) + -7.273203445678076)), loss = 25.306989168522367, cost = 0.7867095742542309)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (cos(-0.1412022175789086 / x2)), loss = 25.286202437235307, cost = 0.7860633843652607), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + ((-0.6005209506226769 - (x2 * -1.8778450101496487)) * -0.6005209506226769)))), loss = 25.491930910123223, cost = 0.7924587938799942), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * -0.6005209506226769) + ((-0.6005209506226769 - (x2 * x2)) * -0.6005209506226769)))), loss = 25.68645832862944, cost = 0.7985060001112336), PopMember(tree = (cos(-0.6005209506226769 / ((-0.6005209506226769 - (x2 * x2)) + ((-0.6005209506226769 - (x2 * x2)) * -0.6005209506226769)))), loss = 25.55950688343692, cost = 0.7945595046694689), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + ((x2 * (-0.6005209506226769 - x2)) * -0.6005209506226769)))), loss = 25.290699480060084, cost = 0.7862031823721481), PopMember(tree = (cos(3.8408872479315255 / ((x2 + ((-2.541670037281891 - (x2 * x2)) * -4.254761598128457)) * x2))), loss = 25.21614263700656, cost = 0.7838854597119854), PopMember(tree = (0.5403023058681398), loss = 28.212524839603333, cost = 0.8770329515455824), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + ((x2 * x2) + ((-0.6005209506226769 - (x2 * x2)) * -0.6005209506226769))))), loss = 25.23101245177773, cost = 0.7843477124742546), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + ((-0.6005209506226769 - (x2 * x2)) * (x3 + 0.23143849294533086))))), loss = 25.55424508723716, cost = 0.7943959330402813), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + (((x3 * 1.4190921810489603) - (x2 * x2)) * -0.6005209506226769)))), loss = 25.306696475123704, cost = 0.7867004753963022)  …  PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + ((-0.6005209506226769 - (x2 * x2)) * -0.4074966722008037)))), loss = 25.273580892810006, cost = 0.7856710228016176), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + ((-0.6005209506226769 - (x2 * x2)) * -0.6005209506226769)))), loss = 25.227861029251855, cost = 0.7842497452977913), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + ((-0.6005209506226769 - (x2 * x2)) * 0.6164315193323867)))), loss = 26.491487569375327, cost = 0.8235316642482047), PopMember(tree = (cos(8.9924350227245 / (x2 * (x2 + ((-47.14308963120953 - (x2 * x2)) * -16.812649888152055))))), loss = 25.30576716776401, cost = 0.786671586341487), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + ((x2 * x2) * -0.6005209506226769)))), loss = 25.895725546723146, cost = 0.8050114173679275), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + ((-0.6005209506226769 - (x2 * x2)) * x2)))), loss = 25.43793182150182, cost = 0.7907801429849165), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + ((-0.6005209506226769 - (x2 * -0.6005209506226769)) * -0.6005209506226769)))), loss = 25.29268894839135, cost = 0.7862650282825194), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + ((-0.6005209506226769 - (x2 * x2)) * -0.6005209506226769)))), loss = 25.227861029251855, cost = 0.7842497452977913), PopMember(tree = (cos(-0.6005209506226769 / ((x2 * x2) + -0.6005209506226769))), loss = 25.44297147185056, cost = 0.7909368088432628), PopMember(tree = (cos(-0.6005209506226769 / ((-0.6005209506226769 - (x2 * x2)) * -0.6005209506226769))), loss = 25.295484797631715, cost = 0.7863519418758719)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (cos(x1 - x1)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x1) - x1), loss = 30.822396596219974, cost = 0.9581651275161585), PopMember(tree = (cos(x1 - x1) - x5), loss = 27.30921145374511, cost = 0.8489519623581924), PopMember(tree = (cos(x1 - x1)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x1) - x1), loss = 30.822396596219974, cost = 0.9581651275161585), PopMember(tree = (cos(cos(x1 - x1) - x1)), loss = 31.723416569017537, cost = 0.9861748221690414), PopMember(tree = (x1), loss = 37.52929918211306, cost = 1.166660276535129), PopMember(tree = (x1 - cos(x1)), loss = 40.448472840523635, cost = 1.2574076131973213), PopMember(tree = (cos(x1 - x1)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x1) - x1), loss = 30.822396596219974, cost = 0.9581651275161585)  …  PopMember(tree = (cos(x1) - x1), loss = 30.822396596219974, cost = 0.9581651275161585), PopMember(tree = (x1), loss = 37.52929918211306, cost = 1.166660276535129), PopMember(tree = (cos(x1 - x1)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x1 - x1)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x1 - x1)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x1 - x1)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x1) - x1), loss = 30.822396596219974, cost = 0.9581651275161585), PopMember(tree = (cos(x1 - x1)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x1 - x1)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x1 - x1)), loss = 25.306717093942233, cost = 0.7867011163663457)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (-1.8288496269606147), loss = 49.89021088474435, cost = 1.550919641338066), PopMember(tree = (3.9307149133949464), loss = 16.717627190474634, cost = 0.5196950645522868), PopMember(tree = (1.542868183215504), loss = 22.419439197199043, cost = 0.6969453121584793), PopMember(tree = (3.9307149133854002), loss = 16.717627190474634, cost = 0.5196950645522868), PopMember(tree = (0.0), loss = 32.16814692068846, cost = 1.0), PopMember(tree = (cos(x4 - x4) - -1.8288496269606147), loss = 17.931734299875544, cost = 0.5574375901753613), PopMember(tree = (0.0), loss = 32.16814692068846, cost = 1.0), PopMember(tree = (1.5736508322117715), loss = 22.273378273175613, cost = 0.6924047669917481), PopMember(tree = (1.0), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (1.0), loss = 25.306717093942233, cost = 0.7867011163663457)  …  PopMember(tree = (1.8259951254202522), loss = 21.147472576274982, cost = 0.6574041280156646), PopMember(tree = (-1.8288496269606147), loss = 49.89021088474435, cost = 1.550919641338066), PopMember(tree = (1.5736508322117715), loss = 22.273378273175613, cost = 0.6924047669917481), PopMember(tree = (1.5736508322117715), loss = 22.273378273175613, cost = 0.6924047669917481), PopMember(tree = (1.0), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (-1.8288496269606147), loss = 49.89021088474435, cost = 1.550919641338066), PopMember(tree = (1.0), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (1.0), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (1.5736508322117715), loss = 22.273378273175613, cost = 0.6924047669917481), PopMember(tree = (1.5736508322117715), loss = 22.273378273175613, cost = 0.6924047669917481)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (3.93071491345699), loss = 16.71762719047463, cost = 0.5196950645522866), PopMember(tree = ((cos(cos(x2) / (x2 * x2)) - -1.097181807106862) + 1.6899427299438161), loss = 15.087264650380813, cost = 0.46901255106733136), PopMember(tree = (cos(cos(x2) / (x2 - (x2 * x2))) + 2.787124537050678), loss = 14.896597805183353, cost = 0.46308535713640475), PopMember(tree = ((cos((cos(cos(x2) / (x2 - (x2 * x2))) - -2.189987423470439) + 2.2295239339046167) + 1.9121767087650101) - -1.693160246939312), loss = 14.841415467276859, cost = 0.46136992298216056), PopMember(tree = (cos(x2) / (x2 - (x2 * x2))), loss = 63.45082922464199, cost = 1.9724738692931842), PopMember(tree = ((cos(cos(x2 * x2) / (x2 - (x2 * x2))) + 1.6899427299438161) - -1.097181807106862), loss = 14.80771145286753, cost = 0.46032217800348874), PopMember(tree = ((cos(x2 / (x2 - (x2 * x2))) - -1.097181807106862) + 1.6899427299438161), loss = 15.422448210004289, cost = 0.479432285858082), PopMember(tree = ((cos(x2) - -1.097181807106862) + 1.6899427299438161), loss = 22.95371331948521, cost = 0.7135541060564753), PopMember(tree = ((cos(1.6899427299438161 / (x2 - (x2 * x2))) + 1.6899427299438161) - -1.097181807106862), loss = 14.982665163182135, cost = 0.46576090317301616), PopMember(tree = ((cos(cos(x2) / (x2 - ((cos(x2) / (x2 - (x2 * x2))) * x2))) - -1.097181807106862) + 1.6899427299438161), loss = 16.319968343927425, cost = 0.507333182236602)  …  PopMember(tree = ((cos(cos(x2) / (x2 - (x2 * x2))) - (cos(cos(x2) / (x2 - (x2 * x2))) - -1.097181807106862)) + 1.6899427299438161), loss = 27.859564033410926, cost = 0.8660605816710402), PopMember(tree = ((cos(cos(x2) / x2) - -1.097181807106862) + 1.6899427299438161), loss = 15.061844831471548, cost = 0.46822233399415214), PopMember(tree = ((cos(cos(x2) / (x2 - (x2 * x2))) + 1.6899427299438161) - -1.097181807106862), loss = 14.896597805183351, cost = 0.4630853571364047), PopMember(tree = ((cos(cos(x2) / (x2 - (x2 * x2))) + 1.6899427299438161) - -1.097181807106862), loss = 14.896597805183351, cost = 0.4630853571364047), PopMember(tree = ((cos(cos(x2 / (x2 - (x2 * x2)))) - -1.097181807106862) + 1.6899427299438161), loss = 17.41332577853875, cost = 0.5413220046983692), PopMember(tree = ((cos(cos(x2) / (x2 - (x2 * x2))) + 1.6899427299438161) - -1.097181807106862), loss = 14.896597805183351, cost = 0.4630853571364047), PopMember(tree = ((cos(cos(x2) / (x2 - (x2 * x2))) + cos(x2)) - -1.097181807106862), loss = 23.802828666518153, cost = 0.739950259652965), PopMember(tree = ((cos((cos(x2) / x2) - (x2 * x2)) - -1.097181807106862) + 1.6899427299438161), loss = 18.099706003985407, cost = 0.562659268145311), PopMember(tree = ((cos(cos(cos(x2) / (x2 - (x2 * x2))) / (x2 - (x2 * x2))) - -1.097181807106862) + 1.6899427299438161), loss = 15.378133914672455, cost = 0.47805470276505857), PopMember(tree = ((cos(cos(x2) / ((x2 - (x2 * x2)) - (x2 * x2))) - -1.097181807106862) + 1.6899427299438161), loss = 15.322307898154149, cost = 0.4763192587975852)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = ((x2 * x2) + 0.3437134359796861), loss = 0.46899082109116885, cost = 0.01457935460962299), PopMember(tree = ((x2 * x2) + 0.3437134359796861), loss = 0.46899082109116885, cost = 0.01457935460962299), PopMember(tree = ((x2 * x2) + 0.18135727114796651), loss = 0.44263129683360064, cost = 0.013759925242971613), PopMember(tree = ((x2 * x2) + 0.3437134359796861), loss = 0.46899082109116885, cost = 0.01457935460962299), PopMember(tree = ((x2 * x2) + 0.3437134359796861), loss = 0.46899082109116885, cost = 0.01457935460962299), PopMember(tree = ((x2 * x2) + 0.3437134359796861), loss = 0.4689908210911689, cost = 0.014579354609622992), PopMember(tree = ((x2 * x2) + 0.18135727028520218), loss = 0.4426312968336007, cost = 0.013759925242971614), PopMember(tree = ((x2 * x2) + 0.3438129973638097), loss = 0.46902315981262055, cost = 0.014580359912214135), PopMember(tree = ((x2 * x2) + 0.3437134359796861), loss = 0.4689908210911689, cost = 0.014579354609622992), PopMember(tree = ((x2 * x2) + 0.3437134359796861), loss = 0.46899082109116885, cost = 0.01457935460962299)  …  PopMember(tree = ((cos(cos(((x2 * x2) + -0.19658901054107952) * -0.0034933615394517575)) + (x2 * x2)) + -0.19658901054107952), loss = 0.4690506749899164, cost = 0.014581215266965023), PopMember(tree = (((x2 + -0.19658901054107952) * x2) + 0.5403024465207656), loss = 0.7439047915037135, cost = 0.023125509633421946), PopMember(tree = ((x2 * x2) + 0.3437180415948206), loss = 0.46899231661240043, cost = 0.014579401100371595), PopMember(tree = ((x2 * x2) + 0.344045510859511), loss = 0.46909876017274255, cost = 0.014582710074326625), PopMember(tree = ((x2 * x2) + 0.3437262935156465), loss = 0.46899499625694036, cost = 0.014579484401549823), PopMember(tree = (((x2 + -0.19658901054107952) * x2) + 0.5403024465207656), loss = 0.7439047915037135, cost = 0.023125509633421946), PopMember(tree = ((x2 * x2) + 0.7886305685506705), loss = 0.8114121545671041, cost = 0.025224087559897853), PopMember(tree = ((x2 * x2) + 0.3552582257331915), loss = 0.47287283883786446, cost = 0.014700033545722942), PopMember(tree = ((x2 * x2) + -0.21688201306832877), loss = 0.6012258243298884, cost = 0.01869009818353009), PopMember(tree = (3.9307149133809265), loss = 16.717627190474634, cost = 0.5196950645522868)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = ((x2 * x2) - (cos(x2) * cos(x3 / (x2 * x2)))), loss = 0.5984803250722759, cost = 0.01860474980258724), PopMember(tree = ((x2 * x2) - (cos((x3 * x2) / x2) * cos(x2))), loss = 0.5523891958775041, cost = 0.01717193089298667), PopMember(tree = ((x2 * x2) - cos(cos(x2) * (x2 * (x3 / x2)))), loss = 1.131386534992931, cost = 0.03517101988443409), PopMember(tree = ((x2 * x2) - cos(((x3 * x2) / x2) * cos(x2))), loss = 1.131386534992931, cost = 0.03517101988443409), PopMember(tree = ((x2 - (cos(x2) * cos((x2 * x3) / x2))) * x2), loss = 1.4998388835825143, cost = 0.046624969951810175), PopMember(tree = ((x2 * x2) - (cos((x3 * x2) / (x2 - x4)) * cos(x2))), loss = 0.7581142975690318, cost = 0.023567235608510047), PopMember(tree = ((x2 * x2) - (cos(x2) * cos((x2 * x3) / x2))), loss = 0.5523891958775041, cost = 0.01717193089298667), PopMember(tree = ((x2 * x2) - cos(cos(x2) * (x2 * (x3 / x2)))), loss = 1.131386534992931, cost = 0.03517101988443409), PopMember(tree = ((x2 * x2) - (cos(x2) * cos(x2))), loss = 1.056928981526112, cost = 0.03285638380513502), PopMember(tree = ((x2 * x2) - (cos(x3 * (x2 / x2)) * cos(x2 * (x3 / x2)))), loss = 1.0277351059774675, cost = 0.03194884394526609)  …  PopMember(tree = ((x2 * x2) - (cos(x2) * (x2 * cos(x3 / x2)))), loss = 1.6117371052327831, cost = 0.050103511066601686), PopMember(tree = ((x2 * x2) - (cos(x3 * (x2 * x2)) * cos(x2))), loss = 0.8346331050080515, cost = 0.02594594917344368), PopMember(tree = ((x2 * x2) - cos(cos(x2) * (x2 * (x3 / x2)))), loss = 1.131386534992931, cost = 0.03517101988443409), PopMember(tree = ((x2 * x2) - (cos(x2) * (x2 * cos(x3 / x2)))), loss = 1.6117371052327831, cost = 0.050103511066601686), PopMember(tree = ((x2 * x2) - (cos(x2) * cos((x2 * x3) / x2))), loss = 0.5523891958775041, cost = 0.01717193089298667), PopMember(tree = ((x2 * x2) - (cos(x2) * cos(x2 * x2))), loss = 0.9595565723598561, cost = 0.02982940157310497), PopMember(tree = ((x2 - (cos(x3 * (x2 / x2)) * cos(x2))) * x2), loss = 1.4998388835825143, cost = 0.046624969951810175), PopMember(tree = ((x2 * x2) - (cos(x2) * cos(cos(x5) * (x3 / x2)))), loss = 0.5710554463862553, cost = 0.017752202133191255), PopMember(tree = ((x2 * x2) - (cos(x2) * cos(x2 * (x3 / x2)))), loss = 0.5523891958775041, cost = 0.01717193089298667), PopMember(tree = ((x2 * x2) - (cos((x3 * x2) / x2) * cos(x2))), loss = 0.5523891958775041, cost = 0.01717193089298667)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (cos((x4 - x4) - x4)), loss = 31.08057553164362, cost = 0.9661910463252273), PopMember(tree = (cos(x4 - x4)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(x4)), loss = 31.08057553164362, cost = 0.9661910463252273), PopMember(tree = (cos(x4 - x4)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (x4), loss = 39.1402167529009, cost = 1.2167383110193537), PopMember(tree = (x4 - x4), loss = 32.16814692068846, cost = 1.0), PopMember(tree = (cos(x4 / x4)), loss = 28.212524839603333, cost = 0.8770329515455824), PopMember(tree = (cos(x4 - x4) - -0.27177230850827766), loss = 23.787602966440055, cost = 0.7394769436078836), PopMember(tree = (cos(cos(x4 - x4) - x4)), loss = 32.00858055690499, cost = 0.9950396159226428), PopMember(tree = (cos(x4 - x4)), loss = 25.306717093942233, cost = 0.7867011163663457)  …  PopMember(tree = (x4 - x4), loss = 32.16814692068846, cost = 1.0), PopMember(tree = (cos(cos(x4 - x4))), loss = 28.212524839603333, cost = 0.8770329515455824), PopMember(tree = (cos(x4 - (x4 - x4))), loss = 31.08057553164362, cost = 0.9661910463252273), PopMember(tree = (cos(x4)), loss = 31.08057553164362, cost = 0.9661910463252273), PopMember(tree = (cos(x4)), loss = 31.08057553164362, cost = 0.9661910463252273), PopMember(tree = (cos(cos(x4 - x4))), loss = 28.212524839603333, cost = 0.8770329515455824), PopMember(tree = (cos(x4)), loss = 31.08057553164362, cost = 0.9661910463252273), PopMember(tree = (x4), loss = 39.1402167529009, cost = 1.2167383110193537), PopMember(tree = (cos(x4 - x4)), loss = 25.306717093942233, cost = 0.7867011163663457), PopMember(tree = (cos(cos(x4 - x4))), loss = 28.212524839603333, cost = 0.8770329515455824)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (cos(((x2 * x2) * 3.262454604262724) - (cos(x2) + 1.631227302131362)) + 3.262454604262724), loss = 16.351212080171216, cost = 0.5083044454032626), PopMember(tree = (cos((x2 * (x2 * 3.3967007693493363)) - (cos(x2) + 2.989404914332725)) + 4.002074136430476), loss = 14.733312261779215, cost = 0.4580093562151604), PopMember(tree = (cos(((x2 * x2) * cos(x2)) - (cos(x2) + 1.631227302131362)) + 3.262454604262724), loss = 16.84794534605556, cost = 0.5237462197494522), PopMember(tree = (cos((((cos(x2) + 1.631227302131362) * x2) * 3.262454604262724) - (cos(x2) + 1.631227302131362)) + 3.262454604262724), loss = 15.735731809219285, cost = 0.4891712241931812), PopMember(tree = (cos(((x2 * x2) * 3.262454604262724) - (cos(x2) + 1.631227302131362)) + 3.262454604262724), loss = 16.351212080171216, cost = 0.5083044454032626), PopMember(tree = (cos(((x2 * x2) * 3.262454604262724) - (cos(x2) + x2)) + 3.262454604262724), loss = 18.519753926256744, cost = 0.5757171518744228), PopMember(tree = (cos(((x2 * x2) * 3.262454604262724) - 0.6385222210903634) + 3.262454604262724), loss = 17.508921105390858, cost = 0.5442937433903058), PopMember(tree = (cos(cos(((x2 * x2) * 3.262454604262724) - (cos(x2) + 1.631227302131362)) + 3.262454604262724) + 3.262454604262724), loss = 18.55353083245515, cost = 0.5767671628148007), PopMember(tree = (cos(((x2 * x2) * 3.262454604262724) - (cos(x2) + 1.631227302131362)) + 1.631227302131362), loss = 21.065272311176876, cost = 0.6548487969516537), PopMember(tree = (cos((cos(x2) * 3.262454604262724) - (cos(x2) + 1.631227302131362)) + 3.262454604262724), loss = 22.59447165696222, cost = 0.7023864853847371)  …  PopMember(tree = (cos((x2 * (x2 * 3.262454604262724)) - (x2 * (x2 * 3.262454604262724))) + 3.262454604262724), loss = 16.827678412986167, cost = 0.5231161886469655), PopMember(tree = (cos(((x2 * x2) * 3.262454604262724) - ((x2 * x2) + 1.631227302131362)) + 3.262454604262724), loss = 18.462415244587064, cost = 0.5739346842112699), PopMember(tree = (cos((x2 * ((x3 + 0.8057135646911971) * 3.262454604262724)) - (cos(x2) + 1.631227302131362)) + 3.262454604262724), loss = 16.383207992411638, cost = 0.5092990912036349), PopMember(tree = (cos((x2 * (x2 * 3.262454604262724)) - (cos(x2) + (x3 * 1.0695992317584349))) + 3.262454604262724), loss = 17.550619018237054, cost = 0.545589991910589), PopMember(tree = (cos((cos(x2) + 1.631227302131362) - (cos(x2) + 1.631227302131362)) + 3.262454604262724), loss = 16.827678412986167, cost = 0.5231161886469655), PopMember(tree = ((x2 * (x2 * 3.262454604262724)) - (cos(x2) + 1.631227302131362)), loss = 137.81030700150356, cost = 4.284061103714773), PopMember(tree = (cos(((x2 * x2) * 3.262454604262724) - x2) + 3.262454604262724), loss = 19.314197516039766, cost = 0.6004137435600349), PopMember(tree = (cos((x2 * (x2 * 3.262454604262724)) - 1.570833101420526) + 3.262454604262724), loss = 17.542362183868764, cost = 0.5453333145710877), PopMember(tree = (cos(((x2 * x2) * 3.262454604262724) - (cos(x2) + 1.631227302131362)) + 3.262454604262724), loss = 16.351212080171216, cost = 0.5083044454032626), PopMember(tree = (x2 + cos(((x2 * x2) * 3.262454604262724) - (cos(x2) + 1.631227302131362))), loss = 37.02707760263065, cost = 1.1510478888921403)], 27), Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (cos(cos(x1) + 2.331213918975196) + 2.331213918975196), loss = 22.6058278441992, cost = 0.702739511229371), PopMember(tree = (cos(x1) + 3.749357642182164), loss = 16.18074745069803, cost = 0.503005270729214), PopMember(tree = (cos(x1) + 2.331213918975196), loss = 18.191879070479946, cost = 0.5655246202192677), PopMember(tree = (cos(x1)), loss = 30.238430179980224, cost = 0.9400115665516572), PopMember(tree = (x1), loss = 37.52929918211306, cost = 1.166660276535129), PopMember(tree = (cos(x1) + 2.331213918975196), loss = 18.191879070479946, cost = 0.5655246202192677), PopMember(tree = (2.331213918975196), loss = 19.276030621554572, cost = 0.5992272625799743), PopMember(tree = (cos(x1) + 2.331213918975196), loss = 18.191879070479946, cost = 0.5655246202192677), PopMember(tree = (cos(x1) + 4.662427837950392), loss = 17.014444633027047, cost = 0.52892212519971), PopMember(tree = (3.9307149168199533), loss = 16.71762719047463, cost = 0.5196950645522866)  …  PopMember(tree = (x1), loss = 37.52929918211306, cost = 1.166660276535129), PopMember(tree = (cos(x1) + 2.331213918975196), loss = 18.191879070479946, cost = 0.5655246202192677), PopMember(tree = (cos(x1) + 2.331213918975196), loss = 18.191879070479946, cost = 0.5655246202192677), PopMember(tree = (cos(x1) + 4.662427837950392), loss = 17.014444633027047, cost = 0.52892212519971), PopMember(tree = ((cos(x1) + 3.568000371084455) + cos(x1)), loss = 16.52913030458862, cost = 0.5138353273920843), PopMember(tree = (cos(x1)), loss = 30.238430179980224, cost = 0.9400115665516572), PopMember(tree = (cos(x1)), loss = 30.238430179980224, cost = 0.9400115665516572), PopMember(tree = (cos(x1) + 2.331213918975196), loss = 18.191879070479946, cost = 0.5655246202192677), PopMember(tree = (cos(x1) + 2.331213918975196), loss = 18.191879070479946, cost = 0.5655246202192677), PopMember(tree = (cos(x1)), loss = 30.238430179980224, cost = 0.9400115665516572)], 27)]], HallOfFame{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}(PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}[PopMember(tree = (3.9307149133974866), loss = 16.71762719047463, cost = 0.5196950645522866), PopMember(tree = (cos(-0.0010435334522494592)), loss = 25.3067202853796, cost = 0.7867012155774495), PopMember(tree = (x2 * x2), loss = 0.475521756633286, cost = 0.014782379532327408), PopMember(tree = (3.3614377634284347 - cos(x2)), loss = 13.096367219162635, cost = 0.4071222147627007), PopMember(tree = ((x2 * x2) + 0.18135727136857355), loss = 0.44263129683360064, cost = 0.013759925242971613), PopMember(tree = ((x2 * x2) + cos(x1)), loss = 0.0, cost = 0.0), PopMember(tree = (((x2 + 0.015386045964918174) * x2) + 0.181886580959982), loss = 0.44174399002883746, cost = 0.013732341844806003), PopMember(tree = (((x2 * x2) + cos(x1)) + 0.01701463245277696), loss = 0.0002894977175030939, cost = 8.999514899532736e-6), PopMember(tree = ((x2 * x2) + cos(x1 + cos(x2))), loss = 0.21862421590648962, cost = 0.006796294994719909), PopMember(tree = (((0.1333104648965273 * 0.1333104648965273) + (x2 * x2)) + cos(x1)), loss = 0.0003158326118325635, cost = 9.818178604171959e-6)  …  PopMember(tree = (cos(((cos(cos(((cos(1.0648028470744428) - 0.1333104648965273) * 0.1333104648965273) + x1)) - 0.1333104648965273) * 0.1333104648965273) + x1) + (x2 * x2)), loss = 0.005388096816215565, cost = 0.0001674978925425851), PopMember(tree = (cos(((cos(x1 + ((cos(1.0648028470744428) - 0.1333104648965273) * 0.1333104648965273)) + (x2 * x2)) * 0.1333104648965273) + x1) + (x2 * x2)), loss = 0.24470428618189316, cost = 0.007607037072580494), PopMember(tree = ((x2 * x2) + (cos(((2.6096553540597918 - cos(2.4060793755489724 / x1)) * -0.021027645463286386) + (((x1 / -2.252903979167695) * 2.2454386717032904) - -0.060400384516245034)) * 0.9962240649853281)), loss = 8.32647960763988e-5, cost = 2.588423768446802e-6), PopMember(tree = ((x2 * x2) + (cos(((2.261239803929954 - cos(cos(x1 / x1))) * -0.5928248094197307) + (((x1 * 2.2053582937084832) / -2.2892253299599754) - -1.038028757726466)) * 0.18368593390361318)), loss = 0.3220819932300293, cost = 0.010012450951064487), PopMember(tree = (((x2 * x2) + (cos(x1 * ((x2 - x2) + -0.9633644468485073)) * 0.18368593390361318)) + (cos(x1 * ((x2 + -0.9633644468485073) - x2)) * 0.18368593390361318)), loss = 0.18990992854043656, cost = 0.005903663925953374), PopMember(tree = ((x2 * x2) + (cos((((0.055881510221470705 + 2.2053582937084832) - cos(2.2053582937084832)) * cos(2.2053582937084832)) + (((x1 * 2.2053582937084832) / -2.2892253299599754) - (-2.2892253299599754 / 2.2053582937084832))) * 0.18368593390361318)), loss = 0.34752350411920996, cost = 0.010803342355282065), PopMember(tree = ((x2 * x2) + (cos((cos(2.2053582937084832) * ((0.055881510221470705 + 2.2053582937084832) - (x1 / x1))) + (((x1 * 2.2053582937084832) / -2.2892253299599754) - (-2.2892253299599754 / 2.2053582937084832))) * 0.18368593390361318)), loss = 0.32650543225528844, cost = 0.010149960862224906), PopMember(tree = ((x2 * x2) + (cos((cos(2.2053582937084832) * ((0.055881510221470705 + 2.2053582937084832) - cos(x1 / x1))) + (((x1 * 2.2053582937084832) / -2.2892253299599754) - (-2.2892253299599754 / 2.2053582937084832))) * 0.18368593390361318)), loss = 0.3167022884840037, cost = 0.009845213939890378), PopMember(tree = ((x2 * x2) + (cos((((0.055881510221470705 + 2.2053582937084832) - cos(cos(x1 / x1))) * cos(2.2053582937084832)) + (((x1 * 2.2053582937084832) / -2.2892253299599754) - (-2.2892253299599754 / 2.2053582937084832))) * 0.18368593390361318)), loss = 0.3220819932300293, cost = 0.010012450951064487), PopMember(tree = ((x2 * x2) + (cos((cos(-2.2892253299599754) * ((0.055881510221470705 + 2.2053582937084832) - cos(2.2053582937084832 / (0.5553320242379358 - -2.305887451795355)))) + ((x1 * (2.2053582937084832 / -2.2892253299599754)) - (-2.2892253299599754 / 2.2053582937084832))) * 0.18368593390361318)), loss = 0.3167520201935258, cost = 0.009846759932254957)], Bool[1, 1, 1, 1, 1, 1, 1, 1, 1, 1  …  1, 1, 1, 1, 1, 1, 1, 1, 1, 1])), 5, 1, Options{SymbolicRegression.CoreModule.OptionsStructModule.ComplexityMapping{Int64, Int64, 2}, OperatorEnum, Tuple{Int64, Int64}, Tuple{Vector{Int64}, Vector{Tuple{Int64, Int64}}}, Node{T, 2} where T, Expression, @NamedTuple{}, Tuple{Main.MutationCounterPlugin, SimulatedAnnealingPlugin, AdaptiveParsimonyPlugin, AdaptiveMutationWeightsPlugin}, PopMember, false, false, nothing, Nothing, 5, false, Symbol, Nothing}(OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}(((cos,), (+, -, *, /))), ([-1], [(-1, -1), (-1, -1), (-1, -1), (-1, -1)]), nothing, SymbolicRegression.CoreModule.OptionsStructModule.ComplexityMapping{Int64, Int64, 2}(false, (Int64[], Int64[]), 0, 0), 15, 0.982, 0.0, nothing, false, 30, 30, Val{false}(), Val{false}(), true, true, true, true, nothing, 31, 0.129, :auto, nothing, Pair{AbstractMutation, Float64}[ConstantMutation(0.129, 0.00743) => 0.0346, OperatorMutation() => 0.293, FeatureMutation() => 0.1, SwapOperandsMutation() => 0.198, RotateTreeMutation() => 4.26, AddNodeMutation() => 2.47, InsertNodeMutation() => 0.0112, DeleteNodeMutation() => 0.87, SimplifyMutation() => 0.00209, RandomizeMutation() => 0.000502, DoNothingMutation() => 0.273, OptimizeMutation() => 0.0, BacksolveMutation(500, 8, 0.001, 8) => 0.0, FormConnectionMutation() => 0.5, BreakConnectionMutation() => 0.1], Pair{AbstractCrossover, Float64}[SubtreeCrossover() => 1.0], 0.2, 0.0, true, true, 1040.0, 27, 380, 0.00036, 0.0614, 0.001, 12, nothing, Val{5}(), true, 0.00743, (1, 4), nothing, L2DistLoss(), nothing, nothing, :log, Node{T, 2} where T, Expression, NamedTuple(), nothing, nothing, Optim.BFGS{LineSearches.InitialStatic{Float64}, LineSearches.BackTracking{Float64, Int64}, Nothing, Nothing, Optim.Flat}(LineSearches.InitialStatic{Float64}(1.0, false), LineSearches.BackTracking{Float64, Int64}(0.0001, 0.5, 0.1, 1000, 3, Inf, nothing), nothing, nothing, Optim.Flat()), 0.14, 2, Optim.Options(x_abstol = 0.0, x_reltol = 0.0, f_abstol = 0.0, f_reltol = 0.0, g_abstol = 1.0e-8, outer_x_abstol = 0.0, outer_x_reltol = 0.0, outer_f_abstol = 0.0, outer_f_reltol = 0.0, outer_g_abstol = 1.0e-8, f_calls_limit = 10000, g_calls_limit = 0, h_calls_limit = 0, allow_f_increases = true, allow_outer_f_increases = true, successive_f_tol = 1, iterations = 8, outer_iterations = 1000, store_trace = false, trace_simplex = false, show_trace = false, extended_trace = false, show_warnings = false, show_every = 1, time_limit = NaN, )
, nothing, "pysr_trace.jsonl", 0.982, nothing, Val{nothing}(), nothing, nothing, IOStream(<fd 8>), true, false, true, Val{false}(), PopMember, (Main.MutationCounterPlugin(), SimulatedAnnealingPlugin(3.17), AdaptiveParsimonyPlugin(true, true), AdaptiveMutationWeightsPlugin(0.02, 0.05, :cost, 0.5))), ["x1", "x2", "x3", "x4", "x5"], nothing, false, nothing, nothing, SymbolicRegression.MLJInterfaceModule.SRFitResultTypes{Float64, Matrix{Float64}, Vector{Float64}, Nothing, Tuple{Vector{Vector{Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}}}, HallOfFame{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}}, Vector{DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}}, DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}, Nothing, Nothing}(Float64, Matrix{Float64}, Vector{Float64}, Nothing, Tuple{Vector{Vector{Population{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}}}, HallOfFame{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}, PopMember{Float64, Float64, Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}}}}, Vector{DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}}, DynamicQuantities.SymbolicDimensions{DynamicQuantities.FRInt32}, Nothing, Nothing)), nothing, (best_idx = 4, equations = Expression{Float64, Node{Float64, 2}, @NamedTuple{operators::OperatorEnum{Tuple{Tuple{typeof(cos)}, Tuple{typeof(+), typeof(-), typeof(*), typeof(/)}}}, variable_names::Vector{String}}}[3.9307149133974866, x2 * x2, (x2 * x2) + 0.18135727136857355, (x2 * x2) + cos(x1)], equation_strings = ["3.9307149133974866", "x2 * x2", "(x2 * x2) + 0.18135727136857355", "(x2 * x2) + cos(x1)"], losses = [16.71762719047463, 0.475521756633286, 0.44263129683360064, 0.0], complexities = [1, 3, 5, 6], scores = [0.0, 1.779903162954416, 0.03583774988456076, 744.4400719213812]))

The search ran with our plugin active. Since on_mutation_end! runs on workers against per-dispatch copies of the state (built by fork_plugin_state, which defaults to deepcopy), the head-side state won't reflect worker counts in multithreading mode. For a production version you'd aggregate via on_generation_end! on the head node. But the plugin loaded, the hooks fired, and the search completed — the API works.

julia
@test report(mach).best_idx isa Int
Test Passed

Show raw source code
julia
#=
# Writing a Custom Plugin

This tutorial walks through building a simple plugin from scratch.
We'll create a plugin that counts how many mutations are accepted vs
rejected during the search, which is useful for diagnosing whether
the search is exploring effectively.

## Defining the plugin

A plugin has two parts: an immutable **config struct** (subtyping
`AbstractPlugin`) and a mutable **state object** returned by
`init_plugin_state`.
=#
using SymbolicRegression
using SymbolicRegression: AbstractPlugin, MutationEvent, AbstractMutation
using SymbolicRegression: machine, fit!, report
using Test

struct MutationCounterPlugin <: AbstractPlugin end

mutable struct MutationCounterState
    accepted::Int
    rejected::Int
end

#=
## Implementing the hooks

Create the state once per output at search start:
=#
function SymbolicRegression.init_plugin_state(::MutationCounterPlugin, options, dataset)
    return MutationCounterState(0, 0)
end

#=
The `on_mutation_end!` hook fires on the worker after each mutation's
accept/reject decision. We increment the appropriate counter:
=#
function SymbolicRegression.on_mutation_end!(
    state::MutationCounterState,
    ::MutationCounterPlugin,
    ::AbstractMutation,
    event::MutationEvent,
    dataset,
    options,
)
    if event.accepted
        state.accepted += 1
    else
        state.rejected += 1
    end
    return nothing
end

#=
## Running the search

Pass the plugin to `SRRegressor` via the `plugins` keyword.
All default plugins (like `AdaptiveParsimonyPlugin`) are still
active alongside yours.
=#
X = 2randn(100, 5)
y = @. cos(X[:, 1]) + X[:, 2]^2

model = SRRegressor(;
    binary_operators=[+, -, *, /],
    unary_operators=[cos],
    plugins=(MutationCounterPlugin(),),
    niterations=5,
)
mach = machine(model, X, y)
fit!(mach)

#=
The search ran with our plugin active. Since `on_mutation_end!` runs on
workers against per-dispatch copies of the state (built by `fork_plugin_state`,
which defaults to `deepcopy`), the head-side state won't reflect worker
counts in multithreading mode. For a production version you'd aggregate
via `on_generation_end!` on the head node. But the plugin loaded, the hooks
fired, and the search completed — the API works.
=#
@test report(mach).best_idx isa Int

which uses Literate.jl to generate this page.