benchmarks.wiki / Public workspace

MMLU-Pro / 10707 / Define a BASIC function which takes on the value …

Problem

Answer published by the source. Consult the official source to check your work against its answer.

question

Define a BASIC function which takes on the value \surd(x^2 - y^2) if x^2 \geq y^2, but \surd(y^2 - x^2) if y^2 > x^2.

category

computer science

options

  1. 1 DEF FNA(X,Y) 11 LET X1 = X^2 / Y^2 12 IF X1 >= 1 then 14 13 LET X1 = Y^2 / X^2 14 LET FNA = X1^0.5 15 FNEND
  2. 1 DEF FNA(X,Y) 11 LET X1 = Y^2 + X^2 12 IF X1 >= 0 then 14 13 LET X1 = -X1 14 LET FNA = X1^0.5 15 FNEND
  3. 1 DEF FNA(X,Y) 11 LET X1 = X^2 + Y^2 12 IF X1 >= 0 then 14 13 LET X1 = -X1 14 LET FNA = X1^0.5 15 FNEND
  4. 1 DEF FNA(X,Y) 11 LET X1 = X^2 - Y^2 12 IF X1 >= 0 then 14 13 LET X1 = -X1 14 LET FNA = X1^0.5 15 FNEND
  5. 1 DEF FNA(X,Y) 11 LET X1 = ABS(X^2 - Y^2) 12 LET FNA = X1^0.5 15 FNEND
  6. 1 DEF FNA(X,Y) 11 LET X1 = X^2 * Y^2 12 IF X1 >= Y^2 * Y^2 then 14 13 LET X1 = Y^2 * Y^2 - X1 14 LET FNA = X1^0.5 15 FNEND
  7. 1 DEF FNA(X,Y) 11 LET X1 = X^2 - Y^2 12 IF X1 > 0 then 14 13 LET X1 = -X1 14 LET FNA = X1^0.5 15 FNEND
  8. 1 DEF FNA(X,Y) 11 LET X1 = X^2 - Y^2 12 IF X1 <= 0 then 14 13 LET X1 = -X1 14 LET FNA = X1^0.5 15 FNEND
  9. 1 DEF FNA(X,Y) 11 LET X1 = Y^2 - X^2 12 IF X1 < 0 then 14 13 LET X1 = -X1 14 LET FNA = X1^0.5 15 FNEND
  10. 1 DEF FNA(X,Y) 11 LET X1 = X^2 - Y^2 12 IF X1 < 0 then 14 13 LET X1 = Y^2 - X^2 14 LET FNA = X1^0.5 15 FNEND

src

stemez-ComputerScience

Discussion

Discussion

No discussion posts on this page yet. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

Source and history

Official source

initial import