(FPCore (k) :precision binary64 (* (/ (* (* (- 2.0) 3.14) 9000000.0) (/ 1.0 300000000.0)) k))
double code(double k) { return (((-2.0 * 3.14) * 9000000.0) / (1.0 / 300000000.0)) * k; }
real(8) function code(k) real(8), intent (in) :: k code = (((-2.0d0 * 3.14d0) * 9000000.0d0) / (1.0d0 / 300000000.0d0)) * k end function
public static double code(double k) { return (((-2.0 * 3.14) * 9000000.0) / (1.0 / 300000000.0)) * k; }
def code(k): return (((-2.0 * 3.14) * 9000000.0) / (1.0 / 300000000.0)) * k
function code(k) return Float64(Float64(Float64(Float64(Float64(-2.0) * 3.14) * 9000000.0) / Float64(1.0 / 300000000.0)) * k) end
function tmp = code(k) tmp = (((-2.0 * 3.14) * 9000000.0) / (1.0 / 300000000.0)) * k; end
code[k_] := N[(N[(N[(N[((-2.0) * 3.14), $MachinePrecision] * 9000000.0), $MachinePrecision] / N[(1.0 / 300000000.0), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]
\begin{array}{l} \\ \frac{\left(\left(-2\right) \cdot 3.14\right) \cdot 9000000}{\frac{1}{300000000}} \cdot k \end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (k) :precision binary64 (* (/ (* (* (- 2.0) 3.14) 9000000.0) (/ 1.0 300000000.0)) k))
double code(double k) { return (((-2.0 * 3.14) * 9000000.0) / (1.0 / 300000000.0)) * k; }
real(8) function code(k) real(8), intent (in) :: k code = (((-2.0d0 * 3.14d0) * 9000000.0d0) / (1.0d0 / 300000000.0d0)) * k end function
public static double code(double k) { return (((-2.0 * 3.14) * 9000000.0) / (1.0 / 300000000.0)) * k; }
def code(k): return (((-2.0 * 3.14) * 9000000.0) / (1.0 / 300000000.0)) * k
function code(k) return Float64(Float64(Float64(Float64(Float64(-2.0) * 3.14) * 9000000.0) / Float64(1.0 / 300000000.0)) * k) end
function tmp = code(k) tmp = (((-2.0 * 3.14) * 9000000.0) / (1.0 / 300000000.0)) * k; end
code[k_] := N[(N[(N[(N[((-2.0) * 3.14), $MachinePrecision] * 9000000.0), $MachinePrecision] / N[(1.0 / 300000000.0), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]
\begin{array}{l} \\ \frac{\left(\left(-2\right) \cdot 3.14\right) \cdot 9000000}{\frac{1}{300000000}} \cdot k \end{array}
(FPCore (k) :precision binary64 (* k -1.6956e+16))
double code(double k) { return k * -1.6956e+16; }
real(8) function code(k) real(8), intent (in) :: k code = k * (-1.6956d+16) end function
public static double code(double k) { return k * -1.6956e+16; }
def code(k): return k * -1.6956e+16
function code(k) return Float64(k * -1.6956e+16) end
function tmp = code(k) tmp = k * -1.6956e+16; end
code[k_] := N[(k * -1.6956e+16), $MachinePrecision]
\begin{array}{l} \\ k \cdot -1.6956 \cdot 10^{+16} \end{array}
Initial program 99.5%
lift-*.f64
N/A
*-commutative
N/A
lower-*.f64
99.5
lift-/.f64
N/A
lift-*.f64
N/A
lift-*.f64
N/A
lift-neg.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
metadata-eval
N/A
lift-/.f64
N/A
metadata-eval
N/A
metadata-eval
99.5
Applied rewrites99.5%
herbie shell --seed 1
(FPCore (k)
:name "(-2.0 * 3.14 * 9000000) / (1.0 / 300000000) * k"
:precision binary64
:pre (and (<= 0.01 k) (<= k 10000.0))
(* (/ (* (* (- 2.0) 3.14) 9000000.0) (/ 1.0 300000000.0)) k))