?

Average Error: 3.5 → 3.5
Time: 19.1s
Precision: binary64
Cost: 75200

?

\[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 := e^{\left(x \cdot 40\right) \cdot \left(x + x\right)}\\ t_1 := x \cdot \left(x \cdot 20\right)\\ t_2 := e^{x \cdot \left(x \cdot 40\right)}\\ \cos x \cdot \left(\left(\left(t_0 \cdot t_0\right) \cdot \frac{\frac{1}{t_2}}{t_0}\right) \cdot \frac{\frac{1}{e^{10 \cdot \left(-x \cdot x\right)}} \cdot e^{-t_1}}{\left(t_2 \cdot t_2\right) \cdot \frac{\frac{1}{e^{t_1}}}{t_2}}\right) \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (exp (* (* x 40.0) (+ x x))))
        (t_1 (* x (* x 20.0)))
        (t_2 (exp (* x (* x 40.0)))))
   (*
    (cos x)
    (*
     (* (* t_0 t_0) (/ (/ 1.0 t_2) t_0))
     (/
      (* (/ 1.0 (exp (* 10.0 (- (* x x))))) (exp (- t_1)))
      (* (* t_2 t_2) (/ (/ 1.0 (exp t_1)) t_2)))))))
double code(double x) {
	return cos(x) * exp((10.0 * (x * x)));
}
double code(double x) {
	double t_0 = exp(((x * 40.0) * (x + x)));
	double t_1 = x * (x * 20.0);
	double t_2 = exp((x * (x * 40.0)));
	return cos(x) * (((t_0 * t_0) * ((1.0 / t_2) / t_0)) * (((1.0 / exp((10.0 * -(x * x)))) * exp(-t_1)) / ((t_2 * t_2) * ((1.0 / exp(t_1)) / t_2))));
}
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
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    t_0 = exp(((x * 40.0d0) * (x + x)))
    t_1 = x * (x * 20.0d0)
    t_2 = exp((x * (x * 40.0d0)))
    code = cos(x) * (((t_0 * t_0) * ((1.0d0 / t_2) / t_0)) * (((1.0d0 / exp((10.0d0 * -(x * x)))) * exp(-t_1)) / ((t_2 * t_2) * ((1.0d0 / exp(t_1)) / t_2))))
end function
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.exp(((x * 40.0) * (x + x)));
	double t_1 = x * (x * 20.0);
	double t_2 = Math.exp((x * (x * 40.0)));
	return Math.cos(x) * (((t_0 * t_0) * ((1.0 / t_2) / t_0)) * (((1.0 / Math.exp((10.0 * -(x * x)))) * Math.exp(-t_1)) / ((t_2 * t_2) * ((1.0 / Math.exp(t_1)) / t_2))));
}
def code(x):
	return math.cos(x) * math.exp((10.0 * (x * x)))
def code(x):
	t_0 = math.exp(((x * 40.0) * (x + x)))
	t_1 = x * (x * 20.0)
	t_2 = math.exp((x * (x * 40.0)))
	return math.cos(x) * (((t_0 * t_0) * ((1.0 / t_2) / t_0)) * (((1.0 / math.exp((10.0 * -(x * x)))) * math.exp(-t_1)) / ((t_2 * t_2) * ((1.0 / math.exp(t_1)) / t_2))))
function code(x)
	return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x))))
end
function code(x)
	t_0 = exp(Float64(Float64(x * 40.0) * Float64(x + x)))
	t_1 = Float64(x * Float64(x * 20.0))
	t_2 = exp(Float64(x * Float64(x * 40.0)))
	return Float64(cos(x) * Float64(Float64(Float64(t_0 * t_0) * Float64(Float64(1.0 / t_2) / t_0)) * Float64(Float64(Float64(1.0 / exp(Float64(10.0 * Float64(-Float64(x * x))))) * exp(Float64(-t_1))) / Float64(Float64(t_2 * t_2) * Float64(Float64(1.0 / exp(t_1)) / t_2)))))
end
function tmp = code(x)
	tmp = cos(x) * exp((10.0 * (x * x)));
end
function tmp = code(x)
	t_0 = exp(((x * 40.0) * (x + x)));
	t_1 = x * (x * 20.0);
	t_2 = exp((x * (x * 40.0)));
	tmp = cos(x) * (((t_0 * t_0) * ((1.0 / t_2) / t_0)) * (((1.0 / exp((10.0 * -(x * x)))) * exp(-t_1)) / ((t_2 * t_2) * ((1.0 / exp(t_1)) / t_2))));
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[Exp[N[(N[(x * 40.0), $MachinePrecision] * N[(x + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * 20.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(x * N[(x * 40.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[Cos[x], $MachinePrecision] * N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] * N[(N[(1.0 / t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / N[Exp[N[(10.0 * (-N[(x * x), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[(-t$95$1)], $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$2 * t$95$2), $MachinePrecision] * N[(N[(1.0 / N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\begin{array}{l}
t_0 := e^{\left(x \cdot 40\right) \cdot \left(x + x\right)}\\
t_1 := x \cdot \left(x \cdot 20\right)\\
t_2 := e^{x \cdot \left(x \cdot 40\right)}\\
\cos x \cdot \left(\left(\left(t_0 \cdot t_0\right) \cdot \frac{\frac{1}{t_2}}{t_0}\right) \cdot \frac{\frac{1}{e^{10 \cdot \left(-x \cdot x\right)}} \cdot e^{-t_1}}{\left(t_2 \cdot t_2\right) \cdot \frac{\frac{1}{e^{t_1}}}{t_2}}\right)
\end{array}

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. Simplified3.6

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

    [Start]3.5

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

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

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

    \[\leadsto \cos x \cdot \color{blue}{\left(e^{x \cdot \left(x \cdot 20\right) + x \cdot \left(x \cdot 20\right)} \cdot \frac{e^{-x \cdot \left(x \cdot 10\right)}}{e^{x \cdot \left(x \cdot 20\right)}}\right)} \]
  4. Applied egg-rr3.5

    \[\leadsto \cos x \cdot \left(e^{x \cdot \left(x \cdot 20\right) + x \cdot \left(x \cdot 20\right)} \cdot \frac{\color{blue}{\frac{1}{e^{10 \cdot \left(-x \cdot x\right)}} \cdot e^{-x \cdot \left(x \cdot 20\right)}}}{e^{x \cdot \left(x \cdot 20\right)}}\right) \]
  5. Applied egg-rr3.5

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

    \[\leadsto \cos x \cdot \left(\left(\left(e^{\left(x \cdot 40\right) \cdot \left(x + x\right)} \cdot e^{\left(x \cdot 40\right) \cdot \left(x + x\right)}\right) \cdot \frac{\frac{1}{e^{x \cdot \left(x \cdot 40\right)}}}{e^{\left(x \cdot 40\right) \cdot \left(x + x\right)}}\right) \cdot \frac{\frac{1}{e^{10 \cdot \left(-x \cdot x\right)}} \cdot e^{-x \cdot \left(x \cdot 20\right)}}{\color{blue}{\left(e^{x \cdot \left(x \cdot 40\right)} \cdot e^{x \cdot \left(x \cdot 40\right)}\right) \cdot \frac{\frac{1}{e^{x \cdot \left(x \cdot 20\right)}}}{e^{x \cdot \left(x \cdot 40\right)}}}}\right) \]
  7. Final simplification3.5

    \[\leadsto \cos x \cdot \left(\left(\left(e^{\left(x \cdot 40\right) \cdot \left(x + x\right)} \cdot e^{\left(x \cdot 40\right) \cdot \left(x + x\right)}\right) \cdot \frac{\frac{1}{e^{x \cdot \left(x \cdot 40\right)}}}{e^{\left(x \cdot 40\right) \cdot \left(x + x\right)}}\right) \cdot \frac{\frac{1}{e^{10 \cdot \left(-x \cdot x\right)}} \cdot e^{-x \cdot \left(x \cdot 20\right)}}{\left(e^{x \cdot \left(x \cdot 40\right)} \cdot e^{x \cdot \left(x \cdot 40\right)}\right) \cdot \frac{\frac{1}{e^{x \cdot \left(x \cdot 20\right)}}}{e^{x \cdot \left(x \cdot 40\right)}}}\right) \]

Alternatives

Alternative 1
Error3.5
Cost61632
\[\begin{array}{l} t_0 := e^{\left(x \cdot 40\right) \cdot \left(x + x\right)}\\ t_1 := x \cdot \left(x \cdot 20\right)\\ t_2 := e^{x \cdot \left(x \cdot 40\right)}\\ \cos x \cdot \left(\left(\left(t_0 \cdot t_0\right) \cdot \frac{\frac{1}{t_2}}{t_0}\right) \cdot \frac{\frac{1}{e^{10 \cdot \left(-x \cdot x\right)}} \cdot e^{-t_1}}{\frac{1}{e^{t_1}} \cdot t_2}\right) \end{array} \]
Alternative 2
Error3.5
Cost61568
\[\begin{array}{l} t_0 := x \cdot \left(x \cdot 20\right)\\ t_1 := e^{\left(x \cdot 40\right) \cdot \left(x + x\right)}\\ \cos x \cdot \left(\left(\left(t_1 \cdot t_1\right) \cdot \frac{\frac{1}{e^{x \cdot \left(x \cdot 80\right)} \cdot e^{-x \cdot \left(x \cdot 40\right)}}}{t_1}\right) \cdot \frac{\frac{1}{e^{10 \cdot \left(-x \cdot x\right)}} \cdot e^{-t_0}}{e^{t_0}}\right) \end{array} \]
Alternative 3
Error3.5
Cost54592
\[\begin{array}{l} t_0 := e^{\left(x \cdot 40\right) \cdot \left(x + x\right)}\\ t_1 := x \cdot \left(x \cdot 20\right)\\ \cos x \cdot \left(\left(\left(t_0 \cdot t_0\right) \cdot \frac{\frac{1}{e^{x \cdot \left(x \cdot 40\right)}}}{e^{x \cdot \left(80 \cdot x\right)}}\right) \cdot \frac{\frac{1}{e^{10 \cdot \left(-x \cdot x\right)}} \cdot e^{-t_1}}{e^{t_1}}\right) \end{array} \]
Alternative 4
Error3.5
Cost40640
\[\begin{array}{l} t_0 := x \cdot \left(x \cdot 20\right)\\ t_1 := e^{t_0}\\ \cos x \cdot \left(\left(t_1 \cdot t_1\right) \cdot \frac{\frac{1}{e^{10 \cdot \left(-x \cdot x\right)}} \cdot e^{-t_0}}{t_1}\right) \end{array} \]
Alternative 5
Error3.5
Cost33856
\[\begin{array}{l} t_0 := x \cdot \left(x \cdot 20\right)\\ \cos x \cdot \left(e^{x \cdot \left(40 \cdot x\right)} \cdot \frac{\frac{1}{e^{10 \cdot \left(-x \cdot x\right)}} \cdot e^{-t_0}}{e^{t_0}}\right) \end{array} \]
Alternative 6
Error3.5
Cost26816
\[\begin{array}{l} t_0 := e^{10 \cdot \left(x \cdot x\right)}\\ \cos x \cdot \left(\left(t_0 \cdot t_0\right) \cdot e^{\left(x \cdot x\right) \cdot -10}\right) \end{array} \]
Alternative 7
Error3.5
Cost13248
\[\cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \]
Alternative 8
Error57.8
Cost6592
\[\cos x \cdot 1 \]
Alternative 9
Error63.0
Cost64
\[1 \]

Error

Reproduce?

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