exp neg sub

Percentage Accurate: 100.0% → 100.0%
Time: 5.9s
Alternatives: 6
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 6 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.5× speedup?

\[\begin{array}{l} \\ {\left(e^{-2}\right)}^{\left(\mathsf{fma}\left(x, x, -1\right) \cdot -0.5\right)} \end{array} \]
(FPCore (x) :precision binary64 (pow (exp -2.0) (* (fma x x -1.0) -0.5)))
double code(double x) {
	return pow(exp(-2.0), (fma(x, x, -1.0) * -0.5));
}
function code(x)
	return exp(-2.0) ^ Float64(fma(x, x, -1.0) * -0.5)
end
code[x_] := N[Power[N[Exp[-2.0], $MachinePrecision], N[(N[(x * x + -1.0), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
{\left(e^{-2}\right)}^{\left(\mathsf{fma}\left(x, x, -1\right) \cdot -0.5\right)}
\end{array}
Derivation
  1. Initial program 99.9%

    \[e^{-\left(1 - x \cdot x\right)} \]
  2. Add Preprocessing
  3. Applied rewrites100.0%

    \[\leadsto \color{blue}{{\left(e^{-1} \cdot e^{-1}\right)}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)}} \]
  4. Step-by-step derivation
    1. lift-*.f64N/A

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

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

      \[\leadsto {\left(e^{-1} \cdot \color{blue}{e^{-1}}\right)}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
    4. prod-expN/A

      \[\leadsto {\color{blue}{\left(e^{-1 + -1}\right)}}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
    5. metadata-evalN/A

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

      \[\leadsto {\color{blue}{\left(e^{-2}\right)}}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
    7. lift-/.f64N/A

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

      \[\leadsto {\left(e^{-2}\right)}^{\color{blue}{\left(\frac{1}{\frac{-2}{\mathsf{fma}\left(x, x, -1\right)}}\right)}} \]
    9. associate-/r/N/A

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

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

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

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

    \[\leadsto {\left(e^{-2}\right)}^{\left(\mathsf{fma}\left(x, x, -1\right) \cdot -0.5\right)} \]
  7. Add Preprocessing

Alternative 2: 100.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)} \end{array} \]
(FPCore (x) :precision binary64 (/ (pow (exp x) x) (E)))
\begin{array}{l}

\\
\frac{{\left(e^{x}\right)}^{x}}{\mathsf{E}\left(\right)}
\end{array}
Derivation
  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. Add Preprocessing

Alternative 3: 100.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ {\left(\mathsf{E}\left(\right) \cdot \mathsf{E}\left(\right)\right)}^{\left(0.5 \cdot \mathsf{fma}\left(x, x, -1\right)\right)} \end{array} \]
(FPCore (x) :precision binary64 (pow (* (E) (E)) (* 0.5 (fma x x -1.0))))
\begin{array}{l}

\\
{\left(\mathsf{E}\left(\right) \cdot \mathsf{E}\left(\right)\right)}^{\left(0.5 \cdot \mathsf{fma}\left(x, x, -1\right)\right)}
\end{array}
Derivation
  1. Initial program 99.9%

    \[e^{-\left(1 - x \cdot x\right)} \]
  2. Add Preprocessing
  3. Applied rewrites100.0%

    \[\leadsto \color{blue}{{\left(e^{-1} \cdot e^{-1}\right)}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)}} \]
  4. Step-by-step derivation
    1. lift-*.f64N/A

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

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

      \[\leadsto {\left(e^{-1} \cdot \color{blue}{e^{-1}}\right)}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
    4. prod-expN/A

      \[\leadsto {\color{blue}{\left(e^{-1 + -1}\right)}}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
    5. metadata-evalN/A

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

      \[\leadsto {\color{blue}{\left(e^{-2}\right)}}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
    7. lift-/.f64N/A

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

      \[\leadsto {\left(e^{-2}\right)}^{\color{blue}{\left(\frac{1}{\frac{-2}{\mathsf{fma}\left(x, x, -1\right)}}\right)}} \]
    9. associate-/r/N/A

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

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

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

    \[\leadsto \color{blue}{{\left(e^{-2}\right)}^{\left(-0.5 \cdot \mathsf{fma}\left(x, x, -1\right)\right)}} \]
  6. Step-by-step derivation
    1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left({\color{blue}{\left(e^{-2}\right)}}^{\frac{-1}{2}} \cdot {\left(e^{-2}\right)}^{\frac{-1}{2}}\right)}^{\left(\frac{x \cdot x - 1 \cdot 1}{2}\right)} \]
    13. pow-expN/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{E}\left(\right) \cdot \mathsf{E}\left(\right)\right)}^{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)}\right)} \]
  7. Applied rewrites99.9%

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

Alternative 4: 99.5% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 100.0%

      \[e^{-\left(1 - x \cdot x\right)} \]
    2. Add Preprocessing
    3. Applied rewrites100.0%

      \[\leadsto \color{blue}{{\left(e^{-1} \cdot e^{-1}\right)}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)}} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

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

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

        \[\leadsto {\left(e^{-1} \cdot \color{blue}{e^{-1}}\right)}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
      4. prod-expN/A

        \[\leadsto {\color{blue}{\left(e^{-1 + -1}\right)}}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
      5. metadata-evalN/A

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

        \[\leadsto {\color{blue}{\left(e^{-2}\right)}}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
      7. lift-/.f64N/A

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

        \[\leadsto {\left(e^{-2}\right)}^{\color{blue}{\left(\frac{1}{\frac{-2}{\mathsf{fma}\left(x, x, -1\right)}}\right)}} \]
      9. associate-/r/N/A

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

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

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

      \[\leadsto \color{blue}{{\left(e^{-2}\right)}^{\left(-0.5 \cdot \mathsf{fma}\left(x, x, -1\right)\right)}} \]
    6. Step-by-step derivation
      1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left({\color{blue}{\left(e^{-2}\right)}}^{\frac{-1}{2}} \cdot {\left(e^{-2}\right)}^{\frac{-1}{2}}\right)}^{\left(\frac{x \cdot x - 1 \cdot 1}{2}\right)} \]
      13. pow-expN/A

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\mathsf{E}\left(\right) \cdot \mathsf{E}\left(\right)\right)}^{\left(0.5 \cdot \mathsf{fma}\left(x, x, -1\right)\right)}} \]
    8. Taylor expanded in x around 0

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

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

        \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot 2}}{\mathsf{E}\left(\right)} + \frac{1}{2} \cdot \frac{{x}^{2} \cdot \log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)} \]
      3. rem-log-expN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{2} \cdot \log \color{blue}{\left({\mathsf{E}\left(\right)}^{2}\right)}}{\mathsf{E}\left(\right)} + \frac{1}{2} \cdot \frac{{x}^{2} \cdot \log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)} \]
      13. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)}} + \frac{1}{2} \cdot \frac{{x}^{2} \cdot \log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)} \]
      14. associate-/l*N/A

        \[\leadsto \frac{1}{2} \cdot \frac{\log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)} + \frac{1}{2} \cdot \color{blue}{\left({x}^{2} \cdot \frac{\log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)}\right)} \]
      15. associate-*r*N/A

        \[\leadsto \frac{1}{2} \cdot \frac{\log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)} + \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{\log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)}} \]
    10. Applied rewrites99.0%

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

    if 0.0050000000000000001 < (*.f64 x x)

    1. Initial program 99.9%

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

      \[\leadsto e^{\color{blue}{{x}^{2}}} \]
    4. 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}} \]
    5. Applied rewrites99.3%

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

Alternative 5: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ e^{\mathsf{fma}\left(x, x, -1\right)} \end{array} \]
(FPCore (x) :precision binary64 (exp (fma x x -1.0)))
double code(double x) {
	return exp(fma(x, x, -1.0));
}
function code(x)
	return exp(fma(x, x, -1.0))
end
code[x_] := N[Exp[N[(x * x + -1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
e^{\mathsf{fma}\left(x, x, -1\right)}
\end{array}
Derivation
  1. Initial program 99.9%

    \[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.f6499.9

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

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

Alternative 6: 75.6% accurate, 6.2× speedup?

\[\begin{array}{l} \\ \frac{\mathsf{fma}\left(x, x, 1\right)}{\mathsf{E}\left(\right)} \end{array} \]
(FPCore (x) :precision binary64 (/ (fma x x 1.0) (E)))
\begin{array}{l}

\\
\frac{\mathsf{fma}\left(x, x, 1\right)}{\mathsf{E}\left(\right)}
\end{array}
Derivation
  1. Initial program 99.9%

    \[e^{-\left(1 - x \cdot x\right)} \]
  2. Add Preprocessing
  3. Applied rewrites100.0%

    \[\leadsto \color{blue}{{\left(e^{-1} \cdot e^{-1}\right)}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)}} \]
  4. Step-by-step derivation
    1. lift-*.f64N/A

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

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

      \[\leadsto {\left(e^{-1} \cdot \color{blue}{e^{-1}}\right)}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
    4. prod-expN/A

      \[\leadsto {\color{blue}{\left(e^{-1 + -1}\right)}}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
    5. metadata-evalN/A

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

      \[\leadsto {\color{blue}{\left(e^{-2}\right)}}^{\left(\frac{\mathsf{fma}\left(x, x, -1\right)}{-2}\right)} \]
    7. lift-/.f64N/A

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

      \[\leadsto {\left(e^{-2}\right)}^{\color{blue}{\left(\frac{1}{\frac{-2}{\mathsf{fma}\left(x, x, -1\right)}}\right)}} \]
    9. associate-/r/N/A

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

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

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

    \[\leadsto \color{blue}{{\left(e^{-2}\right)}^{\left(-0.5 \cdot \mathsf{fma}\left(x, x, -1\right)\right)}} \]
  6. Step-by-step derivation
    1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left({\color{blue}{\left(e^{-2}\right)}}^{\frac{-1}{2}} \cdot {\left(e^{-2}\right)}^{\frac{-1}{2}}\right)}^{\left(\frac{x \cdot x - 1 \cdot 1}{2}\right)} \]
    13. pow-expN/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(\mathsf{E}\left(\right) \cdot \mathsf{E}\left(\right)\right)}^{\left(\left(x \cdot x - 1 \cdot 1\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)}\right)} \]
  7. Applied rewrites99.9%

    \[\leadsto \color{blue}{{\left(\mathsf{E}\left(\right) \cdot \mathsf{E}\left(\right)\right)}^{\left(0.5 \cdot \mathsf{fma}\left(x, x, -1\right)\right)}} \]
  8. Taylor expanded in x around 0

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

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

      \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot 2}}{\mathsf{E}\left(\right)} + \frac{1}{2} \cdot \frac{{x}^{2} \cdot \log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)} \]
    3. rem-log-expN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{2} \cdot \log \color{blue}{\left({\mathsf{E}\left(\right)}^{2}\right)}}{\mathsf{E}\left(\right)} + \frac{1}{2} \cdot \frac{{x}^{2} \cdot \log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)} \]
    13. associate-*r/N/A

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)}} + \frac{1}{2} \cdot \frac{{x}^{2} \cdot \log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)} \]
    14. associate-/l*N/A

      \[\leadsto \frac{1}{2} \cdot \frac{\log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)} + \frac{1}{2} \cdot \color{blue}{\left({x}^{2} \cdot \frac{\log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)}\right)} \]
    15. associate-*r*N/A

      \[\leadsto \frac{1}{2} \cdot \frac{\log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)} + \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{\log \left({\mathsf{E}\left(\right)}^{2}\right)}{\mathsf{E}\left(\right)}} \]
  10. Applied rewrites75.4%

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

Reproduce

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