text:
using JuMP, EAGO

                     m = Model()

                     EAGO.register_eago_operators!(m)

                     @variable(m, -1 <= x[i=1:5] <= 1)

                     @variable(m, -53.467800048111016 <= q <= 50.665869089598125)

                     add_NL_constraint(m, :(sigmoid(-0.14052056007525238 + -0.5593120910347902*sigmoid(0.7927050633346799 + -0.9855209344073468*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8618242155643285*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.1409847014129051*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8981625305472791*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + -0.17714759684008552*sigmoid(-0.6180581651393844 + 0.5051816616434088*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.300474118407668*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.9746449193496836*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.5011252416621814*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + -0.8034040228386923*sigmoid(0.8979118028491286 + 0.6794924903988093*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.8327554381235851*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.9067656866208256*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.9508098734081298*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + 0.8830918026414509*sigmoid(-0.664219788116319 + -0.6624649067900212*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.3925221054786987*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8696160844053109*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.357347274050821*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))))) + sigmoid(-0.9657657813458713 + 0.6555921464493895*sigmoid(0.7927050633346799 + -0.9855209344073468*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8618242155643285*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.1409847014129051*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8981625305472791*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + -0.8721739939427047*sigmoid(-0.6180581651393844 + 0.5051816616434088*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.300474118407668*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.9746449193496836*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.5011252416621814*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + 0.2771767659228326*sigmoid(0.8979118028491286 + 0.6794924903988093*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.8327554381235851*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.9067656866208256*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.9508098734081298*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + -0.3272615516465871*sigmoid(-0.664219788116319 + -0.6624649067900212*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.3925221054786987*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8696160844053109*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.357347274050821*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))))) + sigmoid(0.1449115541174284 + 0.09677925519094499*sigmoid(0.7927050633346799 + -0.9855209344073468*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8618242155643285*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.1409847014129051*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8981625305472791*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + -0.7242562051573604*sigmoid(-0.6180581651393844 + 0.5051816616434088*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.300474118407668*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.9746449193496836*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.5011252416621814*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + -0.5148279577072672*sigmoid(0.8979118028491286 + 0.6794924903988093*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.8327554381235851*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.9067656866208256*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.9508098734081298*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + 0.31101299363436574*sigmoid(-0.664219788116319 + -0.6624649067900212*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.3925221054786987*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8696160844053109*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.357347274050821*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))))) + sigmoid(-0.29157998590300416 + 0.37951557973783334*sigmoid(0.7927050633346799 + -0.9855209344073468*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8618242155643285*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.1409847014129051*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8981625305472791*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + 0.5044820689237324*sigmoid(-0.6180581651393844 + 0.5051816616434088*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.300474118407668*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.9746449193496836*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.5011252416621814*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + 0.4692646156920386*sigmoid(0.8979118028491286 + 0.6794924903988093*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.8327554381235851*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.9067656866208256*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.9508098734081298*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5])))) + -0.6236220471665241*sigmoid(-0.664219788116319 + -0.6624649067900212*sigmoid(-0.5279345513587295 + 0.26674570975926315*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.6014540451740125*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.7842020578742437*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.7348995303901047*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + 0.3925221054786987*sigmoid(-0.9736042039183683 + -0.3730380073565449*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + -0.6111131700945078*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.6070668283472709*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + 0.602250903818204*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.8696160844053109*sigmoid(-0.7008144662498323 + 0.1168473746120049*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.28223204928638745*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.1750913505933096*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.6765062198397387*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))) + -0.357347274050821*sigmoid(0.7932740070802415 + 0.6457743599334909*sigmoid(-0.7911508587829115 + -0.06506911132939441*$(x[1]) + -0.852429148445272*$(x[2]) + 0.9902340539920638*$(x[3]) + -0.5325045469076417*$(x[4]) + 0.16346424911659252*$(x[5])) + 0.13450970941280982*sigmoid(-0.31894961218704987 + -0.02324224975324851*$(x[1]) + -0.016870940285415248*$(x[2]) + 0.446182370860321*$(x[3]) + -0.9288490609590947*$(x[4]) + 0.29295311736763896*$(x[5])) + -0.4617332497282156*sigmoid(-0.4972259981592049 + -0.8938534018236086*$(x[1]) + 0.008380370033680418*$(x[2]) + -0.18784778862206242*$(x[3]) + 0.20554715210351482*$(x[4]) + 0.7932560928666454*$(x[5])) + -0.2655397829444155*sigmoid(-0.6657792028971241 + -0.5409713712241491*$(x[1]) + 0.49245843557230895*$(x[2]) + 0.7906244992303582*$(x[3]) + 0.4705847767166267*$(x[4]) + -0.3481500575812202*$(x[5]))))) - $q <= 0.0))

                     @objective(m, Min, q)

                     return m

max_stars_repo_name: PSORLab/RSActivationFunctions

max_issues_repo_name: PSORLab/RSActivationFunctions

max_forks_repo_name: PSORLab/RSActivationFunctions


text:
abstract type SimpleCone{T <: AbstractFloat} end

@with_kw struct NonnegCone{T <: AbstractFloat} <: SimpleCone{T}
    dim::Int64
    @assert dim > 0
end

NonnegCone(dim::Int64) = NonnegCone{Float64}(dim)

@with_kw struct QuadCone{T <: AbstractFloat} <: SimpleCone{T}
    dim::Int64
    @assert dim > 0
end

QuadCone(dim::Int64) = QuadCone{Float64}(dim)

struct CompositeCone{T <: AbstractFloat}
    cones::Vector{SimpleCone{T}}
end

CompositeCone(C::SimpleCone{T}) where T <: AbstractFloat = CompositeCone(SimpleCone{T}[C])

iterate(C::CompositeCone, args...) = iterate(C.cones, args...)
getindex(C::CompositeCone, args...) = getindex(C.cones, args...)
length(C::CompositeCone) = length(C.cones)
size(C::CompositeCone) = (length(C),)

dim(C::NonnegCone) = C.dim
dim(C::QuadCone)  = C.dim
dim(C::CompositeCone) = sum([dim(Ci) for Ci in C]) # TODO map

elem_cone_dims(C::NonnegCone) = ones(Int64, dim(C))
elem_cone_dims(C::QuadCone) = dim(C)
elem_cone_dims(C::CompositeCone{T}) where T = vcat(Int64[], map(elem_cone_dims, C)...)

∈(x::Vector{T}, C::NonnegCone) where T <: AbstractFloat = all(x .> 0)
∈(x::Vector{T}, C::QuadCone) where T <: AbstractFloat = x[2:end]'*x[2:end] < x[1]^2
function ∈(x::Vector{T}, C::CompositeCone) where T <: AbstractFloat
    x_list = split_by_cone(x, C)
    return all((x_list .∈ C))
end

degree(C::NonnegCone) = dim(C)
degree(C::QuadCone) = 1
degree(C::CompositeCone) = sum([degree(Ci) for Ci in C]) # TODO map

jordan(s::Vector{T}, z::Vector{T}, C::NonnegCone) where T <: AbstractFloat = s .* z
jordan(s::Vector{T}, z::Vector{T}, C::QuadCone) where T <: AbstractFloat = [s'*z; s[1]*z[2:end] + z[1]*s[2:end]]
function jordan(s::Vector{T}, z::Vector{T}, C::CompositeCone) where T <: AbstractFloat
    s_list = split_by_cone(s, C)
    z_list = split_by_cone(z, C)
    return vcat(T[], jordan.(s_list, z_list, C)...)
end

# Defined in §5.4, pg 14.
function jordan_inv(s::Vector{T}, z::Vector{T}, C::NonnegCone) where {T <: AbstractFloat}
    return s .\ z
end

function jordan_inv(u::Vector{T}, w::Vector{T}, C::QuadCone) where {T <: AbstractFloat}
    y = Vector{T}(undef, length(u))
    ρ = u[1]^2 - u[2:end]'*u[2:end]
    ν = u[2:end]'*w[2:end]
    y[1] = u[1]*w[1] - ν
    y[2:end] = (ν/u[1] - w[1])*u[2:end] + (ρ/u[1])*w[2:end]
    return y / ρ
end

function jordan_inv(s::Vector{T}, z::Vector{T}, C::CompositeCone) where {T <: AbstractFloat}
    s_list = split_by_cone(s, C)
    z_list = split_by_cone(z, C)
    return vcat(T[], [jordan_inv(si, zi, Ci) for (si, zi, Ci) in zip(s_list, z_list, C)]...)
end

get_id(C::NonnegCone) = ones(dim(C))
get_id(C::QuadCone) = [1; zeros(dim(C) - 1)]
get_id(C::CompositeCone{T}) where T = vcat(T[], get_id.(C)...)

function get_max_step(x::Vector{T}, δx::Vector{T}, C::NonnegCone) where T <: AbstractFloat
    if x in C
        return 1/pos(-minimum(δx ./ x))
    else
        return NaN
    end
end

function get_max_step(λ::Vector{T}, Δs::Vector{T}, Δz::Vector{T}, C::NonnegCone) where T <: AbstractFloat
    ρ = Δs ./ λ
    σ = Δz ./ λ
    @assert dim(C) > 0
    @assert length(ρ) > 0
    @assert length(σ) > 0
    α = 1/max(0, -minimum(ρ), -minimum(σ))
    return α
end

function get_max_step(λ::Vector{T}, Δs::Vector{T}, Δz::Vector{T}, C::QuadCone) where T <: AbstractFloat
    sqrtλJλ = sqrt(pos(λ'*(J*λ)))
    λbar = λ / sqrtλJλ
    ρ0 = 1/sqrtλJλ * λbar'*(J*Δs)
    ρ1 = 1/sqrtλJλ * (Δs[2:end] - (λbar'*(J*Δs) + Δs[1])/(λbar[1] + 1)*λbar[2:end])
    σ0 = 1/sqrtλJλ * λbar'*(J*Δz)
    σ1 = 1/sqrtλJλ * (Δz[2:end] - (λbar'*(J*Δz) + Δz[1])/(λbar[1] + 1)*λbar[2:end])
    α = 1/max(0, norm(ρ1) - ρ0, norm(σ1) - σ0)
    return α
end

function get_max_step(λ::Vector{T}, Δs::Vector{T}, Δz::Vector{T}, C::CompositeCone) where T <: AbstractFloat
    λ_list = split_by_cone(λ, C)
    Δs_list = split_by_cone(Δs, C)
    Δz_list = split_by_cone(Δz, C)
    return min(Inf, get_max_step.(λ_list, Δs_list, Δz_list, C)...)
end

function dist_along_id_ray(x::Vector{T}, C::NonnegCone{T}) where T <: AbstractFloat
    return maximum(neg.(x))
end

function dist_along_id_ray(x::Vector{T}, C::QuadCone{T}) where T <: AbstractFloat
    return pos(norm(x[2:end]) - x[1])
end

function dist_along_id_ray(x::Vector{T}, C::CompositeCone{T}) where T <: AbstractFloat
    return max(0, [dist_along_id_ray(xi, Ci) for (xi, Ci) in zip(split_by_cone(x, C), C)]...)
end

get_num_quad_cones(C::CompositeCone) = sum([isa(Ci, QuadCone) for Ci in C])

ext: jl


text:
module TimeScales

import Dates

export TimeScale

"""
All timescales are subtypes of the abstract type `TimeScale`.
The following timescales are defined:

* `UTC` — Coordinated Universal Time
* `UT1` — Universal Time
* `TAI` — International Atomic Time
* `TT` — Terrestrial Time
* `TCG` — Geocentric Coordinate Time
* `TCB` — Barycentric Coordinate Time
* `TDB` — Barycentric Dynamical Time
"""
abstract type TimeScale end

const SCALES = (
    :CoordinatedUniversalTime,
    :UniversalTime,
    :InternationalAtomicTime,
    :TerrestrialTime,
    :GeocentricCoordinateTime,
    :BarycentricCoordinateTime,
    :BarycentricDynamicalTime,
)

const ACRONYMS = (
    :UTC,
    :UT1,
    :TAI,
    :TT,
    :TCG,
    :TCB,
    :TDB,
)

for (acronym, scale) in zip(ACRONYMS, SCALES)
    name = String(acronym)
    @eval begin
        struct $scale <: TimeScale end
        const $acronym = $scale()
        export $scale, $acronym

        Base.show(io::IO, ::$scale) = print(io, $name)
        tryparse(::Val{Symbol($name)}) = $acronym
    end
end

struct NotATimeScale <: TimeScale end

tryparse(s::T) where T<:AbstractString = tryparse(Val(Symbol(s)))
tryparse(::T) where T = nothing

@inline function Dates.tryparsenext(d::Dates.DatePart{'t'}, str, i, len, locale)
    next = Dates.tryparsenext_word(str, i, len, locale, Dates.max_width(d))
    next === nothing && return nothing
    word, i = next
    val = tryparse(word)
    val === nothing && throw(ArgumentError("'$word' is not a recognized time scale."))
    return val, i
end

end


text:
include("ellpla.jl")
# Contact between two ellipsoids
# ==============================
# References
# ----------
# [1] J. W. Perram, ￼Statistical Mechanics of Hard Ellipsoids. I.
#     Overlap Algorithm and the Contact Function,
#     Journal of Computational Physics, 58, 409-416 (1985)
# -----------------------------------------------------------------------
# ellipsoids are defined by centre x, radii a, b, c, and orientation R;
# -----------------------------------------------------------------------
# returned: (conpnt, depth, A, B), where:
# conpnt - contact point (or [0.0, 0.0, 0.0] if no contact)
# depth - positive penetration depth (or -1.0 if no contact)
# A, B - approximate contact ellipse radii (or 0.0, 0.0 if no contact)
# __________________________________________________________________________
function ellipsoid_ellipsoid_contact(x1, a1, b1, c1, R1, x2, a2, b2, c2, R2)

  x1 = vec(x1);
  x2 = vec(x2);

  IA = R1*[1.0/(a1*a1) 0.0 0.0; 0.0 1.0/(b1*b1) 0.0; 0.0 0.0 1.0/(c1*c1)]*R1';
  IB = R2*[1.0/(a2*a2) 0.0 0.0; 0.0 1.0/(b2*b2) 0.0; 0.0 0.0 1.0/(c2*c2)]*R2';

  A = R1*[a1*a1 0.0 0.0; 0.0 b1*b1 0.0; 0.0 0.0 c1*c1]*R1';
  B = R2*[a2*a2 0.0 0.0; 0.0 b2*b2 0.0; 0.0 0.0 c2*c2]*R2';

  x21 = x2 - x1;

  C = Matrix{Float64}(undef, 3, 3)
  x = Vector{Float64}(undef, 3)
  lambda = 0.5
  error = 1.0
  iter = 0

  while error > 1E-10 && iter < 100

    C = inv(lambda*B + (1.0-lambda)*A)
    x = x2 - lambda*B*C*x21
    #x = x1 + (1.0-lambda)*A*C*x21 # alternative formula
    #x0 = (lambda*IA + (1.0-lambda)*IB)\(lambda*IA*x1 + (1.0-lambda)*IB*x2) # hand calculation
    #println("x0 = ", x0, ", x = ", x, "x - x0 = ", x-x0) # comparison with paper formula
    FA = (x-x1)'*IA*(x-x1)
    FB = (x-x2)'*IB*(x-x2)
    dFdl = FA - FB
    #ddFdll = -2.0*x21'*C*(lambda*IA + (1.0-lambda)*IB)*C*x21 # paper formula, poorer rate
    #ddFdll = -2.0*x21'*C*(lambda*A + (1.0-lambda)*B)*C*x21 # why this is better?
    #ddFdll = -2.0*x21'*C*(lambda*B + (1.0-lambda)*A)*C*x21 # why this is so much better?
    ddFdll = -2.0*x21'*C*x21 # (same as above) why this is so much better?
    dlambda = -dFdl/ddFdll
    lambda += dlambda

    error = abs(dlambda)
    iter += 1

    println("at iter ", iter, " error ", error, ", and x = ", x)
  end

  F = lambda*(1.0-lambda)*x21'*C*x21

  if F < 1.0
    v = lambda*IA*(x-x1) - (1.0-lambda)*IB*(x-x2)
    conpnt = x
    normal = v/norm(v)
    (y1, d1, A1, B1) = ellipsoid_plane_contact(x1, a1, b1, c1, R1, conpnt, -normal)
    (y2, d2, A2, B2) = ellipsoid_plane_contact(x2, a2, b2, c2, R2, conpnt, normal)
    println(y1, " ", d1, " ", A1, " ", B1)
    println(y2, " ", d2, " ", A2, " ", B2)
    depth = d1+d2
    A = min(A1, A2)
    B = min(B1, B2)
  else
    conpnt = [0.0; 0.0; 0.0];
    normal = [0.0; 0.0; 0.0];
    depth = -1.0;
    A = 0.0;
    B = 0.0;
  end

  return conpnt, normal, depth, A, B
end

max_stars_repo_name: tkoziara/edyna

max_issues_repo_name: tkoziara/edyna

max_forks_repo_name: tkoziara/edyna


text:
module TaskScheduling

using Base.Threads

type Scheduler
    tasks::Vector{Any}
    mutex::Mutex
    nbusy::Atomic{Int}
    terminate::Atomic{Int}
    Scheduler() = new(Any[], Mutex(), Atomic{Int}(), Atomic{Int}())
end
const scheduler = Scheduler()

export submit
function submit(task)
    lock!(scheduler.mutex)
    push!(scheduler.tasks, task)
    unlock!(scheduler.mutex)
end

function gettask()
    # get lock
    lock!(scheduler.mutex)
    # get next task, if any
    task = nothing
    if !isempty(scheduler.tasks)
        # get task
        task = pop!(scheduler.tasks)
        atomic_add!(scheduler.nbusy, 1)
    else
        # check for termination
        if scheduler.nbusy[] == 0
            scheduler.terminate[] = 1
        end
    end
    # release lock
    unlock!(scheduler.mutex)
    task
end

export runtasks
function runtasks()
    scheduler.nbusy[] = 0
    scheduler.terminate[] = 0
    @threads for i in 1:nthreads()
        while scheduler.terminate[] == 0
            # get next task
            task = gettask()
            # run the task
            if task !== nothing
                task()
                atomic_sub!(scheduler.nbusy, 1)
            end
        end
    end
end

end


text:
## Simple Hole Test
## ================
import Sigma: Simplex, weighted_mid_split, rand_partial_split,
              weighted_partial_split
import Sigma: dreal, z3, dreal3
import Sigma: SigmaSMT, SigmaAI
import Sigma: cond_sample_tlmh
import Sigma: runbenchmarks, benchdir

# Vary the size of the holes around the vertices of the simples
holesizes = logspace(-1,-10,10)
problems = [Simplex(3,[:total_time,],100,h)
              for h = holesizes]

mh_captures = [:start_loop, :refinement_depth, :samples]
all_splits = [weighted_partial_split, rand_partial_split]

SMTalgorithms = [SigmaSMT(mh_captures, solver, sampler, nprocs, split)
  for nprocs = [1],
      solver = [dreal3],
      split = all_splits,
      sampler = [cond_sample_tlmh]][:]

AIalgorithms = [SigmaAI(mh_captures, sampler, nprocs, split)
  for nprocs = [1],
      split = all_splits,
      sampler = [cond_sample_tlmh]][:]

for i = 1:10
runbenchmarks(vcat(AIalgorithms),problems;
              runname = "holesize",prefix=benchdir,savedb=true)
end


text:
Base.ndims(::AbstractDomain) = error("Domain dimension is undefined")

struct DiscreteDomain <: AbstractDomain
    length::Int
end

struct RealDomain <: AbstractDomain end
struct ComplexDomain <: AbstractDomain end
struct UnspecifiedDomain <: AbstractDomain end

struct Interval{T} <: AbstractDomain
  start::T
  stop::T
end

struct ProductDomain{T} <: AbstractDomain
    domains::T
end

Base.:*(x::AbstractDomain...) = ProductDomain((x...,))

export RealDomain, ComplexDomain, UnspecifiedDomain, DiscreteDomain, Interval, ProductDomain


text:
export name, name_base_indices, similarvariable, @similarvariable, variable_union_type

Base.copy(x::AbstractVariable) = x

"""
    variable_union_type(p::AbstractPolynomialLike)

Return the supertype for variables of `p`. If `p` is a variable, it should not
be the type of `p` but the supertype of all variables that could be created.

### Examples

For `TypedPolynomials`, a variable of name `x` has type `Variable{:x}` so
`variable_union_type` should return `Variable`.
For `DynamicPolynomials`, all variables have the same type `PolyVar{C}` where
`C` is `true` for commutative variables and `false` for non-commutative ones so
`variable_union_type` should return `PolyVar{C}`.
"""
function variable_union_type end

"""
    variable(p::AbstractPolynomialLike)

Converts `p` to a variable. Throws an error if it is not possible.

### Examples

Calling `variable(x^2 + x - x^2)` should return the variable `x` and
calling `variable(1.0y)` should return the variable `y` however calling
`variable(2x)` or `variable(x + y)` should throw an error.

### Note

This operation is not type stable for the TypedPolynomials implementation if `nvariables(p) > 1` but is type stable for DynamicPolynomials.
"""
variable(m::AbstractMonomialLike) = _mono2var(powers(m)...)
variable(v::AbstractVariable) = v
function variable(t::AbstractTermLike)
    if isone(coefficient(t))
        variable(monomial(t))
    else
        error("A term with non-one coefficient cannot be converted into a variable")
    end
end
variable(p::APL) = variable(term(p))

_errormono2var() = error("Monomial cannot be converted to a variable")
_mono2var() = _errormono2var()
function _checknovar() end
function _checknovar(ve, ves...)
    if iszero(ve[2])
        _checknovar(ves...)
    else
        _errormono2var()
    end
end
function _mono2var(ve, ves...)
    if iszero(ve[2])
        _mono2var(ves...)
    elseif isone(ve[2])
        _checknovar(ves...)
        ve[1]
    else
        _errormono2var()
    end
end

"""
    name(v::AbstractVariable)::AbstractString

Returns the name of a variable.
"""
function name end

"""
    name_base_indices(v::AbstractVariable)

Returns the name of the variable (as a `String` or `Symbol`) and its indices
as a `Vector{Int}` or tuple of `Int`s.
"""
function name_base_indices end

"""
    similarvariable(p::AbstractPolynomialLike, variable::Type{Val{V}})

Creates a new variable `V` based upon the the given source polynomial.

    similarvariable(p::AbstractPolynomialLike, v::Symbol)

Creates a new variable based upon the given source polynomial and the given symbol `v`. Note
that this can lead to type instabilities.

### Examples

Calling `similarvariable(typedpoly, Val{:x})` on a polynomial created with `TypedPolynomials`
results in `TypedPolynomials.Variable{:x}`.
"""
function similarvariable end

similarvariable(p::Union{AbstractPolynomialLike, Type{<:AbstractPolynomialLike}}, s::Symbol) = similarvariable(p, Val{s})

"""
    @similarvariable(p::AbstractPolynomialLike, variable)

Calls `similarvariable(p, Val{variable})` and binds the result to a variable with the same
name.

### Examples

Calling `@similarvariable typedpoly x` on a polynomial created with `TypedPolynomials`
binds `TypedPolynomials.Variable{:x}` to the variable `x`.
"""
macro similarvariable(p, name)
    Expr(:block, _makevar(p, name))
end

_varconstructor(p, name::Symbol) = :(similarvariable($p, Val{$(esc(Expr(:quote, name)))}))
_makevar(f, name::Symbol) = :($(esc(name)) = $(_varconstructor(:($(esc(f))), name)))


text:
include("../LoadAllPackages.jl")
LoadAllPackages.loadall(joinpath((@__DIR__), "..", "Project.toml"))
using Documenter: doctest
doctest((@__DIR__), Module[])


text:
using SFML

function check(r)
    if !isok(r)
        print_with_color(:red, "Error: $(get_status(r))\n")
    end
end

print("Please enter the host address: ")
host = readline(STDIN) |> chomp

print("Please enter your username: ")
username = readline(STDIN) |> chomp

# Don't echo the password in the terminal
print("Please enter your password: ")
@unix_only run(`stty -echo`)
@windows_only print("(Your password will be shown) ")
password = readline(STDIN) |> chomp
@unix_only run(`stty echo`)

println("Connecting...")

ftp = Ftp()
response = connect(ftp, IpAddress(host))
check(response)
if get_status(response) == SFML.FtpConnectionFailed
    println("Failed to connect")
    exit(0)
end
println("Connected")

response = login(ftp, username, password)
check(response)
if get_status(response) == SFML.FtpNotLoggedIn
    println("Failed to log in")
    exit(0)
end
println("Logged in")

println("Possible commands: ls, cd, mkdir, rename, rm, rmdir, download, upload, logout/disconnect/exit")

while true
    response = get_working_directory(ftp)
    check(response)
    print_with_color(:blue, "$(get_directory(response))> ")
    command = split(readline(STDIN) |> strip, r"\s+")

    if command[1] == "ls"
        if length(command) > 1
            dir = command[2]
        else
            dir = "."
        end
        listing = get_directory_listing(ftp, dir)
        check(listing)
        num_files = get_count(listing)
        for i = 0:num_files - 1
            println(get_name(listing, i))
        end
    elseif command[1] == "cd"
        if length(command) > 1
            dir = command[2]
        else
            dir = "~"
        end
        check(change_directory(ftp, dir))
    elseif command[1] == "mkdir"
        if length(command) > 1
            check(create_directory(ftp, command[2]))
        else
            println("mkdir must take one argument")
        end
    elseif command[1] == "rename"
        if length(command) > 2
            check(rename_file(ftp, command[2], command[3]))
        else
            println("rename must take two arguments")
        end
    elseif command[1] == "rm"
        if length(command) > 1
            check(delete_file(ftp, command[2]))
        else
            println("rm must take one argument")
        end
    elseif command[1] == "rmdir"
        if length(command) > 1
            check(delete_directory(ftp, command[2]))
        else
            println("rmdir must take one argument")
        end
    elseif command[1] == "download"
        if length(command) > 1
            if length(command) > 2
                dir = command[3]
            else
                dir = "."
            end
            check(download(ftp, command[2], dir, SFML.FtpBinary))
        else
            println("download must take at least one argument")
        end
    elseif command[1] == "upload"
        if length(command) > 1
            if length(command) > 2
                dir = command[3]
            else
                dir = "."
            end
            check(upload(ftp, command[2], dir, SFML.FtpBinary))
        else
            println("upload must take at least one argument")
        end
    elseif command[1] == "exit" || command[1] == "disconnect" || command[1] == "logout"
        check(disconnect(ftp))
        println("Disconnected")
        exit(0)
    else
        println("Unknown command: $(command[1])")
    end
end


text:
using DataFrames,Distributions,CairoMakie,StatsFuns

df1 = DataFrame( θ = 0.375:0.001:0.525)
α,β = 438,544
posterior = Beta(α,β)
# the pdf function 'knows' when it is supplied a Beta distribution
df1.p =pdf.(posterior,df1.θ);
df2 =DataFrame(θ = LinRange(quantile(posterior,[0.025,0.975])..., 100))# compute the posterior density
df2.p =pdf.(posterior,df2.θ);
fig, ax, post = lines(df1.θ, df1.p, color = :black, linewidth = 4,
axis = (title = "Posterior distribution given uniform prior",
titlesize = 24,))
# Add a layer of colorized 95% posterior interval
i95 = band!(df2.θ,fill(0.0,length(df2.p)), df2.p, color = (:blue,0.2))
# Add the proportion of girl babies in general population
pop = vlines!(ax, [0.488], color = :black, linestyle=:dash)
# Decorate the plot a little
Legend(fig[2,1], [post, i95, pop], ["Poseterior density = Beta($(α),$(β))",
"95% posterior interval", "population average"],
orientation = :horizontal,tellwidth = false, tellheight = true)
fig


text:
module BackwardKernel

include("../Misc.jl")
using .Misc

using Distributions, SpecialFunctions
import DataStructures: PriorityQueue, peek, enqueue!, dequeue!
import Base: iterate, length, sum, eltype

export EventQueue, sum, length, eltype, iterate

mutable struct EventQueue{ℜ<:Real}
    T::Int
    X::Array{ℜ}
    pq::PriorityQueue{Tuple{Int,Int,Int},ℜ,Base.Order.ForwardOrdering}
    function EventQueue(X_new::Array{ℜ}) where {ℜ<:Real}
        I::Int, J::Int, K::Int = size(X_new)
        T_new::Int = Int(round(sum(X_new)))
        pq_new = PriorityQueue([(i,j,k)=>rand(Dirichlet([1.0,X_new[i,j,k]]))[1] for k=1:K, j=1:J, i=1:I if X_new[i,j,k]>0])
        return new{ℜ}(T_new,copy(X_new),pq_new)
    end
end

Base.sum(L::EventQueue) = sum(L.X)
Base.length(L::EventQueue) = L.T
Base.eltype(L::EventQueue) = Tuple{Int,Int,Int}

function Base.iterate(L::EventQueue{ℜ}, state::Ƶ=1) where {Ƶ<:Int,ℜ<:Real}
    τ::Ƶ = state
    i_τ::Ƶ, j_τ::Ƶ, k_τ::Ƶ = 0, 0, 0
    t::ℜ, t_next::ℜ = 0.0, 0.0
    if L.T < τ
        return nothing
    end
    t = peek(L.pq)[2]
    i_τ, j_τ, k_τ = dequeue!(L.pq)
    L.X[i_τ, j_τ, k_τ] -= 1.0
    if L.X[i_τ, j_τ, k_τ] > 0.0
        t_next = t + (1.0 - t)*rand(Dirichlet([1.0, L.X[i_τ,j_τ, k_τ]]))[1]
        L.pq[(i_τ, j_τ, k_τ)] = t_next
    end
    return (i_τ, j_τ, k_τ), state+1
end

end

max_stars_repo_name: mehmetburakkurutmaz/bam

max_issues_repo_name: mehmetburakkurutmaz/bam

max_forks_repo_name: atcemgil/bam


text:
using BSON, Tracker

const NER_Char_UNK = '¿'
const NER_Word_UNK = "<UNK>"

struct NERmodel{M}
    model::M
end

load_model_dicts(filepath) = load_model_dicts(filepath, true)

function load_model_dicts(filepath, remove_tag_prefix)
    labels = BSON.load(joinpath(filepath, "labels.bson"))[:labels]
    chars_idx = BSON.load(joinpath(filepath, "char_to_embed_idx.bson"))[:get_char_index]
    words_idx = BSON.load(joinpath(filepath, "word_to_embed_idx.bson"))[:get_word_index]

    remove_tag_prefix || return [labels...], chars_idx, words_idx

    return remove_ner_label_prefix.([labels...]), chars_idx, words_idx
end

NERTagger() = NERTagger(datadep"NER Model Dicts", datadep"NER Model Weights")

function NERTagger(dicts_path, weights_path)
    labels, chars_idx, words_idx = load_model_dicts(dicts_path)
    model = BiLSTM_CNN_CRF_Model(labels, chars_idx, words_idx, chars_idx[NER_Char_UNK], words_idx[NER_Word_UNK], weights_path)
    NERmodel(model)
end

function (a::NERmodel)(tokens::Array{String,1})
    input_oh = [onehotinput(a.model, token) for token in tokens]
    return (a.model)(input_oh)
end

function (a::NERmodel)(sentence::AbstractString)
    a(WordTokenizers.tokenize(sentence))
end

function (a::NERmodel)(doc::AbstractDocument)
    return vcat(a.(WordTokenizers.split_sentences(text(doc))))
end

function (a::NERmodel)(ngd::NGramDocument)
    throw("Sequence Labelling not possible for NGramsDocument")
end

function (a::NERmodel)(crps::Corpus)
    return a.(crps.documents)
end

function remove_ner_label_prefix(str)
    str == "O" && return str
    str = str[3:end]
end


text:
using PyCall

include("../deps/build.jl")

println("Test Dependency Build")
@test pip("pip") == nothing


text:
using Test
using DandelionWebSockets: SendTextFrame, SendBinaryFrame
using DandelionWebSockets: ClientPingRequest, PongMissed, CloseRequest, SocketClosed
using DandelionWebSockets: FrameFromServer
using DandelionWebSockets.Proxy: ClientProtocolProxy
import DandelionWebSockets.Proxy: handle

struct ClientProtocolNotification
    datatype::Symbol
    payload::Any
end

struct MockProxiedClientProtocol <: AbstractClientProtocol
    call_notifications::Channel{ClientProtocolNotification}

    MockProxiedClientProtocol() = new(Channel{ClientProtocolNotification}(0))
end

takenotification!(c::MockProxiedClientProtocol) = take!(c.call_notifications)
handle(c::MockProxiedClientProtocol, s::SendTextFrame) = put!(c.call_notifications, ClientProtocolNotification(:SendTextFrame, s))
handle(c::MockProxiedClientProtocol, s::SendBinaryFrame) = put!(c.call_notifications, ClientProtocolNotification(:SendBinaryFrame, s))
handle(c::MockProxiedClientProtocol, s::ClientPingRequest) = put!(c.call_notifications, ClientProtocolNotification(:ClientPingRequest, s))
handle(c::MockProxiedClientProtocol, s::PongMissed) = put!(c.call_notifications, ClientProtocolNotification(:PongMissed, s))
handle(c::MockProxiedClientProtocol, s::CloseRequest) = put!(c.call_notifications, ClientProtocolNotification(:CloseRequest, s))
handle(c::MockProxiedClientProtocol, s::SocketClosed) = put!(c.call_notifications, ClientProtocolNotification(:SocketClosed, s))
handle(c::MockProxiedClientProtocol, s::FrameFromServer) = put!(c.call_notifications, ClientProtocolNotification(:FrameFromServer, s))

@testset "Client logic proxy     " begin
    @testset "Callbacks are done one a separate task" begin
        tests = [
            (SendTextFrame("some data", true, OPCODE_TEXT), :SendTextFrame),
            (SendBinaryFrame(b"some data", true, OPCODE_BINARY), :SendBinaryFrame),
            (ClientPingRequest(), :ClientPingRequest),
            (PongMissed(), :PongMissed),
            (CloseRequest(), :CloseRequest),
            (SocketClosed(), :SocketClosed),
            (FrameFromServer(Frame(true,0, 0, 0, OPCODE_TEXT, false, 1, 0, Vector{UInt8}(), b"1")), :FrameFromServer),
        ]

        for test in tests
            data_in = test[1]
            expected_datatype = test[2]

            @testset "Client logic proxy handles a $expected_datatype" begin
                client_logic = MockProxiedClientProtocol()
                proxy = ClientProtocolProxy(client_logic)
                handle(proxy, data_in)

                actual_call = takenotification!(client_logic)
                @test actual_call.datatype == expected_datatype
                @test actual_call.payload == data_in
            end
        end

        @testset "Stop a client logic proxy" begin
            client_logic = MockProxiedClientProtocol()
            proxy = ClientProtocolProxy(client_logic)

            stopproxy(proxy)

            @test isopen(proxy.channel) == false
        end
    end
end


text:
using BinaryBuilder, Pkg

# The version of this JLL is decoupled from the upstream version.
# Whenever we package a new upstream release, we initially map its
# version X.Y.Z to X00.Y00.Z00 (i.e., multiply each component by 100).
# So for example version 2.6.3 would become 200.600.300.
#
# Together, this allows to increment the patch level of the JLL for minor tweaks.
# If a rebuild of the JLL is needed which keeps the upstream version identical
# but breaks ABI compatibility for any reason, one can increment the minor or major
# version (depending on whether package using this JLL use `~` or `^` compat entries)
# e.g. go from 200.600.300 to 200.601.300 or 201.600.300
# Similar tricks can also be used to package prerelease versions; e.g. one might
# map a prerelease of 2.7.0 to 200.690.000.

name = "MUMPS_seq"
upstream_version = v"4.10.0"
version_offset = v"0.0.0" # reset to 0.0.0 once the upstream version changes
version = VersionNumber(upstream_version.major * 100 + version_offset.major,
                        upstream_version.minor * 100 + version_offset.minor,
                        upstream_version.patch * 100 + version_offset.patch)

sources = [
  ArchiveSource("http://mumps.enseeiht.fr/MUMPS_$(upstream_version).tar.gz",
                "d0f86f91a74c51a17a2ff1be9c9cee2338976f13a6d00896ba5b43a5ca05d933"),
  DirectorySource("bundled")
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/MUMPS_4.10.0

# Patch from Coin-OR ThirdPartyMUMPS
(cd src && atomic_patch -p2 $WORKSPACE/srcdir/patches/mumps.patch)
# Patch from JuliaOpt CoinMumpsBuilder
(cd src && atomic_patch -p3 $WORKSPACE/srcdir/patches/quiet.diff)

cp Make.inc/Makefile.gfortran.SEQ Makefile.inc

FFLAGS=()
if [[ "${target}" == aarch64-apple-* ]]; then
    FFLAGS+=(-fallow-argument-mismatch)
fi

make_args=(OPTF=-O3
            CDEFS=-DAdd_
            LMETISDIR=${prefix}/lib
            IMETIS=-I${prefix}/include
            LMETIS='-L$(LMETISDIR) -lmetis'
            ORDERINGSF="-Dpord -Dmetis"
            CC="$CC -fPIC ${CFLAGS[@]}"
            FC="gfortran -fPIC ${FFLAGS[@]}"
            FL="gfortran -fPIC"
            LIBBLAS="-L${libdir} -lopenblas")

if [[ "${target}" == *-apple* ]]; then
  make_args+=(RANLIB=echo)
fi

# NB: parallel build fails
make alllib "${make_args[@]}"

mkdir -p ${prefix}/lib

cd libseq
mv libmpiseq.a ${prefix}/lib

cd ../lib
mv *.a ${prefix}/lib

cd ..
mkdir -p ${prefix}/include/mumps_seq
cp include/* ${prefix}/include/mumps_seq
cp libseq/*.h ${prefix}/include/mumps_seq
"""

platforms = expand_gfortran_versions(supported_platforms())

# The products that we will ensure are always built
products = [
    FileProduct("lib/libsmumps.a", :libsmumps_a),
    FileProduct("lib/libdmumps.a", :libdmumps_a),
    FileProduct("lib/libcmumps.a", :libcmumps_a),
    FileProduct("lib/libzmumps.a", :libzmumps_a),
]

# Dependencies that must be installed before this package can be built
dependencies = [
    BuildDependency(PackageSpec(; name = "METIS_jll",
                                uuid = "d00139f3-1899-568f-a2f0-47f597d42d70",
                                version = v"4.0.3")),
    BuildDependency("OpenBLAS32_jll"),
    BuildDependency("CompilerSupportLibraries_jll"),
]

# Build the tarballs.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
               julia_compat="1.6", preferred_gcc_version=v"6")

max_stars_repo_name: MichelJuillard/Yggdrasil

max_issues_repo_name: MichelJuillard/Yggdrasil

max_forks_repo_name: MichelJuillard/Yggdrasil


text:
using BenchmarkTools

SUITE = BenchmarkGroup()

include("example_benchmark.jl")


text:
@testset "sumtozero.jl" begin
    @testset "SumToZero()" begin
        trailer = SeaPearl.Trailer()

        x = SeaPearl.IntVar(2, 6, "x", trailer)
        y = SeaPearl.IntVar(2, 3, "y", trailer)
        ax = SeaPearl.IntVarViewMul(x, 3, "3x")
        minusY = SeaPearl.IntVarViewOpposite(y, "-y")
        vars = [x, y, ax, minusY]
        constraint = SeaPearl.SumToZero(vars, trailer)

        @test constraint in x.onDomainChange
        @test constraint in y.onDomainChange
        @test constraint.active.value
        @test constraint.numberOfFreeVars.value == 4
        @test constraint.sumOfFixedVars.value == 0
        @test constraint.freeIds == [1, 2, 3, 4]
    end
    @testset "propagate!(::SumToZero)" begin
        trailer = SeaPearl.Trailer()
        vars = SeaPearl.AbstractIntVar[]

        x = SeaPearl.IntVar(2, 3, "x", trailer)
        push!(vars, x)
        y = SeaPearl.IntVar(5, 15, "y", trailer)
        ax = SeaPearl.IntVarViewMul(x, 3, "3x")
        push!(vars, ax)
        minusY = SeaPearl.IntVarViewOpposite(y, "-y")
        push!(vars, minusY)
        constraint = SeaPearl.SumToZero(vars, trailer)

        toPropagate = Set{SeaPearl.Constraint}()
        prunedDomains = SeaPearl.CPModification()

        @test SeaPearl.propagate!(constraint, toPropagate, prunedDomains)

        @test length(y.domain) == 5
        @test 8 in y.domain
        @test !(7 in y.domain)
        @test !(13 in ax.domain)
        @test prunedDomains == SeaPearl.CPModification(
            "-y" => [-5, -6, -7, -13, -14, -15],
            "y"  => [5, 6, 7, 13, 14, 15]
        )

        cons2 = SeaPearl.EqualConstant(y, 15, trailer)

        @test !SeaPearl.propagate!(cons2, toPropagate, prunedDomains)

    end
end


text:
function constraint_voltage_dc(pm::_PM.AbstractPowerModel; nw::Int=pm.cnw)
    constraint_voltage_dc(pm, nw)
end
# no data, so no further templating is needed, constraint goes directly to the formulations
function constraint_power_balance_ac(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    bus = _PM.ref(pm, nw, :bus, i)
    bus_arcs = _PM.ref(pm, nw, :bus_arcs, i)
    bus_arcs_dc = _PM.ref(pm, nw, :bus_arcs_dc, i)
    bus_gens = _PM.ref(pm, nw, :bus_gens, i)
    bus_convs_ac = _PM.ref(pm, nw, :bus_convs_ac, i)
    bus_loads = _PM.ref(pm, nw, :bus_loads, i)
    bus_shunts = _PM.ref(pm, nw, :bus_shunts, i)

    pd = Dict(k => _PM.ref(pm, nw, :load, k, "pd") for k in bus_loads)
    qd = Dict(k => _PM.ref(pm, nw, :load, k, "qd") for k in bus_loads)

    gs = Dict(k => _PM.ref(pm, nw, :shunt, k, "gs") for k in bus_shunts)
    bs = Dict(k => _PM.ref(pm, nw, :shunt, k, "bs") for k in bus_shunts)

    constraint_power_balance_ac(pm, nw, i, bus_arcs, bus_arcs_dc, bus_gens, bus_convs_ac, bus_loads, bus_shunts, pd, qd, gs, bs)
end

function constraint_power_balance_dc(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    bus_arcs_dcgrid = _PM.ref(pm, nw, :bus_arcs_dcgrid, i)
    bus_convs_dc = _PM.ref(pm, nw, :bus_convs_dc, i)
    pd = _PM.ref(pm, nw, :busdc, i)["Pdc"]
    constraint_power_balance_dc(pm, nw, i, bus_arcs_dcgrid, bus_convs_dc, pd)
end
#
function constraint_ohms_dc_branch(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    branch = _PM.ref(pm, nw, :branchdc, i)
    f_bus = branch["fbusdc"]
    t_bus = branch["tbusdc"]
    f_idx = (i, f_bus, t_bus)
    t_idx = (i, t_bus, f_bus)

    p = _PM.ref(pm, nw, :dcpol)

    constraint_ohms_dc_branch(pm, nw, f_bus, t_bus, f_idx, t_idx, branch["r"], p)
end
#
function constraint_converter_losses(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = _PM.ref(pm, nw, :convdc, i)
    a = conv["LossA"]
    b = conv["LossB"]
    c = conv["LossCinv"]
    plmax = conv["LossA"] + conv["LossB"] * conv["Pacrated"] + conv["LossCinv"] * (conv["Pacrated"])^2
    constraint_converter_losses(pm, nw, i, a, b, c, plmax)
end

function constraint_converter_current(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = _PM.ref(pm, nw, :convdc, i)
    Vmax = conv["Vmmax"]
    Imax = conv["Imax"]
    constraint_converter_current(pm, nw, i, Vmax, Imax)
end

function constraint_active_conv_setpoint(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = _PM.ref(pm, nw, :convdc, i)
    constraint_active_conv_setpoint(pm, nw, conv["index"], conv["P_g"])
end

function constraint_reactive_conv_setpoint(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = _PM.ref(pm, nw, :convdc, i)
    constraint_reactive_conv_setpoint(pm, nw, conv["index"], conv["Q_g"])
end
""
function constraint_dc_voltage_magnitude_setpoint(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = _PM.ref(pm, nw, :convdc, i)
    constraint_dc_voltage_magnitude_setpoint(pm, nw, conv["busdc_i"], conv["Vdcset"])
end

#
function constraint_conv_reactor(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = _PM.ref(pm, nw, :convdc, i)
    constraint_conv_reactor(pm, nw, i, conv["rc"], conv["xc"], Bool(conv["reactor"]))
end

#
function constraint_conv_filter(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = _PM.ref(pm, nw, :convdc, i)
    constraint_conv_filter(pm, nw, i, conv["bf"], Bool(conv["filter"]) )
end

#
function constraint_conv_transformer(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = _PM.ref(pm, nw, :convdc, i)
    constraint_conv_transformer(pm, nw, i, conv["rtf"], conv["xtf"], conv["busac_i"], conv["tm"], Bool(conv["transformer"]))
end

#
function constraint_conv_firing_angle(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = _PM.ref(pm, nw, :convdc, i)
    S = conv["Pacrated"]
    P1 = cos(0) * S
    Q1 = sin(0) * S
    P2 = cos(pi) * S
    Q2 = sin(pi) * S
    constraint_conv_firing_angle(pm, nw, i, S, P1, Q1, P2, Q2)
end

function constraint_dc_branch_current(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    vpu = 1;
    branch = _PM.ref(pm, nw, :branchdc, i)
    f_bus = branch["fbusdc"]
    t_bus = branch["tbusdc"]
    f_idx = (i, f_bus, t_bus)

    ccm_max = (_PM.comp_start_value(_PM.ref(pm, nw, :branchdc, i), "rateA", 0.0) / vpu)^2

    p = _PM.ref(pm, nw, :dcpol)
    constraint_dc_branch_current(pm, nw, f_bus, f_idx, ccm_max, p)
end

function constraint_dc_droop_control(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = _PM.ref(pm, nw, :convdc, i)
    bus = _PM.ref(pm, nw, :busdc, conv["busdc_i"])

    constraint_dc_droop_control(pm, nw, i, conv["busdc_i"], conv["Vdcset"], conv["Pdcset"], conv["droop"])
end

############## TNEP Constraints #####################
function constraint_voltage_dc_ne(pm::_PM.AbstractPowerModel; nw::Int=pm.cnw)
    constraint_voltage_dc_ne(pm, nw)
end
# no data, so no further templating is needed, constraint goes directly to the formulations
function constraint_power_balance_ac_dcne(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    bus = PowerModels.ref(pm, nw, :bus, i)
    bus_arcs = PowerModels.ref(pm, nw, :bus_arcs, i)
    bus_arcs_dc = PowerModels.ref(pm, nw, :bus_arcs_dc, i)
    bus_gens = PowerModels.ref(pm, nw, :bus_gens, i)
    bus_convs_ac = PowerModels.ref(pm, nw, :bus_convs_ac, i)
    bus_convs_ac_ne = PowerModels.ref(pm, nw, :bus_convs_ac_ne, i)
    bus_loads = PowerModels.ref(pm, nw, :bus_loads, i)
    bus_shunts = PowerModels.ref(pm, nw, :bus_shunts, i)

    pd = Dict(k => PowerModels.ref(pm, nw, :load, k, "pd") for k in bus_loads)
    qd = Dict(k => PowerModels.ref(pm, nw, :load, k, "qd") for k in bus_loads)

    gs = Dict(k => PowerModels.ref(pm, nw, :shunt, k, "gs") for k in bus_shunts)
    bs = Dict(k => PowerModels.ref(pm, nw, :shunt, k, "bs") for k in bus_shunts)
    constraint_power_balance_ac_dcne(pm, nw, i, bus_arcs, bus_arcs_dc, bus_gens, bus_convs_ac, bus_convs_ac_ne, bus_loads, bus_shunts, pd, qd, gs, bs)
end

function constraint_power_balance_acne_dcne(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    bus = PowerModels.ref(pm, nw, :bus, i)
    bus_arcs = PowerModels.ref(pm, nw, :bus_arcs, i)
    bus_arcs_ne = PowerModels.ref(pm, nw, :ne_bus_arcs, i)
    bus_arcs_dc = PowerModels.ref(pm, nw, :bus_arcs_dc, i)
    bus_gens = PowerModels.ref(pm, nw, :bus_gens, i)
    bus_convs_ac = PowerModels.ref(pm, nw, :bus_convs_ac, i)
    bus_convs_ac_ne = PowerModels.ref(pm, nw, :bus_convs_ac_ne, i)
    bus_loads = PowerModels.ref(pm, nw, :bus_loads, i)
    bus_shunts = PowerModels.ref(pm, nw, :bus_shunts, i)

    pd = Dict(k => PowerModels.ref(pm, nw, :load, k, "pd") for k in bus_loads)
    qd = Dict(k => PowerModels.ref(pm, nw, :load, k, "qd") for k in bus_loads)

    gs = Dict(k => PowerModels.ref(pm, nw, :shunt, k, "gs") for k in bus_shunts)
    bs = Dict(k => PowerModels.ref(pm, nw, :shunt, k, "bs") for k in bus_shunts)
    constraint_power_balance_acne_dcne(pm, nw, i, bus_arcs, bus_arcs_ne, bus_arcs_dc, bus_gens, bus_convs_ac, bus_convs_ac_ne, bus_loads, bus_shunts, pd, qd, gs, bs)
end

function constraint_converter_limit_on_off(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    bigM = 1.2
    conv = PowerModels.ref(pm, nw, :convdc_ne, i)
    pmax = conv["Pacrated"]
    pmin = -conv["Pacrated"]
    qmax = conv["Qacrated"]
    qmin = -conv["Qacrated"]
    pmaxdc = conv["Pacrated"] * bigM
    pmindc = -conv["Pacrated"] * bigM
    imax = conv["Imax"]

    constraint_converter_limit_on_off(pm, nw, i, pmax, pmin, qmax, qmin, pmaxdc, pmindc, imax)
end

function constraint_power_balance_dc_dcne(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    bus_arcs_dcgrid = PowerModels.ref(pm, nw, :bus_arcs_dcgrid, i)
    if haskey(PowerModels.ref(pm, nw, :bus_arcs_dcgrid_ne), i)
        bus_arcs_dcgrid_ne = PowerModels.ref(pm, nw, :bus_arcs_dcgrid_ne, i)
    else
        bus_arcs_dcgrid_ne = []
    end
    bus_convs_dc = PowerModels.ref(pm, nw, :bus_convs_dc, i)
    bus_convs_dc_ne = PowerModels.ref(pm, nw, :bus_convs_dc_ne, i)
    pd = PowerModels.ref(pm, nw, :busdc, i)["Pdc"]
    constraint_power_balance_dc_dcne(pm, nw, i, bus_arcs_dcgrid, bus_arcs_dcgrid_ne, bus_convs_dc, bus_convs_dc_ne, pd)
end

function constraint_power_balance_dcne_dcne(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    bus_i = PowerModels.ref(pm, nw, :busdc_ne, i)["busdc_i"]
    if haskey(PowerModels.ref(pm, nw, :bus_arcs_dcgrid_ne), bus_i)
        bus_arcs_dcgrid_ne = PowerModels.ref(pm, nw, :bus_arcs_dcgrid_ne, bus_i)
    else
        bus_arcs_dcgrid_ne = []
    end
    bus_ne_convs_dc_ne = PowerModels.ref(pm, nw, :bus_ne_convs_dc_ne, bus_i)
    pd_ne = PowerModels.ref(pm, nw, :busdc_ne, i)["Pdc"]
    constraint_power_balance_dcne_dcne(pm, nw, i, bus_arcs_dcgrid_ne, bus_ne_convs_dc_ne, pd_ne)
end

function constraint_ohms_dc_branch_ne(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    branch = PowerModels.ref(pm, nw, :branchdc_ne, i)
    f_bus = branch["fbusdc"]
    t_bus = branch["tbusdc"]
    f_idx = (i, f_bus, t_bus)
    t_idx = (i, t_bus, f_bus)

    p = PowerModels.ref(pm, nw, :dcpol)

    constraint_ohms_dc_branch_ne(pm, nw, f_bus, t_bus, f_idx, t_idx, branch["r"], p)
end

function constraint_branch_limit_on_off(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    branch = PowerModels.ref(pm, nw, :branchdc_ne, i)
    f_bus = branch["fbusdc"]
    t_bus = branch["tbusdc"]
    f_idx = (i, f_bus, t_bus)
    t_idx = (i, t_bus, f_bus)

    pmax = branch["rateA"]
    pmin = -branch["rateA"]
    vpu = 0.8; #as taken in the variable creation
    imax = (branch["rateA"]/0.8)^2
    imin = 0
    constraint_branch_limit_on_off(pm, nw, i, f_idx, t_idx, pmax, pmin, imax, imin)
end

#
function constraint_converter_losses_ne(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = PowerModels.ref(pm, nw, :convdc_ne, i)
    a = conv["LossA"]
    b = conv["LossB"]
    c = conv["LossCinv"]
    plmax = conv["LossA"] + conv["LossB"] * conv["Imax"] + conv["LossCinv"] * (conv["Imax"])^2

    constraint_converter_losses_ne(pm, nw, i, a, b, c, plmax)
end
#
 function constraint_converter_current_ne(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
     conv = PowerModels.ref(pm, nw, :convdc_ne, i)
     Vmax = conv["Vmmax"]
     Imax = conv["Imax"]
     constraint_converter_current_ne(pm, nw, i, Vmax, Imax)
 end

function constraint_conv_reactor_ne(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = PowerModels.ref(pm, nw, :convdc_ne, i)
    constraint_conv_reactor_ne(pm, nw, i, conv["rc"], conv["xc"], Bool(conv["reactor"]))
end

#
function constraint_conv_filter_ne(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = PowerModels.ref(pm, nw, :convdc_ne, i)
    constraint_conv_filter_ne(pm, nw, i, conv["bf"], Bool(conv["filter"]) )
end

#
function constraint_conv_transformer_ne(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
    conv = PowerModels.ref(pm, nw, :convdc_ne, i)
    constraint_conv_transformer_ne(pm, nw, i, conv["rtf"], conv["xtf"], conv["busac_i"], conv["tm"], Bool(conv["transformer"]))
end
#
function constraint_conv_firing_angle_ne(pm::_PM.AbstractPowerModel, i::Int; nw::Int=pm.cnw)
     conv = PowerModels.ref(pm, n, :convdc_ne, i)
     S = conv["Pacrated"]
     P1 = cos(0) * S
     Q1 = sin(0) * S
     P2 = cos(pi) * S
     Q2 = sin(pi) * S
     constraint_conv_firing_angle_ne(pm, n, i, S, P1, Q1, P2, Q2)
end