(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
(FPCore (x) :precision binary64 (let* ((t_0 (pow (pow (exp x) x) 30.0))) (* (cos x) (cbrt (cbrt (* t_0 (* t_0 t_0)))))))
double code(double x) {
return cos(x) * exp((10.0 * (x * x)));
}
double code(double x) {
double t_0 = pow(pow(exp(x), x), 30.0);
return cos(x) * cbrt(cbrt((t_0 * (t_0 * t_0))));
}
public static double code(double x) {
return Math.cos(x) * Math.exp((10.0 * (x * x)));
}
public static double code(double x) {
double t_0 = Math.pow(Math.pow(Math.exp(x), x), 30.0);
return Math.cos(x) * Math.cbrt(Math.cbrt((t_0 * (t_0 * t_0))));
}
function code(x) return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x)))) end
function code(x) t_0 = (exp(x) ^ x) ^ 30.0 return Float64(cos(x) * cbrt(cbrt(Float64(t_0 * Float64(t_0 * t_0))))) end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[Power[N[Power[N[Exp[x], $MachinePrecision], x], $MachinePrecision], 30.0], $MachinePrecision]}, N[(N[Cos[x], $MachinePrecision] * N[Power[N[Power[N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\begin{array}{l}
t_0 := {\left({\left(e^{x}\right)}^{x}\right)}^{30}\\
\cos x \cdot \sqrt[3]{\sqrt[3]{t_0 \cdot \left(t_0 \cdot t_0\right)}}
\end{array}



Bits error versus x
Results
Initial program 3.5
Applied add-cbrt-cube_binary643.5
Simplified3.0
Applied add-log-exp_binary643.0
Applied exp-to-pow_binary642.2
Applied add-cbrt-cube_binary642.2
Final simplification2.2
herbie shell --seed 2022129
(FPCore (x)
:name "ENA, Section 1.4, Exercise 1"
:precision binary64
:pre (and (<= 1.99 x) (<= x 2.01))
(* (cos x) (exp (* 10.0 (* x x)))))