exp neg sub

Percentage Accurate: 100.0% → 100.0%
Time: 12.8s
Alternatives: 27
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 27 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} \\ \frac{{\left(e^{x \cdot 4}\right)}^{\left(\frac{x}{4}\right)}}{e} \end{array} \]
(FPCore (x) :precision binary64 (/ (pow (exp (* x 4.0)) (/ x 4.0)) E))
double code(double x) {
	return pow(exp((x * 4.0)), (x / 4.0)) / ((double) M_E);
}
public static double code(double x) {
	return Math.pow(Math.exp((x * 4.0)), (x / 4.0)) / Math.E;
}
def code(x):
	return math.pow(math.exp((x * 4.0)), (x / 4.0)) / math.e
function code(x)
	return Float64((exp(Float64(x * 4.0)) ^ Float64(x / 4.0)) / exp(1))
end
function tmp = code(x)
	tmp = (exp((x * 4.0)) ^ (x / 4.0)) / 2.71828182845904523536;
end
code[x_] := N[(N[Power[N[Exp[N[(x * 4.0), $MachinePrecision]], $MachinePrecision], N[(x / 4.0), $MachinePrecision]], $MachinePrecision] / E), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(e^{x \cdot x}\right), \color{blue}{\left(e^{1}\right)}\right) \]
    5. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot x\right)\right), \left(e^{\color{blue}{1}}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \left(e^{1}\right)\right) \]
    7. exp-1-eN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \mathsf{E}\left(\right)\right) \]
    8. E-lowering-E.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \mathsf{E.f64}\left(\right)\right) \]
  4. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e}} \]
  5. Step-by-step derivation
    1. exp-prodN/A

      \[\leadsto \mathsf{/.f64}\left(\left({\left(e^{x}\right)}^{x}\right), \mathsf{E.f64}\left(\right)\right) \]
    2. sqr-powN/A

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

      \[\leadsto \mathsf{/.f64}\left(\left({\left(e^{x} \cdot e^{x}\right)}^{\left(\frac{x}{2}\right)}\right), \mathsf{E.f64}\left(\right)\right) \]
    4. div-invN/A

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

      \[\leadsto \mathsf{/.f64}\left(\left({\left(e^{x} \cdot e^{x}\right)}^{\left(x \cdot \frac{1}{2}\right)}\right), \mathsf{E.f64}\left(\right)\right) \]
    6. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(e^{x} \cdot e^{x}\right), \left(x \cdot \frac{1}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\left(e^{x}\right), \left(e^{x}\right)\right), \left(x \cdot \frac{1}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    8. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{exp.f64}\left(x\right), \left(e^{x}\right)\right), \left(x \cdot \frac{1}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    9. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{exp.f64}\left(x\right)\right), \left(x \cdot \frac{1}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    10. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{exp.f64}\left(x\right)\right), \left(x \cdot \frac{1}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    11. div-invN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{exp.f64}\left(x\right)\right), \left(\frac{x}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    12. /-lowering-/.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{exp.f64}\left(x\right)\right), \mathsf{/.f64}\left(x, 2\right)\right), \mathsf{E.f64}\left(\right)\right) \]
  6. Applied egg-rr100.0%

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

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

      \[\leadsto \mathsf{/.f64}\left(\left({\left(\left(e^{x} \cdot e^{x}\right) \cdot \left(e^{x} \cdot e^{x}\right)\right)}^{\left(\frac{\frac{x}{2}}{2}\right)}\right), \mathsf{E.f64}\left(\right)\right) \]
    3. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\left(e^{x} \cdot e^{x}\right) \cdot \left(e^{x} \cdot e^{x}\right)\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    4. rem-exp-logN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(e^{\log \left(e^{x} \cdot e^{x}\right)} \cdot \left(e^{x} \cdot e^{x}\right)\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    5. rem-exp-logN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(e^{\log \left(e^{x} \cdot e^{x}\right)} \cdot e^{\log \left(e^{x} \cdot e^{x}\right)}\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    6. prod-expN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(e^{\log \left(e^{x} \cdot e^{x}\right) + \log \left(e^{x} \cdot e^{x}\right)}\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    7. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\left(\log \left(e^{x} \cdot e^{x}\right) + \log \left(e^{x} \cdot e^{x}\right)\right)\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{+.f64}\left(\log \left(e^{x} \cdot e^{x}\right), \log \left(e^{x} \cdot e^{x}\right)\right)\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    9. exp-lft-sqrN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{+.f64}\left(\log \left(e^{x \cdot 2}\right), \log \left(e^{x} \cdot e^{x}\right)\right)\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    10. rem-log-expN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(x \cdot 2\right), \log \left(e^{x} \cdot e^{x}\right)\right)\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \log \left(e^{x} \cdot e^{x}\right)\right)\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    12. exp-lft-sqrN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \log \left(e^{x \cdot 2}\right)\right)\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    13. rem-log-expN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \left(x \cdot 2\right)\right)\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(\frac{\frac{x}{2}}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    15. associate-/l/N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(\frac{x}{2 \cdot 2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    16. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(\frac{x}{4}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    17. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(x, 2\right)\right)\right), \left(\frac{x}{2 + 2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    18. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), \mathsf{*.f64}\left(x, 2\right)\right)\right), \mathsf{/.f64}\left(x, \left(2 + 2\right)\right)\right), \mathsf{E.f64}\left(\right)\right) \]
  8. Applied egg-rr100.0%

    \[\leadsto \frac{\color{blue}{{\left(e^{x \cdot 2 + x \cdot 2}\right)}^{\left(\frac{x}{4}\right)}}}{e} \]
  9. Step-by-step derivation
    1. distribute-lft-outN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(2 + 2\right)\right)\right), \mathsf{/.f64}\left(x, 4\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot 4\right)\right), \mathsf{/.f64}\left(x, 4\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    3. *-lowering-*.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, 4\right)\right), \mathsf{/.f64}\left(x, 4\right)\right), \mathsf{E.f64}\left(\right)\right) \]
  10. Applied egg-rr100.0%

    \[\leadsto \frac{{\left(e^{\color{blue}{x \cdot 4}}\right)}^{\left(\frac{x}{4}\right)}}{e} \]
  11. Add Preprocessing

Alternative 2: 100.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \frac{{\left(e^{x \cdot 2}\right)}^{\left(\frac{x}{2}\right)}}{e} \end{array} \]
(FPCore (x) :precision binary64 (/ (pow (exp (* x 2.0)) (/ x 2.0)) E))
double code(double x) {
	return pow(exp((x * 2.0)), (x / 2.0)) / ((double) M_E);
}
public static double code(double x) {
	return Math.pow(Math.exp((x * 2.0)), (x / 2.0)) / Math.E;
}
def code(x):
	return math.pow(math.exp((x * 2.0)), (x / 2.0)) / math.e
function code(x)
	return Float64((exp(Float64(x * 2.0)) ^ Float64(x / 2.0)) / exp(1))
end
function tmp = code(x)
	tmp = (exp((x * 2.0)) ^ (x / 2.0)) / 2.71828182845904523536;
end
code[x_] := N[(N[Power[N[Exp[N[(x * 2.0), $MachinePrecision]], $MachinePrecision], N[(x / 2.0), $MachinePrecision]], $MachinePrecision] / E), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(e^{x \cdot x}\right), \color{blue}{\left(e^{1}\right)}\right) \]
    5. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot x\right)\right), \left(e^{\color{blue}{1}}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \left(e^{1}\right)\right) \]
    7. exp-1-eN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \mathsf{E}\left(\right)\right) \]
    8. E-lowering-E.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \mathsf{E.f64}\left(\right)\right) \]
  4. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e}} \]
  5. Step-by-step derivation
    1. exp-prodN/A

      \[\leadsto \mathsf{/.f64}\left(\left({\left(e^{x}\right)}^{x}\right), \mathsf{E.f64}\left(\right)\right) \]
    2. sqr-powN/A

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

      \[\leadsto \mathsf{/.f64}\left(\left({\left(e^{x} \cdot e^{x}\right)}^{\left(\frac{x}{2}\right)}\right), \mathsf{E.f64}\left(\right)\right) \]
    4. div-invN/A

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

      \[\leadsto \mathsf{/.f64}\left(\left({\left(e^{x} \cdot e^{x}\right)}^{\left(x \cdot \frac{1}{2}\right)}\right), \mathsf{E.f64}\left(\right)\right) \]
    6. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(e^{x} \cdot e^{x}\right), \left(x \cdot \frac{1}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\left(e^{x}\right), \left(e^{x}\right)\right), \left(x \cdot \frac{1}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    8. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{exp.f64}\left(x\right), \left(e^{x}\right)\right), \left(x \cdot \frac{1}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    9. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{exp.f64}\left(x\right)\right), \left(x \cdot \frac{1}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    10. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{exp.f64}\left(x\right)\right), \left(x \cdot \frac{1}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    11. div-invN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{exp.f64}\left(x\right)\right), \left(\frac{x}{2}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    12. /-lowering-/.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{exp.f64}\left(x\right)\right), \mathsf{/.f64}\left(x, 2\right)\right), \mathsf{E.f64}\left(\right)\right) \]
  6. Applied egg-rr100.0%

    \[\leadsto \frac{\color{blue}{{\left(e^{x} \cdot e^{x}\right)}^{\left(\frac{x}{2}\right)}}}{e} \]
  7. Step-by-step derivation
    1. rem-exp-logN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(e^{\log \left(e^{x} \cdot e^{x}\right)}\right), \mathsf{/.f64}\left(x, 2\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    2. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\log \left(e^{x} \cdot e^{x}\right)\right), \mathsf{/.f64}\left(x, 2\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    3. exp-lft-sqrN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\log \left(e^{x \cdot 2}\right)\right), \mathsf{/.f64}\left(x, 2\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    4. rem-log-expN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot 2\right)\right), \mathsf{/.f64}\left(x, 2\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    5. *-lowering-*.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, 2\right)\right), \mathsf{/.f64}\left(x, 2\right)\right), \mathsf{E.f64}\left(\right)\right) \]
  8. Applied egg-rr100.0%

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

Alternative 3: 100.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \frac{{\left(e^{x}\right)}^{x}}{e} \end{array} \]
(FPCore (x) :precision binary64 (/ (pow (exp x) x) E))
double code(double x) {
	return pow(exp(x), x) / ((double) M_E);
}
public static double code(double x) {
	return Math.pow(Math.exp(x), x) / Math.E;
}
def code(x):
	return math.pow(math.exp(x), x) / math.e
function code(x)
	return Float64((exp(x) ^ x) / exp(1))
end
function tmp = code(x)
	tmp = (exp(x) ^ x) / 2.71828182845904523536;
end
code[x_] := N[(N[Power[N[Exp[x], $MachinePrecision], x], $MachinePrecision] / E), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(e^{x \cdot x}\right), \color{blue}{\left(e^{1}\right)}\right) \]
    5. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot x\right)\right), \left(e^{\color{blue}{1}}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \left(e^{1}\right)\right) \]
    7. exp-1-eN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \mathsf{E}\left(\right)\right) \]
    8. E-lowering-E.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \mathsf{E.f64}\left(\right)\right) \]
  4. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e}} \]
  5. Step-by-step derivation
    1. exp-prodN/A

      \[\leadsto \mathsf{/.f64}\left(\left({\left(e^{x}\right)}^{x}\right), \mathsf{E.f64}\left(\right)\right) \]
    2. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(e^{x}\right), x\right), \mathsf{E.f64}\left(\right)\right) \]
    3. exp-lowering-exp.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(x\right), x\right), \mathsf{E.f64}\left(\right)\right) \]
  6. Applied egg-rr100.0%

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

Alternative 4: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{x \cdot x}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= (* x x) 5e-5)
   (*
    (/ 1.0 E)
    (+
     1.0
     (* (* x x) (+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.16666666666666666)))))))
   (exp (* x x))))
double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / ((double) M_E)) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))));
	} else {
		tmp = exp((x * x));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / Math.E) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))));
	} else {
		tmp = Math.exp((x * x));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x * x) <= 5e-5:
		tmp = (1.0 / math.e) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))))
	else:
		tmp = math.exp((x * x))
	return tmp
function code(x)
	tmp = 0.0
	if (Float64(x * x) <= 5e-5)
		tmp = Float64(Float64(1.0 / exp(1)) * Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666)))))));
	else
		tmp = exp(Float64(x * x));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x * x) <= 5e-5)
		tmp = (1.0 / 2.71828182845904523536) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))));
	else
		tmp = exp((x * x));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-5], N[(N[(1.0 / E), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)\\

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


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

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]

    if 5.00000000000000024e-5 < (*.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 \mathsf{exp.f64}\left(\color{blue}{\left({x}^{2}\right)}\right) \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{exp.f64}\left(\left(x \cdot x\right)\right) \]
      2. *-lowering-*.f6499.4%

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right) \]
    5. Simplified99.4%

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

\\
e^{x \cdot x + -1}
\end{array}
Derivation
  1. Initial program 100.0%

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

    \[\leadsto e^{x \cdot x + -1} \]
  4. Add Preprocessing

Alternative 6: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{e^{x \cdot x}}{e} \end{array} \]
(FPCore (x) :precision binary64 (/ (exp (* x x)) E))
double code(double x) {
	return exp((x * x)) / ((double) M_E);
}
public static double code(double x) {
	return Math.exp((x * x)) / Math.E;
}
def code(x):
	return math.exp((x * x)) / math.e
function code(x)
	return Float64(exp(Float64(x * x)) / exp(1))
end
function tmp = code(x)
	tmp = exp((x * x)) / 2.71828182845904523536;
end
code[x_] := N[(N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision] / E), $MachinePrecision]
\begin{array}{l}

\\
\frac{e^{x \cdot x}}{e}
\end{array}
Derivation
  1. Initial program 100.0%

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(e^{x \cdot x}\right), \color{blue}{\left(e^{1}\right)}\right) \]
    5. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot x\right)\right), \left(e^{\color{blue}{1}}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \left(e^{1}\right)\right) \]
    7. exp-1-eN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \mathsf{E}\left(\right)\right) \]
    8. E-lowering-E.f64100.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, x\right)\right), \mathsf{E.f64}\left(\right)\right) \]
  4. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{e}} \]
  5. Add Preprocessing

Alternative 7: 96.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\\ t_1 := x \cdot \left(x \cdot \left(-1 - t\_0\right)\right)\\ t_2 := x \cdot \left(x \cdot \left(1 + t\_0\right)\right)\\ \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{+46}:\\ \;\;\;\;\frac{\frac{1 + t\_2 \cdot \left(t\_2 \cdot t\_2\right)}{e}}{1 + t\_2 \cdot \left(t\_2 + -1\right)}\\ \mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{+101}:\\ \;\;\;\;\frac{\frac{1 + t\_2 \cdot t\_1}{e}}{1 + t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(0.16666666666666666 \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* (* x x) (+ 0.5 (* x (* x 0.16666666666666666)))))
        (t_1 (* x (* x (- -1.0 t_0))))
        (t_2 (* x (* x (+ 1.0 t_0)))))
   (if (<= (* x x) 5e+46)
     (/ (/ (+ 1.0 (* t_2 (* t_2 t_2))) E) (+ 1.0 (* t_2 (+ t_2 -1.0))))
     (if (<= (* x x) 5e+101)
       (/ (/ (+ 1.0 (* t_2 t_1)) E) (+ 1.0 t_1))
       (* (* x x) (* (* x x) (* 0.16666666666666666 (/ (* x x) E))))))))
double code(double x) {
	double t_0 = (x * x) * (0.5 + (x * (x * 0.16666666666666666)));
	double t_1 = x * (x * (-1.0 - t_0));
	double t_2 = x * (x * (1.0 + t_0));
	double tmp;
	if ((x * x) <= 5e+46) {
		tmp = ((1.0 + (t_2 * (t_2 * t_2))) / ((double) M_E)) / (1.0 + (t_2 * (t_2 + -1.0)));
	} else if ((x * x) <= 5e+101) {
		tmp = ((1.0 + (t_2 * t_1)) / ((double) M_E)) / (1.0 + t_1);
	} else {
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / ((double) M_E))));
	}
	return tmp;
}
public static double code(double x) {
	double t_0 = (x * x) * (0.5 + (x * (x * 0.16666666666666666)));
	double t_1 = x * (x * (-1.0 - t_0));
	double t_2 = x * (x * (1.0 + t_0));
	double tmp;
	if ((x * x) <= 5e+46) {
		tmp = ((1.0 + (t_2 * (t_2 * t_2))) / Math.E) / (1.0 + (t_2 * (t_2 + -1.0)));
	} else if ((x * x) <= 5e+101) {
		tmp = ((1.0 + (t_2 * t_1)) / Math.E) / (1.0 + t_1);
	} else {
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / Math.E)));
	}
	return tmp;
}
def code(x):
	t_0 = (x * x) * (0.5 + (x * (x * 0.16666666666666666)))
	t_1 = x * (x * (-1.0 - t_0))
	t_2 = x * (x * (1.0 + t_0))
	tmp = 0
	if (x * x) <= 5e+46:
		tmp = ((1.0 + (t_2 * (t_2 * t_2))) / math.e) / (1.0 + (t_2 * (t_2 + -1.0)))
	elif (x * x) <= 5e+101:
		tmp = ((1.0 + (t_2 * t_1)) / math.e) / (1.0 + t_1)
	else:
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / math.e)))
	return tmp
function code(x)
	t_0 = Float64(Float64(x * x) * Float64(0.5 + Float64(x * Float64(x * 0.16666666666666666))))
	t_1 = Float64(x * Float64(x * Float64(-1.0 - t_0)))
	t_2 = Float64(x * Float64(x * Float64(1.0 + t_0)))
	tmp = 0.0
	if (Float64(x * x) <= 5e+46)
		tmp = Float64(Float64(Float64(1.0 + Float64(t_2 * Float64(t_2 * t_2))) / exp(1)) / Float64(1.0 + Float64(t_2 * Float64(t_2 + -1.0))));
	elseif (Float64(x * x) <= 5e+101)
		tmp = Float64(Float64(Float64(1.0 + Float64(t_2 * t_1)) / exp(1)) / Float64(1.0 + t_1));
	else
		tmp = Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(0.16666666666666666 * Float64(Float64(x * x) / exp(1)))));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = (x * x) * (0.5 + (x * (x * 0.16666666666666666)));
	t_1 = x * (x * (-1.0 - t_0));
	t_2 = x * (x * (1.0 + t_0));
	tmp = 0.0;
	if ((x * x) <= 5e+46)
		tmp = ((1.0 + (t_2 * (t_2 * t_2))) / 2.71828182845904523536) / (1.0 + (t_2 * (t_2 + -1.0)));
	elseif ((x * x) <= 5e+101)
		tmp = ((1.0 + (t_2 * t_1)) / 2.71828182845904523536) / (1.0 + t_1);
	else
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / 2.71828182845904523536)));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(x * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 5e+46], N[(N[(N[(1.0 + N[(t$95$2 * N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision] / N[(1.0 + N[(t$95$2 * N[(t$95$2 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * x), $MachinePrecision], 5e+101], N[(N[(N[(1.0 + N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(0.16666666666666666 * N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\\
t_1 := x \cdot \left(x \cdot \left(-1 - t\_0\right)\right)\\
t_2 := x \cdot \left(x \cdot \left(1 + t\_0\right)\right)\\
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{+46}:\\
\;\;\;\;\frac{\frac{1 + t\_2 \cdot \left(t\_2 \cdot t\_2\right)}{e}}{1 + t\_2 \cdot \left(t\_2 + -1\right)}\\

\mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{+101}:\\
\;\;\;\;\frac{\frac{1 + t\_2 \cdot t\_1}{e}}{1 + t\_1}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(0.16666666666666666 \cdot \frac{x \cdot x}{e}\right)\right)\\


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

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
    4. Simplified90.4%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \frac{\left({1}^{3} + {\left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right)}^{3}\right) \cdot \frac{1}{\mathsf{E}\left(\right)}}{\color{blue}{1 \cdot 1 + \left(\left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) - 1 \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right)\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left({1}^{3} + {\left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right)}^{3}\right) \cdot \frac{1}{\mathsf{E}\left(\right)}\right), \color{blue}{\left(1 \cdot 1 + \left(\left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) - 1 \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right)\right)\right)}\right) \]
    6. Applied egg-rr93.8%

      \[\leadsto \color{blue}{\frac{\frac{1 + \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot \left(\left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right)\right)}{e}}{1 + \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right) + -1\right)}} \]

    if 5.0000000000000002e46 < (*.f64 x x) < 4.99999999999999989e101

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
    4. Simplified7.3%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \frac{\left(1 \cdot 1 - \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right)\right) \cdot \frac{1}{\mathsf{E}\left(\right)}}{\color{blue}{1 - \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 \cdot 1 - \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right)\right) \cdot \frac{1}{\mathsf{E}\left(\right)}\right), \color{blue}{\left(1 - \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right)}\right) \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{\frac{1 - \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right)}{e}}{1 - x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)}} \]

    if 4.99999999999999989e101 < (*.f64 x x)

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\mathsf{E}\left(\right)} \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right) + \color{blue}{1}\right) \]
      2. distribute-rgt-inN/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \mathsf{E}\left(\right) + \mathsf{E}\left(\right) \cdot 1\right), \color{blue}{\left(\mathsf{E}\left(\right) \cdot \mathsf{E}\left(\right)\right)}\right) \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{\left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot e + e}{e \cdot e}} \]
    7. Taylor expanded in x around inf

      \[\leadsto \color{blue}{\frac{1}{6} \cdot \frac{{x}^{6}}{\mathsf{E}\left(\right)}} \]
    8. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \frac{{x}^{6} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      3. metadata-evalN/A

        \[\leadsto \frac{{x}^{\left(5 + 1\right)} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{{x}^{\left(\left(4 + 1\right) + 1\right)} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      5. pow-plusN/A

        \[\leadsto \frac{\left({x}^{\left(4 + 1\right)} \cdot x\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      6. pow-plusN/A

        \[\leadsto \frac{\left(\left({x}^{4} \cdot x\right) \cdot x\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left({x}^{4} \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{\left({x}^{4} \cdot {x}^{2}\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\left({x}^{2} \cdot {x}^{4}\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{6} \cdot \left({x}^{2} \cdot {x}^{4}\right)}{\mathsf{E}\left(\right)} \]
      11. associate-*l*N/A

        \[\leadsto \frac{\left(\frac{1}{6} \cdot {x}^{2}\right) \cdot {x}^{4}}{\mathsf{E}\left(\right)} \]
      12. associate-*l/N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2}\right), \color{blue}{\left(\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot {x}^{2}\right)}\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)} \cdot {x}^{2}\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)} \cdot {x}^{2}\right)\right) \]
      21. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left({x}^{2} \cdot \color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)}\right)\right) \]
      22. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left({x}^{2}\right), \color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)}\right)\right) \]
    9. Simplified100.0%

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{x \cdot x}{e} \cdot 0.16666666666666666\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification96.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{+46}:\\ \;\;\;\;\frac{\frac{1 + \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot \left(\left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right)\right)}{e}}{1 + \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right) + -1\right)}\\ \mathbf{elif}\;x \cdot x \leq 5 \cdot 10^{+101}:\\ \;\;\;\;\frac{\frac{1 + \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(-1 - \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right)}{e}}{1 + x \cdot \left(x \cdot \left(-1 - \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(0.16666666666666666 \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 95.9% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\\ t_1 := x \cdot \left(x \cdot \left(-1 - t\_0\right)\right)\\ \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{+101}:\\ \;\;\;\;\frac{\frac{1 + \left(x \cdot \left(x \cdot \left(1 + t\_0\right)\right)\right) \cdot t\_1}{e}}{1 + t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(0.16666666666666666 \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* (* x x) (+ 0.5 (* x (* x 0.16666666666666666)))))
        (t_1 (* x (* x (- -1.0 t_0)))))
   (if (<= (* x x) 5e+101)
     (/ (/ (+ 1.0 (* (* x (* x (+ 1.0 t_0))) t_1)) E) (+ 1.0 t_1))
     (* (* x x) (* (* x x) (* 0.16666666666666666 (/ (* x x) E)))))))
double code(double x) {
	double t_0 = (x * x) * (0.5 + (x * (x * 0.16666666666666666)));
	double t_1 = x * (x * (-1.0 - t_0));
	double tmp;
	if ((x * x) <= 5e+101) {
		tmp = ((1.0 + ((x * (x * (1.0 + t_0))) * t_1)) / ((double) M_E)) / (1.0 + t_1);
	} else {
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / ((double) M_E))));
	}
	return tmp;
}
public static double code(double x) {
	double t_0 = (x * x) * (0.5 + (x * (x * 0.16666666666666666)));
	double t_1 = x * (x * (-1.0 - t_0));
	double tmp;
	if ((x * x) <= 5e+101) {
		tmp = ((1.0 + ((x * (x * (1.0 + t_0))) * t_1)) / Math.E) / (1.0 + t_1);
	} else {
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / Math.E)));
	}
	return tmp;
}
def code(x):
	t_0 = (x * x) * (0.5 + (x * (x * 0.16666666666666666)))
	t_1 = x * (x * (-1.0 - t_0))
	tmp = 0
	if (x * x) <= 5e+101:
		tmp = ((1.0 + ((x * (x * (1.0 + t_0))) * t_1)) / math.e) / (1.0 + t_1)
	else:
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / math.e)))
	return tmp
function code(x)
	t_0 = Float64(Float64(x * x) * Float64(0.5 + Float64(x * Float64(x * 0.16666666666666666))))
	t_1 = Float64(x * Float64(x * Float64(-1.0 - t_0)))
	tmp = 0.0
	if (Float64(x * x) <= 5e+101)
		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(x * Float64(x * Float64(1.0 + t_0))) * t_1)) / exp(1)) / Float64(1.0 + t_1));
	else
		tmp = Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(0.16666666666666666 * Float64(Float64(x * x) / exp(1)))));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = (x * x) * (0.5 + (x * (x * 0.16666666666666666)));
	t_1 = x * (x * (-1.0 - t_0));
	tmp = 0.0;
	if ((x * x) <= 5e+101)
		tmp = ((1.0 + ((x * (x * (1.0 + t_0))) * t_1)) / 2.71828182845904523536) / (1.0 + t_1);
	else
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / 2.71828182845904523536)));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 5e+101], N[(N[(N[(1.0 + N[(N[(x * N[(x * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(0.16666666666666666 * N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\\
t_1 := x \cdot \left(x \cdot \left(-1 - t\_0\right)\right)\\
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{+101}:\\
\;\;\;\;\frac{\frac{1 + \left(x \cdot \left(x \cdot \left(1 + t\_0\right)\right)\right) \cdot t\_1}{e}}{1 + t\_1}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(0.16666666666666666 \cdot \frac{x \cdot x}{e}\right)\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
    4. Simplified84.9%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \frac{\left(1 \cdot 1 - \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right)\right) \cdot \frac{1}{\mathsf{E}\left(\right)}}{\color{blue}{1 - \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 \cdot 1 - \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right)\right) \cdot \frac{1}{\mathsf{E}\left(\right)}\right), \color{blue}{\left(1 - \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right)}\right) \]
    6. Applied egg-rr91.1%

      \[\leadsto \color{blue}{\frac{\frac{1 - \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right)}{e}}{1 - x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)}} \]

    if 4.99999999999999989e101 < (*.f64 x x)

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\mathsf{E}\left(\right)} \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right) + \color{blue}{1}\right) \]
      2. distribute-rgt-inN/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \mathsf{E}\left(\right) + \mathsf{E}\left(\right) \cdot 1\right), \color{blue}{\left(\mathsf{E}\left(\right) \cdot \mathsf{E}\left(\right)\right)}\right) \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{\left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot e + e}{e \cdot e}} \]
    7. Taylor expanded in x around inf

      \[\leadsto \color{blue}{\frac{1}{6} \cdot \frac{{x}^{6}}{\mathsf{E}\left(\right)}} \]
    8. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \frac{{x}^{6} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      3. metadata-evalN/A

        \[\leadsto \frac{{x}^{\left(5 + 1\right)} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{{x}^{\left(\left(4 + 1\right) + 1\right)} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      5. pow-plusN/A

        \[\leadsto \frac{\left({x}^{\left(4 + 1\right)} \cdot x\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      6. pow-plusN/A

        \[\leadsto \frac{\left(\left({x}^{4} \cdot x\right) \cdot x\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left({x}^{4} \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{\left({x}^{4} \cdot {x}^{2}\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\left({x}^{2} \cdot {x}^{4}\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{6} \cdot \left({x}^{2} \cdot {x}^{4}\right)}{\mathsf{E}\left(\right)} \]
      11. associate-*l*N/A

        \[\leadsto \frac{\left(\frac{1}{6} \cdot {x}^{2}\right) \cdot {x}^{4}}{\mathsf{E}\left(\right)} \]
      12. associate-*l/N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2}\right), \color{blue}{\left(\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot {x}^{2}\right)}\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)} \cdot {x}^{2}\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)} \cdot {x}^{2}\right)\right) \]
      21. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left({x}^{2} \cdot \color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)}\right)\right) \]
      22. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left({x}^{2}\right), \color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)}\right)\right) \]
    9. Simplified100.0%

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{x \cdot x}{e} \cdot 0.16666666666666666\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.7%

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

Alternative 9: 94.9% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\\ t_1 := \left(x \cdot x\right) \cdot t\_0\\ \mathbf{if}\;x \cdot x \leq 10^{+153}:\\ \;\;\;\;\frac{1}{e} \cdot \left(1 + \frac{\left(x \cdot x\right) \cdot \left(1 - t\_0 \cdot \left(\left(x \cdot x\right) \cdot t\_1\right)\right)}{1 - t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (+ 0.5 (* x (* x 0.16666666666666666)))) (t_1 (* (* x x) t_0)))
   (if (<= (* x x) 1e+153)
     (*
      (/ 1.0 E)
      (+ 1.0 (/ (* (* x x) (- 1.0 (* t_0 (* (* x x) t_1)))) (- 1.0 t_1))))
     (* x (* 0.5 (* x (/ (* x x) E)))))))
double code(double x) {
	double t_0 = 0.5 + (x * (x * 0.16666666666666666));
	double t_1 = (x * x) * t_0;
	double tmp;
	if ((x * x) <= 1e+153) {
		tmp = (1.0 / ((double) M_E)) * (1.0 + (((x * x) * (1.0 - (t_0 * ((x * x) * t_1)))) / (1.0 - t_1)));
	} else {
		tmp = x * (0.5 * (x * ((x * x) / ((double) M_E))));
	}
	return tmp;
}
public static double code(double x) {
	double t_0 = 0.5 + (x * (x * 0.16666666666666666));
	double t_1 = (x * x) * t_0;
	double tmp;
	if ((x * x) <= 1e+153) {
		tmp = (1.0 / Math.E) * (1.0 + (((x * x) * (1.0 - (t_0 * ((x * x) * t_1)))) / (1.0 - t_1)));
	} else {
		tmp = x * (0.5 * (x * ((x * x) / Math.E)));
	}
	return tmp;
}
def code(x):
	t_0 = 0.5 + (x * (x * 0.16666666666666666))
	t_1 = (x * x) * t_0
	tmp = 0
	if (x * x) <= 1e+153:
		tmp = (1.0 / math.e) * (1.0 + (((x * x) * (1.0 - (t_0 * ((x * x) * t_1)))) / (1.0 - t_1)))
	else:
		tmp = x * (0.5 * (x * ((x * x) / math.e)))
	return tmp
function code(x)
	t_0 = Float64(0.5 + Float64(x * Float64(x * 0.16666666666666666)))
	t_1 = Float64(Float64(x * x) * t_0)
	tmp = 0.0
	if (Float64(x * x) <= 1e+153)
		tmp = Float64(Float64(1.0 / exp(1)) * Float64(1.0 + Float64(Float64(Float64(x * x) * Float64(1.0 - Float64(t_0 * Float64(Float64(x * x) * t_1)))) / Float64(1.0 - t_1))));
	else
		tmp = Float64(x * Float64(0.5 * Float64(x * Float64(Float64(x * x) / exp(1)))));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = 0.5 + (x * (x * 0.16666666666666666));
	t_1 = (x * x) * t_0;
	tmp = 0.0;
	if ((x * x) <= 1e+153)
		tmp = (1.0 / 2.71828182845904523536) * (1.0 + (((x * x) * (1.0 - (t_0 * ((x * x) * t_1)))) / (1.0 - t_1)));
	else
		tmp = x * (0.5 * (x * ((x * x) / 2.71828182845904523536)));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(0.5 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 1e+153], N[(N[(1.0 / E), $MachinePrecision] * N[(1.0 + N[(N[(N[(x * x), $MachinePrecision] * N[(1.0 - N[(t$95$0 * N[(N[(x * x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(0.5 * N[(x * N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\\
t_1 := \left(x \cdot x\right) \cdot t\_0\\
\mathbf{if}\;x \cdot x \leq 10^{+153}:\\
\;\;\;\;\frac{1}{e} \cdot \left(1 + \frac{\left(x \cdot x\right) \cdot \left(1 - t\_0 \cdot \left(\left(x \cdot x\right) \cdot t\_1\right)\right)}{1 - t\_1}\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
    4. Simplified85.8%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \left(\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right) \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right) \]
      2. flip-+N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(1 \cdot 1 - \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(x \cdot x\right)}{\color{blue}{1 - \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)}}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(1 \cdot 1 - \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(x \cdot x\right)\right), \color{blue}{\left(1 - \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)}\right)\right)\right) \]
    6. Applied egg-rr89.8%

      \[\leadsto \frac{1}{e} \cdot \left(1 + \color{blue}{\frac{\left(1 - \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot \left(x \cdot x\right)}{1 - \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)}}\right) \]

    if 1e153 < (*.f64 x x)

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]
    6. Taylor expanded in x around inf

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

        \[\leadsto \frac{1}{2} \cdot \frac{{x}^{\left(2 \cdot 2\right)}}{\mathsf{E}\left(\right)} \]
      2. pow-sqrN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)}\right) \]
      12. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)\right) \]
      13. associate-*l/N/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right) \cdot {x}^{2}\right) \cdot x\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right) \cdot x\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right)}\right)\right) \]
      17. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\color{blue}{\mathsf{E}\left(\right)}}\right)\right)\right) \]
      20. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)\right)\right) \]
    8. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot \left(\left(x \cdot \frac{x \cdot x}{e}\right) \cdot 0.5\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.6%

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

Alternative 10: 94.9% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\\ \mathbf{if}\;x \cdot x \leq 10^{+153}:\\ \;\;\;\;\frac{1}{e} \cdot \left(1 + \frac{\left(x \cdot x\right) \cdot \left(1 - t\_0 \cdot \left(\left(x \cdot \left(\left(x \cdot x\right) \cdot 0.16666666666666666\right)\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)}{1 - \left(x \cdot x\right) \cdot t\_0}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (+ 0.5 (* x (* x 0.16666666666666666)))))
   (if (<= (* x x) 1e+153)
     (*
      (/ 1.0 E)
      (+
       1.0
       (/
        (*
         (* x x)
         (-
          1.0
          (* t_0 (* (* x (* (* x x) 0.16666666666666666)) (* x (* x x))))))
        (- 1.0 (* (* x x) t_0)))))
     (* x (* 0.5 (* x (/ (* x x) E)))))))
double code(double x) {
	double t_0 = 0.5 + (x * (x * 0.16666666666666666));
	double tmp;
	if ((x * x) <= 1e+153) {
		tmp = (1.0 / ((double) M_E)) * (1.0 + (((x * x) * (1.0 - (t_0 * ((x * ((x * x) * 0.16666666666666666)) * (x * (x * x)))))) / (1.0 - ((x * x) * t_0))));
	} else {
		tmp = x * (0.5 * (x * ((x * x) / ((double) M_E))));
	}
	return tmp;
}
public static double code(double x) {
	double t_0 = 0.5 + (x * (x * 0.16666666666666666));
	double tmp;
	if ((x * x) <= 1e+153) {
		tmp = (1.0 / Math.E) * (1.0 + (((x * x) * (1.0 - (t_0 * ((x * ((x * x) * 0.16666666666666666)) * (x * (x * x)))))) / (1.0 - ((x * x) * t_0))));
	} else {
		tmp = x * (0.5 * (x * ((x * x) / Math.E)));
	}
	return tmp;
}
def code(x):
	t_0 = 0.5 + (x * (x * 0.16666666666666666))
	tmp = 0
	if (x * x) <= 1e+153:
		tmp = (1.0 / math.e) * (1.0 + (((x * x) * (1.0 - (t_0 * ((x * ((x * x) * 0.16666666666666666)) * (x * (x * x)))))) / (1.0 - ((x * x) * t_0))))
	else:
		tmp = x * (0.5 * (x * ((x * x) / math.e)))
	return tmp
function code(x)
	t_0 = Float64(0.5 + Float64(x * Float64(x * 0.16666666666666666)))
	tmp = 0.0
	if (Float64(x * x) <= 1e+153)
		tmp = Float64(Float64(1.0 / exp(1)) * Float64(1.0 + Float64(Float64(Float64(x * x) * Float64(1.0 - Float64(t_0 * Float64(Float64(x * Float64(Float64(x * x) * 0.16666666666666666)) * Float64(x * Float64(x * x)))))) / Float64(1.0 - Float64(Float64(x * x) * t_0)))));
	else
		tmp = Float64(x * Float64(0.5 * Float64(x * Float64(Float64(x * x) / exp(1)))));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = 0.5 + (x * (x * 0.16666666666666666));
	tmp = 0.0;
	if ((x * x) <= 1e+153)
		tmp = (1.0 / 2.71828182845904523536) * (1.0 + (((x * x) * (1.0 - (t_0 * ((x * ((x * x) * 0.16666666666666666)) * (x * (x * x)))))) / (1.0 - ((x * x) * t_0))));
	else
		tmp = x * (0.5 * (x * ((x * x) / 2.71828182845904523536)));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(0.5 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 1e+153], N[(N[(1.0 / E), $MachinePrecision] * N[(1.0 + N[(N[(N[(x * x), $MachinePrecision] * N[(1.0 - N[(t$95$0 * N[(N[(x * N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[(x * x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(0.5 * N[(x * N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\\
\mathbf{if}\;x \cdot x \leq 10^{+153}:\\
\;\;\;\;\frac{1}{e} \cdot \left(1 + \frac{\left(x \cdot x\right) \cdot \left(1 - t\_0 \cdot \left(\left(x \cdot \left(\left(x \cdot x\right) \cdot 0.16666666666666666\right)\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)}{1 - \left(x \cdot x\right) \cdot t\_0}\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
    4. Simplified85.8%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \left(\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right) \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right) \]
      2. flip-+N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\left(1 \cdot 1 - \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(x \cdot x\right)}{\color{blue}{1 - \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)}}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(1 \cdot 1 - \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \left(x \cdot x\right)\right), \color{blue}{\left(1 - \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)}\right)\right)\right) \]
    6. Applied egg-rr89.8%

      \[\leadsto \frac{1}{e} \cdot \left(1 + \color{blue}{\frac{\left(1 - \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot \left(x \cdot x\right)}{1 - \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)}}\right) \]
    7. Taylor expanded in x around inf

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \color{blue}{\left(\frac{1}{6} \cdot {x}^{6}\right)}\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
    8. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\frac{1}{6} \cdot {x}^{\left(5 + 1\right)}\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\frac{1}{6} \cdot {x}^{\left(\left(4 + 1\right) + 1\right)}\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      3. pow-plusN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\frac{1}{6} \cdot \left({x}^{\left(4 + 1\right)} \cdot x\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      4. pow-plusN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\frac{1}{6} \cdot \left(\left({x}^{4} \cdot x\right) \cdot x\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\frac{1}{6} \cdot \left({x}^{4} \cdot \left(x \cdot x\right)\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\frac{1}{6} \cdot \left({x}^{4} \cdot {x}^{2}\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\left(\frac{1}{6} \cdot {x}^{4}\right) \cdot {x}^{2}\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\left(\frac{1}{6} \cdot {x}^{\left(2 \cdot 2\right)}\right) \cdot {x}^{2}\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      9. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\left(\frac{1}{6} \cdot \left({x}^{2} \cdot {x}^{2}\right)\right) \cdot {x}^{2}\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\left(\left(\frac{1}{6} \cdot {x}^{2}\right) \cdot {x}^{2}\right) \cdot {x}^{2}\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\left({x}^{2} \cdot \left(\frac{1}{6} \cdot {x}^{2}\right)\right) \cdot {x}^{2}\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\left(\left(x \cdot x\right) \cdot \left(\frac{1}{6} \cdot {x}^{2}\right)\right) \cdot {x}^{2}\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\left(x \cdot \left(x \cdot \left(\frac{1}{6} \cdot {x}^{2}\right)\right)\right) \cdot {x}^{2}\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\left(\left(x \cdot \left(\frac{1}{6} \cdot {x}^{2}\right)\right) \cdot x\right) \cdot {x}^{2}\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \left(\left(x \cdot \left(\frac{1}{6} \cdot {x}^{2}\right)\right) \cdot \left(x \cdot {x}^{2}\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \mathsf{*.f64}\left(\left(x \cdot \left(\frac{1}{6} \cdot {x}^{2}\right)\right), \left(x \cdot {x}^{2}\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{6} \cdot {x}^{2}\right)\right), \left(x \cdot {x}^{2}\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left({x}^{2} \cdot \frac{1}{6}\right)\right), \left(x \cdot {x}^{2}\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      19. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left({x}^{2}\right), \frac{1}{6}\right)\right), \left(x \cdot {x}^{2}\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      20. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(x \cdot x\right), \frac{1}{6}\right)\right), \left(x \cdot {x}^{2}\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      21. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{6}\right)\right), \left(x \cdot {x}^{2}\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      22. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{6}\right)\right), \mathsf{*.f64}\left(x, \left({x}^{2}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      23. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{6}\right)\right), \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      24. *-lowering-*.f6489.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{6}\right)\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right)\right), \mathsf{*.f64}\left(x, x\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
    9. Simplified89.7%

      \[\leadsto \frac{1}{e} \cdot \left(1 + \frac{\left(1 - \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right) \cdot \color{blue}{\left(\left(x \cdot \left(\left(x \cdot x\right) \cdot 0.16666666666666666\right)\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)}\right) \cdot \left(x \cdot x\right)}{1 - \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)}\right) \]

    if 1e153 < (*.f64 x x)

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]
    6. Taylor expanded in x around inf

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

        \[\leadsto \frac{1}{2} \cdot \frac{{x}^{\left(2 \cdot 2\right)}}{\mathsf{E}\left(\right)} \]
      2. pow-sqrN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)}\right) \]
      12. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)\right) \]
      13. associate-*l/N/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right) \cdot {x}^{2}\right) \cdot x\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right) \cdot x\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right)}\right)\right) \]
      17. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\color{blue}{\mathsf{E}\left(\right)}}\right)\right)\right) \]
      20. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)\right)\right) \]
    8. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot \left(\left(x \cdot \frac{x \cdot x}{e}\right) \cdot 0.5\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.6%

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

Alternative 11: 93.7% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(x \cdot x\right)\\ t_1 := x \cdot \left(x \cdot 0.16666666666666666\right)\\ \mathbf{if}\;x \cdot x \leq 10^{+153}:\\ \;\;\;\;\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \frac{\left(x \cdot x\right) \cdot \left(0.125 + t\_0 \cdot \left(t\_0 \cdot 0.004629629629629629\right)\right)}{0.25 + t\_1 \cdot \left(t\_1 + -0.5\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* x (* x x))) (t_1 (* x (* x 0.16666666666666666))))
   (if (<= (* x x) 1e+153)
     (*
      (/ 1.0 E)
      (+
       1.0
       (*
        (* x x)
        (+
         1.0
         (/
          (* (* x x) (+ 0.125 (* t_0 (* t_0 0.004629629629629629))))
          (+ 0.25 (* t_1 (+ t_1 -0.5))))))))
     (* x (* 0.5 (* x (/ (* x x) E)))))))
double code(double x) {
	double t_0 = x * (x * x);
	double t_1 = x * (x * 0.16666666666666666);
	double tmp;
	if ((x * x) <= 1e+153) {
		tmp = (1.0 / ((double) M_E)) * (1.0 + ((x * x) * (1.0 + (((x * x) * (0.125 + (t_0 * (t_0 * 0.004629629629629629)))) / (0.25 + (t_1 * (t_1 + -0.5)))))));
	} else {
		tmp = x * (0.5 * (x * ((x * x) / ((double) M_E))));
	}
	return tmp;
}
public static double code(double x) {
	double t_0 = x * (x * x);
	double t_1 = x * (x * 0.16666666666666666);
	double tmp;
	if ((x * x) <= 1e+153) {
		tmp = (1.0 / Math.E) * (1.0 + ((x * x) * (1.0 + (((x * x) * (0.125 + (t_0 * (t_0 * 0.004629629629629629)))) / (0.25 + (t_1 * (t_1 + -0.5)))))));
	} else {
		tmp = x * (0.5 * (x * ((x * x) / Math.E)));
	}
	return tmp;
}
def code(x):
	t_0 = x * (x * x)
	t_1 = x * (x * 0.16666666666666666)
	tmp = 0
	if (x * x) <= 1e+153:
		tmp = (1.0 / math.e) * (1.0 + ((x * x) * (1.0 + (((x * x) * (0.125 + (t_0 * (t_0 * 0.004629629629629629)))) / (0.25 + (t_1 * (t_1 + -0.5)))))))
	else:
		tmp = x * (0.5 * (x * ((x * x) / math.e)))
	return tmp
function code(x)
	t_0 = Float64(x * Float64(x * x))
	t_1 = Float64(x * Float64(x * 0.16666666666666666))
	tmp = 0.0
	if (Float64(x * x) <= 1e+153)
		tmp = Float64(Float64(1.0 / exp(1)) * Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(Float64(x * x) * Float64(0.125 + Float64(t_0 * Float64(t_0 * 0.004629629629629629)))) / Float64(0.25 + Float64(t_1 * Float64(t_1 + -0.5))))))));
	else
		tmp = Float64(x * Float64(0.5 * Float64(x * Float64(Float64(x * x) / exp(1)))));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = x * (x * x);
	t_1 = x * (x * 0.16666666666666666);
	tmp = 0.0;
	if ((x * x) <= 1e+153)
		tmp = (1.0 / 2.71828182845904523536) * (1.0 + ((x * x) * (1.0 + (((x * x) * (0.125 + (t_0 * (t_0 * 0.004629629629629629)))) / (0.25 + (t_1 * (t_1 + -0.5)))))));
	else
		tmp = x * (0.5 * (x * ((x * x) / 2.71828182845904523536)));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 1e+153], N[(N[(1.0 / E), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(N[(x * x), $MachinePrecision] * N[(0.125 + N[(t$95$0 * N[(t$95$0 * 0.004629629629629629), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.25 + N[(t$95$1 * N[(t$95$1 + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(0.5 * N[(x * N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := x \cdot \left(x \cdot 0.16666666666666666\right)\\
\mathbf{if}\;x \cdot x \leq 10^{+153}:\\
\;\;\;\;\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \frac{\left(x \cdot x\right) \cdot \left(0.125 + t\_0 \cdot \left(t\_0 \cdot 0.004629629629629629\right)\right)}{0.25 + t\_1 \cdot \left(t\_1 + -0.5\right)}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
    4. Simplified85.8%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right) \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right)\right)\right) \]
      2. flip3-+N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \left(\frac{\left({\frac{1}{2}}^{3} + {\left(\left(x \cdot x\right) \cdot \frac{1}{6}\right)}^{3}\right) \cdot \left(x \cdot x\right)}{\color{blue}{\frac{1}{2} \cdot \frac{1}{2} + \left(\left(\left(x \cdot x\right) \cdot \frac{1}{6}\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{1}{6}\right) - \frac{1}{2} \cdot \left(\left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)}}\right)\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left({\frac{1}{2}}^{3} + {\left(\left(x \cdot x\right) \cdot \frac{1}{6}\right)}^{3}\right) \cdot \left(x \cdot x\right)\right), \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{2} + \left(\left(\left(x \cdot x\right) \cdot \frac{1}{6}\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{1}{6}\right) - \frac{1}{2} \cdot \left(\left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right)}\right)\right)\right)\right)\right) \]
    6. Applied egg-rr88.6%

      \[\leadsto \frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \color{blue}{\frac{\left(0.125 + \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 0.004629629629629629\right)\right) \cdot \left(x \cdot x\right)}{0.25 + \left(x \cdot \left(x \cdot 0.16666666666666666\right)\right) \cdot \left(x \cdot \left(x \cdot 0.16666666666666666\right) + -0.5\right)}}\right)\right) \]

    if 1e153 < (*.f64 x x)

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]
    6. Taylor expanded in x around inf

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

        \[\leadsto \frac{1}{2} \cdot \frac{{x}^{\left(2 \cdot 2\right)}}{\mathsf{E}\left(\right)} \]
      2. pow-sqrN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)}\right) \]
      12. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)\right) \]
      13. associate-*l/N/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right) \cdot {x}^{2}\right) \cdot x\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right) \cdot x\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right)}\right)\right) \]
      17. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\color{blue}{\mathsf{E}\left(\right)}}\right)\right)\right) \]
      20. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)\right)\right) \]
    8. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot \left(\left(x \cdot \frac{x \cdot x}{e}\right) \cdot 0.5\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 10^{+153}:\\ \;\;\;\;\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \frac{\left(x \cdot x\right) \cdot \left(0.125 + \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\left(x \cdot \left(x \cdot x\right)\right) \cdot 0.004629629629629629\right)\right)}{0.25 + \left(x \cdot \left(x \cdot 0.16666666666666666\right)\right) \cdot \left(x \cdot \left(x \cdot 0.16666666666666666\right) + -0.5\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 93.6% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{x}{2}\\ t_1 := \left(x \cdot x\right) \cdot \left(-1 - t\_0\right)\\ \mathbf{if}\;x \cdot x \leq 10^{+153}:\\ \;\;\;\;\frac{\frac{1 + \left(\left(x \cdot x\right) \cdot \left(1 + t\_0\right)\right) \cdot t\_1}{e}}{1 + t\_1}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* x (/ x 2.0))) (t_1 (* (* x x) (- -1.0 t_0))))
   (if (<= (* x x) 1e+153)
     (/ (/ (+ 1.0 (* (* (* x x) (+ 1.0 t_0)) t_1)) E) (+ 1.0 t_1))
     (* x (* 0.5 (* x (/ (* x x) E)))))))
double code(double x) {
	double t_0 = x * (x / 2.0);
	double t_1 = (x * x) * (-1.0 - t_0);
	double tmp;
	if ((x * x) <= 1e+153) {
		tmp = ((1.0 + (((x * x) * (1.0 + t_0)) * t_1)) / ((double) M_E)) / (1.0 + t_1);
	} else {
		tmp = x * (0.5 * (x * ((x * x) / ((double) M_E))));
	}
	return tmp;
}
public static double code(double x) {
	double t_0 = x * (x / 2.0);
	double t_1 = (x * x) * (-1.0 - t_0);
	double tmp;
	if ((x * x) <= 1e+153) {
		tmp = ((1.0 + (((x * x) * (1.0 + t_0)) * t_1)) / Math.E) / (1.0 + t_1);
	} else {
		tmp = x * (0.5 * (x * ((x * x) / Math.E)));
	}
	return tmp;
}
def code(x):
	t_0 = x * (x / 2.0)
	t_1 = (x * x) * (-1.0 - t_0)
	tmp = 0
	if (x * x) <= 1e+153:
		tmp = ((1.0 + (((x * x) * (1.0 + t_0)) * t_1)) / math.e) / (1.0 + t_1)
	else:
		tmp = x * (0.5 * (x * ((x * x) / math.e)))
	return tmp
function code(x)
	t_0 = Float64(x * Float64(x / 2.0))
	t_1 = Float64(Float64(x * x) * Float64(-1.0 - t_0))
	tmp = 0.0
	if (Float64(x * x) <= 1e+153)
		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(x * x) * Float64(1.0 + t_0)) * t_1)) / exp(1)) / Float64(1.0 + t_1));
	else
		tmp = Float64(x * Float64(0.5 * Float64(x * Float64(Float64(x * x) / exp(1)))));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = x * (x / 2.0);
	t_1 = (x * x) * (-1.0 - t_0);
	tmp = 0.0;
	if ((x * x) <= 1e+153)
		tmp = ((1.0 + (((x * x) * (1.0 + t_0)) * t_1)) / 2.71828182845904523536) / (1.0 + t_1);
	else
		tmp = x * (0.5 * (x * ((x * x) / 2.71828182845904523536)));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(x * N[(x / 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 1e+153], N[(N[(N[(1.0 + N[(N[(N[(x * x), $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(x * N[(0.5 * N[(x * N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{x}{2}\\
t_1 := \left(x \cdot x\right) \cdot \left(-1 - t\_0\right)\\
\mathbf{if}\;x \cdot x \leq 10^{+153}:\\
\;\;\;\;\frac{\frac{1 + \left(\left(x \cdot x\right) \cdot \left(1 + t\_0\right)\right) \cdot t\_1}{e}}{1 + t\_1}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{-1}\right), \color{blue}{\left(\left({x}^{2} + 1\right) + {x}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)\right)}\right) \]
    5. Simplified80.3%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 \cdot 1 - \left(x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right) \cdot \frac{1}{\mathsf{E}\left(\right)}\right), \color{blue}{\left(1 - x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right)}\right) \]
    7. Applied egg-rr88.5%

      \[\leadsto \color{blue}{\frac{\frac{1 - \left(\left(x \cdot x\right) \cdot \left(1 + x \cdot \frac{x}{2}\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(1 + x \cdot \frac{x}{2}\right)\right)}{e}}{1 - \left(x \cdot x\right) \cdot \left(1 + x \cdot \frac{x}{2}\right)}} \]

    if 1e153 < (*.f64 x x)

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]
    6. Taylor expanded in x around inf

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

        \[\leadsto \frac{1}{2} \cdot \frac{{x}^{\left(2 \cdot 2\right)}}{\mathsf{E}\left(\right)} \]
      2. pow-sqrN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)}\right) \]
      12. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)\right) \]
      13. associate-*l/N/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right) \cdot {x}^{2}\right) \cdot x\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right) \cdot x\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right)}\right)\right) \]
      17. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\color{blue}{\mathsf{E}\left(\right)}}\right)\right)\right) \]
      20. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)\right)\right) \]
    8. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot \left(\left(x \cdot \frac{x \cdot x}{e}\right) \cdot 0.5\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.8%

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

Alternative 13: 93.6% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\frac{2}{x}}\\ \mathbf{if}\;x \cdot x \leq 10^{+153}:\\ \;\;\;\;\frac{1 + \frac{\left(x \cdot x\right) \cdot \left(1 + \frac{\left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)}{8}\right)}{1 + t\_0 \cdot \left(-1 + t\_0\right)}}{e}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (/ x (/ 2.0 x))))
   (if (<= (* x x) 1e+153)
     (/
      (+
       1.0
       (/
        (* (* x x) (+ 1.0 (/ (* (* x x) (* x (* x (* x x)))) 8.0)))
        (+ 1.0 (* t_0 (+ -1.0 t_0)))))
      E)
     (* x (* 0.5 (* x (/ (* x x) E)))))))
double code(double x) {
	double t_0 = x / (2.0 / x);
	double tmp;
	if ((x * x) <= 1e+153) {
		tmp = (1.0 + (((x * x) * (1.0 + (((x * x) * (x * (x * (x * x)))) / 8.0))) / (1.0 + (t_0 * (-1.0 + t_0))))) / ((double) M_E);
	} else {
		tmp = x * (0.5 * (x * ((x * x) / ((double) M_E))));
	}
	return tmp;
}
public static double code(double x) {
	double t_0 = x / (2.0 / x);
	double tmp;
	if ((x * x) <= 1e+153) {
		tmp = (1.0 + (((x * x) * (1.0 + (((x * x) * (x * (x * (x * x)))) / 8.0))) / (1.0 + (t_0 * (-1.0 + t_0))))) / Math.E;
	} else {
		tmp = x * (0.5 * (x * ((x * x) / Math.E)));
	}
	return tmp;
}
def code(x):
	t_0 = x / (2.0 / x)
	tmp = 0
	if (x * x) <= 1e+153:
		tmp = (1.0 + (((x * x) * (1.0 + (((x * x) * (x * (x * (x * x)))) / 8.0))) / (1.0 + (t_0 * (-1.0 + t_0))))) / math.e
	else:
		tmp = x * (0.5 * (x * ((x * x) / math.e)))
	return tmp
function code(x)
	t_0 = Float64(x / Float64(2.0 / x))
	tmp = 0.0
	if (Float64(x * x) <= 1e+153)
		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(Float64(x * x) * Float64(x * Float64(x * Float64(x * x)))) / 8.0))) / Float64(1.0 + Float64(t_0 * Float64(-1.0 + t_0))))) / exp(1));
	else
		tmp = Float64(x * Float64(0.5 * Float64(x * Float64(Float64(x * x) / exp(1)))));
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = x / (2.0 / x);
	tmp = 0.0;
	if ((x * x) <= 1e+153)
		tmp = (1.0 + (((x * x) * (1.0 + (((x * x) * (x * (x * (x * x)))) / 8.0))) / (1.0 + (t_0 * (-1.0 + t_0))))) / 2.71828182845904523536;
	else
		tmp = x * (0.5 * (x * ((x * x) / 2.71828182845904523536)));
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(x / N[(2.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * x), $MachinePrecision], 1e+153], N[(N[(1.0 + N[(N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(N[(x * x), $MachinePrecision] * N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(t$95$0 * N[(-1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision], N[(x * N[(0.5 * N[(x * N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\frac{2}{x}}\\
\mathbf{if}\;x \cdot x \leq 10^{+153}:\\
\;\;\;\;\frac{1 + \frac{\left(x \cdot x\right) \cdot \left(1 + \frac{\left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)}{8}\right)}{1 + t\_0 \cdot \left(-1 + t\_0\right)}}{e}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{-1}\right), \color{blue}{\left(\left({x}^{2} + 1\right) + {x}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)\right)}\right) \]
    5. Simplified80.3%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \color{blue}{\mathsf{E}\left(\right)}\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\left(x \cdot x\right) \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      11. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\frac{x}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, 2\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      13. E-lowering-E.f6480.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, 2\right)\right)\right)\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    7. Applied egg-rr80.3%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\left(1 + x \cdot \frac{x}{2}\right) \cdot \left(x \cdot x\right)\right)\right), \mathsf{E.f64}\left(\right)\right) \]
      2. flip3-+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{{1}^{3} + {\left(x \cdot \frac{x}{2}\right)}^{3}}{1 \cdot 1 + \left(\left(x \cdot \frac{x}{2}\right) \cdot \left(x \cdot \frac{x}{2}\right) - 1 \cdot \left(x \cdot \frac{x}{2}\right)\right)} \cdot \left(x \cdot x\right)\right)\right), \mathsf{E.f64}\left(\right)\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\left({1}^{3} + {\left(x \cdot \frac{x}{2}\right)}^{3}\right) \cdot \left(x \cdot x\right)}{1 \cdot 1 + \left(\left(x \cdot \frac{x}{2}\right) \cdot \left(x \cdot \frac{x}{2}\right) - 1 \cdot \left(x \cdot \frac{x}{2}\right)\right)}\right)\right), \mathsf{E.f64}\left(\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left({1}^{3} + {\left(x \cdot \frac{x}{2}\right)}^{3}\right) \cdot \left(x \cdot x\right)\right), \left(1 \cdot 1 + \left(\left(x \cdot \frac{x}{2}\right) \cdot \left(x \cdot \frac{x}{2}\right) - 1 \cdot \left(x \cdot \frac{x}{2}\right)\right)\right)\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    9. Applied egg-rr88.5%

      \[\leadsto \frac{1 + \color{blue}{\frac{\left(1 + \frac{\left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)}{8}\right) \cdot \left(x \cdot x\right)}{1 + \frac{x}{\frac{2}{x}} \cdot \left(\frac{x}{\frac{2}{x}} - 1\right)}}}{e} \]

    if 1e153 < (*.f64 x x)

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]
    6. Taylor expanded in x around inf

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

        \[\leadsto \frac{1}{2} \cdot \frac{{x}^{\left(2 \cdot 2\right)}}{\mathsf{E}\left(\right)} \]
      2. pow-sqrN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)}\right) \]
      12. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)\right) \]
      13. associate-*l/N/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right) \cdot {x}^{2}\right) \cdot x\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right) \cdot x\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right)}\right)\right) \]
      17. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\color{blue}{\mathsf{E}\left(\right)}}\right)\right)\right) \]
      20. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)\right)\right) \]
    8. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot \left(\left(x \cdot \frac{x \cdot x}{e}\right) \cdot 0.5\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 10^{+153}:\\ \;\;\;\;\frac{1 + \frac{\left(x \cdot x\right) \cdot \left(1 + \frac{\left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)}{8}\right)}{1 + \frac{x}{\frac{2}{x}} \cdot \left(-1 + \frac{x}{\frac{2}{x}}\right)}}{e}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 91.7% accurate, 4.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot x}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= (* x x) 5e-5)
   (* (/ 1.0 E) (+ 1.0 (* x (* x (+ 1.0 (* x (* x 0.5)))))))
   (*
    (/ (* x x) E)
    (+ 1.0 (* x (* x (+ 0.5 (* (* x x) 0.16666666666666666))))))))
double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / ((double) M_E)) * (1.0 + (x * (x * (1.0 + (x * (x * 0.5))))));
	} else {
		tmp = ((x * x) / ((double) M_E)) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666)))));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / Math.E) * (1.0 + (x * (x * (1.0 + (x * (x * 0.5))))));
	} else {
		tmp = ((x * x) / Math.E) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666)))));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x * x) <= 5e-5:
		tmp = (1.0 / math.e) * (1.0 + (x * (x * (1.0 + (x * (x * 0.5))))))
	else:
		tmp = ((x * x) / math.e) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666)))))
	return tmp
function code(x)
	tmp = 0.0
	if (Float64(x * x) <= 5e-5)
		tmp = Float64(Float64(1.0 / exp(1)) * Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + Float64(x * Float64(x * 0.5)))))));
	else
		tmp = Float64(Float64(Float64(x * x) / exp(1)) * Float64(1.0 + Float64(x * Float64(x * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666))))));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x * x) <= 5e-5)
		tmp = (1.0 / 2.71828182845904523536) * (1.0 + (x * (x * (1.0 + (x * (x * 0.5))))));
	else
		tmp = ((x * x) / 2.71828182845904523536) * (1.0 + (x * (x * (0.5 + ((x * x) * 0.16666666666666666)))));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-5], N[(N[(1.0 / E), $MachinePrecision] * N[(1.0 + N[(x * N[(x * N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision] * N[(1.0 + N[(x * N[(x * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot x}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{-1}\right), \color{blue}{\left(\left({x}^{2} + 1\right) + {x}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)\right)}\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]

    if 5.00000000000000024e-5 < (*.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 \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
    4. Simplified82.4%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\mathsf{E}\left(\right)} \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right) + \color{blue}{1}\right) \]
      2. distribute-rgt-inN/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \mathsf{E}\left(\right) + \mathsf{E}\left(\right) \cdot 1\right), \color{blue}{\left(\mathsf{E}\left(\right) \cdot \mathsf{E}\left(\right)\right)}\right) \]
    6. Applied egg-rr82.4%

      \[\leadsto \color{blue}{\frac{\left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot e + e}{e \cdot e}} \]
    7. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{6} \cdot \left(\frac{\frac{1}{2}}{{x}^{2} \cdot \mathsf{E}\left(\right)} + \left(\frac{1}{6} \cdot \frac{1}{\mathsf{E}\left(\right)} + \frac{1}{{x}^{4} \cdot \mathsf{E}\left(\right)}\right)\right)} \]
    8. Simplified82.4%

      \[\leadsto \color{blue}{\frac{x \cdot x}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 91.7% accurate, 4.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666}{e}\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= (* x x) 5e-5)
   (* (/ 1.0 E) (+ 1.0 (* x (* x (+ 1.0 (* x (* x 0.5)))))))
   (* (* x x) (* (* x x) (/ (+ 0.5 (* (* x x) 0.16666666666666666)) E)))))
double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / ((double) M_E)) * (1.0 + (x * (x * (1.0 + (x * (x * 0.5))))));
	} else {
		tmp = (x * x) * ((x * x) * ((0.5 + ((x * x) * 0.16666666666666666)) / ((double) M_E)));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / Math.E) * (1.0 + (x * (x * (1.0 + (x * (x * 0.5))))));
	} else {
		tmp = (x * x) * ((x * x) * ((0.5 + ((x * x) * 0.16666666666666666)) / Math.E));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x * x) <= 5e-5:
		tmp = (1.0 / math.e) * (1.0 + (x * (x * (1.0 + (x * (x * 0.5))))))
	else:
		tmp = (x * x) * ((x * x) * ((0.5 + ((x * x) * 0.16666666666666666)) / math.e))
	return tmp
function code(x)
	tmp = 0.0
	if (Float64(x * x) <= 5e-5)
		tmp = Float64(Float64(1.0 / exp(1)) * Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + Float64(x * Float64(x * 0.5)))))));
	else
		tmp = Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666)) / exp(1))));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x * x) <= 5e-5)
		tmp = (1.0 / 2.71828182845904523536) * (1.0 + (x * (x * (1.0 + (x * (x * 0.5))))));
	else
		tmp = (x * x) * ((x * x) * ((0.5 + ((x * x) * 0.16666666666666666)) / 2.71828182845904523536));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-5], N[(N[(1.0 / E), $MachinePrecision] * N[(1.0 + N[(x * N[(x * N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666}{e}\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{-1}\right), \color{blue}{\left(\left({x}^{2} + 1\right) + {x}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)\right)}\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]

    if 5.00000000000000024e-5 < (*.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 \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
    4. Simplified82.4%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Taylor expanded in x around inf

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

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(\frac{x \cdot x}{e} \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-inN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{2} \cdot \frac{x \cdot x}{\mathsf{E}\left(\right)} + \left(x \cdot \left(x \cdot \frac{1}{6}\right)\right) \cdot \frac{\color{blue}{x \cdot x}}{\mathsf{E}\left(\right)}\right)\right) \]
      3. distribute-rgt-inN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\left(x \cdot x\right) \cdot \color{blue}{\frac{\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{6}\right)}{\mathsf{E}\left(\right)}}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\frac{\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{6}\right)}{\mathsf{E}\left(\right)}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{\color{blue}{\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{6}\right)}}{\mathsf{E}\left(\right)}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{6}\right)\right), \color{blue}{\mathsf{E}\left(\right)}\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(x \cdot \frac{1}{6}\right)\right)\right), \mathsf{E}\left(\right)\right)\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \left(\left(x \cdot x\right) \cdot \frac{1}{6}\right)\right), \mathsf{E}\left(\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(x \cdot x\right), \frac{1}{6}\right)\right), \mathsf{E}\left(\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{6}\right)\right), \mathsf{E}\left(\right)\right)\right)\right) \]
      13. E-lowering-E.f6482.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{6}\right)\right), \mathsf{E.f64}\left(\right)\right)\right)\right) \]
    8. Applied egg-rr82.4%

      \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot \frac{0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666}{e}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 91.7% accurate, 4.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\frac{1 + \left(x \cdot x\right) \cdot \left(1 + x \cdot \frac{x}{2}\right)}{e}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666}{e}\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= (* x x) 5e-5)
   (/ (+ 1.0 (* (* x x) (+ 1.0 (* x (/ x 2.0))))) E)
   (* (* x x) (* (* x x) (/ (+ 0.5 (* (* x x) 0.16666666666666666)) E)))))
double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 + ((x * x) * (1.0 + (x * (x / 2.0))))) / ((double) M_E);
	} else {
		tmp = (x * x) * ((x * x) * ((0.5 + ((x * x) * 0.16666666666666666)) / ((double) M_E)));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 + ((x * x) * (1.0 + (x * (x / 2.0))))) / Math.E;
	} else {
		tmp = (x * x) * ((x * x) * ((0.5 + ((x * x) * 0.16666666666666666)) / Math.E));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x * x) <= 5e-5:
		tmp = (1.0 + ((x * x) * (1.0 + (x * (x / 2.0))))) / math.e
	else:
		tmp = (x * x) * ((x * x) * ((0.5 + ((x * x) * 0.16666666666666666)) / math.e))
	return tmp
function code(x)
	tmp = 0.0
	if (Float64(x * x) <= 5e-5)
		tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(x * Float64(x / 2.0))))) / exp(1));
	else
		tmp = Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666)) / exp(1))));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x * x) <= 5e-5)
		tmp = (1.0 + ((x * x) * (1.0 + (x * (x / 2.0))))) / 2.71828182845904523536;
	else
		tmp = (x * x) * ((x * x) * ((0.5 + ((x * x) * 0.16666666666666666)) / 2.71828182845904523536));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-5], N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(x * N[(x / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\frac{1 + \left(x \cdot x\right) \cdot \left(1 + x \cdot \frac{x}{2}\right)}{e}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \frac{0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666}{e}\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{-1}\right), \color{blue}{\left(\left({x}^{2} + 1\right) + {x}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)\right)}\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \color{blue}{\mathsf{E}\left(\right)}\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\left(x \cdot x\right) \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      11. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\frac{x}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, 2\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      13. E-lowering-E.f6499.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, 2\right)\right)\right)\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    7. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{1 + \left(x \cdot x\right) \cdot \left(1 + x \cdot \frac{x}{2}\right)}{e}} \]

    if 5.00000000000000024e-5 < (*.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 \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
    4. Simplified82.4%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Taylor expanded in x around inf

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

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(\frac{x \cdot x}{e} \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-inN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{2} \cdot \frac{x \cdot x}{\mathsf{E}\left(\right)} + \left(x \cdot \left(x \cdot \frac{1}{6}\right)\right) \cdot \frac{\color{blue}{x \cdot x}}{\mathsf{E}\left(\right)}\right)\right) \]
      3. distribute-rgt-inN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\left(x \cdot x\right) \cdot \color{blue}{\frac{\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{6}\right)}{\mathsf{E}\left(\right)}}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\frac{\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{6}\right)}{\mathsf{E}\left(\right)}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{\color{blue}{\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{6}\right)}}{\mathsf{E}\left(\right)}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{6}\right)\right), \color{blue}{\mathsf{E}\left(\right)}\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(x \cdot \frac{1}{6}\right)\right)\right), \mathsf{E}\left(\right)\right)\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \left(\left(x \cdot x\right) \cdot \frac{1}{6}\right)\right), \mathsf{E}\left(\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(x \cdot x\right), \frac{1}{6}\right)\right), \mathsf{E}\left(\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{6}\right)\right), \mathsf{E}\left(\right)\right)\right)\right) \]
      13. E-lowering-E.f6482.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{6}\right)\right), \mathsf{E.f64}\left(\right)\right)\right)\right) \]
    8. Applied egg-rr82.4%

      \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot \frac{0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666}{e}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 91.9% accurate, 4.6× speedup?

\[\begin{array}{l} \\ \frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right) \end{array} \]
(FPCore (x)
 :precision binary64
 (*
  (/ 1.0 E)
  (+
   1.0
   (* (* x x) (+ 1.0 (* (* x x) (+ 0.5 (* (* x x) 0.16666666666666666))))))))
double code(double x) {
	return (1.0 / ((double) M_E)) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))));
}
public static double code(double x) {
	return (1.0 / Math.E) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))));
}
def code(x):
	return (1.0 / math.e) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))))
function code(x)
	return Float64(Float64(1.0 / exp(1)) * Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(Float64(x * x) * 0.16666666666666666)))))))
end
function tmp = code(x)
	tmp = (1.0 / 2.71828182845904523536) * (1.0 + ((x * x) * (1.0 + ((x * x) * (0.5 + ((x * x) * 0.16666666666666666))))));
end
code[x_] := N[(N[(1.0 / E), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(N[(x * x), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)
\end{array}
Derivation
  1. Initial program 100.0%

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

    \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
  4. Simplified91.1%

    \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
  5. Add Preprocessing

Alternative 18: 91.7% accurate, 4.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\frac{1 + \left(x \cdot x\right) \cdot \left(1 + x \cdot \frac{x}{2}\right)}{e}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(0.16666666666666666 \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= (* x x) 5e-5)
   (/ (+ 1.0 (* (* x x) (+ 1.0 (* x (/ x 2.0))))) E)
   (* (* x x) (* (* x x) (* 0.16666666666666666 (/ (* x x) E))))))
double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 + ((x * x) * (1.0 + (x * (x / 2.0))))) / ((double) M_E);
	} else {
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / ((double) M_E))));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 + ((x * x) * (1.0 + (x * (x / 2.0))))) / Math.E;
	} else {
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / Math.E)));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x * x) <= 5e-5:
		tmp = (1.0 + ((x * x) * (1.0 + (x * (x / 2.0))))) / math.e
	else:
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / math.e)))
	return tmp
function code(x)
	tmp = 0.0
	if (Float64(x * x) <= 5e-5)
		tmp = Float64(Float64(1.0 + Float64(Float64(x * x) * Float64(1.0 + Float64(x * Float64(x / 2.0))))) / exp(1));
	else
		tmp = Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(0.16666666666666666 * Float64(Float64(x * x) / exp(1)))));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x * x) <= 5e-5)
		tmp = (1.0 + ((x * x) * (1.0 + (x * (x / 2.0))))) / 2.71828182845904523536;
	else
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / 2.71828182845904523536)));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-5], N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(1.0 + N[(x * N[(x / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(0.16666666666666666 * N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\frac{1 + \left(x \cdot x\right) \cdot \left(1 + x \cdot \frac{x}{2}\right)}{e}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(0.16666666666666666 \cdot \frac{x \cdot x}{e}\right)\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{-1}\right), \color{blue}{\left(\left({x}^{2} + 1\right) + {x}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)\right)}\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \color{blue}{\mathsf{E}\left(\right)}\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\left(x \cdot x\right) \cdot \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(1 + x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      11. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\frac{x}{2}\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, 2\right)\right)\right)\right)\right), \mathsf{E}\left(\right)\right) \]
      13. E-lowering-E.f6499.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, 2\right)\right)\right)\right)\right), \mathsf{E.f64}\left(\right)\right) \]
    7. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{1 + \left(x \cdot x\right) \cdot \left(1 + x \cdot \frac{x}{2}\right)}{e}} \]

    if 5.00000000000000024e-5 < (*.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 \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
    4. Simplified82.4%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\mathsf{E}\left(\right)} \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right) + \color{blue}{1}\right) \]
      2. distribute-rgt-inN/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \mathsf{E}\left(\right) + \mathsf{E}\left(\right) \cdot 1\right), \color{blue}{\left(\mathsf{E}\left(\right) \cdot \mathsf{E}\left(\right)\right)}\right) \]
    6. Applied egg-rr82.4%

      \[\leadsto \color{blue}{\frac{\left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot e + e}{e \cdot e}} \]
    7. Taylor expanded in x around inf

      \[\leadsto \color{blue}{\frac{1}{6} \cdot \frac{{x}^{6}}{\mathsf{E}\left(\right)}} \]
    8. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \frac{{x}^{6} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      3. metadata-evalN/A

        \[\leadsto \frac{{x}^{\left(5 + 1\right)} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{{x}^{\left(\left(4 + 1\right) + 1\right)} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      5. pow-plusN/A

        \[\leadsto \frac{\left({x}^{\left(4 + 1\right)} \cdot x\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      6. pow-plusN/A

        \[\leadsto \frac{\left(\left({x}^{4} \cdot x\right) \cdot x\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left({x}^{4} \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{\left({x}^{4} \cdot {x}^{2}\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\left({x}^{2} \cdot {x}^{4}\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{6} \cdot \left({x}^{2} \cdot {x}^{4}\right)}{\mathsf{E}\left(\right)} \]
      11. associate-*l*N/A

        \[\leadsto \frac{\left(\frac{1}{6} \cdot {x}^{2}\right) \cdot {x}^{4}}{\mathsf{E}\left(\right)} \]
      12. associate-*l/N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2}\right), \color{blue}{\left(\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot {x}^{2}\right)}\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)} \cdot {x}^{2}\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)} \cdot {x}^{2}\right)\right) \]
      21. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left({x}^{2} \cdot \color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)}\right)\right) \]
      22. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left({x}^{2}\right), \color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)}\right)\right) \]
    9. Simplified82.4%

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{x \cdot x}{e} \cdot 0.16666666666666666\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.1%

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

Alternative 19: 91.7% accurate, 4.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{e} \cdot \left(1 + x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(0.16666666666666666 \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= (* x x) 5e-5)
   (* (/ 1.0 E) (+ 1.0 (* x x)))
   (* (* x x) (* (* x x) (* 0.16666666666666666 (/ (* x x) E))))))
double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / ((double) M_E)) * (1.0 + (x * x));
	} else {
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / ((double) M_E))));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / Math.E) * (1.0 + (x * x));
	} else {
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / Math.E)));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x * x) <= 5e-5:
		tmp = (1.0 / math.e) * (1.0 + (x * x))
	else:
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / math.e)))
	return tmp
function code(x)
	tmp = 0.0
	if (Float64(x * x) <= 5e-5)
		tmp = Float64(Float64(1.0 / exp(1)) * Float64(1.0 + Float64(x * x)));
	else
		tmp = Float64(Float64(x * x) * Float64(Float64(x * x) * Float64(0.16666666666666666 * Float64(Float64(x * x) / exp(1)))));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x * x) <= 5e-5)
		tmp = (1.0 / 2.71828182845904523536) * (1.0 + (x * x));
	else
		tmp = (x * x) * ((x * x) * (0.16666666666666666 * ((x * x) / 2.71828182845904523536)));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-5], N[(N[(1.0 / E), $MachinePrecision] * N[(1.0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(0.16666666666666666 * N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{e} \cdot \left(1 + x \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(0.16666666666666666 \cdot \frac{x \cdot x}{e}\right)\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot e^{-1}} \]
    4. Step-by-step derivation
      1. distribute-rgt1-inN/A

        \[\leadsto \left({x}^{2} + 1\right) \cdot \color{blue}{e^{-1}} \]
      2. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{\mathsf{neg}\left(1\right)}\right), \left({\color{blue}{x}}^{2} + 1\right)\right) \]
      5. rec-expN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{e^{1}}\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(e^{1}\right)\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
      7. exp-1-eN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
      8. E-lowering-E.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
      9. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(x \cdot x\right), 1\right)\right) \]
      11. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), 1\right)\right) \]
    5. Simplified99.7%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(x \cdot x + 1\right)} \]

    if 5.00000000000000024e-5 < (*.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 \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
    4. Simplified82.4%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\mathsf{E}\left(\right)} \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right) + \color{blue}{1}\right) \]
      2. distribute-rgt-inN/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right) \cdot \mathsf{E}\left(\right) + \mathsf{E}\left(\right) \cdot 1\right), \color{blue}{\left(\mathsf{E}\left(\right) \cdot \mathsf{E}\left(\right)\right)}\right) \]
    6. Applied egg-rr82.4%

      \[\leadsto \color{blue}{\frac{\left(x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)\right) \cdot e + e}{e \cdot e}} \]
    7. Taylor expanded in x around inf

      \[\leadsto \color{blue}{\frac{1}{6} \cdot \frac{{x}^{6}}{\mathsf{E}\left(\right)}} \]
    8. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \frac{{x}^{6} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      3. metadata-evalN/A

        \[\leadsto \frac{{x}^{\left(5 + 1\right)} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{{x}^{\left(\left(4 + 1\right) + 1\right)} \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      5. pow-plusN/A

        \[\leadsto \frac{\left({x}^{\left(4 + 1\right)} \cdot x\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      6. pow-plusN/A

        \[\leadsto \frac{\left(\left({x}^{4} \cdot x\right) \cdot x\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\left({x}^{4} \cdot \left(x \cdot x\right)\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{\left({x}^{4} \cdot {x}^{2}\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\left({x}^{2} \cdot {x}^{4}\right) \cdot \frac{1}{6}}{\mathsf{E}\left(\right)} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{6} \cdot \left({x}^{2} \cdot {x}^{4}\right)}{\mathsf{E}\left(\right)} \]
      11. associate-*l*N/A

        \[\leadsto \frac{\left(\frac{1}{6} \cdot {x}^{2}\right) \cdot {x}^{4}}{\mathsf{E}\left(\right)} \]
      12. associate-*l/N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{2}\right), \color{blue}{\left(\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot {x}^{2}\right)}\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)} \cdot {x}^{2}\right)\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)} \cdot {x}^{2}\right)\right) \]
      21. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left({x}^{2} \cdot \color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)}\right)\right) \]
      22. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left({x}^{2}\right), \color{blue}{\left(\frac{1}{6} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)}\right)\right) \]
    9. Simplified82.4%

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{x \cdot x}{e} \cdot 0.16666666666666666\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.0%

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

Alternative 20: 91.9% accurate, 5.0× speedup?

\[\begin{array}{l} \\ \frac{1 + x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)}{e} \end{array} \]
(FPCore (x)
 :precision binary64
 (/
  (+
   1.0
   (* x (* x (+ 1.0 (* (* x x) (+ 0.5 (* x (* x 0.16666666666666666))))))))
  E))
double code(double x) {
	return (1.0 + (x * (x * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666)))))))) / ((double) M_E);
}
public static double code(double x) {
	return (1.0 + (x * (x * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666)))))))) / Math.E;
}
def code(x):
	return (1.0 + (x * (x * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666)))))))) / math.e
function code(x)
	return Float64(Float64(1.0 + Float64(x * Float64(x * Float64(1.0 + Float64(Float64(x * x) * Float64(0.5 + Float64(x * Float64(x * 0.16666666666666666)))))))) / exp(1))
end
function tmp = code(x)
	tmp = (1.0 + (x * (x * (1.0 + ((x * x) * (0.5 + (x * (x * 0.16666666666666666)))))))) / 2.71828182845904523536;
end
code[x_] := N[(N[(1.0 + N[(x * N[(x * N[(1.0 + N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(x * N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision]
\begin{array}{l}

\\
\frac{1 + x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)}{e}
\end{array}
Derivation
  1. Initial program 100.0%

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

    \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + {x}^{2} \cdot \left(\frac{1}{6} \cdot \left({x}^{2} \cdot e^{-1}\right) + \frac{1}{2} \cdot e^{-1}\right)\right)} \]
  4. Simplified91.1%

    \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)} \]
  5. Step-by-step derivation
    1. *-commutativeN/A

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

      \[\leadsto \frac{1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)}{\color{blue}{\mathsf{E}\left(\right)}} \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(1 + \left(x \cdot x\right) \cdot \left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \frac{1}{6}\right)\right)\right), \color{blue}{\mathsf{E}\left(\right)}\right) \]
  6. Applied egg-rr91.1%

    \[\leadsto \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)\right)}{e}} \]
  7. Add Preprocessing

Alternative 21: 87.7% accurate, 5.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{e} \cdot \left(1 + x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot x}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot 0.5\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= (* x x) 5e-5)
   (* (/ 1.0 E) (+ 1.0 (* x x)))
   (* (/ (* x x) E) (+ 1.0 (* (* x x) 0.5)))))
double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / ((double) M_E)) * (1.0 + (x * x));
	} else {
		tmp = ((x * x) / ((double) M_E)) * (1.0 + ((x * x) * 0.5));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / Math.E) * (1.0 + (x * x));
	} else {
		tmp = ((x * x) / Math.E) * (1.0 + ((x * x) * 0.5));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x * x) <= 5e-5:
		tmp = (1.0 / math.e) * (1.0 + (x * x))
	else:
		tmp = ((x * x) / math.e) * (1.0 + ((x * x) * 0.5))
	return tmp
function code(x)
	tmp = 0.0
	if (Float64(x * x) <= 5e-5)
		tmp = Float64(Float64(1.0 / exp(1)) * Float64(1.0 + Float64(x * x)));
	else
		tmp = Float64(Float64(Float64(x * x) / exp(1)) * Float64(1.0 + Float64(Float64(x * x) * 0.5)));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x * x) <= 5e-5)
		tmp = (1.0 / 2.71828182845904523536) * (1.0 + (x * x));
	else
		tmp = ((x * x) / 2.71828182845904523536) * (1.0 + ((x * x) * 0.5));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-5], N[(N[(1.0 / E), $MachinePrecision] * N[(1.0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision] * N[(1.0 + N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{e} \cdot \left(1 + x \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot x}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot 0.5\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot e^{-1}} \]
    4. Step-by-step derivation
      1. distribute-rgt1-inN/A

        \[\leadsto \left({x}^{2} + 1\right) \cdot \color{blue}{e^{-1}} \]
      2. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{\mathsf{neg}\left(1\right)}\right), \left({\color{blue}{x}}^{2} + 1\right)\right) \]
      5. rec-expN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{e^{1}}\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(e^{1}\right)\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
      7. exp-1-eN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
      8. E-lowering-E.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
      9. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(x \cdot x\right), 1\right)\right) \]
      11. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), 1\right)\right) \]
    5. Simplified99.7%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(x \cdot x + 1\right)} \]

    if 5.00000000000000024e-5 < (*.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 \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{-1}\right), \color{blue}{\left(\left({x}^{2} + 1\right) + {x}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)\right)}\right) \]
    5. Simplified75.7%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]
    6. Taylor expanded in x around inf

      \[\leadsto \color{blue}{{x}^{4} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)} + \frac{1}{{x}^{2} \cdot \mathsf{E}\left(\right)}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-inN/A

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

        \[\leadsto {x}^{\left(2 \cdot 2\right)} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right) + {x}^{4} \cdot \frac{1}{{x}^{2} \cdot \mathsf{E}\left(\right)} \]
      3. pow-sqrN/A

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

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

        \[\leadsto {x}^{2} \cdot \left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right) + {x}^{\left(2 \cdot 2\right)} \cdot \frac{1}{{x}^{2} \cdot \mathsf{E}\left(\right)} \]
      6. pow-sqrN/A

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

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

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

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

        \[\leadsto {x}^{2} \cdot \left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right) + {x}^{2} \cdot \frac{1}{\mathsf{E}\left(\right)} \]
      11. distribute-lft-inN/A

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

        \[\leadsto {x}^{2} \cdot \left(\frac{1}{\mathsf{E}\left(\right)} + \color{blue}{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)}\right) \]
    8. Simplified75.7%

      \[\leadsto \color{blue}{\frac{x \cdot x}{e} \cdot \left(1 + \left(x \cdot x\right) \cdot 0.5\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.6%

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

Alternative 22: 87.7% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{e} \cdot \left(1 + x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= (* x x) 5e-5)
   (* (/ 1.0 E) (+ 1.0 (* x x)))
   (* x (* 0.5 (* x (/ (* x x) E))))))
double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / ((double) M_E)) * (1.0 + (x * x));
	} else {
		tmp = x * (0.5 * (x * ((x * x) / ((double) M_E))));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = (1.0 / Math.E) * (1.0 + (x * x));
	} else {
		tmp = x * (0.5 * (x * ((x * x) / Math.E)));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x * x) <= 5e-5:
		tmp = (1.0 / math.e) * (1.0 + (x * x))
	else:
		tmp = x * (0.5 * (x * ((x * x) / math.e)))
	return tmp
function code(x)
	tmp = 0.0
	if (Float64(x * x) <= 5e-5)
		tmp = Float64(Float64(1.0 / exp(1)) * Float64(1.0 + Float64(x * x)));
	else
		tmp = Float64(x * Float64(0.5 * Float64(x * Float64(Float64(x * x) / exp(1)))));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x * x) <= 5e-5)
		tmp = (1.0 / 2.71828182845904523536) * (1.0 + (x * x));
	else
		tmp = x * (0.5 * (x * ((x * x) / 2.71828182845904523536)));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-5], N[(N[(1.0 / E), $MachinePrecision] * N[(1.0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(0.5 * N[(x * N[(N[(x * x), $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{e} \cdot \left(1 + x \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \left(x \cdot \frac{x \cdot x}{e}\right)\right)\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot e^{-1}} \]
    4. Step-by-step derivation
      1. distribute-rgt1-inN/A

        \[\leadsto \left({x}^{2} + 1\right) \cdot \color{blue}{e^{-1}} \]
      2. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{\mathsf{neg}\left(1\right)}\right), \left({\color{blue}{x}}^{2} + 1\right)\right) \]
      5. rec-expN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{e^{1}}\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(e^{1}\right)\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
      7. exp-1-eN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
      8. E-lowering-E.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
      9. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(x \cdot x\right), 1\right)\right) \]
      11. *-lowering-*.f6499.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), 1\right)\right) \]
    5. Simplified99.7%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(x \cdot x + 1\right)} \]

    if 5.00000000000000024e-5 < (*.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 \color{blue}{e^{-1} + {x}^{2} \cdot \left(e^{-1} + \frac{1}{2} \cdot \left({x}^{2} \cdot e^{-1}\right)\right)} \]
    4. Step-by-step derivation
      1. *-lft-identityN/A

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

        \[\leadsto 1 \cdot e^{-1} + {x}^{2} \cdot \left(e^{-1} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \color{blue}{e^{-1}}\right) \]
      3. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{-1}\right), \color{blue}{\left(\left({x}^{2} + 1\right) + {x}^{2} \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)\right)}\right) \]
    5. Simplified75.7%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(1 + x \cdot \left(x \cdot \left(1 + x \cdot \left(x \cdot 0.5\right)\right)\right)\right)} \]
    6. Taylor expanded in x around inf

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

        \[\leadsto \frac{1}{2} \cdot \frac{{x}^{\left(2 \cdot 2\right)}}{\mathsf{E}\left(\right)} \]
      2. pow-sqrN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)}\right) \]
      12. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\mathsf{E}\left(\right)}\right) \cdot x\right)\right) \]
      13. associate-*l/N/A

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right) \cdot {x}^{2}\right) \cdot x\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right) \cdot x\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{\mathsf{E}\left(\right)}\right)\right)}\right)\right) \]
      17. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{\color{blue}{\mathsf{E}\left(\right)}}\right)\right)\right) \]
      20. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{{x}^{2}}{\mathsf{E}\left(\right)}\right)\right)\right) \]
    8. Simplified75.7%

      \[\leadsto \color{blue}{x \cdot \left(\left(x \cdot \frac{x \cdot x}{e}\right) \cdot 0.5\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.6%

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

Alternative 23: 75.7% accurate, 7.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{e}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{e}{x \cdot x}}\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= (* x x) 5e-5) (/ 1.0 E) (/ 1.0 (/ E (* x x)))))
double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = 1.0 / ((double) M_E);
	} else {
		tmp = 1.0 / (((double) M_E) / (x * x));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = 1.0 / Math.E;
	} else {
		tmp = 1.0 / (Math.E / (x * x));
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x * x) <= 5e-5:
		tmp = 1.0 / math.e
	else:
		tmp = 1.0 / (math.e / (x * x))
	return tmp
function code(x)
	tmp = 0.0
	if (Float64(x * x) <= 5e-5)
		tmp = Float64(1.0 / exp(1));
	else
		tmp = Float64(1.0 / Float64(exp(1) / Float64(x * x)));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x * x) <= 5e-5)
		tmp = 1.0 / 2.71828182845904523536;
	else
		tmp = 1.0 / (2.71828182845904523536 / (x * x));
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-5], N[(1.0 / E), $MachinePrecision], N[(1.0 / N[(E / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{e}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{e}{x \cdot x}}\\


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1}} \]
    4. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto e^{\mathsf{neg}\left(1\right)} \]
      2. rec-expN/A

        \[\leadsto \frac{1}{\color{blue}{e^{1}}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{1}\right)}\right) \]
      4. exp-1-eN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{E}\left(\right)\right) \]
      5. E-lowering-E.f6498.8%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right) \]
    5. Simplified98.8%

      \[\leadsto \color{blue}{\frac{1}{e}} \]

    if 5.00000000000000024e-5 < (*.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 \color{blue}{e^{-1} + {x}^{2} \cdot e^{-1}} \]
    4. Step-by-step derivation
      1. distribute-rgt1-inN/A

        \[\leadsto \left({x}^{2} + 1\right) \cdot \color{blue}{e^{-1}} \]
      2. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{\mathsf{neg}\left(1\right)}\right), \left({\color{blue}{x}}^{2} + 1\right)\right) \]
      5. rec-expN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{e^{1}}\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(e^{1}\right)\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
      7. exp-1-eN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
      8. E-lowering-E.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
      9. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(x \cdot x\right), 1\right)\right) \]
      11. *-lowering-*.f6448.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), 1\right)\right) \]
    5. Simplified48.6%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(x \cdot x + 1\right)} \]
    6. Taylor expanded in x around inf

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(x \cdot x\right), \mathsf{E}\left(\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{E}\left(\right)\right) \]
      4. E-lowering-E.f6448.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{E.f64}\left(\right)\right) \]
    8. Simplified48.6%

      \[\leadsto \color{blue}{\frac{x \cdot x}{e}} \]
    9. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{E}\left(\right), \color{blue}{\left(x \cdot x\right)}\right)\right) \]
      4. E-lowering-E.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{E.f64}\left(\right), \left(\color{blue}{x} \cdot x\right)\right)\right) \]
      5. *-lowering-*.f6448.6%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{E.f64}\left(\right), \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
    10. Applied egg-rr48.6%

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

Alternative 24: 75.6% accurate, 8.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{e}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{x}{e}\\ \end{array} \end{array} \]
(FPCore (x) :precision binary64 (if (<= (* x x) 5e-5) (/ 1.0 E) (* x (/ x E))))
double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = 1.0 / ((double) M_E);
	} else {
		tmp = x * (x / ((double) M_E));
	}
	return tmp;
}
public static double code(double x) {
	double tmp;
	if ((x * x) <= 5e-5) {
		tmp = 1.0 / Math.E;
	} else {
		tmp = x * (x / Math.E);
	}
	return tmp;
}
def code(x):
	tmp = 0
	if (x * x) <= 5e-5:
		tmp = 1.0 / math.e
	else:
		tmp = x * (x / math.e)
	return tmp
function code(x)
	tmp = 0.0
	if (Float64(x * x) <= 5e-5)
		tmp = Float64(1.0 / exp(1));
	else
		tmp = Float64(x * Float64(x / exp(1)));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if ((x * x) <= 5e-5)
		tmp = 1.0 / 2.71828182845904523536;
	else
		tmp = x * (x / 2.71828182845904523536);
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[N[(x * x), $MachinePrecision], 5e-5], N[(1.0 / E), $MachinePrecision], N[(x * N[(x / E), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{e}\\

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


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{e^{-1}} \]
    4. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto e^{\mathsf{neg}\left(1\right)} \]
      2. rec-expN/A

        \[\leadsto \frac{1}{\color{blue}{e^{1}}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{1}\right)}\right) \]
      4. exp-1-eN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{E}\left(\right)\right) \]
      5. E-lowering-E.f6498.8%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right) \]
    5. Simplified98.8%

      \[\leadsto \color{blue}{\frac{1}{e}} \]

    if 5.00000000000000024e-5 < (*.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 \color{blue}{e^{-1} + {x}^{2} \cdot e^{-1}} \]
    4. Step-by-step derivation
      1. distribute-rgt1-inN/A

        \[\leadsto \left({x}^{2} + 1\right) \cdot \color{blue}{e^{-1}} \]
      2. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(e^{\mathsf{neg}\left(1\right)}\right), \left({\color{blue}{x}}^{2} + 1\right)\right) \]
      5. rec-expN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{e^{1}}\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(e^{1}\right)\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
      7. exp-1-eN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
      8. E-lowering-E.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
      9. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(x \cdot x\right), 1\right)\right) \]
      11. *-lowering-*.f6448.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), 1\right)\right) \]
    5. Simplified48.6%

      \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(x \cdot x + 1\right)} \]
    6. Taylor expanded in x around inf

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(x \cdot x\right), \mathsf{E}\left(\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{E}\left(\right)\right) \]
      4. E-lowering-E.f6448.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{E.f64}\left(\right)\right) \]
    8. Simplified48.6%

      \[\leadsto \color{blue}{\frac{x \cdot x}{e}} \]
    9. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto x \cdot \color{blue}{\frac{x}{\mathsf{E}\left(\right)}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{x}{\mathsf{E}\left(\right)} \cdot \color{blue}{x} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{\mathsf{E}\left(\right)}\right), \color{blue}{x}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{E}\left(\right)\right), x\right) \]
      5. E-lowering-E.f6448.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{E.f64}\left(\right)\right), x\right) \]
    10. Applied egg-rr48.6%

      \[\leadsto \color{blue}{\frac{x}{e} \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification73.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{e}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{x}{e}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 76.0% accurate, 11.8× speedup?

\[\begin{array}{l} \\ \frac{1}{e} \cdot \left(1 + x \cdot x\right) \end{array} \]
(FPCore (x) :precision binary64 (* (/ 1.0 E) (+ 1.0 (* x x))))
double code(double x) {
	return (1.0 / ((double) M_E)) * (1.0 + (x * x));
}
public static double code(double x) {
	return (1.0 / Math.E) * (1.0 + (x * x));
}
def code(x):
	return (1.0 / math.e) * (1.0 + (x * x))
function code(x)
	return Float64(Float64(1.0 / exp(1)) * Float64(1.0 + Float64(x * x)))
end
function tmp = code(x)
	tmp = (1.0 / 2.71828182845904523536) * (1.0 + (x * x));
end
code[x_] := N[(N[(1.0 / E), $MachinePrecision] * N[(1.0 + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{e} \cdot \left(1 + x \cdot x\right)
\end{array}
Derivation
  1. Initial program 100.0%

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

    \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot e^{-1}} \]
  4. Step-by-step derivation
    1. distribute-rgt1-inN/A

      \[\leadsto \left({x}^{2} + 1\right) \cdot \color{blue}{e^{-1}} \]
    2. *-commutativeN/A

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

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

      \[\leadsto \mathsf{*.f64}\left(\left(e^{\mathsf{neg}\left(1\right)}\right), \left({\color{blue}{x}}^{2} + 1\right)\right) \]
    5. rec-expN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{e^{1}}\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(e^{1}\right)\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
    7. exp-1-eN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
    8. E-lowering-E.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
    9. +-lowering-+.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(x \cdot x\right), 1\right)\right) \]
    11. *-lowering-*.f6473.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), 1\right)\right) \]
  5. Simplified73.9%

    \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(x \cdot x + 1\right)} \]
  6. Final simplification73.9%

    \[\leadsto \frac{1}{e} \cdot \left(1 + x \cdot x\right) \]
  7. Add Preprocessing

Alternative 26: 76.0% accurate, 15.1× speedup?

\[\begin{array}{l} \\ \frac{1 + x \cdot x}{e} \end{array} \]
(FPCore (x) :precision binary64 (/ (+ 1.0 (* x x)) E))
double code(double x) {
	return (1.0 + (x * x)) / ((double) M_E);
}
public static double code(double x) {
	return (1.0 + (x * x)) / Math.E;
}
def code(x):
	return (1.0 + (x * x)) / math.e
function code(x)
	return Float64(Float64(1.0 + Float64(x * x)) / exp(1))
end
function tmp = code(x)
	tmp = (1.0 + (x * x)) / 2.71828182845904523536;
end
code[x_] := N[(N[(1.0 + N[(x * x), $MachinePrecision]), $MachinePrecision] / E), $MachinePrecision]
\begin{array}{l}

\\
\frac{1 + x \cdot x}{e}
\end{array}
Derivation
  1. Initial program 100.0%

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

    \[\leadsto \color{blue}{e^{-1} + {x}^{2} \cdot e^{-1}} \]
  4. Step-by-step derivation
    1. distribute-rgt1-inN/A

      \[\leadsto \left({x}^{2} + 1\right) \cdot \color{blue}{e^{-1}} \]
    2. *-commutativeN/A

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

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

      \[\leadsto \mathsf{*.f64}\left(\left(e^{\mathsf{neg}\left(1\right)}\right), \left({\color{blue}{x}}^{2} + 1\right)\right) \]
    5. rec-expN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{e^{1}}\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(e^{1}\right)\right), \left(\color{blue}{{x}^{2}} + 1\right)\right) \]
    7. exp-1-eN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
    8. E-lowering-E.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \left({x}^{\color{blue}{2}} + 1\right)\right) \]
    9. +-lowering-+.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\left(x \cdot x\right), 1\right)\right) \]
    11. *-lowering-*.f6473.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), 1\right)\right) \]
  5. Simplified73.9%

    \[\leadsto \color{blue}{\frac{1}{e} \cdot \left(x \cdot x + 1\right)} \]
  6. Step-by-step derivation
    1. *-commutativeN/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(x \cdot x + 1\right), \color{blue}{\mathsf{E}\left(\right)}\right) \]
    4. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(x \cdot x\right), 1\right), \mathsf{E}\left(\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), 1\right), \mathsf{E}\left(\right)\right) \]
    6. E-lowering-E.f6473.9%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, x\right), 1\right), \mathsf{E.f64}\left(\right)\right) \]
  7. Applied egg-rr73.9%

    \[\leadsto \color{blue}{\frac{x \cdot x + 1}{e}} \]
  8. Final simplification73.9%

    \[\leadsto \frac{1 + x \cdot x}{e} \]
  9. Add Preprocessing

Alternative 27: 51.6% accurate, 35.3× speedup?

\[\begin{array}{l} \\ \frac{1}{e} \end{array} \]
(FPCore (x) :precision binary64 (/ 1.0 E))
double code(double x) {
	return 1.0 / ((double) M_E);
}
public static double code(double x) {
	return 1.0 / Math.E;
}
def code(x):
	return 1.0 / math.e
function code(x)
	return Float64(1.0 / exp(1))
end
function tmp = code(x)
	tmp = 1.0 / 2.71828182845904523536;
end
code[x_] := N[(1.0 / E), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{e}
\end{array}
Derivation
  1. Initial program 100.0%

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

    \[\leadsto \color{blue}{e^{-1}} \]
  4. Step-by-step derivation
    1. metadata-evalN/A

      \[\leadsto e^{\mathsf{neg}\left(1\right)} \]
    2. rec-expN/A

      \[\leadsto \frac{1}{\color{blue}{e^{1}}} \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(e^{1}\right)}\right) \]
    4. exp-1-eN/A

      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{E}\left(\right)\right) \]
    5. E-lowering-E.f6450.6%

      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{E.f64}\left(\right)\right) \]
  5. Simplified50.6%

    \[\leadsto \color{blue}{\frac{1}{e}} \]
  6. Add Preprocessing

Reproduce

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