Average Error: 0.0 → 0.0
Time: 3.4s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[e^{\left(-\sqrt{1}\right) \cdot \left(\sqrt{1} - x\right)} \cdot {\left(e^{-x}\right)}^{\left(\sqrt{1} - x\right)}\]
e^{-\left(1 - x \cdot x\right)}
e^{\left(-\sqrt{1}\right) \cdot \left(\sqrt{1} - x\right)} \cdot {\left(e^{-x}\right)}^{\left(\sqrt{1} - x\right)}
double code(double x) {
	return exp(-(1.0 - (x * x)));
}
double code(double x) {
	return (exp((-sqrt(1.0) * (sqrt(1.0) - x))) * pow(exp(-x), (sqrt(1.0) - 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 add-sqr-sqrt0.0

    \[\leadsto e^{-\left(\color{blue}{\sqrt{1} \cdot \sqrt{1}} - x \cdot x\right)}\]
  4. Applied difference-of-squares0.0

    \[\leadsto e^{-\color{blue}{\left(\sqrt{1} + x\right) \cdot \left(\sqrt{1} - x\right)}}\]
  5. Applied distribute-lft-neg-in0.0

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

    \[\leadsto \color{blue}{{\left(e^{-\left(\sqrt{1} + x\right)}\right)}^{\left(\sqrt{1} - x\right)}}\]
  7. Using strategy rm
  8. Applied distribute-neg-in0.0

    \[\leadsto {\left(e^{\color{blue}{\left(-\sqrt{1}\right) + \left(-x\right)}}\right)}^{\left(\sqrt{1} - x\right)}\]
  9. Applied exp-sum0.0

    \[\leadsto {\color{blue}{\left(e^{-\sqrt{1}} \cdot e^{-x}\right)}}^{\left(\sqrt{1} - x\right)}\]
  10. Applied unpow-prod-down0.0

    \[\leadsto \color{blue}{{\left(e^{-\sqrt{1}}\right)}^{\left(\sqrt{1} - x\right)} \cdot {\left(e^{-x}\right)}^{\left(\sqrt{1} - x\right)}}\]
  11. Using strategy rm
  12. Applied pow-exp0.0

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

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

Reproduce

herbie shell --seed 2020079 +o rules:numerics
(FPCore (x)
  :name "exp neg sub"
  :precision binary64
  (exp (- (- 1 (* x x)))))