Alternative 1 | |
---|---|
Error | 0.3 |
Cost | 6656 |
\[0.005555555555555556 \cdot \left(x \cdot \pi\right)
\]
(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}
Results
Initial program 0.3
Simplified0.1
Final simplification0.1
Alternative 1 | |
---|---|
Error | 0.3 |
Cost | 6656 |
Alternative 2 | |
---|---|
Error | 0.3 |
Cost | 6656 |
herbie shell --seed 1
(FPCore (x)
:name "x / 180 * PI"
:precision binary64
:pre (and (<= 0.0 x) (<= x 360.0))
(* (/ x 180.0) PI))