?

Average Error: 3.5 → 3.1
Time: 13.3s
Precision: binary64
Cost: 20032

?

\[1.99 \leq x \land x \leq 2.01\]
\[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
\[\cos x \cdot \left(e^{x \cdot \left(x \cdot 5\right)} \cdot e^{5 \cdot \left(x \cdot x\right)}\right) \]
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
(FPCore (x)
 :precision binary64
 (* (cos x) (* (exp (* x (* x 5.0))) (exp (* 5.0 (* x x))))))
double code(double x) {
	return cos(x) * exp((10.0 * (x * x)));
}
double code(double x) {
	return cos(x) * (exp((x * (x * 5.0))) * exp((5.0 * (x * x))));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = cos(x) * exp((10.0d0 * (x * x)))
end function
real(8) function code(x)
    real(8), intent (in) :: x
    code = cos(x) * (exp((x * (x * 5.0d0))) * exp((5.0d0 * (x * x))))
end function
public static double code(double x) {
	return Math.cos(x) * Math.exp((10.0 * (x * x)));
}
public static double code(double x) {
	return Math.cos(x) * (Math.exp((x * (x * 5.0))) * Math.exp((5.0 * (x * x))));
}
def code(x):
	return math.cos(x) * math.exp((10.0 * (x * x)))
def code(x):
	return math.cos(x) * (math.exp((x * (x * 5.0))) * math.exp((5.0 * (x * x))))
function code(x)
	return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x))))
end
function code(x)
	return Float64(cos(x) * Float64(exp(Float64(x * Float64(x * 5.0))) * exp(Float64(5.0 * Float64(x * x)))))
end
function tmp = code(x)
	tmp = cos(x) * exp((10.0 * (x * x)));
end
function tmp = code(x)
	tmp = cos(x) * (exp((x * (x * 5.0))) * exp((5.0 * (x * x))));
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Exp[N[(x * N[(x * 5.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(5.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\cos x \cdot \left(e^{x \cdot \left(x \cdot 5\right)} \cdot e^{5 \cdot \left(x \cdot x\right)}\right)

Error?

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 egg-rr3.9

    \[\leadsto \cos x \cdot e^{\color{blue}{\frac{10 \cdot \left|x\right|}{\frac{1}{\left|x\right|}}}} \]
  3. Applied egg-rr3.9

    \[\leadsto \cos x \cdot e^{\color{blue}{\frac{x}{0.1} \cdot x}} \]
  4. Applied egg-rr3.6

    \[\leadsto \cos x \cdot \color{blue}{\left(e^{x \cdot \left(x \cdot 5\right)} \cdot e^{x \cdot \left(x \cdot 5\right)}\right)} \]
  5. Applied egg-rr3.6

    \[\leadsto \cos x \cdot \left(e^{x \cdot \left(x \cdot 5\right)} \cdot \color{blue}{\left(e^{x \cdot \left(x \cdot 5\right)} + 0\right)}\right) \]
  6. Simplified3.1

    \[\leadsto \cos x \cdot \left(e^{x \cdot \left(x \cdot 5\right)} \cdot \color{blue}{e^{5 \cdot \left(x \cdot x\right)}}\right) \]
    Proof

    [Start]3.6

    \[ \cos x \cdot \left(e^{x \cdot \left(x \cdot 5\right)} \cdot \left(e^{x \cdot \left(x \cdot 5\right)} + 0\right)\right) \]

    rational.json-simplify-4 [=>]3.6

    \[ \cos x \cdot \left(e^{x \cdot \left(x \cdot 5\right)} \cdot \color{blue}{e^{x \cdot \left(x \cdot 5\right)}}\right) \]

    rational.json-simplify-2 [=>]3.6

    \[ \cos x \cdot \left(e^{x \cdot \left(x \cdot 5\right)} \cdot e^{x \cdot \color{blue}{\left(5 \cdot x\right)}}\right) \]

    rational.json-simplify-43 [=>]3.1

    \[ \cos x \cdot \left(e^{x \cdot \left(x \cdot 5\right)} \cdot e^{\color{blue}{5 \cdot \left(x \cdot x\right)}}\right) \]
  7. Final simplification3.1

    \[\leadsto \cos x \cdot \left(e^{x \cdot \left(x \cdot 5\right)} \cdot e^{5 \cdot \left(x \cdot x\right)}\right) \]

Alternatives

Alternative 1
Error3.5
Cost13248
\[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
Alternative 2
Error57.8
Cost6784
\[\left(-0.5 \cdot {x}^{2}\right) \cdot 1 \]
Alternative 3
Error57.8
Cost6592
\[\cos x \cdot 1 \]
Alternative 4
Error63.0
Cost64
\[1 \]

Error

Reproduce?

herbie shell --seed 2023074 
(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)))))