instruction_seed stringlengths 43 8.03k | source stringclasses 1
value | embeddings listlengths 1.02k 1.02k | mean_positive_score float64 0.73 0.85 | mean_negative_score float64 0.71 0.82 | difference_score float64 0.01 0.07 |
|---|---|---|---|---|---|
You are tasked with creating a program that calculates the maximum probability for a given set of quantum states. The program should take into account the amplitude and probability functions provided in the code snippet. The goal is to use the NMaximize function to find the maximum probability for a specified range of ... | glaive | [
0.007450448349118233,
0.031140390783548355,
-0.03861173987388611,
-0.018775925040245056,
0.04819726571440697,
-0.022155646234750748,
-0.022115448489785194,
0.0678970217704773,
0.038633041083812714,
0.005564420018345118,
0.025590283796191216,
0.0387304425239563,
-0.01943463273346424,
-0.006... | 0.801281 | 0.77694 | 0.024341 |
You are tasked with writing a program that performs bitwise OR operations on two memory locations and stores the result in another memory location. The memory locations are represented by variables {m1} and {m2}, and the constants to be OR-ed are represented by {c1}. Write a program that performs the following steps:
1... | glaive | [
0.028822418302297592,
0.009146404452621937,
-0.03796716406941414,
-0.01736493967473507,
0.018976861611008644,
-0.04221959412097931,
-0.026082690805196762,
0.07305489480495453,
0.06170855835080147,
-0.02114589884877205,
0.010131613351404667,
0.022522540763020515,
-0.027895234525203705,
-0.0... | 0.812412 | 0.778884 | 0.033527 |
You are tasked with creating a program that calculates the maximum probability and plots the probability distribution for a given quantum state. The quantum state is represented by a function `probability(x, y)` that takes in two variables x and y and returns the absolute value squared of the amplitude of the quantum s... | glaive | [
-0.0034064012579619884,
0.024621542543172836,
-0.03783266618847847,
-0.02762950025498867,
0.03839040547609329,
-0.016389550641179085,
-0.02036128379404545,
0.07437698543071747,
0.044439397752285004,
0.0006892979145050049,
0.029734596610069275,
0.04218144714832306,
-0.013743291608989239,
-0... | 0.797365 | 0.773997 | 0.023368 |
You are tasked with creating a function in Fortran that calculates the elliptic blending function for momentum. The function should take in two arguments: a type called Turb_Type and an integer called c. The elliptic blending function for momentum is defined as follows:
Turb_Mod_Ebf_Momentum = max(0.01 * turb % y_plu... | glaive | [
0.018342718482017517,
0.044493697583675385,
-0.015632687136530876,
-0.03913145139813423,
0.03738747909665108,
-0.0054704900830984116,
-0.022922737523913383,
0.07014420628547668,
0.04207693040370941,
0.007516579702496529,
0.012844789773225784,
0.045620646327733994,
-0.017119290307164192,
-0... | 0.785882 | 0.771224 | 0.014658 |
You are tasked with implementing a CUDA kernel function to calculate the percent change in a vector and store the result in another vector. The formula to calculate the percent change is given as:
C = log(A[x]/A[x-1])
You need to write a CUDA kernel function that takes in two Vector objects A and C, and computes the p... | glaive | [
0.0024789602030068636,
0.0657244324684143,
-0.027159295976161957,
-0.017754709348082542,
0.03518250957131386,
-0.023101961240172386,
-0.03073704242706299,
0.10942719131708145,
0.05421338230371475,
-0.01301406417042017,
0.026733025908470154,
0.018118197098374367,
-0.01427160482853651,
0.018... | 0.805296 | 0.784829 | 0.020467 |
You are required to create a function that calculates the sum of elements in a vector or 1D matrix. The function should take the vector or 1D matrix as input and return the sum of its elements. Additionally, you need to write a function to calculate the sum of squares of values in a vector or 1D matrix. The function sh... | glaive | [
0.01644056662917137,
0.04772300645709038,
-0.0331571102142334,
-0.049280133098363876,
0.06634040176868439,
-0.02183256857097149,
-0.021467536687850952,
0.05058629810810089,
0.03849869966506958,
-0.008539509028196335,
0.019392229616642,
0.027323298156261444,
-0.025422438979148865,
-0.027098... | 0.807066 | 0.785897 | 0.021169 |
You are tasked with implementing a function that takes a list of numbers and performs various operations based on the type of number in the list. The operations to be performed include checking if the number is an integer, natural number, bit list, dab digit list, and more. You need to create a function that can handle... | glaive | [
0.03565787151455879,
0.010558543726801872,
-0.032671112567186356,
-0.026395155116915703,
0.048721008002758026,
-0.02257087454199791,
-0.014344444498419762,
0.05404016748070717,
0.047902874648571014,
-0.001954799285158515,
0.01968439668416977,
0.042382895946502686,
-0.023897331207990646,
-0... | 0.799257 | 0.779017 | 0.02024 |
You are tasked with implementing a subroutine that computes the eigenvalues and eigenvectors of a 2-by-2 symmetric matrix. The input to the subroutine will be the elements of the 2-by-2 matrix (A, B, and C), and the output will be the eigenvalues (RT1 and RT2) and the unit right eigenvector (CS1, SN1). The purpose of t... | glaive | [
0.03159602731466293,
0.034303538501262665,
-0.04118023067712784,
-0.0301585141569376,
0.030071381479501724,
-0.0009035326074808836,
-0.018365036696195602,
0.0751173347234726,
0.045992061495780945,
-0.01407466921955347,
0.010324028320610523,
0.03870400786399841,
-0.03453836217522621,
0.0063... | 0.795312 | 0.765634 | 0.029679 |
Can you provide an algorithm that counts the number of words in a given paragraph of text? | glaive | [
0.017885847017169,
0.011420093476772308,
-0.00860915519297123,
-0.01786734163761139,
0.02532043680548668,
-0.050720226019620895,
-0.036302413791418076,
0.04446698725223541,
0.02850469946861267,
-0.030767327174544334,
0.0074369413778185844,
0.02209988236427307,
-0.02326035313308239,
-0.0299... | 0.787429 | 0.772648 | 0.014781 |
I am trying to implement a parallel Breadth-First Search (BFS) algorithm using CUDA in C++. I have a graph with 5 nodes and the edges are represented using an adjacency list. The goal is to find the order of vertices in BFS and the cost of each vertex from the source node. The BFS frontier corresponds to all the nodes ... | glaive | [
-0.0015961057506501675,
0.05024024844169617,
-0.03340458497405052,
-0.025380386039614677,
0.020149169489741325,
0.00011632017412921414,
-0.025369727984070778,
0.1066204383969307,
0.05300123989582062,
-0.0023381870705634356,
0.02592507377266884,
0.045607853680849075,
-0.0016832208493724465,
... | 0.790552 | 0.775965 | 0.014587 |
You are tasked with implementing a CUDA kernel for parallel processing of DNA sequences. The kernel should process the sequences using local memory and perform a series of calculations on the input data. The input parameters include arrays of unsigned integers, double precision numbers, and other constants required for... | glaive | [
0.000938517099712044,
0.044012706726789474,
-0.019458221271634102,
-0.015353875234723091,
0.011743824928998947,
-0.0008413947653025389,
-0.028243202716112137,
0.0828743726015091,
0.03503269702196121,
-0.019194280728697777,
0.021400248631834984,
0.04370330646634102,
-0.0033072326332330704,
... | 0.786909 | 0.7689 | 0.018009 |
How can I write a C program that prints the Fibonacci series up to N terms? | glaive | [
0.0009357862873002887,
0.018689651042222977,
-0.02842995896935463,
-0.02373350039124489,
0.031311050057411194,
-0.03390126675367355,
-0.02183421514928341,
0.06589050590991974,
0.027955327183008194,
-0.029106656089425087,
0.019944854080677032,
0.057124167680740356,
-0.04972924664616585,
-0.... | 0.801577 | 0.786585 | 0.014992 |
You are tasked with creating a program that can efficiently merge two sorted arrays into a single sorted array. The program should take in two arrays as input and return a single merged and sorted array as output. It should be able to handle arrays of any size and should be implemented using C++. | glaive | [
0.021927526220679283,
0.034311022609472275,
-0.026637952774763107,
-0.030618663877248764,
0.019711095839738846,
0.0033952894154936075,
-0.028424566611647606,
0.07799161225557327,
0.04793564975261688,
-0.024257110431790352,
0.01179079432040453,
0.025496650487184525,
-0.02013297565281391,
-0... | 0.811 | 0.783756 | 0.027244 |
You are tasked with creating a program that computes the largest eigenvalue of a given sparse matrix using the LOBPCG algorithm. The sparse matrix is initialized using the 5-point Poisson matrix with dimensions 1024x1024. You need to allocate storage and initialize eigenpairs for the matrix, set stopping criteria for t... | glaive | [
0.023676972836256027,
0.03522271290421486,
-0.02481740713119507,
-0.041101157665252686,
0.028894487768411636,
-0.002533793216571212,
-0.017592551186680794,
0.051721587777137756,
0.0205675158649683,
-0.021948665380477905,
0.02367877960205078,
0.03301943838596344,
-0.029479943215847015,
0.00... | 0.815784 | 0.777041 | 0.038743 |
You are tasked with writing a program that can interpret a given string of characters to navigate a grid. The grid is represented as a 2D matrix, and the characters in the string represent movements in the grid. The movements are as follows:
- 'A': Move one step forward in the current direction
- 'W': Turn 90 degrees t... | glaive | [
0.017976608127355576,
0.01556717325001955,
-0.013691756874322891,
-0.051184967160224915,
0.03873273730278015,
-0.048041533678770065,
-0.022510061040520668,
0.051730625331401825,
0.037252653390169144,
-0.00703652948141098,
0.02615172415971756,
0.03391260281205177,
-0.026013365015387535,
-0.... | 0.814011 | 0.77827 | 0.035741 |
You are tasked with creating a program to calculate the probability distribution of a quantum state for a given set of parameters. The quantum state is described by a complex-valued function amplitude(x,y), and the probability distribution is given by the absolute square of the amplitude function, i.e., |amplitude(x, y... | glaive | [
0.008068853057920933,
0.024115726351737976,
-0.03729210048913956,
-0.02960074506700039,
0.046625636518001556,
-0.021849658340215683,
-0.019448844715952873,
0.07211427390575409,
0.04030131176114082,
0.001140654319897294,
0.031706370413303375,
0.04126245528459549,
-0.023929396644234657,
-0.0... | 0.794377 | 0.767313 | 0.027064 |
You are tasked with implementing a subroutine in Fortran that evaluates all of the unnormalized Legendre polynomials and their first derivatives up to a specified degree. The subroutine should take in the following parameters:
- An integer, lmax, representing the maximum degree to compute.
- Two real arrays, p and dp1,... | glaive | [
-0.0014069409808143973,
0.03589630872011185,
-0.004183790646493435,
-0.04908568784594536,
0.030626239255070686,
-0.02829739637672901,
-0.007422891911119223,
0.039603620767593384,
0.03182202950119972,
-0.00860945601016283,
0.031203441321849823,
0.04777080938220024,
-0.02112158015370369,
-0.... | 0.80463 | 0.774867 | 0.029763 |
You are tasked with creating a CUDA kernel that implements the softmax function for the GPT-2 model. The softmax function is used to normalize the input values into a probability distribution. The input to the kernel is a buffer containing the values to be normalized, along with padding indices for each batch. The norm... | glaive | [
0.01192955207079649,
0.03995408117771149,
-0.011029795743525028,
-0.02303253673017025,
0.02855542115867138,
-0.017199790105223656,
-0.03925230726599693,
0.08123048394918442,
0.042923979461193085,
-0.026531560346484184,
0.022675417363643646,
0.04111434519290924,
-0.00534413754940033,
0.0108... | 0.797098 | 0.781754 | 0.015343 |
You have been tasked with solving a linear system (A + \sigma_i * I) * x = b for each sigma_i using the Conjugate Gradient method. The matrix A is a 2D Poisson problem on a 10x10 mesh. You need to allocate storage for the solution (x) and the right-hand side (b) and set the sigma values. Additionally, you need to set t... | glaive | [
0.010107308626174927,
0.014875324442982674,
-0.02937960997223854,
-0.034072957932949066,
0.03421196714043617,
-0.04536387696862221,
-0.029933825135231018,
0.08240927010774612,
0.028935017064213753,
-0.010156067088246346,
0.012330393306910992,
0.03073064237833023,
-0.03733714297413826,
-0.0... | 0.809725 | 0.781217 | 0.028508 |
You are tasked with creating a high-quality programming problem that involves implementing a sequence of GPIO (General Purpose Input/Output) operations in a specific order. The problem involves combining multiple GPIO sequences into one sequence to run sequentially. The sequences are identified by their names and have ... | glaive | [
0.004298471380025148,
0.018310805782675743,
-0.031174305826425552,
-0.0408707894384861,
0.02016676962375641,
0.0004948806017637253,
-0.016628654673695564,
0.05933837220072746,
0.022313285619020462,
0.0017183040035888553,
0.012578405439853668,
0.024879394099116325,
-0.01412901934236288,
0.0... | 0.81224 | 0.793006 | 0.019234 |
You are tasked with implementing a Haskell class for semigroups, which are types with an associative binary operation. The class should include the following functions:
1. `(<>)`: an infix operation that takes two values of type `a` and returns a value of the same type.
2. `sconcat`: a function that takes a non-empty ... | glaive | [
0.013767856173217297,
0.023433271795511246,
-0.007300752680748701,
-0.006425727624446154,
0.03640678524971008,
-0.025392157956957817,
-0.012949613854289055,
0.06365880370140076,
0.04832176864147186,
-0.00790984183549881,
0.02038595639169216,
0.0332319550216198,
-0.005593306850641966,
-0.03... | 0.800045 | 0.784078 | 0.015967 |
You are tasked with implementing a CUDA kernel for matrix multiplication using half precision floating point numbers. The goal is to optimize the matrix multiplication operation for performance by leveraging the parallel processing capabilities of CUDA. The input matrices a and b are of size N x N, and the output matri... | glaive | [
0.012634146958589554,
0.04837538301944733,
-0.027097105979919434,
-0.021189818158745766,
0.03472443297505379,
-0.0005789181450381875,
-0.03557860851287842,
0.08951883018016815,
0.040250513702631,
-0.021873613819479942,
0.008688023313879967,
0.0339043028652668,
-0.009262566454708576,
-0.007... | 0.791646 | 0.770513 | 0.021133 |
You are tasked with implementing a CUDA kernel to perform a per block histogram computation of the occurrences of each digit in a given input vector of unsorted numbers. The goal is to use a 4-bit radix (i.e. 16 possible digits) for the histogram computation. The histogram computation should be performed in parallel us... | glaive | [
0.006374440621584654,
0.03962988778948784,
-0.027095232158899307,
-0.009421383030712605,
0.029912345111370087,
-0.0021214508451521397,
-0.037697069346904755,
0.09493095427751541,
0.04054590314626694,
-0.014932839199900627,
0.025103850290179253,
0.02652541920542717,
0.0031148626003414392,
0... | 0.821393 | 0.784395 | 0.036998 |
You are working on a machine learning project and need to implement a function to aggregate predictions from a model. Given a numpy array of predictions `preds` of shape (n_samples * reps), where n_samples is the number of samples and reps is the number of repetitions for each sample, you need to implement the `agg_pre... | glaive | [
0.0026358910836279392,
0.016215166077017784,
-0.0311292577534914,
-0.029011545702815056,
0.048862211406230927,
-0.023451287299394608,
-0.027009136974811554,
0.06720708310604095,
0.0188810583204031,
0.014593886211514473,
-0.002537798136472702,
0.021620139479637146,
-0.019872168079018593,
0.... | 0.800051 | 0.779918 | 0.020134 |
You are tasked with implementing a parallel matrix multiplication using CUDA in C++. You are required to write a CUDA kernel that takes in two matrices A and B, and computes their product C. Each thread in the kernel should be responsible for computing a single element of the resulting matrix C. The matrices A, B, and ... | glaive | [
0.017063364386558533,
0.04848867282271385,
-0.01671493612229824,
-0.01720152422785759,
0.034928079694509506,
0.0080265486612916,
-0.03993295505642891,
0.11723495274782181,
0.038465164601802826,
-0.02591206133365631,
0.010926060378551483,
0.040511175990104675,
-0.005256138741970062,
-0.0057... | 0.788637 | 0.763834 | 0.024804 |
How can I create a C++ program that calculates the sum of all the elements in an integer array? | glaive | [
0.008831094019114971,
0.027094529941678047,
-0.02974686585366726,
-0.03821554034948349,
0.05078766867518425,
-0.03437422215938568,
-0.015315954573452473,
0.0772414281964302,
0.04419388622045517,
-0.04155392944812775,
0.024157151579856873,
0.04474900662899017,
-0.03832196071743965,
-0.02156... | 0.786134 | 0.769944 | 0.016191 |
You are tasked with implementing a method to perform a zigzag level order traversal of a binary tree. In this traversal, you should visit all nodes of the tree level by level, alternating between left to right and right to left at each level. The traversal should return a list of lists, where each inner list contains t... | glaive | [
0.007106877863407135,
0.03344772383570671,
-0.01367278303951025,
-0.0406024344265461,
0.025491956621408463,
-0.03819978982210159,
0.0007443440263159573,
0.02575031854212284,
0.013815293088555336,
-0.008420482277870178,
0.04042303189635277,
0.02719530276954174,
-0.03431770205497742,
0.00899... | 0.811451 | 0.773954 | 0.037498 |
You are tasked with implementing a logistic loss function in C++ using CUDA. The logistic loss function is commonly used in machine learning for binary classification problems. It is defined as the negative log-likelihood of the logistic regression model. Your task is to create a `LogisticLoss` struct that inherits fro... | glaive | [
-0.019106879830360413,
0.034277357161045074,
-0.02389035001397133,
-0.029019834473729134,
0.019558390602469444,
-0.012606797739863396,
-0.04183809831738472,
0.10035184025764465,
0.04456229880452156,
-0.007704201620072126,
0.022096849977970123,
0.031298648566007614,
-0.008312691003084183,
0... | 0.797654 | 0.781078 | 0.016576 |
What is an algorithm to find the length of the longest increasing subsequence from an array of integers? | glaive | [
0.010103524662554264,
0.02238077111542225,
-0.035210102796554565,
-0.03691639378666878,
0.02245689183473587,
-0.013081460259854794,
-0.046399544924497604,
0.04656519368290901,
0.028389671817421913,
-0.042800966650247574,
0.02348422445356846,
0.018527956679463387,
-0.03893093392252922,
0.00... | 0.807888 | 0.771087 | 0.036801 |
You are tasked with writing a program in a specific assembly language that will perform a series of operations on data stored in memory. Your program should load specific values into registers, perform bitwise operations, and store the results back in memory. Additionally, your program should copy a specific set of dat... | glaive | [
0.03457709029316902,
0.01808842085301876,
-0.014036820270121098,
-0.028429532423615456,
0.02482091449201107,
-0.056865155696868896,
-0.007451712153851986,
0.07957719266414642,
0.03806065395474434,
-0.014748487621545792,
0.025390101596713066,
0.035107433795928955,
-0.03941352665424347,
-0.0... | 0.80394 | 0.776552 | 0.027388 |
You are tasked with creating a set of functions to implement a colormap for a visualization application. The colormap consists of three separate functions: `colormap_red`, `colormap_green`, and `colormap_blue`, each taking a single float parameter `x` and returning the corresponding color channel value in the range [0,... | glaive | [
0.021332889795303345,
0.04543702304363251,
-0.009199487045407295,
-0.046257998794317245,
0.04175061360001564,
-0.024258984252810478,
-0.033765602856874466,
0.0653047114610672,
0.03372443467378616,
0.00956755317747593,
0.04300178214907646,
0.02390763722360134,
0.015069281682372093,
-0.00632... | 0.780181 | 0.762468 | 0.017713 |
You are tasked with implementing a label reduction algorithm in CUDA for parallel processing. The goal is to find the root of a chain and perform label reduction on two given labels. The label reduction function should take in an array of labels and two labels to be reduced, and return the resulting label after reducti... | glaive | [
-0.0058194962330162525,
0.04550107195973396,
-0.02492104284465313,
-0.015267272479832172,
0.027940571308135986,
-0.021244380623102188,
-0.027550429105758667,
0.09716635197401047,
0.04139187932014465,
-0.0008490512263961136,
0.01521084550768137,
0.021976277232170105,
-0.0056335958652198315,
... | 0.809327 | 0.790361 | 0.018966 |
You are tasked with simulating a quantum system and visualizing the probability amplitudes using a given code snippet. The quantum system consists of 15 qubits with 4 possible states. The probability amplitudes are represented by the functions `amplitude[x_,y_]`, `amplitude2[x_,y_]`, and `probability[x, y]`. Your goal ... | glaive | [
-0.0021105629857629538,
0.02592419646680355,
-0.02350233495235443,
-0.03239387273788452,
0.03819867968559265,
-0.03567574918270111,
-0.017828471958637238,
0.06580287218093872,
0.030665872618556023,
0.002858108840882778,
0.023609116673469543,
0.0363997146487236,
-0.014220379292964935,
-0.01... | 0.796747 | 0.767396 | 0.029351 |
You are tasked with implementing a function `is_element/W1` in the programming language that checks whether a given input x is an element of a set A. The elements of the set A are represented as tables indexed by A, with values as real numbers. The function should return true if x is a valid element of A, and false oth... | glaive | [
0.036470696330070496,
0.012142883613705635,
-0.022819017991423607,
-0.03252319619059563,
0.055157095193862915,
-0.039850689470767975,
0.02189530059695244,
0.09076258540153503,
0.04097956418991089,
-0.020888933911919594,
0.02302331104874611,
0.025810183957219124,
-0.013975606299936771,
-0.0... | 0.821763 | 0.787045 | 0.034718 |
You are tasked with designing a cache structure for a 32-bit RISC-V processor with the following specifications:
- Cache size: 4KB
- Cache line size: 4 cache words
- Associativity: 1 way
Design and implement the necessary size, type, function, and address-decode declarations for the cache structures to meet the given ... | glaive | [
0.051073841750621796,
0.03149202838540077,
-0.030812282115221024,
-0.006647700443863869,
0.0339234359562397,
-0.028250213712453842,
-0.03882984444499016,
0.07928626984357834,
0.03172941133379936,
-0.01512018870562315,
0.025932971388101578,
0.01942867413163185,
-0.03240084648132324,
0.00161... | 0.793745 | 0.771444 | 0.022301 |
You are required to implement a function that calculates the sum of squares of a list of integers, a function that composes a series of functions, a function that concatenates a list of strings with a separator, a function that converts a list to a string, a function that clones a value n times into a list, a function ... | glaive | [
0.027321331202983856,
0.03871697187423706,
-0.02996927872300148,
-0.04698962718248367,
0.0529756024479866,
-0.02160337008535862,
-0.025608589872717857,
0.040772806853055954,
0.04231693595647812,
-0.014348495751619339,
0.021115927025675774,
0.04350679740309715,
-0.040091149508953094,
-0.032... | 0.833627 | 0.806168 | 0.027459 |
You are required to write a shader program using GLSL (OpenGL Shading Language) that takes in a uniform buffer object and a uniform variable, and outputs the color of a vertex based on its position and the tile it belongs to.
The uniform buffer object contains the following data structure:
```c
struct context_data
{
... | glaive | [
0.013113903813064098,
0.03210167959332466,
-0.02204846777021885,
-0.048503950238227844,
0.025604216381907463,
-0.045833081007003784,
-0.0467090979218483,
0.08420798182487488,
0.03865436092019081,
-0.021804040297865868,
0.04679466784000397,
0.038506556302309036,
-0.009515824727714062,
0.003... | 0.805795 | 0.78596 | 0.019836 |
You are tasked with creating a program to filter a list of DNA probe sequences based on the presence of a polyA sequence. A polyA sequence is defined as a sequence of consecutive 'A's in a DNA probe. Your program should take as input a list of DNA probe sequences and output a filtered list that contains only the probes... | glaive | [
0.027056435123085976,
0.0011825957335531712,
-0.023254580795764923,
-0.03910115733742714,
0.0075698839500546455,
-0.02926596999168396,
-0.024151556193828583,
0.06709939241409302,
0.024769239127635956,
-0.018894309177994728,
0.0019383374601602554,
0.04457949101924896,
-0.004192821681499481,
... | 0.805809 | 0.777979 | 0.027829 |
You are tasked with creating a program in which you need to define multiple structs with various data types and nested data structures. Each struct should contain a different combination of data types such as maps, lists, sets, strings, booleans, integers, floats, and binaries. Additionally, some structs should have fi... | glaive | [
0.000692651723511517,
0.008245525881648064,
-0.04338947683572769,
-0.017017658799886703,
0.046603117138147354,
-0.02997409738600254,
-0.016393382102251053,
0.05367765575647354,
0.04017695412039757,
-0.016053907573223114,
0.024550428614020348,
0.04759944602847099,
-0.02982284314930439,
-0.0... | 0.789824 | 0.773533 | 0.016292 |
Can you provide an implementation of a function that generates a list of integers from 1 to a given input number? | glaive | [
0.03199346363544464,
0.029113594442605972,
-0.021728895604610443,
-0.031037528067827225,
0.04078732058405876,
-0.045425910502672195,
-0.029034990817308426,
0.04352107271552086,
0.039642419666051865,
-0.036069806665182114,
0.032542042434215546,
0.04322455823421478,
-0.03565805405378342,
-0.... | 0.808963 | 0.793312 | 0.015651 |
You are tasked with implementing a CUDA kernel function that aggregates and bins RGBA values based on index counts. The function should take in the following parameters:
- An integer n representing the number of elements to process
- An array of integers ind_count representing the count of indices
- An array of floats ... | glaive | [
-0.003197377547621727,
0.04861946776509285,
-0.020796174183487892,
-0.01674029789865017,
0.028683913871645927,
-0.011550438590347767,
-0.03552447631955147,
0.0747697576880455,
0.043108705431222916,
0.01199623104184866,
0.029751533642411232,
0.02960815653204918,
-0.003582033794373274,
0.017... | 0.807936 | 0.781963 | 0.025973 |
You are tasked with implementing a CUDA kernel to perform an inclusive scan along the innermost dimension of a tensor. The input consists of a 2D tensor with dimensions num_rows x row_size, and the output should be the same size as the input tensor. The inclusive scan algorithm should be parallelized using CUDA, and th... | glaive | [
-0.0016874851426109672,
0.060948021709918976,
-0.015779605135321617,
-0.022251196205615997,
0.02495722286403179,
0.004611857235431671,
-0.016968363896012306,
0.07848592847585678,
0.032416313886642456,
-0.009441197849810123,
0.025616170838475227,
0.04202968627214432,
-0.001061402028426528,
... | 0.804064 | 0.783886 | 0.020178 |
You are tasked with creating a 3D animation of a rotating cube using LaTeX and Tikz. The animation should consist of two parts:
1. A cube made up of smaller cubes rotating around the x-axis
2. Another set of cubes rotating around the y-axis
Write the code to create the 3D animation as described above using the LaTeX... | glaive | [
0.012629278004169464,
0.05537687987089157,
-0.02340327762067318,
-0.017758606001734734,
0.03591303154826164,
0.0029861845541745424,
-0.020650090649724007,
0.06389428675174713,
0.024904638528823853,
0.0028907021041959524,
0.04289925843477249,
0.005081485956907272,
-0.022927043959498405,
0.0... | 0.766288 | 0.748461 | 0.017827 |
You are tasked with optimizing a complex mathematical function that takes two input variables, β and γ. The function is defined as a combination of exponential terms involving trigonometric functions, and it is used to calculate the maximum value under certain constraints. The goal is to find the maximum value of the r... | glaive | [
0.02387680858373642,
0.03917701169848442,
-0.05770857259631157,
-0.03472549840807915,
0.02747432515025139,
-0.014958532527089119,
-0.03209024295210838,
0.05852127447724342,
0.040350738912820816,
0.0024717566557228565,
0.0003700470260810107,
0.031303342431783676,
-0.027662863954901695,
0.01... | 0.797856 | 0.764926 | 0.03293 |
You are tasked with creating a VHDL program to implement a counter that counts up to a modulus of 71023. The program should include a clock input and output signals for the counter value and the carry out. The counter should be 30 bits wide and should count up in the 'UP' direction. The program should not use any unuse... | glaive | [
0.025264572352170944,
0.024093393236398697,
-0.038329511880874634,
-0.041858065873384476,
0.02411496266722679,
-0.024108123034238815,
-0.03826143220067024,
0.08431318402290344,
0.0260279830545187,
-0.043050892651081085,
0.025493057444691658,
0.06462596356868744,
-0.01351347379386425,
-0.01... | 0.801765 | 0.785681 | 0.016084 |
You are tasked with writing a program that calculates the value of the following mathematical expression:
&(nproduct (0..(7-1)) (\k. 2 EXP (2 EXP k) + 3 EXP (2 EXP k))) = int_of_num (3 EXP 128) - &(2 EXP 128) | glaive | [
0.03391353785991669,
0.01755521446466446,
-0.027698785066604614,
-0.04955437034368515,
0.05243735760450363,
-0.023370644077658653,
-0.039558231830596924,
0.07755287736654282,
0.04866636544466019,
-0.010253402404487133,
0.02745088003575802,
0.05951216071844101,
-0.05268527939915657,
-0.0272... | 0.827419 | 0.784905 | 0.042514 |
You are given a dataset that represents the positions, speeds, and accelerations of a set of objects. The dataset is read from the standard input and needs to be processed to remove any non-numeric characters and leading/trailing spaces. Then, the program needs to calculate the number of unique positions after updating... | glaive | [
0.011659066192805767,
0.008501912467181683,
-0.025266574695706367,
-0.022930974140763283,
0.02733592689037323,
-0.025813907384872437,
-0.02688610553741455,
0.06079652160406113,
0.0641559287905693,
-0.02730514667928219,
0.019428720697760582,
0.012173243798315525,
-0.014105873182415962,
-0.0... | 0.833328 | 0.807953 | 0.025375 |
You are tasked with implementing a CUDA operator for calculating the sigmoid accuracy of a given input. The sigmoid accuracy is defined as the ratio of the number of correct predictions to the total number of predictions. The input consists of two tensors: X and T. X contains the logits and T contains the target labels... | glaive | [
-0.009243213571608067,
0.026513874530792236,
-0.03640185669064522,
-0.020245952531695366,
0.019667217507958412,
-0.020925914868712425,
-0.03782932460308075,
0.09898337721824646,
0.03150247782468796,
-0.019584234803915024,
0.029648037627339363,
0.032338887453079224,
0.0014281660551205277,
-... | 0.7952 | 0.777862 | 0.017338 |
You are tasked with creating a program to calculate the probability distribution for a quantum system. The system is described by a function `probability(x, y)` that takes in two parameters `x` and `y`, and returns the absolute value squared of a complex-valued function `amplitude(x, y)`. The quantum system is specifie... | glaive | [
-0.006150226108729839,
0.023557398468255997,
-0.03301478549838066,
-0.013325130566954613,
0.04486272111535072,
-0.020694205537438393,
-0.02582561783492565,
0.06093732267618179,
0.0359157957136631,
0.0013351375237107277,
0.020902222022414207,
0.038265954703092575,
-0.006639933679252863,
-0.... | 0.798816 | 0.761225 | 0.037592 |
You are tasked with creating a program that calculates the linear regression equation for a given set of data points. The linear regression equation is represented as y = mx + c, where y is the dependent variable, x is the independent variable, m is the slope of the line, and c is the y-intercept. Your program should t... | glaive | [
-0.012847142294049263,
0.022955628111958504,
-0.06374049931764603,
-0.06256671249866486,
0.06620695441961288,
-0.02293202094733715,
-0.01417597196996212,
0.07895860821008682,
0.062407486140728,
-0.01922462321817875,
0.012328637763857841,
0.04261351749300957,
-0.03438296914100647,
-0.001497... | 0.789009 | 0.768904 | 0.020105 |
You are working with a group theory library in a programming language that supports formal verification. You need to create a function that establishes a bijection between the preimage of a subset `t` in `α/s` and the product `s × t`. The group `α` has a subgroup `s`, and `t` is a set of elements in the quotient group ... | glaive | [
0.02778046764433384,
0.0198171716183424,
-0.03229203447699547,
-0.03142508864402771,
0.049644749611616135,
-0.042872603982686996,
-0.022204816341400146,
0.0713072419166565,
0.05087457224726677,
-0.013428328558802605,
0.01330016553401947,
0.019760584458708763,
-0.016030145809054375,
-0.0157... | 0.825693 | 0.809108 | 0.016585 |
You are tasked with implementing a program that performs a specific sequence of operations on a set of numbers. The program should start by adding 1 to the first number in the set, and then move the result to another variable. It should then subtract 1 from the first number, and enter a loop that performs a series of c... | glaive | [
0.03767785429954529,
0.03840424120426178,
-0.03670590743422508,
-0.015530191361904144,
0.05068172886967659,
-0.0020986737217754126,
-0.03556468337774277,
0.0841793566942215,
0.06398925185203552,
-0.017255248501896858,
0.015442159958183765,
0.03600718080997467,
-0.04081694036722183,
-0.0040... | 0.822873 | 0.778938 | 0.043935 |
You are asked to create a module in Erlang that provides a set of functions for list manipulation. The module should include the following functions:
- `sum`: returns the sum of all the elements of a list.
- `mult`: returns the multiplication of all the elements of a list.
- `mean`: returns the mean of a list.
- `drop`... | glaive | [
0.025130392983555794,
0.033148761838674545,
-0.007695816922932863,
-0.06307058781385422,
0.03717371076345444,
-0.049533870071172714,
-0.017353517934679985,
0.02716679498553276,
0.04503939673304558,
-0.01562606543302536,
0.023002389818429947,
0.05569547414779663,
-0.02245178632438183,
0.001... | 0.79578 | 0.781308 | 0.014472 |
You are tasked with defining a Huber pair, which consists of a Huber ring and a ring of integral elements. A Huber pair is defined as an integrally closed, power bounded, open subring. Your goal is to create a structure for a Huber pair, including the definition of the ring of integral elements and its properties. Addi... | glaive | [
0.03733992949128151,
0.02600334957242012,
-0.03658657893538475,
-0.017187071964144707,
0.032683368772268295,
-0.022660061717033386,
0.004959332291036844,
0.05259796977043152,
0.0432734452188015,
-0.008470743894577026,
0.010022283531725407,
0.02868681587278843,
-0.017187369987368584,
-0.007... | 0.773481 | 0.743173 | 0.030308 |
You are tasked with maximizing a complex mathematical function that depends on two variables, x and y. The function is defined as follows:
function[x_, y_] := $Conjugate[Exp[11 I y/2] (1 (-I Sin[x])^4 Cos[x]^8 + 1 (-I Sin[x])^8 Cos[x]^4) + Exp[9 I y/2] (6 (-I Sin[x])^5 Cos[x]^7 + 6 (-I Sin[x])^7 Cos[x]^5 + 2 (-I Sin[x... | glaive | [
0.02813759632408619,
0.03175666183233261,
-0.044036660343408585,
-0.039625134319067,
0.025840653106570244,
-0.006061910651624203,
-0.024386418983340263,
0.06767205148935318,
0.03926652669906616,
0.0015715790214017034,
0.020230064168572426,
0.04421628266572952,
-0.026172082871198654,
-0.003... | 0.812587 | 0.776434 | 0.036153 |
You are tasked with implementing a function to calculate the square root of a given number, with support for both 32-bit and 64-bit floating-point numbers. The function should handle special cases such as zero, negative numbers, and edge cases for subnormal numbers. The solution should be efficient and accurate, provid... | glaive | [
0.017437145113945007,
0.051876381039619446,
-0.03182859718799591,
-0.0390259325504303,
0.03834044560790062,
-0.014226765371859074,
-0.018551040440797806,
0.061871130019426346,
0.047954775393009186,
-0.023212717846035957,
0.04121893271803856,
0.029873788356781006,
-0.03614552319049835,
-0.0... | 0.802508 | 0.777361 | 0.025148 |
You are tasked with creating a program to calculate the probability distribution of a quantum system. The system is described by a wavefunction amplitude defined as a function of two variables x and y. The probability distribution is given by the absolute value squared of the amplitude. Your task is to find the maximum... | glaive | [
0.003483555279672146,
0.015435785986483097,
-0.045504361391067505,
-0.028509600088000298,
0.04962703213095665,
-0.03257502242922783,
-0.022303711622953415,
0.07169795781373978,
0.04543114826083183,
-0.0033865883015096188,
0.022448845207691193,
0.02809266373515129,
-0.020770743489265442,
-0... | 0.798421 | 0.771108 | 0.027314 |
You are tasked with implementing a program to calculate the maximum probability of a quantum state for a given set of qubits. The quantum state is described by the amplitude function, which takes in two variables (x and y) and returns a complex number. The probability of the quantum state is calculated using the absolu... | glaive | [
0.003270119195804,
0.037032000720500946,
-0.028314577415585518,
-0.015850581228733063,
0.039666321128606796,
-0.012997505255043507,
-0.01973162218928337,
0.0707140639424324,
0.032097816467285156,
-0.0035251593217253685,
0.024227524176239967,
0.028159406036138535,
-0.009852511808276176,
-0.... | 0.800053 | 0.765915 | 0.034138 |
You are required to implement a Prolog predicate to create a backtrackable hash table and perform various operations on it. The hash table should be able to associate keys with values and support operations like creating a new hash table, looking up a key to retrieve its associated value, updating the value associated ... | glaive | [
0.046759605407714844,
0.031436119228601456,
-0.01412644237279892,
-0.01760859414935112,
0.0429624505341053,
-0.03593356907367706,
-0.003539489349350333,
0.05451101437211037,
0.030932694673538208,
-0.014619509689509869,
0.010621617548167706,
0.04023391753435135,
-0.01664193533360958,
0.0078... | 0.804463 | 0.788165 | 0.016298 |
You are tasked with creating a program that will expand the given polynomial expression (1-x-2x^2)/(1-x) and generate the first 75 terms of the expansion. The expansion should be in the form of a sequence of integers separated by commas.
Create a function or program that takes no input and returns the first 75 terms o... | glaive | [
0.05448473244905472,
0.033489663153886795,
-0.030752163380384445,
-0.04913735389709473,
0.021480893716216087,
-0.03892846778035164,
-0.005650708451867104,
0.08867128938436508,
0.025477463379502296,
-0.027231963351368904,
0.01146145723760128,
0.02159085124731064,
-0.05077073723077774,
-0.01... | 0.811687 | 0.780046 | 0.031642 |
You are tasked with creating a program to generate a sequence of prime numbers based on the expansion of the function (1+x^2)/(1-2*x+x^3). The sequence should start from 0 and end at 40. The program should output the sequence of prime numbers within this range. | glaive | [
0.025849703699350357,
0.03028830699622631,
-0.021185414865612984,
-0.03911169618368149,
0.018986167386174202,
-0.031052762642502785,
-0.015145865269005299,
0.08627863228321075,
0.024075914174318314,
-0.027275918051600456,
0.02234129048883915,
0.022095948457717896,
-0.05398200824856758,
-0.... | 0.819162 | 0.776056 | 0.043106 |
You are tasked with creating a program that generates random data in two-dimensional space and then interpolates this data onto a grid. The program should also plot a surface based on the interpolated data. The code should be written in Fortran and should include the necessary parameters, arrays, and functions to achie... | glaive | [
-0.0029202252626419067,
0.03748898208141327,
-0.015984375029802322,
-0.05077764764428139,
0.02929912880063057,
-0.02720908634364605,
-0.022771356627345085,
0.061803970485925674,
0.028411149978637695,
-0.016949670389294624,
0.021569207310676575,
0.056122735142707825,
-0.027060622349381447,
... | 0.788122 | 0.770123 | 0.017998 |
You are required to write a CUDA program that performs a 2D periodic computation using a user-defined function. The program involves applying a user-defined stencil to a 2D array of data and computing the result. The stencil is provided by the user and is used to perform a central difference calculation in both the x a... | glaive | [
0.010240698233246803,
0.05875644087791443,
-0.02674681507050991,
-0.019916942343115807,
0.03082960844039917,
-0.033181652426719666,
-0.0365142859518528,
0.09664327651262283,
0.04496840760111809,
-0.018718309700489044,
0.03172975778579712,
0.042473290115594864,
0.0011070152977481484,
0.0015... | 0.801363 | 0.776914 | 0.024449 |
What is the algorithm in Python for generating the nth Fibonacci number? | glaive | [
0.007024161983281374,
0.01184904295951128,
-0.03290463984012604,
-0.0402919240295887,
0.030297070741653442,
-0.02891211025416851,
-0.026509305462241173,
0.04763002693653107,
0.01697452738881111,
-0.03416376933455467,
0.025820182636380196,
0.03460735082626343,
-0.04123343154788017,
-0.00720... | 0.795247 | 0.77839 | 0.016858 |
You are required to implement a W type in a programming language, given `α : Type` and `β : α → Type`. The W type is an inductively defined type of trees where the nodes are labeled by elements of `α` and the children of a node labeled `a` are indexed by elements of `β a`. Your task is to define the W type and the dept... | glaive | [
0.019637349992990494,
0.02531842328608036,
-0.017226602882146835,
-0.03679569065570831,
0.031199287623167038,
-0.03412304446101189,
0.0176110677421093,
0.08617781847715378,
0.013508379459381104,
-0.024189826101064682,
0.04189714789390564,
0.04442351683974266,
-0.0171979833394289,
0.0079671... | 0.821735 | 0.795832 | 0.025903 |
You are tasked with implementing a hierarchical Bayesian model in Stan for a dataset with multiple levels of grouping. The dataset contains the following variables:
- N: Number of observations
- J: Number of groups
- y: Vector of length N, representing the response variable
- u: Vector of length J, representing the gro... | glaive | [
0.020156538113951683,
0.0049378168769180775,
-0.0407312847673893,
-0.051345113664865494,
0.030147695913910866,
-0.02614569664001465,
-0.012423691339790821,
0.06610629707574844,
0.04835723340511322,
-0.008110122755169868,
0.00042891307384707034,
0.039183348417282104,
-0.021519718691706657,
... | 0.786384 | 0.767726 | 0.018658 |
You are tasked with creating a program in the Pascal programming language that calculates the sum of all numbers from 1 to a given input n. Your program should take an integer input n from the user and then use a while loop to calculate the sum of all numbers from 1 to n. The program should then output the sum of the n... | glaive | [
0.01398650836199522,
0.027373747900128365,
-0.028165895491838455,
-0.032614726573228836,
0.0453421026468277,
-0.028584513813257217,
0.0031064560171216726,
0.03438704460859299,
0.037130288779735565,
-0.003792895469814539,
0.02315971441566944,
0.055080268532037735,
-0.03464916720986366,
-0.0... | 0.81467 | 0.779433 | 0.035237 |
You are tasked with implementing a program that solves implicit equations in a neuroscience simulation. The program must be able to solve equations for different types of neurons and synapses. The program should be able to handle the solve functions for neurons such as go, gr, pkj, and io, as well as synapses such as g... | glaive | [
0.010635053738951683,
0.0069276574067771435,
-0.02741204760968685,
-0.038045484572649,
0.03790290653705597,
-0.032897915691137314,
0.0012396358652040362,
0.05348384007811546,
0.03397707641124725,
-0.020053425803780556,
0.034321535378694534,
0.05132116749882698,
-0.01091634389013052,
-0.000... | 0.802896 | 0.783386 | 0.01951 |
You are tasked with creating a function in a programming language that constructs a sorted list from an unordered set. The function should use the merge sort algorithm to sort the elements in the set and return a list of the sorted elements.
You should also provide functions to check if the sorted list is indeed sorte... | glaive | [
0.02669587731361389,
0.022127855569124222,
-0.01171441562473774,
-0.03253054618835449,
0.042121052742004395,
-0.018083414062857628,
-0.024923959746956825,
0.045712560415267944,
0.04330464452505112,
-0.007461427245289087,
0.026987755671143532,
0.033324990421533585,
-0.02417580410838127,
-0.... | 0.814055 | 0.783589 | 0.030465 |
You are tasked with writing a program that calculates the probability distribution of a quantum state given by the `amplitude` function. The program should then find the maximum probability and plot the probability distribution in 3D and 2D. | glaive | [
-0.0020909286104142666,
0.02887297235429287,
-0.031011315062642097,
-0.03275918588042259,
0.03589598834514618,
-0.022732704877853394,
-0.031356025487184525,
0.07027877122163773,
0.03340720385313034,
-0.00499592162668705,
0.029789689928293228,
0.037619102746248245,
-0.016229212284088135,
-0... | 0.810631 | 0.785697 | 0.024934 |
You are tasked with implementing CUDA kernels for constructing a Gaussian affinity matrix and a correspondence probability matrix, as well as utility functions for a given set of input data. The kernels should be implemented in both single and double precision, and the utility functions should be able to handle the spe... | glaive | [
0.002676563337445259,
0.029797779396176338,
-0.0219829473644495,
-0.023722734302282333,
0.03247947245836258,
-0.0033675353042781353,
-0.027178797870874405,
0.07645033299922943,
0.041977789252996445,
-0.016437849029898643,
0.024444008246064186,
0.026936965063214302,
0.008575007319450378,
0.... | 0.806066 | 0.788526 | 0.017539 |
You are tasked with implementing an odd/even sort algorithm using CUDA for parallel processing. The goal is to sort an array of float values and update the corresponding array of float3 colors based on the sorting order. Additionally, you need to update the xrefs array to reflect the new sorting order. The odd/even sor... | glaive | [
0.005811807233840227,
0.037970371544361115,
-0.023254483938217163,
-0.023092621937394142,
0.005772382020950317,
-0.0017070373287424445,
-0.045324113219976425,
0.09118666499853134,
0.04137850180268288,
-0.020016072317957878,
0.016664372757077217,
0.03026956506073475,
-0.010038654319941998,
... | 0.806255 | 0.782381 | 0.023874 |
You are tasked with implementing a set of utility functions for working with multisets in a programming language. The utility functions you need to implement are as follows:
1. `multisetComplement`: This function takes two multisets as input and returns the multiset complement of the second set in the first set.
2. `m... | glaive | [
0.027464376762509346,
0.01611732691526413,
-0.020820189267396927,
-0.025001488626003265,
0.04026595130562782,
-0.01763349026441574,
-0.02683420665562153,
0.04916170984506607,
0.04485683515667915,
-0.019010793417692184,
0.03695433959364891,
0.041302960366010666,
-0.0002553864906076342,
-0.0... | 0.807291 | 0.790957 | 0.016334 |
You are tasked with creating a program that calculates the probability of a quantum state using a given code snippet. The code snippet provides functions to calculate the amplitude and probability of a quantum state, and then uses NMaximize to find the maximum probability. Your task is to create a program that takes in... | glaive | [
-0.0017426921986043453,
0.03698944300413132,
-0.022854330018162727,
-0.019069738686084747,
0.049567025154829025,
-0.018788756802678108,
-0.01794370263814926,
0.0793028399348259,
0.025240113958716393,
-0.001646819175221026,
0.028770780190825462,
0.03748272731900215,
-0.01954379864037037,
-0... | 0.80471 | 0.782043 | 0.022667 |
You are tasked with creating a program that sorts a list of numbers in ascending order using the bubble sort algorithm. The program should prompt the user to enter a series of numbers separated by spaces, and then output the sorted list. The program should be implemented in Python. | glaive | [
0.0212063230574131,
0.012778800912201405,
-0.02821355313062668,
-0.03366590291261673,
0.03133633732795715,
-0.025036634877324104,
-0.023150717839598656,
0.04632103443145752,
0.022536881268024445,
-0.022337673231959343,
0.01720053143799305,
0.03793640062212944,
-0.046326860785484314,
-0.001... | 0.813523 | 0.781856 | 0.031668 |
You are tasked with creating a function that calculates the powers of two for a given input. The function should take a single parameter and return the result as an unsigned 32-bit integer. You will need to figure out the parameter name and type that is expected for the function. The output type has already been specif... | glaive | [
0.03872978314757347,
0.04990622028708458,
-0.03221810981631279,
-0.029564887285232544,
0.04116533324122429,
-0.014770438894629478,
-0.00860213115811348,
0.08678249269723892,
0.05574067682027817,
-0.012335309758782387,
0.03717826306819916,
0.05062631517648697,
-0.012842768803238869,
-0.0274... | 0.804539 | 0.785576 | 0.018963 |
You are tasked with creating a CUDA kernel to perform element-wise multiplication of two arrays, where the result is stored in a third array. The arrays are of type T, and the number of elements in each array is given by the variable n.
Create a CUDA kernel named k_cwprod that takes three parameters:
- const T* a: Poi... | glaive | [
0.01949325203895569,
0.06330075860023499,
-0.02587052807211876,
-0.018795186653733253,
0.03125535696744919,
-0.006425146479159594,
-0.023265276104211807,
0.10756310075521469,
0.031803444027900696,
-0.01964765414595604,
0.019973231479525566,
0.04159596189856529,
-0.018021786585450172,
-0.01... | 0.792734 | 0.762707 | 0.030028 |
You are required to implement a CUDA kernel to find the eigenvalues of a small, symmetric, and tridiagonal matrix. The kernel should utilize a bisection algorithm to determine the eigenvalues with a desired accuracy level, and should be able to handle the intervals and number of eigenvalues that are smaller than a give... | glaive | [
0.005604216828942299,
0.036605969071388245,
-0.029633883386850357,
-0.03182306885719299,
0.031750813126564026,
-0.01433595921844244,
-0.01723671890795231,
0.0826369971036911,
0.0411684550344944,
-0.022945642471313477,
0.022989289835095406,
0.035456158220767975,
-0.015566186979413033,
-0.00... | 0.804605 | 0.778628 | 0.025977 |
You are tasked with creating a function that takes in an array of strings and returns a new array that contains only the strings that start with the letter "A". If no strings start with "A", the function should return an empty array. | glaive | [
0.039943285286426544,
0.03565153107047081,
-0.002854864113032818,
-0.03397500887513161,
0.0416693314909935,
-0.03768989071249962,
-0.0036750256549566984,
0.06392630934715271,
0.02949249930679798,
-0.022557755932211876,
0.008496137335896492,
0.0017555408412590623,
-0.019875038415193558,
-0.... | 0.789215 | 0.763854 | 0.02536 |
You are tasked with creating a series of functions in Haskell to manipulate lists. Each function has a specific requirement and hint to guide your implementation. Your task is to write the code for each function based on the given requirements.
1. Write a function called `maxDiff` that returns the greatest difference ... | glaive | [
0.03912629559636116,
0.02133343741297722,
0.0023280580062419176,
-0.05255407467484474,
0.05088060349225998,
-0.022998521104454994,
-0.016642186790704727,
0.031206553801894188,
0.044484980404376984,
-0.015040147118270397,
0.021610550582408905,
0.05034758895635605,
-0.0214280616492033,
-0.01... | 0.805041 | 0.783075 | 0.021965 |
You are tasked with implementing a function to find the maximum depth of a binary tree. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. If the tree is empty, the maximum depth is 0.
Implement a function `maxDepth` that takes a binary tree as input and... | glaive | [
0.02527867630124092,
0.012265189550817013,
-0.03380493074655533,
-0.018114641308784485,
0.04244372993707657,
-0.03826730325818062,
-0.0014888579025864601,
0.04792693257331848,
0.02271738089621067,
-0.002726438222452998,
0.03856586292386055,
0.023810265585780144,
-0.03559305891394615,
0.010... | 0.808153 | 0.775122 | 0.033031 |
You are tasked with simulating and visualizing the probability distribution of a quantum system with 16 qubits. The system is described by a complex amplitude function and you need to find the maximum probability of a specific state. Additionally, you are required to visualize the probability distribution in 3D and 2D.... | glaive | [
0.004465896636247635,
0.02671848051249981,
-0.02789289318025112,
-0.0327763706445694,
0.04234857112169266,
-0.026961466297507286,
-0.021896814927458763,
0.07024727016687393,
0.03980662301182747,
-0.002728744177147746,
0.033283546566963196,
0.03458988294005394,
-0.003882420714944601,
-0.010... | 0.802124 | 0.772869 | 0.029255 |
You are tasked with implementing a subroutine in Fortran that manipulates an array of real numbers. The subroutine should take an array 'a' as input and perform the following operations:
- If the value at index 'i' in the array is less than 0.0, it should be negated and the loop should skip to label 30.
- If the value ... | glaive | [
-0.00117657077498734,
0.0317758247256279,
-0.013712090440094471,
-0.0291611161082983,
0.03568142279982567,
-0.04272916540503502,
-0.0032926220446825027,
0.07477469742298126,
0.03964956849813461,
-0.01118478924036026,
0.01687675528228283,
0.03801419213414192,
-0.028529727831482887,
-0.01361... | 0.810764 | 0.784674 | 0.02609 |
You are tasked with creating a Haskell function to count the number of vowels in a given string. The function should take a string as input and return the count of vowels within that string. You must implement the countVowels function without using the given code snippet. The function should only count the lowercase vo... | glaive | [
0.01618240214884281,
0.02614312246441841,
-0.0035392974968999624,
-0.03423469141125679,
0.04950889199972153,
-0.017070133239030838,
-0.00853728223592043,
0.04128527641296387,
0.02955845184624195,
-0.0028937789611518383,
0.005242381244897842,
0.02498318813741207,
-0.0038534279447048903,
-0.... | 0.791253 | 0.77 | 0.021253 |
You are tasked with creating a function that takes a string as input and returns the same string with all letters converted to uppercase. The function should handle special characters and numbers without altering them. For example, if the input is "wow", the function should return "WOW". If the input is "Hello", the fu... | glaive | [
0.027041645720601082,
0.03913581743836403,
0.004415801726281643,
-0.03733620420098305,
0.02567920833826065,
-0.03191208466887474,
0.010595764964818954,
0.05372508242726326,
0.019087297841906548,
-0.023057270795106888,
0.034860678017139435,
0.034021276980638504,
-0.024469221010804176,
-0.02... | 0.78088 | 0.762803 | 0.018077 |
You are tasked with implementing a function in Small-C/Plus z88dk to calculate the logarithm base 2 of a 16-bit floating point number. The function should take a single parameter, a 16-bit floating point number, and return its logarithm base 2. You need to implement the entire function from scratch, including any neces... | glaive | [
0.019618652760982513,
0.04045576974749565,
-0.035210803151130676,
-0.039016153663396835,
0.056284647434949875,
-0.027224887162446976,
-0.016484474763274193,
0.06399138271808624,
0.037544164806604385,
-0.027171220630407333,
0.03292100876569748,
0.038627516478300095,
-0.016113359481096268,
-... | 0.808582 | 0.792912 | 0.015671 |
I need to calculate the number of divisors that a given number has, based on its prime factorization. Each divisor must have the same primes as the number itself but at the same or lower counts. For instance, for the number 28 = 2 x 2 x 7 = 2^2 x 7^1, this has (2+1)x(1+1) = 6 divisors corresponding to those with 0,1,2 ... | glaive | [
0.013599120080471039,
0.03204067796468735,
-0.037386417388916016,
-0.03041936829686165,
0.04034627601504326,
-0.018305614590644836,
-0.02092672511935234,
0.053704410791397095,
0.024494759738445282,
-0.000006355222012643935,
0.007998844608664513,
0.03325397148728371,
-0.038638193160295486,
... | 0.819388 | 0.778091 | 0.041297 |
You are tasked with creating a program to calculate the probability of a quantum state for a given set of parameters. The program should include a function to calculate the amplitude of the quantum state, a function to calculate the probability based on the amplitude, and a function to find the maximum probability with... | glaive | [
0.0019720487762242556,
0.037112053483724594,
-0.028590891510248184,
-0.017240313813090324,
0.040585022419691086,
-0.0221280287951231,
-0.022178299725055695,
0.07257715612649918,
0.026371296495199203,
-0.0004106769629288465,
0.02200263924896717,
0.03692759945988655,
-0.017045168206095695,
-... | 0.799265 | 0.768131 | 0.031135 |
You are tasked with creating a score display board for a rhythm game. The board should display the top scores achieved by the player, along with relevant information such as grade, percentage score, max combo, judgment breakdown, and date of the score. The display should also allow for mouse rollover functionality to h... | glaive | [
0.025764044374227524,
0.011078337207436562,
-0.0593714565038681,
-0.034038692712783813,
0.018069708719849586,
-0.03225860372185707,
-0.03975514695048332,
0.046270497143268585,
0.03231755271553993,
-0.010153803043067455,
0.037856969982385635,
0.0480564683675766,
-0.026214394718408585,
0.016... | 0.770642 | 0.748914 | 0.021728 |
You are required to write a Fortran program to implement a set of subroutines for particle-in-cell (PIC) simulations. The subroutines are used for electromagnetic field particle push, field interpolation, current deposition, and particle sorting. The subroutines are to be used in a 2D Cartesian geometry.
You need to i... | glaive | [
0.009550534188747406,
0.03455721214413643,
-0.01994132623076439,
-0.039664484560489655,
0.02763332985341549,
-0.03608423471450806,
-0.01916390098631382,
0.051243703812360764,
0.035452160984277725,
0.0010123268002644181,
0.022036578506231308,
0.04193972796201706,
-0.01173985656350851,
-0.00... | 0.801414 | 0.785271 | 0.016143 |
You are tasked with creating a program to calculate the probability distribution and plot the results for a quantum system. The system is defined by a number of qubits (nqubits), a state name (name), and the number of states (nstates). The probability distribution is determined by the amplitude and amplitude2 functions... | glaive | [
0.003559436183422804,
0.023695241659879684,
-0.04381893202662468,
-0.023641707375645638,
0.038635291159152985,
-0.04354381188750267,
-0.02841203287243843,
0.06863448023796082,
0.036424942314624786,
-0.0010951799340546131,
0.016750583425164223,
0.042492855340242386,
-0.02357177436351776,
-0... | 0.791175 | 0.764063 | 0.027112 |
I need to implement a CUDA kernel function that calculates the squared difference between two input arrays and stores the result in a third array. The kernel function should take the size of the arrays, the arrays themselves, and the output array as inputs. The formula for calculating the squared difference is `(a_ptr[... | glaive | [
0.0013954414753243327,
0.05278432369232178,
-0.036655839532613754,
-0.029049629345536232,
0.04098988324403763,
-0.00762175302952528,
-0.043997589498758316,
0.09112732857465744,
0.04697040095925331,
-0.02319294959306717,
0.03499949723482132,
0.025626396760344505,
-0.03607996180653572,
-0.01... | 0.803094 | 0.788113 | 0.014981 |
You are tasked with implementing a set of functions to compute matrices for Gegenbauer polynomials. Gegenbauer polynomials are a family of orthogonal polynomials that arise in the study of special functions and mathematical physics. Your task is to implement the following functions:
1. `compute_S(n::myI, lam::myI)`: C... | glaive | [
0.010700599290430546,
0.03755255416035652,
-0.012780160643160343,
-0.024158764630556107,
0.05363558232784271,
-0.01833178848028183,
-0.022055765613913536,
0.06631255894899368,
0.061194416135549545,
-0.005840518977493048,
0.008888239040970802,
0.033765263855457306,
-0.030416812747716904,
-0... | 0.795994 | 0.772255 | 0.023738 |
You are tasked with implementing a CUDA kernel that performs a diagonal operation on a given input tensor. The diagonal operation is defined as follows:
Given an input tensor `in` with shape `[N, D1, D2, ..., Dk]` and an offset value `offset`, the diagonal operation should return a new tensor `out` with shape `[N, siz... | glaive | [
0.007233227603137493,
0.03225591406226158,
-0.02719002589583397,
-0.026104586198925972,
0.0017835414037108421,
0.006523264572024345,
-0.018115073442459106,
0.09333797544240952,
0.034985803067684174,
-0.012549190782010555,
0.04042809084057808,
0.026401905342936516,
-0.007632196415215731,
-0... | 0.8121 | 0.78743 | 0.02467 |
You are tasked with implementing a program that demonstrates type inference in a specific programming language. The program should include a module called "ExampleAntipattern" and import the "int" module. Inside the module, define an abstract syntax for type "B" using the "conc" function with the ability to concatenate... | glaive | [
0.02259181998670101,
0.029326535761356354,
-0.019328778609633446,
-0.023299382999539375,
0.03762100264430046,
-0.017328763380646706,
0.00908374972641468,
0.0634574443101883,
0.04674956575036049,
-0.032533444464206696,
0.02455652318894863,
0.06129977107048035,
-0.008823936805129051,
-0.0026... | 0.812381 | 0.796312 | 0.016069 |
You are tasked with creating a function in C that converts a long long (64 bit) value from network byte order to host byte order. The function should take a long long (64 bit) value in network byte order as its argument and return that value in host byte order. The function should adhere to the calling convention provi... | glaive | [
0.02063882164657116,
0.03598279505968094,
-0.016153058037161827,
-0.023101042956113815,
0.008589604869484901,
-0.028433948755264282,
-0.04849185422062874,
0.04852589964866638,
0.044602204114198685,
-0.02257413975894451,
0.020159099251031876,
0.042811233550310135,
-0.045269038528203964,
-0.... | 0.796537 | 0.781924 | 0.014613 |
You are tasked with implementing a subroutine in Fortran called DLSQP2, which takes in the following parameters:
- N: an integer representing the number of data points
- X: an array of double precision numbers representing the independent variable
- Y: an array of double precision numbers representing the dependent var... | glaive | [
-0.010741797275841236,
0.028020426630973816,
-0.03095853701233864,
-0.0627267137169838,
0.024924859404563904,
0.0015373879577964544,
-0.008648054674267769,
0.05621790513396263,
0.035254620015621185,
0.012125321663916111,
0.02706756256520748,
0.04555238410830498,
-0.014443955384194851,
0.01... | 0.796921 | 0.777876 | 0.019045 |
How can I create a program that finds pairs of elements in a given list whose sum equals a given number? | glaive | [
0.01406798791140318,
0.014088180847465992,
-0.04314000532031059,
-0.040228843688964844,
0.049720752984285355,
-0.02446342445909977,
-0.006177282426506281,
0.04261162504553795,
0.03516949713230133,
-0.03269454836845398,
0.01682671159505844,
0.047958679497241974,
-0.03647269308567047,
-0.015... | 0.80427 | 0.783444 | 0.020827 |
You are tasked with implementing a subroutine in Fortran called ZGETSLS which solves overdetermined or underdetermined complex linear systems. The subroutine involves an M-by-N matrix A and a tall skinny QR or short wide LQ factorization of A. It is assumed that A has full rank. The subroutine provides several options:... | glaive | [
0.016444768756628036,
0.024128718301653862,
-0.025977356359362602,
-0.036195058375597,
0.056407470256090164,
-0.022632712498307228,
-0.002341445069760084,
0.03890853002667427,
0.024430062621831894,
-0.016516776755452156,
0.011574145406484604,
0.04059735685586929,
-0.021635903045535088,
0.0... | 0.805052 | 0.780484 | 0.024568 |
What is the most efficient way to calculate the average of an array of numbers in Java? | glaive | [
0.012791241519153118,
0.027579687535762787,
-0.04147493094205856,
-0.041873857378959656,
0.034699760377407074,
-0.04396525397896767,
-0.02826722152531147,
0.02123674377799034,
0.032071586698293686,
-0.055932193994522095,
0.013983087614178658,
0.007639956660568714,
-0.03504959121346474,
-0.... | 0.773907 | 0.755544 | 0.018363 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.