SaC
1 program
Added 2025-11-04T14:39:08Z
Model: x-ai/grok-4-fastTemp: 0.4
Evidence
Report issue
View issues
Aliases: —
Provenance: commit f32d0afd60 · authored 2025-11-04T15:39:08+01:00 · model x-ai/grok-4-fast
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
Scalar product of two vectors
Provenance: commit f32d0afd60 · authored 2025-11-04T15:39:08+01:00 · model x-ai/grok-4-fast · Temp 0.4
def scalarProduct [n] (a : [n]double, b : [n]double) : double =
for i < n
reduce + 0.0 (a[i] * b[i]);
def main =
let
a = with { i } i*2.0 in [0<10] double;
b = with { i } i*3.0 in [0<10] double
in
write("Scalar product = " ++ unparse(scalarProduct(a,b)) ++ "\n");