
(FPCore () :precision binary64 (* 2.0 (+ (+ (* 1.0 (/ 1.0 9.0)) (* (/ 1.0 9.0) (/ 1.0 9.0))) (* (/ 1.0 9.0) 1.0))))
double code() {
return 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0));
}
real(8) function code()
code = 2.0d0 * (((1.0d0 * (1.0d0 / 9.0d0)) + ((1.0d0 / 9.0d0) * (1.0d0 / 9.0d0))) + ((1.0d0 / 9.0d0) * 1.0d0))
end function
public static double code() {
return 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0));
}
def code(): return 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0))
function code() return Float64(2.0 * Float64(Float64(Float64(1.0 * Float64(1.0 / 9.0)) + Float64(Float64(1.0 / 9.0) * Float64(1.0 / 9.0))) + Float64(Float64(1.0 / 9.0) * 1.0))) end
function tmp = code() tmp = 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0)); end
code[] := N[(2.0 * N[(N[(N[(1.0 * N[(1.0 / 9.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 9.0), $MachinePrecision] * N[(1.0 / 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 9.0), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(1 \cdot \frac{1}{9} + \frac{1}{9} \cdot \frac{1}{9}\right) + \frac{1}{9} \cdot 1\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore () :precision binary64 (* 2.0 (+ (+ (* 1.0 (/ 1.0 9.0)) (* (/ 1.0 9.0) (/ 1.0 9.0))) (* (/ 1.0 9.0) 1.0))))
double code() {
return 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0));
}
real(8) function code()
code = 2.0d0 * (((1.0d0 * (1.0d0 / 9.0d0)) + ((1.0d0 / 9.0d0) * (1.0d0 / 9.0d0))) + ((1.0d0 / 9.0d0) * 1.0d0))
end function
public static double code() {
return 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0));
}
def code(): return 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0))
function code() return Float64(2.0 * Float64(Float64(Float64(1.0 * Float64(1.0 / 9.0)) + Float64(Float64(1.0 / 9.0) * Float64(1.0 / 9.0))) + Float64(Float64(1.0 / 9.0) * 1.0))) end
function tmp = code() tmp = 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0)); end
code[] := N[(2.0 * N[(N[(N[(1.0 * N[(1.0 / 9.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 9.0), $MachinePrecision] * N[(1.0 / 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 9.0), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(1 \cdot \frac{1}{9} + \frac{1}{9} \cdot \frac{1}{9}\right) + \frac{1}{9} \cdot 1\right)
\end{array}
(FPCore () :precision binary64 0.4691358024691358)
double code() {
return 0.4691358024691358;
}
real(8) function code()
code = 0.4691358024691358d0
end function
public static double code() {
return 0.4691358024691358;
}
def code(): return 0.4691358024691358
function code() return 0.4691358024691358 end
function tmp = code() tmp = 0.4691358024691358; end
code[] := 0.4691358024691358
\begin{array}{l}
\\
0.4691358024691358
\end{array}
Initial program 100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification100.0%
(FPCore () :precision binary64 (+ (+ (* (* (/ 1.0 9.0) 1.0) 2.0) (* 2.0 (* (/ 1.0 9.0) (/ 1.0 9.0)))) (* 2.0 (* 1.0 (/ 1.0 9.0)))))
double code() {
return ((((1.0 / 9.0) * 1.0) * 2.0) + (2.0 * ((1.0 / 9.0) * (1.0 / 9.0)))) + (2.0 * (1.0 * (1.0 / 9.0)));
}
real(8) function code()
code = ((((1.0d0 / 9.0d0) * 1.0d0) * 2.0d0) + (2.0d0 * ((1.0d0 / 9.0d0) * (1.0d0 / 9.0d0)))) + (2.0d0 * (1.0d0 * (1.0d0 / 9.0d0)))
end function
public static double code() {
return ((((1.0 / 9.0) * 1.0) * 2.0) + (2.0 * ((1.0 / 9.0) * (1.0 / 9.0)))) + (2.0 * (1.0 * (1.0 / 9.0)));
}
def code(): return ((((1.0 / 9.0) * 1.0) * 2.0) + (2.0 * ((1.0 / 9.0) * (1.0 / 9.0)))) + (2.0 * (1.0 * (1.0 / 9.0)))
function code() return Float64(Float64(Float64(Float64(Float64(1.0 / 9.0) * 1.0) * 2.0) + Float64(2.0 * Float64(Float64(1.0 / 9.0) * Float64(1.0 / 9.0)))) + Float64(2.0 * Float64(1.0 * Float64(1.0 / 9.0)))) end
function tmp = code() tmp = ((((1.0 / 9.0) * 1.0) * 2.0) + (2.0 * ((1.0 / 9.0) * (1.0 / 9.0)))) + (2.0 * (1.0 * (1.0 / 9.0))); end
code[] := N[(N[(N[(N[(N[(1.0 / 9.0), $MachinePrecision] * 1.0), $MachinePrecision] * 2.0), $MachinePrecision] + N[(2.0 * N[(N[(1.0 / 9.0), $MachinePrecision] * N[(1.0 / 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(1.0 * N[(1.0 / 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{9} \cdot 1\right) \cdot 2 + 2 \cdot \left(\frac{1}{9} \cdot \frac{1}{9}\right)\right) + 2 \cdot \left(1 \cdot \frac{1}{9}\right)
\end{array}
herbie shell --seed 2023178
(FPCore ()
:name "Rectangular parallelepiped of dimension a×b×c"
:precision binary64
:herbie-target
(+ (+ (* (* (/ 1.0 9.0) 1.0) 2.0) (* 2.0 (* (/ 1.0 9.0) (/ 1.0 9.0)))) (* 2.0 (* 1.0 (/ 1.0 9.0))))
(* 2.0 (+ (+ (* 1.0 (/ 1.0 9.0)) (* (/ 1.0 9.0) (/ 1.0 9.0))) (* (/ 1.0 9.0) 1.0))))