(FPCore (distance) :precision binary64 (* (* (* (* (- 2.0) 3.141592653589793) 9600000.0) (/ 1.0 300000000.0)) distance))
double code(double distance) { return (((-2.0 * 3.141592653589793) * 9600000.0) * (1.0 / 300000000.0)) * distance; }
real(8) function code(distance) real(8), intent (in) :: distance code = (((-2.0d0 * 3.141592653589793d0) * 9600000.0d0) * (1.0d0 / 300000000.0d0)) * distance end function
public static double code(double distance) { return (((-2.0 * 3.141592653589793) * 9600000.0) * (1.0 / 300000000.0)) * distance; }
def code(distance): return (((-2.0 * 3.141592653589793) * 9600000.0) * (1.0 / 300000000.0)) * distance
function code(distance) return Float64(Float64(Float64(Float64(Float64(-2.0) * 3.141592653589793) * 9600000.0) * Float64(1.0 / 300000000.0)) * distance) end
function tmp = code(distance) tmp = (((-2.0 * 3.141592653589793) * 9600000.0) * (1.0 / 300000000.0)) * distance; end
code[distance_] := N[(N[(N[(N[((-2.0) * 3.141592653589793), $MachinePrecision] * 9600000.0), $MachinePrecision] * N[(1.0 / 300000000.0), $MachinePrecision]), $MachinePrecision] * distance), $MachinePrecision]
\begin{array}{l} \\ \left(\left(\left(\left(-2\right) \cdot 3.141592653589793\right) \cdot 9600000\right) \cdot \frac{1}{300000000}\right) \cdot distance \end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (distance) :precision binary64 (* (* (* (* (- 2.0) 3.141592653589793) 9600000.0) (/ 1.0 300000000.0)) distance))
double code(double distance) { return (((-2.0 * 3.141592653589793) * 9600000.0) * (1.0 / 300000000.0)) * distance; }
real(8) function code(distance) real(8), intent (in) :: distance code = (((-2.0d0 * 3.141592653589793d0) * 9600000.0d0) * (1.0d0 / 300000000.0d0)) * distance end function
public static double code(double distance) { return (((-2.0 * 3.141592653589793) * 9600000.0) * (1.0 / 300000000.0)) * distance; }
def code(distance): return (((-2.0 * 3.141592653589793) * 9600000.0) * (1.0 / 300000000.0)) * distance
function code(distance) return Float64(Float64(Float64(Float64(Float64(-2.0) * 3.141592653589793) * 9600000.0) * Float64(1.0 / 300000000.0)) * distance) end
function tmp = code(distance) tmp = (((-2.0 * 3.141592653589793) * 9600000.0) * (1.0 / 300000000.0)) * distance; end
code[distance_] := N[(N[(N[(N[((-2.0) * 3.141592653589793), $MachinePrecision] * 9600000.0), $MachinePrecision] * N[(1.0 / 300000000.0), $MachinePrecision]), $MachinePrecision] * distance), $MachinePrecision]
\begin{array}{l} \\ \left(\left(\left(\left(-2\right) \cdot 3.141592653589793\right) \cdot 9600000\right) \cdot \frac{1}{300000000}\right) \cdot distance \end{array}
(FPCore (distance) :precision binary64 (* distance -0.20106192982974677))
double code(double distance) { return distance * -0.20106192982974677; }
real(8) function code(distance) real(8), intent (in) :: distance code = distance * (-0.20106192982974677d0) end function
public static double code(double distance) { return distance * -0.20106192982974677; }
def code(distance): return distance * -0.20106192982974677
function code(distance) return Float64(distance * -0.20106192982974677) end
function tmp = code(distance) tmp = distance * -0.20106192982974677; end
code[distance_] := N[(distance * -0.20106192982974677), $MachinePrecision]
\begin{array}{l} \\ distance \cdot -0.20106192982974677 \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 (distance)
:name "((-2. * 3.14159265358979323846 * 9600000) * (1. / 300000000)) * distance;"
:precision binary64
:pre (and (<= 0.01 distance) (<= distance 1000.0))
(* (* (* (* (- 2.0) 3.141592653589793) 9600000.0) (/ 1.0 300000000.0)) distance))