xpile 0.1.616

Polyglot transpile workbench (Python/C/C++/Rust/Ruchy/Lean ↔ Rust/Ruchy/PTX/WGSL/SPIR-V) with provable contracts at every layer.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import math


def hypotenuse(a: float, b: float) -> float:
    return math.hypot(a, b)


def angle(y: float, x: float) -> float:
    return math.atan2(y, x)


def log_base(x: float, base: float) -> float:
    return math.log(x, base)


def natural_log(x: float) -> float:
    # 1-arg math.log is still natural log (ln).
    return math.log(x)