Average Error: 0.0 → 0.3
Time: 3.1s
Precision: binary64
\[x \cdot e^{y \cdot y} \]
\[\begin{array}{l} t_0 := \left(y \cdot y\right) \cdot \sqrt[3]{x}\\ 0.16666666666666666 \cdot \left(\mathsf{fma}\left(t_0, {t_0}^{2}, -0 \cdot x\right) + \mathsf{fma}\left(0, x, 0 \cdot x\right)\right) + \left({y}^{2} \cdot x + \left(0.5 \cdot \left({y}^{4} \cdot x\right) + x\right)\right) \end{array} \]
x \cdot e^{y \cdot y}
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot \sqrt[3]{x}\\
0.16666666666666666 \cdot \left(\mathsf{fma}\left(t_0, {t_0}^{2}, -0 \cdot x\right) + \mathsf{fma}\left(0, x, 0 \cdot x\right)\right) + \left({y}^{2} \cdot x + \left(0.5 \cdot \left({y}^{4} \cdot x\right) + x\right)\right)
\end{array}
(FPCore (x y) :precision binary64 (* x (exp (* y y))))
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (* y y) (cbrt x))))
   (+
    (*
     0.16666666666666666
     (+ (fma t_0 (pow t_0 2.0) (- (* 0.0 x))) (fma 0.0 x (* 0.0 x))))
    (+ (* (pow y 2.0) x) (+ (* 0.5 (* (pow y 4.0) x)) x)))))
double code(double x, double y) {
	return x * exp((y * y));
}
double code(double x, double y) {
	double t_0 = (y * y) * cbrt(x);
	return (0.16666666666666666 * (fma(t_0, pow(t_0, 2.0), -(0.0 * x)) + fma(0.0, x, (0.0 * x)))) + ((pow(y, 2.0) * x) + ((0.5 * (pow(y, 4.0) * x)) + x));
}

Error

Bits error versus x

Bits error versus y

Target

Original0.0
Target0.0
Herbie0.3
\[x \cdot {\left(e^{y}\right)}^{y} \]

Derivation

  1. Initial program 0.0

    \[x \cdot e^{y \cdot y} \]
  2. Taylor expanded in y around 0 0.3

    \[\leadsto \color{blue}{0.16666666666666666 \cdot \left({y}^{6} \cdot x\right) + \left({y}^{2} \cdot x + \left(0.5 \cdot \left({y}^{4} \cdot x\right) + x\right)\right)} \]
  3. Applied egg-rr0.3

    \[\leadsto 0.16666666666666666 \cdot \color{blue}{\left(\mathsf{fma}\left(\left(y \cdot y\right) \cdot \sqrt[3]{x}, {\left(\left(y \cdot y\right) \cdot \sqrt[3]{x}\right)}^{2}, -0 \cdot x\right) + \mathsf{fma}\left(0, x, 0 \cdot x\right)\right)} + \left({y}^{2} \cdot x + \left(0.5 \cdot \left({y}^{4} \cdot x\right) + x\right)\right) \]
  4. Final simplification0.3

    \[\leadsto 0.16666666666666666 \cdot \left(\mathsf{fma}\left(\left(y \cdot y\right) \cdot \sqrt[3]{x}, {\left(\left(y \cdot y\right) \cdot \sqrt[3]{x}\right)}^{2}, -0 \cdot x\right) + \mathsf{fma}\left(0, x, 0 \cdot x\right)\right) + \left({y}^{2} \cdot x + \left(0.5 \cdot \left({y}^{4} \cdot x\right) + x\right)\right) \]

Reproduce

herbie shell --seed 2022127 
(FPCore (x y)
  :name "Data.Number.Erf:$dmerfcx from erf-2.0.0.0"
  :precision binary64

  :herbie-target
  (* x (pow (exp y) y))

  (* x (exp (* y y))))