exp neg sub

Percentage Accurate: 100.0% → 100.0%
Time: 5.9s
Alternatives: 11
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ e^{-\left(1 - x \cdot x\right)} \end{array} \]
(FPCore (x) :precision binary64 (exp (- (- 1.0 (* x x)))))
double code(double x) {
	return exp(-(1.0 - (x * x)));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = exp(-(1.0d0 - (x * x)))
end function
public static double code(double x) {
	return Math.exp(-(1.0 - (x * x)));
}
def code(x):
	return math.exp(-(1.0 - (x * x)))
function code(x)
	return exp(Float64(-Float64(1.0 - Float64(x * x))))
end
function tmp = code(x)
	tmp = exp(-(1.0 - (x * x)));
end
code[x_] := N[Exp[(-N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]
\begin{array}{l}

\\
e^{-\left(1 - x \cdot x\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ e^{-\left(1 - x \cdot x\right)} \end{array} \]
(FPCore (x) :precision binary64 (exp (- (- 1.0 (* x x)))))
double code(double x) {
	return exp(-(1.0 - (x * x)));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = exp(-(1.0d0 - (x * x)))
end function
public static double code(double x) {
	return Math.exp(-(1.0 - (x * x)));
}
def code(x):
	return math.exp(-(1.0 - (x * x)))
function code(x)
	return exp(Float64(-Float64(1.0 - Float64(x * x))))
end
function tmp = code(x)
	tmp = exp(-(1.0 - (x * x)));
end
code[x_] := N[Exp[(-N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]
\begin{array}{l}

\\
e^{-\left(1 - x \cdot x\right)}
\end{array}

Alternative 1: 100.0% accurate, 0.3× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} t_0 := e^{-x\_m}\\ \frac{--1}{\mathsf{E}\left(\right) \cdot {\left(t\_0 \cdot t\_0\right)}^{\left(0.5 \cdot x\_m\right)}} \end{array} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m)
 :precision binary64
 (let* ((t_0 (exp (- x_m))))
   (/ (- -1.0) (* (E) (pow (* t_0 t_0) (* 0.5 x_m))))))
\begin{array}{l}
x_m = \left|x\right|

\\
\begin{array}{l}
t_0 := e^{-x\_m}\\
\frac{--1}{\mathsf{E}\left(\right) \cdot {\left(t\_0 \cdot t\_0\right)}^{\left(0.5 \cdot x\_m\right)}}
\end{array}
\end{array}
Derivation
  1. Initial program 100.0%

    \[e^{-\left(1 - x \cdot x\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-exp.f64N/A

      \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
    2. lift-neg.f64N/A

      \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
    3. exp-negN/A

      \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
    4. lift--.f64N/A

      \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
    5. exp-diffN/A

      \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
    6. clear-numN/A

      \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
    7. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
    8. lift-*.f64N/A

      \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
    9. exp-prodN/A

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
    10. lower-pow.f64N/A

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
    11. lower-exp.f64N/A

      \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
    12. exp-1-eN/A

      \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
    13. lower-E.f64100.0

      \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
  4. Applied rewrites100.0%

    \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
  5. Step-by-step derivation
    1. /-rgt-identityN/A

      \[\leadsto \frac{\color{blue}{\frac{{\left(e^{x}\right)}^{x}}{1}}}{\mathsf{E}\left(\right)} \]
    2. clear-numN/A

      \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
    3. lift-pow.f64N/A

      \[\leadsto \frac{\frac{1}{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
    4. pow-flipN/A

      \[\leadsto \frac{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}}{\mathsf{E}\left(\right)} \]
    5. pow-flipN/A

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
    6. exp-to-powN/A

      \[\leadsto \frac{\color{blue}{e^{\log \left(e^{x}\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
    7. lift-exp.f64N/A

      \[\leadsto \frac{e^{\log \color{blue}{\left(e^{x}\right)} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
    8. rem-log-expN/A

      \[\leadsto \frac{e^{\color{blue}{x} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
    9. distribute-rgt-neg-inN/A

      \[\leadsto \frac{e^{\color{blue}{\mathsf{neg}\left(x \cdot \left(\mathsf{neg}\left(x\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
    10. distribute-lft-neg-inN/A

      \[\leadsto \frac{e^{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
    11. rem-log-expN/A

      \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\color{blue}{\log \left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    12. lift-exp.f64N/A

      \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\log \color{blue}{\left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    13. neg-logN/A

      \[\leadsto \frac{e^{\color{blue}{\log \left(\frac{1}{e^{x}}\right)} \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    14. exp-to-powN/A

      \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
    15. lower-pow.f64N/A

      \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
    16. inv-powN/A

      \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    17. lower-pow.f64N/A

      \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    18. lower-neg.f64100.0

      \[\leadsto \frac{{\left({\left(e^{x}\right)}^{-1}\right)}^{\color{blue}{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
  6. Applied rewrites100.0%

    \[\leadsto \frac{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
  7. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}}{\mathsf{E}\left(\right)}} \]
    2. div-invN/A

      \[\leadsto \color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)} \cdot \frac{1}{\mathsf{E}\left(\right)}} \]
    3. lift-pow.f64N/A

      \[\leadsto \color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}} \cdot \frac{1}{\mathsf{E}\left(\right)} \]
    4. lift-neg.f64N/A

      \[\leadsto {\left({\left(e^{x}\right)}^{-1}\right)}^{\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}} \cdot \frac{1}{\mathsf{E}\left(\right)} \]
    5. pow-negN/A

      \[\leadsto \color{blue}{\frac{1}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x}}} \cdot \frac{1}{\mathsf{E}\left(\right)} \]
    6. frac-2negN/A

      \[\leadsto \frac{1}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x}} \cdot \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\mathsf{E}\left(\right)\right)}} \]
    7. metadata-evalN/A

      \[\leadsto \frac{1}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x}} \cdot \frac{\color{blue}{-1}}{\mathsf{neg}\left(\mathsf{E}\left(\right)\right)} \]
    8. frac-timesN/A

      \[\leadsto \color{blue}{\frac{1 \cdot -1}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)}} \]
    9. metadata-evalN/A

      \[\leadsto \frac{\color{blue}{-1}}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    10. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{-1}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)}} \]
    11. lower-*.f64N/A

      \[\leadsto \frac{-1}{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)}} \]
    12. lower-pow.f64N/A

      \[\leadsto \frac{-1}{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x}} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    13. lift-pow.f64N/A

      \[\leadsto \frac{-1}{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    14. unpow-1N/A

      \[\leadsto \frac{-1}{{\color{blue}{\left(\frac{1}{e^{x}}\right)}}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    15. lift-exp.f64N/A

      \[\leadsto \frac{-1}{{\left(\frac{1}{\color{blue}{e^{x}}}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    16. rec-expN/A

      \[\leadsto \frac{-1}{{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)}\right)}}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    17. lift-neg.f64N/A

      \[\leadsto \frac{-1}{{\left(e^{\color{blue}{-x}}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    18. lower-exp.f64N/A

      \[\leadsto \frac{-1}{{\color{blue}{\left(e^{-x}\right)}}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    19. lower-neg.f64100.0

      \[\leadsto \frac{-1}{{\left(e^{-x}\right)}^{x} \cdot \color{blue}{\left(-\mathsf{E}\left(\right)\right)}} \]
  8. Applied rewrites100.0%

    \[\leadsto \color{blue}{\frac{-1}{{\left(e^{-x}\right)}^{x} \cdot \left(-\mathsf{E}\left(\right)\right)}} \]
  9. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \frac{-1}{\color{blue}{{\left(e^{-x}\right)}^{x}} \cdot \left(-\mathsf{E}\left(\right)\right)} \]
    2. sqr-powN/A

      \[\leadsto \frac{-1}{\color{blue}{\left({\left(e^{-x}\right)}^{\left(\frac{x}{2}\right)} \cdot {\left(e^{-x}\right)}^{\left(\frac{x}{2}\right)}\right)} \cdot \left(-\mathsf{E}\left(\right)\right)} \]
    3. pow-prod-downN/A

      \[\leadsto \frac{-1}{\color{blue}{{\left(e^{-x} \cdot e^{-x}\right)}^{\left(\frac{x}{2}\right)}} \cdot \left(-\mathsf{E}\left(\right)\right)} \]
    4. lower-pow.f64N/A

      \[\leadsto \frac{-1}{\color{blue}{{\left(e^{-x} \cdot e^{-x}\right)}^{\left(\frac{x}{2}\right)}} \cdot \left(-\mathsf{E}\left(\right)\right)} \]
    5. lower-*.f64N/A

      \[\leadsto \frac{-1}{{\color{blue}{\left(e^{-x} \cdot e^{-x}\right)}}^{\left(\frac{x}{2}\right)} \cdot \left(-\mathsf{E}\left(\right)\right)} \]
    6. div-invN/A

      \[\leadsto \frac{-1}{{\left(e^{-x} \cdot e^{-x}\right)}^{\color{blue}{\left(x \cdot \frac{1}{2}\right)}} \cdot \left(-\mathsf{E}\left(\right)\right)} \]
    7. metadata-evalN/A

      \[\leadsto \frac{-1}{{\left(e^{-x} \cdot e^{-x}\right)}^{\left(x \cdot \color{blue}{\frac{1}{2}}\right)} \cdot \left(-\mathsf{E}\left(\right)\right)} \]
    8. lower-*.f64100.0

      \[\leadsto \frac{-1}{{\left(e^{-x} \cdot e^{-x}\right)}^{\color{blue}{\left(x \cdot 0.5\right)}} \cdot \left(-\mathsf{E}\left(\right)\right)} \]
  10. Applied rewrites100.0%

    \[\leadsto \frac{-1}{\color{blue}{{\left(e^{-x} \cdot e^{-x}\right)}^{\left(x \cdot 0.5\right)}} \cdot \left(-\mathsf{E}\left(\right)\right)} \]
  11. Final simplification100.0%

    \[\leadsto \frac{--1}{\mathsf{E}\left(\right) \cdot {\left(e^{-x} \cdot e^{-x}\right)}^{\left(0.5 \cdot x\right)}} \]
  12. Add Preprocessing

Alternative 2: 100.0% accurate, 0.5× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \frac{--1}{{\left(e^{-x\_m}\right)}^{x\_m} \cdot \mathsf{E}\left(\right)} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m) :precision binary64 (/ (- -1.0) (* (pow (exp (- x_m)) x_m) (E))))
\begin{array}{l}
x_m = \left|x\right|

\\
\frac{--1}{{\left(e^{-x\_m}\right)}^{x\_m} \cdot \mathsf{E}\left(\right)}
\end{array}
Derivation
  1. Initial program 100.0%

    \[e^{-\left(1 - x \cdot x\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-exp.f64N/A

      \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
    2. lift-neg.f64N/A

      \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
    3. exp-negN/A

      \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
    4. lift--.f64N/A

      \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
    5. exp-diffN/A

      \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
    6. clear-numN/A

      \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
    7. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
    8. lift-*.f64N/A

      \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
    9. exp-prodN/A

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
    10. lower-pow.f64N/A

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
    11. lower-exp.f64N/A

      \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
    12. exp-1-eN/A

      \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
    13. lower-E.f64100.0

      \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
  4. Applied rewrites100.0%

    \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
  5. Step-by-step derivation
    1. /-rgt-identityN/A

      \[\leadsto \frac{\color{blue}{\frac{{\left(e^{x}\right)}^{x}}{1}}}{\mathsf{E}\left(\right)} \]
    2. clear-numN/A

      \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
    3. lift-pow.f64N/A

      \[\leadsto \frac{\frac{1}{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
    4. pow-flipN/A

      \[\leadsto \frac{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}}{\mathsf{E}\left(\right)} \]
    5. pow-flipN/A

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
    6. exp-to-powN/A

      \[\leadsto \frac{\color{blue}{e^{\log \left(e^{x}\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
    7. lift-exp.f64N/A

      \[\leadsto \frac{e^{\log \color{blue}{\left(e^{x}\right)} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
    8. rem-log-expN/A

      \[\leadsto \frac{e^{\color{blue}{x} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
    9. distribute-rgt-neg-inN/A

      \[\leadsto \frac{e^{\color{blue}{\mathsf{neg}\left(x \cdot \left(\mathsf{neg}\left(x\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
    10. distribute-lft-neg-inN/A

      \[\leadsto \frac{e^{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
    11. rem-log-expN/A

      \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\color{blue}{\log \left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    12. lift-exp.f64N/A

      \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\log \color{blue}{\left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    13. neg-logN/A

      \[\leadsto \frac{e^{\color{blue}{\log \left(\frac{1}{e^{x}}\right)} \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    14. exp-to-powN/A

      \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
    15. lower-pow.f64N/A

      \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
    16. inv-powN/A

      \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    17. lower-pow.f64N/A

      \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    18. lower-neg.f64100.0

      \[\leadsto \frac{{\left({\left(e^{x}\right)}^{-1}\right)}^{\color{blue}{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
  6. Applied rewrites100.0%

    \[\leadsto \frac{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
  7. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}}{\mathsf{E}\left(\right)}} \]
    2. div-invN/A

      \[\leadsto \color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)} \cdot \frac{1}{\mathsf{E}\left(\right)}} \]
    3. lift-pow.f64N/A

      \[\leadsto \color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}} \cdot \frac{1}{\mathsf{E}\left(\right)} \]
    4. lift-neg.f64N/A

      \[\leadsto {\left({\left(e^{x}\right)}^{-1}\right)}^{\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}} \cdot \frac{1}{\mathsf{E}\left(\right)} \]
    5. pow-negN/A

      \[\leadsto \color{blue}{\frac{1}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x}}} \cdot \frac{1}{\mathsf{E}\left(\right)} \]
    6. frac-2negN/A

      \[\leadsto \frac{1}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x}} \cdot \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\mathsf{E}\left(\right)\right)}} \]
    7. metadata-evalN/A

      \[\leadsto \frac{1}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x}} \cdot \frac{\color{blue}{-1}}{\mathsf{neg}\left(\mathsf{E}\left(\right)\right)} \]
    8. frac-timesN/A

      \[\leadsto \color{blue}{\frac{1 \cdot -1}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)}} \]
    9. metadata-evalN/A

      \[\leadsto \frac{\color{blue}{-1}}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    10. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{-1}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)}} \]
    11. lower-*.f64N/A

      \[\leadsto \frac{-1}{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)}} \]
    12. lower-pow.f64N/A

      \[\leadsto \frac{-1}{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{x}} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    13. lift-pow.f64N/A

      \[\leadsto \frac{-1}{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    14. unpow-1N/A

      \[\leadsto \frac{-1}{{\color{blue}{\left(\frac{1}{e^{x}}\right)}}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    15. lift-exp.f64N/A

      \[\leadsto \frac{-1}{{\left(\frac{1}{\color{blue}{e^{x}}}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    16. rec-expN/A

      \[\leadsto \frac{-1}{{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)}\right)}}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    17. lift-neg.f64N/A

      \[\leadsto \frac{-1}{{\left(e^{\color{blue}{-x}}\right)}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    18. lower-exp.f64N/A

      \[\leadsto \frac{-1}{{\color{blue}{\left(e^{-x}\right)}}^{x} \cdot \left(\mathsf{neg}\left(\mathsf{E}\left(\right)\right)\right)} \]
    19. lower-neg.f64100.0

      \[\leadsto \frac{-1}{{\left(e^{-x}\right)}^{x} \cdot \color{blue}{\left(-\mathsf{E}\left(\right)\right)}} \]
  8. Applied rewrites100.0%

    \[\leadsto \color{blue}{\frac{-1}{{\left(e^{-x}\right)}^{x} \cdot \left(-\mathsf{E}\left(\right)\right)}} \]
  9. Final simplification100.0%

    \[\leadsto \frac{--1}{{\left(e^{-x}\right)}^{x} \cdot \mathsf{E}\left(\right)} \]
  10. Add Preprocessing

Alternative 3: 100.0% accurate, 0.5× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \frac{{\left(e^{-x\_m}\right)}^{\left(-x\_m\right)}}{\mathsf{E}\left(\right)} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m) :precision binary64 (/ (pow (exp (- x_m)) (- x_m)) (E)))
\begin{array}{l}
x_m = \left|x\right|

\\
\frac{{\left(e^{-x\_m}\right)}^{\left(-x\_m\right)}}{\mathsf{E}\left(\right)}
\end{array}
Derivation
  1. Initial program 100.0%

    \[e^{-\left(1 - x \cdot x\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-exp.f64N/A

      \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
    2. lift-neg.f64N/A

      \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
    3. exp-negN/A

      \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
    4. lift--.f64N/A

      \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
    5. exp-diffN/A

      \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
    6. clear-numN/A

      \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
    7. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
    8. lift-*.f64N/A

      \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
    9. exp-prodN/A

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
    10. lower-pow.f64N/A

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
    11. lower-exp.f64N/A

      \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
    12. exp-1-eN/A

      \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
    13. lower-E.f64100.0

      \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
  4. Applied rewrites100.0%

    \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
  5. Step-by-step derivation
    1. /-rgt-identityN/A

      \[\leadsto \frac{\color{blue}{\frac{{\left(e^{x}\right)}^{x}}{1}}}{\mathsf{E}\left(\right)} \]
    2. clear-numN/A

      \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
    3. lift-pow.f64N/A

      \[\leadsto \frac{\frac{1}{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
    4. pow-flipN/A

      \[\leadsto \frac{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}}{\mathsf{E}\left(\right)} \]
    5. pow-flipN/A

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
    6. exp-to-powN/A

      \[\leadsto \frac{\color{blue}{e^{\log \left(e^{x}\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
    7. lift-exp.f64N/A

      \[\leadsto \frac{e^{\log \color{blue}{\left(e^{x}\right)} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
    8. rem-log-expN/A

      \[\leadsto \frac{e^{\color{blue}{x} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
    9. distribute-rgt-neg-inN/A

      \[\leadsto \frac{e^{\color{blue}{\mathsf{neg}\left(x \cdot \left(\mathsf{neg}\left(x\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
    10. distribute-lft-neg-inN/A

      \[\leadsto \frac{e^{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
    11. rem-log-expN/A

      \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\color{blue}{\log \left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    12. lift-exp.f64N/A

      \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\log \color{blue}{\left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    13. neg-logN/A

      \[\leadsto \frac{e^{\color{blue}{\log \left(\frac{1}{e^{x}}\right)} \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    14. exp-to-powN/A

      \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
    15. lower-pow.f64N/A

      \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
    16. inv-powN/A

      \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    17. lower-pow.f64N/A

      \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
    18. lower-neg.f64100.0

      \[\leadsto \frac{{\left({\left(e^{x}\right)}^{-1}\right)}^{\color{blue}{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
  6. Applied rewrites100.0%

    \[\leadsto \frac{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
  7. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(-x\right)}}{\mathsf{E}\left(\right)} \]
    2. unpow-1N/A

      \[\leadsto \frac{{\color{blue}{\left(\frac{1}{e^{x}}\right)}}^{\left(-x\right)}}{\mathsf{E}\left(\right)} \]
    3. lift-exp.f64N/A

      \[\leadsto \frac{{\left(\frac{1}{\color{blue}{e^{x}}}\right)}^{\left(-x\right)}}{\mathsf{E}\left(\right)} \]
    4. rec-expN/A

      \[\leadsto \frac{{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)}\right)}}^{\left(-x\right)}}{\mathsf{E}\left(\right)} \]
    5. lift-neg.f64N/A

      \[\leadsto \frac{{\left(e^{\color{blue}{-x}}\right)}^{\left(-x\right)}}{\mathsf{E}\left(\right)} \]
    6. lower-exp.f64100.0

      \[\leadsto \frac{{\color{blue}{\left(e^{-x}\right)}}^{\left(-x\right)}}{\mathsf{E}\left(\right)} \]
  8. Applied rewrites100.0%

    \[\leadsto \frac{{\color{blue}{\left(e^{-x}\right)}}^{\left(-x\right)}}{\mathsf{E}\left(\right)} \]
  9. Add Preprocessing

Alternative 4: 100.0% accurate, 0.5× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \frac{{\left(e^{x\_m}\right)}^{x\_m}}{\mathsf{E}\left(\right)} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m) :precision binary64 (/ (pow (exp x_m) x_m) (E)))
\begin{array}{l}
x_m = \left|x\right|

\\
\frac{{\left(e^{x\_m}\right)}^{x\_m}}{\mathsf{E}\left(\right)}
\end{array}
Derivation
  1. Initial program 100.0%

    \[e^{-\left(1 - x \cdot x\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-exp.f64N/A

      \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
    2. lift-neg.f64N/A

      \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
    3. exp-negN/A

      \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
    4. lift--.f64N/A

      \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
    5. exp-diffN/A

      \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
    6. clear-numN/A

      \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
    7. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
    8. lift-*.f64N/A

      \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
    9. exp-prodN/A

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
    10. lower-pow.f64N/A

      \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
    11. lower-exp.f64N/A

      \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
    12. exp-1-eN/A

      \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
    13. lower-E.f64100.0

      \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
  4. Applied rewrites100.0%

    \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
  5. Add Preprocessing

Alternative 5: 99.5% accurate, 0.9× speedup?

\[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;x\_m \cdot x\_m \leq 0.0002:\\ \;\;\;\;\frac{1}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x\_m, x\_m, 1\right)}}\\ \mathbf{else}:\\ \;\;\;\;e^{x\_m \cdot x\_m}\\ \end{array} \end{array} \]
x_m = (fabs.f64 x)
(FPCore (x_m)
 :precision binary64
 (if (<= (* x_m x_m) 0.0002)
   (/ 1.0 (/ (E) (fma x_m x_m 1.0)))
   (exp (* x_m x_m))))
\begin{array}{l}
x_m = \left|x\right|

\\
\begin{array}{l}
\mathbf{if}\;x\_m \cdot x\_m \leq 0.0002:\\
\;\;\;\;\frac{1}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x\_m, x\_m, 1\right)}}\\

\mathbf{else}:\\
\;\;\;\;e^{x\_m \cdot x\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x x) < 2.0000000000000001e-4

    1. Initial program 100.0%

      \[e^{-\left(1 - x \cdot x\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-exp.f64N/A

        \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
      2. lift-neg.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
      3. exp-negN/A

        \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
      4. lift--.f64N/A

        \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
      5. exp-diffN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
      6. clear-numN/A

        \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
      8. lift-*.f64N/A

        \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
      9. exp-prodN/A

        \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
      10. lower-pow.f64N/A

        \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
      11. lower-exp.f64N/A

        \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
      12. exp-1-eN/A

        \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
      13. lower-E.f64100.0

        \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
    4. Applied rewrites100.0%

      \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
    5. Step-by-step derivation
      1. /-rgt-identityN/A

        \[\leadsto \frac{\color{blue}{\frac{{\left(e^{x}\right)}^{x}}{1}}}{\mathsf{E}\left(\right)} \]
      2. clear-numN/A

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{\frac{1}{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
      4. pow-flipN/A

        \[\leadsto \frac{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}}{\mathsf{E}\left(\right)} \]
      5. pow-flipN/A

        \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
      6. exp-to-powN/A

        \[\leadsto \frac{\color{blue}{e^{\log \left(e^{x}\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
      7. lift-exp.f64N/A

        \[\leadsto \frac{e^{\log \color{blue}{\left(e^{x}\right)} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
      8. rem-log-expN/A

        \[\leadsto \frac{e^{\color{blue}{x} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
      9. distribute-rgt-neg-inN/A

        \[\leadsto \frac{e^{\color{blue}{\mathsf{neg}\left(x \cdot \left(\mathsf{neg}\left(x\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
      10. distribute-lft-neg-inN/A

        \[\leadsto \frac{e^{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
      11. rem-log-expN/A

        \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\color{blue}{\log \left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
      12. lift-exp.f64N/A

        \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\log \color{blue}{\left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
      13. neg-logN/A

        \[\leadsto \frac{e^{\color{blue}{\log \left(\frac{1}{e^{x}}\right)} \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
      14. exp-to-powN/A

        \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
      15. lower-pow.f64N/A

        \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
      16. inv-powN/A

        \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
      17. lower-pow.f64N/A

        \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
      18. lower-neg.f64100.0

        \[\leadsto \frac{{\left({\left(e^{x}\right)}^{-1}\right)}^{\color{blue}{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
    6. Applied rewrites100.0%

      \[\leadsto \frac{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
    7. Taylor expanded in x around 0

      \[\leadsto \frac{\color{blue}{1 + {x}^{2}}}{\mathsf{E}\left(\right)} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{{x}^{2} + 1}}{\mathsf{E}\left(\right)} \]
      2. unpow2N/A

        \[\leadsto \frac{\color{blue}{x \cdot x} + 1}{\mathsf{E}\left(\right)} \]
      3. lower-fma.f6499.7

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
    9. Applied rewrites99.7%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, x, 1\right)}{\mathsf{E}\left(\right)}} \]
      2. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x, x, 1\right)}}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x, x, 1\right)}}} \]
      4. lower-/.f6499.7

        \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x, x, 1\right)}}} \]
    11. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x, x, 1\right)}}} \]

    if 2.0000000000000001e-4 < (*.f64 x x)

    1. Initial program 99.9%

      \[e^{-\left(1 - x \cdot x\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto e^{\color{blue}{-1}} \]
    4. Step-by-step derivation
      1. Applied rewrites3.1%

        \[\leadsto e^{\color{blue}{-1}} \]
      2. Taylor expanded in x around inf

        \[\leadsto e^{\color{blue}{{x}^{2}}} \]
      3. Step-by-step derivation
        1. unpow2N/A

          \[\leadsto e^{\color{blue}{x \cdot x}} \]
        2. lower-*.f6499.3

          \[\leadsto e^{\color{blue}{x \cdot x}} \]
      4. Applied rewrites99.3%

        \[\leadsto e^{\color{blue}{x \cdot x}} \]
    5. Recombined 2 regimes into one program.
    6. Add Preprocessing

    Alternative 6: 100.0% accurate, 1.0× speedup?

    \[\begin{array}{l} x_m = \left|x\right| \\ e^{\mathsf{fma}\left(x\_m, x\_m, -1\right)} \end{array} \]
    x_m = (fabs.f64 x)
    (FPCore (x_m) :precision binary64 (exp (fma x_m x_m -1.0)))
    x_m = fabs(x);
    double code(double x_m) {
    	return exp(fma(x_m, x_m, -1.0));
    }
    
    x_m = abs(x)
    function code(x_m)
    	return exp(fma(x_m, x_m, -1.0))
    end
    
    x_m = N[Abs[x], $MachinePrecision]
    code[x$95$m_] := N[Exp[N[(x$95$m * x$95$m + -1.0), $MachinePrecision]], $MachinePrecision]
    
    \begin{array}{l}
    x_m = \left|x\right|
    
    \\
    e^{\mathsf{fma}\left(x\_m, x\_m, -1\right)}
    \end{array}
    
    Derivation
    1. Initial program 100.0%

      \[e^{-\left(1 - x \cdot x\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-neg.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
      2. neg-sub0N/A

        \[\leadsto e^{\color{blue}{0 - \left(1 - x \cdot x\right)}} \]
      3. lift--.f64N/A

        \[\leadsto e^{0 - \color{blue}{\left(1 - x \cdot x\right)}} \]
      4. associate--r-N/A

        \[\leadsto e^{\color{blue}{\left(0 - 1\right) + x \cdot x}} \]
      5. metadata-evalN/A

        \[\leadsto e^{\color{blue}{-1} + x \cdot x} \]
      6. +-commutativeN/A

        \[\leadsto e^{\color{blue}{x \cdot x + -1}} \]
      7. lift-*.f64N/A

        \[\leadsto e^{\color{blue}{x \cdot x} + -1} \]
      8. lower-fma.f64100.0

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}} \]
    4. Applied rewrites100.0%

      \[\leadsto e^{\color{blue}{\mathsf{fma}\left(x, x, -1\right)}} \]
    5. Add Preprocessing

    Alternative 7: 86.4% accurate, 1.8× speedup?

    \[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;x\_m \cdot x\_m \leq 5 \cdot 10^{+293}:\\ \;\;\;\;\frac{\frac{1 - \left(x\_m \cdot x\_m\right) \cdot \left(x\_m \cdot x\_m\right)}{1 - x\_m \cdot x\_m}}{\mathsf{E}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m \cdot x\_m}{\mathsf{E}\left(\right)}\\ \end{array} \end{array} \]
    x_m = (fabs.f64 x)
    (FPCore (x_m)
     :precision binary64
     (if (<= (* x_m x_m) 5e+293)
       (/ (/ (- 1.0 (* (* x_m x_m) (* x_m x_m))) (- 1.0 (* x_m x_m))) (E))
       (/ (* x_m x_m) (E))))
    \begin{array}{l}
    x_m = \left|x\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x\_m \cdot x\_m \leq 5 \cdot 10^{+293}:\\
    \;\;\;\;\frac{\frac{1 - \left(x\_m \cdot x\_m\right) \cdot \left(x\_m \cdot x\_m\right)}{1 - x\_m \cdot x\_m}}{\mathsf{E}\left(\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x\_m \cdot x\_m}{\mathsf{E}\left(\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 x x) < 5.00000000000000033e293

      1. Initial program 100.0%

        \[e^{-\left(1 - x \cdot x\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-exp.f64N/A

          \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
        2. lift-neg.f64N/A

          \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
        3. exp-negN/A

          \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
        4. lift--.f64N/A

          \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
        5. exp-diffN/A

          \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
        6. clear-numN/A

          \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
        7. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
        8. lift-*.f64N/A

          \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
        9. exp-prodN/A

          \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
        10. lower-pow.f64N/A

          \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
        11. lower-exp.f64N/A

          \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
        12. exp-1-eN/A

          \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
        13. lower-E.f64100.0

          \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
      4. Applied rewrites100.0%

        \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
      5. Step-by-step derivation
        1. /-rgt-identityN/A

          \[\leadsto \frac{\color{blue}{\frac{{\left(e^{x}\right)}^{x}}{1}}}{\mathsf{E}\left(\right)} \]
        2. clear-numN/A

          \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
        3. lift-pow.f64N/A

          \[\leadsto \frac{\frac{1}{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
        4. pow-flipN/A

          \[\leadsto \frac{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}}{\mathsf{E}\left(\right)} \]
        5. pow-flipN/A

          \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
        6. exp-to-powN/A

          \[\leadsto \frac{\color{blue}{e^{\log \left(e^{x}\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
        7. lift-exp.f64N/A

          \[\leadsto \frac{e^{\log \color{blue}{\left(e^{x}\right)} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
        8. rem-log-expN/A

          \[\leadsto \frac{e^{\color{blue}{x} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
        9. distribute-rgt-neg-inN/A

          \[\leadsto \frac{e^{\color{blue}{\mathsf{neg}\left(x \cdot \left(\mathsf{neg}\left(x\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
        10. distribute-lft-neg-inN/A

          \[\leadsto \frac{e^{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
        11. rem-log-expN/A

          \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\color{blue}{\log \left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
        12. lift-exp.f64N/A

          \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\log \color{blue}{\left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
        13. neg-logN/A

          \[\leadsto \frac{e^{\color{blue}{\log \left(\frac{1}{e^{x}}\right)} \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
        14. exp-to-powN/A

          \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
        15. lower-pow.f64N/A

          \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
        16. inv-powN/A

          \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
        17. lower-pow.f64N/A

          \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
        18. lower-neg.f64100.0

          \[\leadsto \frac{{\left({\left(e^{x}\right)}^{-1}\right)}^{\color{blue}{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
      6. Applied rewrites100.0%

        \[\leadsto \frac{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
      7. Taylor expanded in x around 0

        \[\leadsto \frac{\color{blue}{1 + {x}^{2}}}{\mathsf{E}\left(\right)} \]
      8. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \frac{\color{blue}{{x}^{2} + 1}}{\mathsf{E}\left(\right)} \]
        2. unpow2N/A

          \[\leadsto \frac{\color{blue}{x \cdot x} + 1}{\mathsf{E}\left(\right)} \]
        3. lower-fma.f6471.2

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
      9. Applied rewrites71.2%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
      10. Step-by-step derivation
        1. Applied rewrites84.1%

          \[\leadsto \frac{\frac{1 - \left(\left(-x\right) \cdot x\right) \cdot \left(\left(-x\right) \cdot x\right)}{\color{blue}{1 - x \cdot x}}}{\mathsf{E}\left(\right)} \]

        if 5.00000000000000033e293 < (*.f64 x x)

        1. Initial program 100.0%

          \[e^{-\left(1 - x \cdot x\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-exp.f64N/A

            \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
          2. lift-neg.f64N/A

            \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
          3. exp-negN/A

            \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
          4. lift--.f64N/A

            \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
          5. exp-diffN/A

            \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
          6. clear-numN/A

            \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
          7. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
          8. lift-*.f64N/A

            \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
          9. exp-prodN/A

            \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
          10. lower-pow.f64N/A

            \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
          11. lower-exp.f64N/A

            \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
          12. exp-1-eN/A

            \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
          13. lower-E.f64100.0

            \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
        4. Applied rewrites100.0%

          \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
        5. Step-by-step derivation
          1. /-rgt-identityN/A

            \[\leadsto \frac{\color{blue}{\frac{{\left(e^{x}\right)}^{x}}{1}}}{\mathsf{E}\left(\right)} \]
          2. clear-numN/A

            \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
          3. lift-pow.f64N/A

            \[\leadsto \frac{\frac{1}{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
          4. pow-flipN/A

            \[\leadsto \frac{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}}{\mathsf{E}\left(\right)} \]
          5. pow-flipN/A

            \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
          6. exp-to-powN/A

            \[\leadsto \frac{\color{blue}{e^{\log \left(e^{x}\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
          7. lift-exp.f64N/A

            \[\leadsto \frac{e^{\log \color{blue}{\left(e^{x}\right)} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
          8. rem-log-expN/A

            \[\leadsto \frac{e^{\color{blue}{x} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
          9. distribute-rgt-neg-inN/A

            \[\leadsto \frac{e^{\color{blue}{\mathsf{neg}\left(x \cdot \left(\mathsf{neg}\left(x\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
          10. distribute-lft-neg-inN/A

            \[\leadsto \frac{e^{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
          11. rem-log-expN/A

            \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\color{blue}{\log \left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
          12. lift-exp.f64N/A

            \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\log \color{blue}{\left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
          13. neg-logN/A

            \[\leadsto \frac{e^{\color{blue}{\log \left(\frac{1}{e^{x}}\right)} \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
          14. exp-to-powN/A

            \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
          15. lower-pow.f64N/A

            \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
          16. inv-powN/A

            \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
          17. lower-pow.f64N/A

            \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
          18. lower-neg.f64100.0

            \[\leadsto \frac{{\left({\left(e^{x}\right)}^{-1}\right)}^{\color{blue}{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
        6. Applied rewrites100.0%

          \[\leadsto \frac{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
        7. Taylor expanded in x around 0

          \[\leadsto \frac{\color{blue}{1 + {x}^{2}}}{\mathsf{E}\left(\right)} \]
        8. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \frac{\color{blue}{{x}^{2} + 1}}{\mathsf{E}\left(\right)} \]
          2. unpow2N/A

            \[\leadsto \frac{\color{blue}{x \cdot x} + 1}{\mathsf{E}\left(\right)} \]
          3. lower-fma.f64100.0

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
        9. Applied rewrites100.0%

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
        10. Taylor expanded in x around inf

          \[\leadsto \frac{{x}^{\color{blue}{2}}}{\mathsf{E}\left(\right)} \]
        11. Step-by-step derivation
          1. Applied rewrites100.0%

            \[\leadsto \frac{x \cdot \color{blue}{x}}{\mathsf{E}\left(\right)} \]
        12. Recombined 2 regimes into one program.
        13. Final simplification87.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{+293}:\\ \;\;\;\;\frac{\frac{1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}{1 - x \cdot x}}{\mathsf{E}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot x}{\mathsf{E}\left(\right)}\\ \end{array} \]
        14. Add Preprocessing

        Alternative 8: 76.0% accurate, 3.8× speedup?

        \[\begin{array}{l} x_m = \left|x\right| \\ \frac{1}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x\_m, x\_m, 1\right)}} \end{array} \]
        x_m = (fabs.f64 x)
        (FPCore (x_m) :precision binary64 (/ 1.0 (/ (E) (fma x_m x_m 1.0))))
        \begin{array}{l}
        x_m = \left|x\right|
        
        \\
        \frac{1}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x\_m, x\_m, 1\right)}}
        \end{array}
        
        Derivation
        1. Initial program 100.0%

          \[e^{-\left(1 - x \cdot x\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-exp.f64N/A

            \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
          2. lift-neg.f64N/A

            \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
          3. exp-negN/A

            \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
          4. lift--.f64N/A

            \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
          5. exp-diffN/A

            \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
          6. clear-numN/A

            \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
          7. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
          8. lift-*.f64N/A

            \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
          9. exp-prodN/A

            \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
          10. lower-pow.f64N/A

            \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
          11. lower-exp.f64N/A

            \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
          12. exp-1-eN/A

            \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
          13. lower-E.f64100.0

            \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
        4. Applied rewrites100.0%

          \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
        5. Step-by-step derivation
          1. /-rgt-identityN/A

            \[\leadsto \frac{\color{blue}{\frac{{\left(e^{x}\right)}^{x}}{1}}}{\mathsf{E}\left(\right)} \]
          2. clear-numN/A

            \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
          3. lift-pow.f64N/A

            \[\leadsto \frac{\frac{1}{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
          4. pow-flipN/A

            \[\leadsto \frac{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}}{\mathsf{E}\left(\right)} \]
          5. pow-flipN/A

            \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
          6. exp-to-powN/A

            \[\leadsto \frac{\color{blue}{e^{\log \left(e^{x}\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
          7. lift-exp.f64N/A

            \[\leadsto \frac{e^{\log \color{blue}{\left(e^{x}\right)} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
          8. rem-log-expN/A

            \[\leadsto \frac{e^{\color{blue}{x} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
          9. distribute-rgt-neg-inN/A

            \[\leadsto \frac{e^{\color{blue}{\mathsf{neg}\left(x \cdot \left(\mathsf{neg}\left(x\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
          10. distribute-lft-neg-inN/A

            \[\leadsto \frac{e^{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
          11. rem-log-expN/A

            \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\color{blue}{\log \left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
          12. lift-exp.f64N/A

            \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\log \color{blue}{\left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
          13. neg-logN/A

            \[\leadsto \frac{e^{\color{blue}{\log \left(\frac{1}{e^{x}}\right)} \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
          14. exp-to-powN/A

            \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
          15. lower-pow.f64N/A

            \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
          16. inv-powN/A

            \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
          17. lower-pow.f64N/A

            \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
          18. lower-neg.f64100.0

            \[\leadsto \frac{{\left({\left(e^{x}\right)}^{-1}\right)}^{\color{blue}{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
        6. Applied rewrites100.0%

          \[\leadsto \frac{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
        7. Taylor expanded in x around 0

          \[\leadsto \frac{\color{blue}{1 + {x}^{2}}}{\mathsf{E}\left(\right)} \]
        8. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \frac{\color{blue}{{x}^{2} + 1}}{\mathsf{E}\left(\right)} \]
          2. unpow2N/A

            \[\leadsto \frac{\color{blue}{x \cdot x} + 1}{\mathsf{E}\left(\right)} \]
          3. lower-fma.f6478.0

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
        9. Applied rewrites78.0%

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
        10. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, x, 1\right)}{\mathsf{E}\left(\right)}} \]
          2. clear-numN/A

            \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x, x, 1\right)}}} \]
          3. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x, x, 1\right)}}} \]
          4. lower-/.f6478.0

            \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x, x, 1\right)}}} \]
        11. Applied rewrites78.0%

          \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{E}\left(\right)}{\mathsf{fma}\left(x, x, 1\right)}}} \]
        12. Add Preprocessing

        Alternative 9: 75.8% accurate, 4.0× speedup?

        \[\begin{array}{l} x_m = \left|x\right| \\ \begin{array}{l} \mathbf{if}\;x\_m \cdot x\_m \leq 1:\\ \;\;\;\;\frac{1}{\mathsf{E}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m \cdot x\_m}{\mathsf{E}\left(\right)}\\ \end{array} \end{array} \]
        x_m = (fabs.f64 x)
        (FPCore (x_m)
         :precision binary64
         (if (<= (* x_m x_m) 1.0) (/ 1.0 (E)) (/ (* x_m x_m) (E))))
        \begin{array}{l}
        x_m = \left|x\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;x\_m \cdot x\_m \leq 1:\\
        \;\;\;\;\frac{1}{\mathsf{E}\left(\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{x\_m \cdot x\_m}{\mathsf{E}\left(\right)}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 x x) < 1

          1. Initial program 100.0%

            \[e^{-\left(1 - x \cdot x\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-exp.f64N/A

              \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
            2. lift-neg.f64N/A

              \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
            3. exp-negN/A

              \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
            4. lift--.f64N/A

              \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
            5. exp-diffN/A

              \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
            6. clear-numN/A

              \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
            7. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
            8. lift-*.f64N/A

              \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
            9. exp-prodN/A

              \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
            10. lower-pow.f64N/A

              \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
            11. lower-exp.f64N/A

              \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
            12. exp-1-eN/A

              \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
            13. lower-E.f64100.0

              \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
          4. Applied rewrites100.0%

            \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
          5. Taylor expanded in x around 0

            \[\leadsto \frac{\color{blue}{1}}{\mathsf{E}\left(\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites99.2%

              \[\leadsto \frac{\color{blue}{1}}{\mathsf{E}\left(\right)} \]

            if 1 < (*.f64 x x)

            1. Initial program 99.9%

              \[e^{-\left(1 - x \cdot x\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-exp.f64N/A

                \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
              2. lift-neg.f64N/A

                \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
              3. exp-negN/A

                \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
              4. lift--.f64N/A

                \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
              5. exp-diffN/A

                \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
              6. clear-numN/A

                \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
              7. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
              8. lift-*.f64N/A

                \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
              9. exp-prodN/A

                \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
              10. lower-pow.f64N/A

                \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
              11. lower-exp.f64N/A

                \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
              12. exp-1-eN/A

                \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
              13. lower-E.f64100.0

                \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
            4. Applied rewrites100.0%

              \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
            5. Step-by-step derivation
              1. /-rgt-identityN/A

                \[\leadsto \frac{\color{blue}{\frac{{\left(e^{x}\right)}^{x}}{1}}}{\mathsf{E}\left(\right)} \]
              2. clear-numN/A

                \[\leadsto \frac{\color{blue}{\frac{1}{\frac{1}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
              3. lift-pow.f64N/A

                \[\leadsto \frac{\frac{1}{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{x}}}}}{\mathsf{E}\left(\right)} \]
              4. pow-flipN/A

                \[\leadsto \frac{\frac{1}{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}}{\mathsf{E}\left(\right)} \]
              5. pow-flipN/A

                \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
              6. exp-to-powN/A

                \[\leadsto \frac{\color{blue}{e^{\log \left(e^{x}\right) \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
              7. lift-exp.f64N/A

                \[\leadsto \frac{e^{\log \color{blue}{\left(e^{x}\right)} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
              8. rem-log-expN/A

                \[\leadsto \frac{e^{\color{blue}{x} \cdot \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)}}{\mathsf{E}\left(\right)} \]
              9. distribute-rgt-neg-inN/A

                \[\leadsto \frac{e^{\color{blue}{\mathsf{neg}\left(x \cdot \left(\mathsf{neg}\left(x\right)\right)\right)}}}{\mathsf{E}\left(\right)} \]
              10. distribute-lft-neg-inN/A

                \[\leadsto \frac{e^{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
              11. rem-log-expN/A

                \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\color{blue}{\log \left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
              12. lift-exp.f64N/A

                \[\leadsto \frac{e^{\left(\mathsf{neg}\left(\log \color{blue}{\left(e^{x}\right)}\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
              13. neg-logN/A

                \[\leadsto \frac{e^{\color{blue}{\log \left(\frac{1}{e^{x}}\right)} \cdot \left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
              14. exp-to-powN/A

                \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
              15. lower-pow.f64N/A

                \[\leadsto \frac{\color{blue}{{\left(\frac{1}{e^{x}}\right)}^{\left(\mathsf{neg}\left(x\right)\right)}}}{\mathsf{E}\left(\right)} \]
              16. inv-powN/A

                \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
              17. lower-pow.f64N/A

                \[\leadsto \frac{{\color{blue}{\left({\left(e^{x}\right)}^{-1}\right)}}^{\left(\mathsf{neg}\left(x\right)\right)}}{\mathsf{E}\left(\right)} \]
              18. lower-neg.f64100.0

                \[\leadsto \frac{{\left({\left(e^{x}\right)}^{-1}\right)}^{\color{blue}{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
            6. Applied rewrites100.0%

              \[\leadsto \frac{\color{blue}{{\left({\left(e^{x}\right)}^{-1}\right)}^{\left(-x\right)}}}{\mathsf{E}\left(\right)} \]
            7. Taylor expanded in x around 0

              \[\leadsto \frac{\color{blue}{1 + {x}^{2}}}{\mathsf{E}\left(\right)} \]
            8. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \frac{\color{blue}{{x}^{2} + 1}}{\mathsf{E}\left(\right)} \]
              2. unpow2N/A

                \[\leadsto \frac{\color{blue}{x \cdot x} + 1}{\mathsf{E}\left(\right)} \]
              3. lower-fma.f6453.0

                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
            9. Applied rewrites53.0%

              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
            10. Taylor expanded in x around inf

              \[\leadsto \frac{{x}^{\color{blue}{2}}}{\mathsf{E}\left(\right)} \]
            11. Step-by-step derivation
              1. Applied rewrites53.0%

                \[\leadsto \frac{x \cdot \color{blue}{x}}{\mathsf{E}\left(\right)} \]
            12. Recombined 2 regimes into one program.
            13. Add Preprocessing

            Alternative 10: 76.0% accurate, 6.2× speedup?

            \[\begin{array}{l} x_m = \left|x\right| \\ \frac{\mathsf{fma}\left(x\_m, x\_m, 1\right)}{\mathsf{E}\left(\right)} \end{array} \]
            x_m = (fabs.f64 x)
            (FPCore (x_m) :precision binary64 (/ (fma x_m x_m 1.0) (E)))
            \begin{array}{l}
            x_m = \left|x\right|
            
            \\
            \frac{\mathsf{fma}\left(x\_m, x\_m, 1\right)}{\mathsf{E}\left(\right)}
            \end{array}
            
            Derivation
            1. Initial program 100.0%

              \[e^{-\left(1 - x \cdot x\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-exp.f64N/A

                \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
              2. lift-neg.f64N/A

                \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
              3. exp-negN/A

                \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
              4. lift--.f64N/A

                \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
              5. exp-diffN/A

                \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
              6. clear-numN/A

                \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
              7. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
              8. lift-*.f64N/A

                \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
              9. exp-prodN/A

                \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
              10. lower-pow.f64N/A

                \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
              11. lower-exp.f64N/A

                \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
              12. exp-1-eN/A

                \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
              13. lower-E.f64100.0

                \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
            4. Applied rewrites100.0%

              \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
            5. Taylor expanded in x around 0

              \[\leadsto \frac{\color{blue}{1 + {x}^{2}}}{\mathsf{E}\left(\right)} \]
            6. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \frac{\color{blue}{{x}^{2} + 1}}{\mathsf{E}\left(\right)} \]
              2. unpow2N/A

                \[\leadsto \frac{\color{blue}{x \cdot x} + 1}{\mathsf{E}\left(\right)} \]
              3. lower-fma.f6478.0

                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
            7. Applied rewrites78.0%

              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x, x, 1\right)}}{\mathsf{E}\left(\right)} \]
            8. Add Preprocessing

            Alternative 11: 50.8% accurate, 9.3× speedup?

            \[\begin{array}{l} x_m = \left|x\right| \\ \frac{1}{\mathsf{E}\left(\right)} \end{array} \]
            x_m = (fabs.f64 x)
            (FPCore (x_m) :precision binary64 (/ 1.0 (E)))
            \begin{array}{l}
            x_m = \left|x\right|
            
            \\
            \frac{1}{\mathsf{E}\left(\right)}
            \end{array}
            
            Derivation
            1. Initial program 100.0%

              \[e^{-\left(1 - x \cdot x\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-exp.f64N/A

                \[\leadsto \color{blue}{e^{-\left(1 - x \cdot x\right)}} \]
              2. lift-neg.f64N/A

                \[\leadsto e^{\color{blue}{\mathsf{neg}\left(\left(1 - x \cdot x\right)\right)}} \]
              3. exp-negN/A

                \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}} \]
              4. lift--.f64N/A

                \[\leadsto \frac{1}{e^{\color{blue}{1 - x \cdot x}}} \]
              5. exp-diffN/A

                \[\leadsto \frac{1}{\color{blue}{\frac{e^{1}}{e^{x \cdot x}}}} \]
              6. clear-numN/A

                \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
              7. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e^{1}}} \]
              8. lift-*.f64N/A

                \[\leadsto \frac{e^{\color{blue}{x \cdot x}}}{e^{1}} \]
              9. exp-prodN/A

                \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
              10. lower-pow.f64N/A

                \[\leadsto \frac{\color{blue}{{\left(e^{x}\right)}^{x}}}{e^{1}} \]
              11. lower-exp.f64N/A

                \[\leadsto \frac{{\color{blue}{\left(e^{x}\right)}}^{x}}{e^{1}} \]
              12. exp-1-eN/A

                \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
              13. lower-E.f64100.0

                \[\leadsto \frac{{\left(e^{x}\right)}^{x}}{\color{blue}{\mathsf{E}\left(\right)}} \]
            4. Applied rewrites100.0%

              \[\leadsto \color{blue}{\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}} \]
            5. Taylor expanded in x around 0

              \[\leadsto \frac{\color{blue}{1}}{\mathsf{E}\left(\right)} \]
            6. Step-by-step derivation
              1. Applied rewrites54.6%

                \[\leadsto \frac{\color{blue}{1}}{\mathsf{E}\left(\right)} \]
              2. Add Preprocessing

              Reproduce

              ?
              herbie shell --seed 2024332 
              (FPCore (x)
                :name "exp neg sub"
                :precision binary64
                (exp (- (- 1.0 (* x x)))))