
(FPCore (x) :precision binary64 (- (/ x x) (- 987654312.0 123456789.0)))
double code(double x) {
return (x / x) - (987654312.0 - 123456789.0);
}
real(8) function code(x)
real(8), intent (in) :: x
code = (x / x) - (987654312.0d0 - 123456789.0d0)
end function
public static double code(double x) {
return (x / x) - (987654312.0 - 123456789.0);
}
def code(x): return (x / x) - (987654312.0 - 123456789.0)
function code(x) return Float64(Float64(x / x) - Float64(987654312.0 - 123456789.0)) end
function tmp = code(x) tmp = (x / x) - (987654312.0 - 123456789.0); end
code[x_] := N[(N[(x / x), $MachinePrecision] - N[(987654312.0 - 123456789.0), $MachinePrecision]), $MachinePrecision]
\frac{x}{x} - \left(987654312 - 123456789\right)
Herbie found 1 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (- (/ x x) (- 987654312.0 123456789.0)))
double code(double x) {
return (x / x) - (987654312.0 - 123456789.0);
}
real(8) function code(x)
real(8), intent (in) :: x
code = (x / x) - (987654312.0d0 - 123456789.0d0)
end function
public static double code(double x) {
return (x / x) - (987654312.0 - 123456789.0);
}
def code(x): return (x / x) - (987654312.0 - 123456789.0)
function code(x) return Float64(Float64(x / x) - Float64(987654312.0 - 123456789.0)) end
function tmp = code(x) tmp = (x / x) - (987654312.0 - 123456789.0); end
code[x_] := N[(N[(x / x), $MachinePrecision] - N[(987654312.0 - 123456789.0), $MachinePrecision]), $MachinePrecision]
\frac{x}{x} - \left(987654312 - 123456789\right)
(FPCore (x) :precision binary64 -864197522.0)
double code(double x) {
return -864197522.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = -864197522.0d0
end function
public static double code(double x) {
return -864197522.0;
}
def code(x): return -864197522.0
function code(x) return -864197522.0 end
function tmp = code(x) tmp = -864197522.0; end
code[x_] := -864197522.0
-864197522
Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites100.0%
herbie shell --seed 1
(FPCore (x)
:name "x / x - (987654312-123456789)"
:precision binary64
:pre (and (<= 987654300.0 x) (<= x 987654399.0))
(- (/ x x) (- 987654312.0 123456789.0)))