Alternative 1 | |
---|---|
Error | 0.1 |
Cost | 576 |
\[d \cdot \left(\left(d \cdot d\right) \cdot 0.3333333333333333 + 1\right)
\]
(FPCore (d) :precision binary64 (+ (/ (pow d 3.0) 3.0) d))
(FPCore (d) :precision binary64 (+ d (/ (pow d 3.0) 3.0)))
double code(double d) { return (pow(d, 3.0) / 3.0) + d; }
double code(double d) { return d + (pow(d, 3.0) / 3.0); }
real(8) function code(d) real(8), intent (in) :: d code = ((d ** 3.0d0) / 3.0d0) + d end function
real(8) function code(d) real(8), intent (in) :: d code = d + ((d ** 3.0d0) / 3.0d0) end function
public static double code(double d) { return (Math.pow(d, 3.0) / 3.0) + d; }
public static double code(double d) { return d + (Math.pow(d, 3.0) / 3.0); }
def code(d): return (math.pow(d, 3.0) / 3.0) + d
def code(d): return d + (math.pow(d, 3.0) / 3.0)
function code(d) return Float64(Float64((d ^ 3.0) / 3.0) + d) end
function code(d) return Float64(d + Float64((d ^ 3.0) / 3.0)) end
function tmp = code(d) tmp = ((d ^ 3.0) / 3.0) + d; end
function tmp = code(d) tmp = d + ((d ^ 3.0) / 3.0); end
code[d_] := N[(N[(N[Power[d, 3.0], $MachinePrecision] / 3.0), $MachinePrecision] + d), $MachinePrecision]
code[d_] := N[(d + N[(N[Power[d, 3.0], $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]
\frac{{d}^{3}}{3} + d
d + \frac{{d}^{3}}{3}
Results
Initial program 0.1
Simplified0.1
Final simplification0.1
Alternative 1 | |
---|---|
Error | 0.1 |
Cost | 576 |
Alternative 2 | |
---|---|
Error | 0.1 |
Cost | 576 |
Alternative 3 | |
---|---|
Error | 0.1 |
Cost | 576 |
Alternative 4 | |
---|---|
Error | 15.0 |
Cost | 64 |
herbie shell --seed 1
(FPCore (d)
:name "d^3/3 + d "
:precision binary64
(+ (/ (pow d 3.0) 3.0) d))