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

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 flip--0.0

    \[\leadsto e^{-\color{blue}{\frac{1 \cdot 1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{1 + x \cdot x}}}\]
  4. Simplified0.0

    \[\leadsto e^{-\frac{\color{blue}{\left(1 - {x}^{2}\right) \cdot \mathsf{fma}\left(x, x, 1\right)}}{1 + x \cdot x}}\]
  5. Simplified0.0

    \[\leadsto e^{-\frac{\left(1 - {x}^{2}\right) \cdot \mathsf{fma}\left(x, x, 1\right)}{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}}\]
  6. Final simplification0.0

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

Reproduce

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