
(FPCore (x) :precision binary64 (* (* x 3.0) x))
double code(double x) {
return (x * 3.0) * x;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (x * 3.0d0) * x
end function
public static double code(double x) {
return (x * 3.0) * x;
}
def code(x): return (x * 3.0) * x
function code(x) return Float64(Float64(x * 3.0) * x) end
function tmp = code(x) tmp = (x * 3.0) * x; end
code[x_] := N[(N[(x * 3.0), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 3\right) \cdot x
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (* (* x 3.0) x))
double code(double x) {
return (x * 3.0) * x;
}
real(8) function code(x)
real(8), intent (in) :: x
code = (x * 3.0d0) * x
end function
public static double code(double x) {
return (x * 3.0) * x;
}
def code(x): return (x * 3.0) * x
function code(x) return Float64(Float64(x * 3.0) * x) end
function tmp = code(x) tmp = (x * 3.0) * x; end
code[x_] := N[(N[(x * 3.0), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 3\right) \cdot x
\end{array}
(FPCore (x) :precision binary64 (* 3.0 (* x x)))
double code(double x) {
return 3.0 * (x * x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = 3.0d0 * (x * x)
end function
public static double code(double x) {
return 3.0 * (x * x);
}
def code(x): return 3.0 * (x * x)
function code(x) return Float64(3.0 * Float64(x * x)) end
function tmp = code(x) tmp = 3.0 * (x * x); end
code[x_] := N[(3.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
3 \cdot \left(x \cdot x\right)
\end{array}
Initial program 99.7%
add-sqr-sqrt99.5%
sqrt-unprod70.4%
pow270.4%
*-commutative70.4%
associate-*r*70.4%
unpow-prod-down70.4%
pow-prod-down70.4%
pow-prod-up70.4%
metadata-eval70.4%
metadata-eval70.4%
Applied egg-rr70.4%
sqrt-prod70.4%
metadata-eval70.4%
add-cube-cbrt70.0%
cbrt-prod70.2%
add-sqr-sqrt70.2%
sqrt-pow170.2%
metadata-eval70.2%
associate-*l*70.2%
pow1/368.7%
pow-pow43.6%
metadata-eval43.6%
metadata-eval43.6%
pow-pow43.6%
pow1/398.6%
unpow298.6%
cbrt-prod98.3%
pow298.3%
Applied egg-rr98.3%
associate-*r*98.3%
*-commutative98.3%
unpow298.3%
associate-*r*98.3%
pow-plus98.4%
pow-plus98.3%
metadata-eval98.3%
metadata-eval98.3%
Simplified98.3%
pow1/343.3%
pow-pow99.7%
metadata-eval99.7%
pow299.7%
Applied egg-rr99.7%
herbie shell --seed 2024108
(FPCore (x)
:name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, F"
:precision binary64
(* (* x 3.0) x))