
(FPCore (x y) :precision binary64 (+ (+ (* x x) y) y))
(FPCore (x y) :precision binary64 (+ y (+ (* x x) y)))
double code(double x, double y) {
return ((x * x) + y) + y;
}
double code(double x, double y) {
return y + ((x * x) + y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x * x) + y) + y
end function
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y + ((x * x) + y)
end function
public static double code(double x, double y) {
return ((x * x) + y) + y;
}
public static double code(double x, double y) {
return y + ((x * x) + y);
}
def code(x, y): return ((x * x) + y) + y
def code(x, y): return y + ((x * x) + y)
function code(x, y) return Float64(Float64(Float64(x * x) + y) + y) end
function code(x, y) return Float64(y + Float64(Float64(x * x) + y)) end
function tmp = code(x, y) tmp = ((x * x) + y) + y; end
function tmp = code(x, y) tmp = y + ((x * x) + y); end
code[x_, y_] := N[(N[(N[(x * x), $MachinePrecision] + y), $MachinePrecision] + y), $MachinePrecision]
code[x_, y_] := N[(y + N[(N[(x * x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\left(x \cdot x + y\right) + y
y + \left(x \cdot x + y\right)
Herbie found 1 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Results
| Original | 100.0% |
|---|---|
| Target | 100.0% |
| Herbie | 100.0% |
Initial program 100.0%
Final simplification100.0%
herbie shell --seed 2023164
(FPCore (x y)
:name "Data.Random.Distribution.Normal:normalTail from random-fu-0.2.6.2"
:precision binary64
:herbie-target
(+ (+ y y) (* x x))
(+ (+ (* x x) y) y))