Average Error: 0.0 → 0.0
Time: 2.2s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[\frac{{\left(e^{-1}\right)}^{1}}{{\left(e^{-1 \cdot x}\right)}^{x}}\]
e^{-\left(1 - x \cdot x\right)}
\frac{{\left(e^{-1}\right)}^{1}}{{\left(e^{-1 \cdot x}\right)}^{x}}
double code(double x) {
	return exp(-(1.0 - (x * x)));
}
double code(double x) {
	return (pow(exp(-1.0), 1.0) / pow(exp((-1.0 * x)), x));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[e^{-\left(1 - x \cdot x\right)}\]
  2. Using strategy rm
  3. Applied neg-mul-10.0

    \[\leadsto e^{\color{blue}{-1 \cdot \left(1 - x \cdot x\right)}}\]
  4. Applied exp-prod0.0

    \[\leadsto \color{blue}{{\left(e^{-1}\right)}^{\left(1 - x \cdot x\right)}}\]
  5. Using strategy rm
  6. Applied pow-sub0.0

    \[\leadsto \color{blue}{\frac{{\left(e^{-1}\right)}^{1}}{{\left(e^{-1}\right)}^{\left(x \cdot x\right)}}}\]
  7. Using strategy rm
  8. Applied pow-unpow0.0

    \[\leadsto \frac{{\left(e^{-1}\right)}^{1}}{\color{blue}{{\left({\left(e^{-1}\right)}^{x}\right)}^{x}}}\]
  9. Using strategy rm
  10. Applied pow-exp0.0

    \[\leadsto \frac{{\left(e^{-1}\right)}^{1}}{{\color{blue}{\left(e^{-1 \cdot x}\right)}}^{x}}\]
  11. Final simplification0.0

    \[\leadsto \frac{{\left(e^{-1}\right)}^{1}}{{\left(e^{-1 \cdot x}\right)}^{x}}\]

Reproduce

herbie shell --seed 2020078 
(FPCore (x)
  :name "exp neg sub"
  :precision binary64
  (exp (- (- 1 (* x x)))))