
(FPCore (x) :precision binary64 (* 100.0 (/ (- x x) x)))
double code(double x) {
return 100.0 * ((x - x) / x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = 100.0d0 * ((x - x) / x)
end function
public static double code(double x) {
return 100.0 * ((x - x) / x);
}
def code(x): return 100.0 * ((x - x) / x)
function code(x) return Float64(100.0 * Float64(Float64(x - x) / x)) end
function tmp = code(x) tmp = 100.0 * ((x - x) / x); end
code[x_] := N[(100.0 * N[(N[(x - x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
100 \cdot \frac{x - x}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (* 100.0 (/ (- x x) x)))
double code(double x) {
return 100.0 * ((x - x) / x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = 100.0d0 * ((x - x) / x)
end function
public static double code(double x) {
return 100.0 * ((x - x) / x);
}
def code(x): return 100.0 * ((x - x) / x)
function code(x) return Float64(100.0 * Float64(Float64(x - x) / x)) end
function tmp = code(x) tmp = 100.0 * ((x - x) / x); end
code[x_] := N[(100.0 * N[(N[(x - x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
100 \cdot \frac{x - x}{x}
\end{array}
(FPCore (x) :precision binary64 (* 100.0 (/ (- x x) x)))
double code(double x) {
return 100.0 * ((x - x) / x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = 100.0d0 * ((x - x) / x)
end function
public static double code(double x) {
return 100.0 * ((x - x) / x);
}
def code(x): return 100.0 * ((x - x) / x)
function code(x) return Float64(100.0 * Float64(Float64(x - x) / x)) end
function tmp = code(x) tmp = 100.0 * ((x - x) / x); end
code[x_] := N[(100.0 * N[(N[(x - x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
100 \cdot \frac{x - x}{x}
\end{array}
Initial program 100.0%
(FPCore (x) :precision binary64 0.0)
double code(double x) {
return 0.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 0.0d0
end function
public static double code(double x) {
return 0.0;
}
def code(x): return 0.0
function code(x) return 0.0 end
function tmp = code(x) tmp = 0.0; end
code[x_] := 0.0
\begin{array}{l}
\\
0
\end{array}
herbie shell --seed 2024321
(FPCore (x)
:name "ReportTypes:explainFloat from gipeda-0.1.2.1"
:precision binary64
:pre (TRUE)
:alt
(! :herbie-platform default 0)
(* 100.0 (/ (- x x) x)))