Average Error: 3.5 → 2.2
Time: 4.8s
Precision: binary64
\[1.99 \leq x \land x \leq 2.01\]
\[\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} \]
(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}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 3.5

    \[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  2. Applied add-cbrt-cube_binary643.5

    \[\leadsto \cos x \cdot \color{blue}{\sqrt[3]{\left(e^{10 \cdot \left(x \cdot x\right)} \cdot e^{10 \cdot \left(x \cdot x\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)}}} \]
  3. Simplified3.0

    \[\leadsto \cos x \cdot \sqrt[3]{\color{blue}{{\left(e^{x \cdot x}\right)}^{30}}} \]
  4. Applied add-log-exp_binary643.0

    \[\leadsto \cos x \cdot \sqrt[3]{{\left(e^{\color{blue}{\log \left(e^{x}\right)} \cdot x}\right)}^{30}} \]
  5. Applied exp-to-pow_binary642.2

    \[\leadsto \cos x \cdot \sqrt[3]{{\color{blue}{\left({\left(e^{x}\right)}^{x}\right)}}^{30}} \]
  6. Applied add-cbrt-cube_binary642.2

    \[\leadsto \cos x \cdot \sqrt[3]{\color{blue}{\sqrt[3]{\left({\left({\left(e^{x}\right)}^{x}\right)}^{30} \cdot {\left({\left(e^{x}\right)}^{x}\right)}^{30}\right) \cdot {\left({\left(e^{x}\right)}^{x}\right)}^{30}}}} \]
  7. Final simplification2.2

    \[\leadsto \cos x \cdot \sqrt[3]{\sqrt[3]{{\left({\left(e^{x}\right)}^{x}\right)}^{30} \cdot \left({\left({\left(e^{x}\right)}^{x}\right)}^{30} \cdot {\left({\left(e^{x}\right)}^{x}\right)}^{30}\right)}} \]

Reproduce

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)))))