Average Error: 0.3 → 0.1
Time: 3.6s
Precision: binary64
Cost: 6656
$0 \leq x \land x \leq 360$
$\frac{x}{180} \cdot \pi$
$x \cdot \frac{\pi}{180}$
(FPCore (x) :precision binary64 (* (/ x 180.0) PI))
(FPCore (x) :precision binary64 (* x (/ PI 180.0)))
double code(double x) {
return (x / 180.0) * ((double) M_PI);
}

double code(double x) {
return x * (((double) M_PI) / 180.0);
}

public static double code(double x) {
return (x / 180.0) * Math.PI;
}

public static double code(double x) {
return x * (Math.PI / 180.0);
}

def code(x):
return (x / 180.0) * math.pi

def code(x):
return x * (math.pi / 180.0)

function code(x)
return Float64(Float64(x / 180.0) * pi)
end

function code(x)
return Float64(x * Float64(pi / 180.0))
end

function tmp = code(x)
tmp = (x / 180.0) * pi;
end

function tmp = code(x)
tmp = x * (pi / 180.0);
end

code[x_] := N[(N[(x / 180.0), $MachinePrecision] * Pi),$MachinePrecision]

code[x_] := N[(x * N[(Pi / 180.0), $MachinePrecision]),$MachinePrecision]

\frac{x}{180} \cdot \pi

x \cdot \frac{\pi}{180}


# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.3

$\frac{x}{180} \cdot \pi$
2. Simplified0.1

$\leadsto \color{blue}{x \cdot \frac{\pi}{180}}$
3. Final simplification0.1

$\leadsto x \cdot \frac{\pi}{180}$

# Alternatives

Alternative 1
Error0.3
Cost6656
$0.005555555555555556 \cdot \left(x \cdot \pi\right)$
Alternative 2
Error0.3
Cost6656
$\pi \cdot \left(x \cdot 0.005555555555555556\right)$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "x / 180 * PI"
:precision binary64
:pre (and (<= 0.0 x) (<= x 360.0))
(* (/ x 180.0) PI))