?

Average Accuracy: 78.9% → 99.8%
Time: 16.3s
Precision: binary64
Cost: 79432

?

\[1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|} \]
\[\begin{array}{l} t_0 := 1 + 0.3275911 \cdot \left|x\right|\\ t_1 := \sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}\\ \mathbf{if}\;x \leq -1.2 \cdot 10^{-6}:\\ \;\;\;\;\log \left(e^{1 + \frac{\frac{-0.254829592 + \frac{0.284496736 - \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t_0}}{t_0}}{t_0}}{t_0}}{e^{x \cdot x}}}{t_0}}\right)\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-7}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{0.284496736 + \frac{-1.421413741 + \frac{1.453152027 + \frac{-1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{t_1 \cdot t_1}, 1\right)\\ \end{array} \]
(FPCore (x)
 :precision binary64
 (-
  1.0
  (*
   (*
    (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
    (+
     0.254829592
     (*
      (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
      (+
       -0.284496736
       (*
        (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
        (+
         1.421413741
         (*
          (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
          (+
           -1.453152027
           (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) 1.061405429)))))))))
   (exp (- (* (fabs x) (fabs x)))))))
(FPCore (x)
 :precision binary64
 (let* ((t_0 (+ 1.0 (* 0.3275911 (fabs x))))
        (t_1 (sqrt (fma 0.3275911 x 1.0))))
   (if (<= x -1.2e-6)
     (log
      (exp
       (+
        1.0
        (/
         (/
          (+
           -0.254829592
           (/
            (-
             0.284496736
             (/
              (+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_0)) t_0))
              t_0))
            t_0))
          (exp (* x x)))
         t_0))))
     (if (<= x 5.5e-7)
       (+ 1e-9 (sqrt (* x (* x 1.2732557730789702))))
       (fma
        (/ (pow (exp x) (- x)) (fma 0.3275911 (fabs x) 1.0))
        (+
         -0.254829592
         (/
          (+
           0.284496736
           (/
            (+
             -1.421413741
             (/
              (+ 1.453152027 (/ -1.061405429 (fma 0.3275911 x 1.0)))
              (fma 0.3275911 x 1.0)))
            (fma 0.3275911 x 1.0)))
          (* t_1 t_1)))
        1.0)))))
double code(double x) {
	return 1.0 - (((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (0.254829592 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (-0.284496736 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (1.421413741 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (-1.453152027 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * 1.061405429))))))))) * exp(-(fabs(x) * fabs(x))));
}
double code(double x) {
	double t_0 = 1.0 + (0.3275911 * fabs(x));
	double t_1 = sqrt(fma(0.3275911, x, 1.0));
	double tmp;
	if (x <= -1.2e-6) {
		tmp = log(exp((1.0 + (((-0.254829592 + ((0.284496736 - ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / t_0)) / exp((x * x))) / t_0))));
	} else if (x <= 5.5e-7) {
		tmp = 1e-9 + sqrt((x * (x * 1.2732557730789702)));
	} else {
		tmp = fma((pow(exp(x), -x) / fma(0.3275911, fabs(x), 1.0)), (-0.254829592 + ((0.284496736 + ((-1.421413741 + ((1.453152027 + (-1.061405429 / fma(0.3275911, x, 1.0))) / fma(0.3275911, x, 1.0))) / fma(0.3275911, x, 1.0))) / (t_1 * t_1))), 1.0);
	}
	return tmp;
}
function code(x)
	return Float64(1.0 - Float64(Float64(Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) * Float64(0.254829592 + Float64(Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) * Float64(-0.284496736 + Float64(Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) * Float64(1.421413741 + Float64(Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) * Float64(-1.453152027 + Float64(Float64(1.0 / Float64(1.0 + Float64(0.3275911 * abs(x)))) * 1.061405429))))))))) * exp(Float64(-Float64(abs(x) * abs(x))))))
end
function code(x)
	t_0 = Float64(1.0 + Float64(0.3275911 * abs(x)))
	t_1 = sqrt(fma(0.3275911, x, 1.0))
	tmp = 0.0
	if (x <= -1.2e-6)
		tmp = log(exp(Float64(1.0 + Float64(Float64(Float64(-0.254829592 + Float64(Float64(0.284496736 - Float64(Float64(1.421413741 + Float64(Float64(-1.453152027 + Float64(1.061405429 / t_0)) / t_0)) / t_0)) / t_0)) / exp(Float64(x * x))) / t_0))));
	elseif (x <= 5.5e-7)
		tmp = Float64(1e-9 + sqrt(Float64(x * Float64(x * 1.2732557730789702))));
	else
		tmp = fma(Float64((exp(x) ^ Float64(-x)) / fma(0.3275911, abs(x), 1.0)), Float64(-0.254829592 + Float64(Float64(0.284496736 + Float64(Float64(-1.421413741 + Float64(Float64(1.453152027 + Float64(-1.061405429 / fma(0.3275911, x, 1.0))) / fma(0.3275911, x, 1.0))) / fma(0.3275911, x, 1.0))) / Float64(t_1 * t_1))), 1.0);
	end
	return tmp
end
code[x_] := N[(1.0 - N[(N[(N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.254829592 + N[(N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.284496736 + N[(N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.421413741 + N[(N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.453152027 + N[(N[(1.0 / N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.061405429), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(0.3275911 * x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.2e-6], N[Log[N[Exp[N[(1.0 + N[(N[(N[(-0.254829592 + N[(N[(0.284496736 - N[(N[(1.421413741 + N[(N[(-1.453152027 + N[(1.061405429 / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 5.5e-7], N[(1e-9 + N[Sqrt[N[(x * N[(x * 1.2732557730789702), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Exp[x], $MachinePrecision], (-x)], $MachinePrecision] / N[(0.3275911 * N[Abs[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(-0.254829592 + N[(N[(0.284496736 + N[(N[(-1.421413741 + N[(N[(1.453152027 + N[(-1.061405429 / N[(0.3275911 * x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.3275911 * x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.3275911 * x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]]]
1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}
\begin{array}{l}
t_0 := 1 + 0.3275911 \cdot \left|x\right|\\
t_1 := \sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{-6}:\\
\;\;\;\;\log \left(e^{1 + \frac{\frac{-0.254829592 + \frac{0.284496736 - \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t_0}}{t_0}}{t_0}}{t_0}}{e^{x \cdot x}}}{t_0}}\right)\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-7}:\\
\;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{0.284496736 + \frac{-1.421413741 + \frac{1.453152027 + \frac{-1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{t_1 \cdot t_1}, 1\right)\\


\end{array}

Error?

Derivation?

  1. Split input into 3 regimes
  2. if x < -1.1999999999999999e-6

    1. Initial program 99.7%

      \[1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|} \]
    2. Simplified99.7%

      \[\leadsto \color{blue}{1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1.061405429}{1 + 0.3275911 \cdot \left|x\right|}\right)\right)\right)\right) \cdot e^{-x \cdot x}\right)} \]
      Proof

      [Start]99.7

      \[ 1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|} \]

      associate-*l* [=>]99.7

      \[ 1 - \color{blue}{\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(\left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\right)} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\log \left(e^{1 - \frac{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{1 + 0.3275911 \cdot \left|x\right|}}{1 + 0.3275911 \cdot \left|x\right|}}{1 + 0.3275911 \cdot \left|x\right|}}{1 + 0.3275911 \cdot \left|x\right|}}{e^{x \cdot x}}}{1 + 0.3275911 \cdot \left|x\right|}}\right)} \]

    if -1.1999999999999999e-6 < x < 5.5000000000000003e-7

    1. Initial program 57.7%

      \[1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|} \]
    2. Simplified57.7%

      \[\leadsto \color{blue}{1 - \frac{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{{\left(e^{x}\right)}^{x}}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}} \]
      Proof

      [Start]57.7

      \[ 1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|} \]

      associate-*l/ [=>]57.7

      \[ 1 - \color{blue}{\frac{1 \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)}{1 + 0.3275911 \cdot \left|x\right|}} \cdot e^{-\left|x\right| \cdot \left|x\right|} \]

      associate-*l/ [=>]57.7

      \[ 1 - \color{blue}{\frac{\left(1 \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}}{1 + 0.3275911 \cdot \left|x\right|}} \]
    3. Applied egg-rr57.3%

      \[\leadsto \color{blue}{1 \cdot \left(1 - \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}\right)} \]
    4. Simplified57.3%

      \[\leadsto \color{blue}{1 - \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{e^{x \cdot x} \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}} \]
      Proof

      [Start]57.3

      \[ 1 \cdot \left(1 - \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}\right) \]

      *-lft-identity [=>]57.3

      \[ \color{blue}{1 - \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot {\left(e^{x}\right)}^{x}}} \]

      *-commutative [=>]57.3

      \[ 1 - \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\color{blue}{{\left(e^{x}\right)}^{x} \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}} \]

      exp-prod [<=]57.3

      \[ 1 - \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\color{blue}{e^{x \cdot x}} \cdot \mathsf{fma}\left(0.3275911, x, 1\right)} \]
    5. Taylor expanded in x around 0 98.4%

      \[\leadsto \color{blue}{10^{-9} + 1.128386358070218 \cdot x} \]
    6. Applied egg-rr99.8%

      \[\leadsto 10^{-9} + \color{blue}{\sqrt{1.2732557730789702 \cdot \left(x \cdot x\right)}} \]
    7. Simplified99.8%

      \[\leadsto 10^{-9} + \color{blue}{\sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}} \]
      Proof

      [Start]99.8

      \[ 10^{-9} + \sqrt{1.2732557730789702 \cdot \left(x \cdot x\right)} \]

      *-commutative [=>]99.8

      \[ 10^{-9} + \sqrt{\color{blue}{\left(x \cdot x\right) \cdot 1.2732557730789702}} \]

      associate-*l* [=>]99.8

      \[ 10^{-9} + \sqrt{\color{blue}{x \cdot \left(x \cdot 1.2732557730789702\right)}} \]

    if 5.5000000000000003e-7 < x

    1. Initial program 99.8%

      \[1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|} \]
    2. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{0.284496736 - \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, 1\right)} \]
      Proof

      [Start]99.8

      \[ 1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|} \]

      cancel-sign-sub-inv [=>]99.8

      \[ \color{blue}{1 + \left(-\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}} \]

      +-commutative [=>]99.8

      \[ \color{blue}{\left(-\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|} + 1} \]
    3. Applied egg-rr99.8%

      \[\leadsto \mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}} \cdot \frac{0.284496736 - \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}}, 1\right) \]
    4. Simplified99.8%

      \[\leadsto \mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \color{blue}{\frac{0.284496736 + \frac{-1.421413741 - \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}}, 1\right) \]
      Proof

      [Start]99.8

      \[ \mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{1}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}} \cdot \frac{0.284496736 - \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}, 1\right) \]

      associate-*l/ [=>]99.8

      \[ \mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \color{blue}{\frac{1 \cdot \frac{0.284496736 - \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}}, 1\right) \]

      *-lft-identity [=>]99.8

      \[ \mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{\color{blue}{\frac{0.284496736 - \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}, 1\right) \]

      associate-/l/ [=>]99.8

      \[ \mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \color{blue}{\frac{0.284496736 - \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}}, 1\right) \]

      sub-neg [=>]99.8

      \[ \mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{\color{blue}{0.284496736 + \left(-\frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}\right)}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}, 1\right) \]

      distribute-neg-frac [=>]99.8

      \[ \mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{0.284496736 + \color{blue}{\frac{-\left(1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}\right)}{\mathsf{fma}\left(0.3275911, x, 1\right)}}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}, 1\right) \]

      neg-sub0 [=>]99.8

      \[ \mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{0.284496736 + \frac{\color{blue}{0 - \left(1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}, 1\right) \]

      associate--r+ [=>]99.8

      \[ \mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{0.284496736 + \frac{\color{blue}{\left(0 - 1.421413741\right) - \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}, 1\right) \]

      metadata-eval [=>]99.8

      \[ \mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{0.284496736 + \frac{\color{blue}{-1.421413741} - \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}, 1\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{-6}:\\ \;\;\;\;\log \left(e^{1 + \frac{\frac{-0.254829592 + \frac{0.284496736 - \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{1 + 0.3275911 \cdot \left|x\right|}}{1 + 0.3275911 \cdot \left|x\right|}}{1 + 0.3275911 \cdot \left|x\right|}}{1 + 0.3275911 \cdot \left|x\right|}}{e^{x \cdot x}}}{1 + 0.3275911 \cdot \left|x\right|}}\right)\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-7}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{{\left(e^{x}\right)}^{\left(-x\right)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}, -0.254829592 + \frac{0.284496736 + \frac{-1.421413741 + \frac{1.453152027 + \frac{-1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \sqrt{\mathsf{fma}\left(0.3275911, x, 1\right)}}, 1\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy99.8%
Cost54212
\[\begin{array}{l} t_0 := 1 + 0.3275911 \cdot \left|x\right|\\ t_1 := e^{x \cdot x}\\ \mathbf{if}\;x \leq -1.2 \cdot 10^{-6}:\\ \;\;\;\;\log \left(e^{1 + \frac{\frac{-0.254829592 + \frac{0.284496736 - \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t_0}}{t_0}}{t_0}}{t_0}}{t_1}}{t_0}}\right)\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-7}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-0.254829592 - \frac{1}{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \left(-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}\right)}{t_1 \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}\\ \end{array} \]
Alternative 2
Accuracy99.8%
Cost41860
\[\begin{array}{l} t_0 := 1 + 0.3275911 \cdot \left|x\right|\\ t_1 := \frac{1}{t_0}\\ \mathbf{if}\;x \leq -1.6 \cdot 10^{-6}:\\ \;\;\;\;1 + t_1 \cdot \left(e^{x \cdot \left(-x\right)} \cdot \left(-0.254829592 + t_1 \cdot \left(0.284496736 + \left(1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t_0}}{t_0}\right) \cdot \frac{-1}{t_0}\right)\right)\right)\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-7}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-0.254829592 - \frac{1}{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \left(-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}\right)}{e^{x \cdot x} \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}\\ \end{array} \]
Alternative 3
Accuracy99.8%
Cost41412
\[\begin{array}{l} t_0 := 1 + 0.3275911 \cdot \left|x\right|\\ t_1 := e^{x \cdot x}\\ \mathbf{if}\;x \leq -1.45 \cdot 10^{-6}:\\ \;\;\;\;1 + \frac{\frac{-0.254829592 + \frac{0.284496736 - \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{t_0}}{t_0}}{t_0}}{t_0}}{t_1}}{t_0}\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-7}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-0.254829592 - \frac{1}{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \left(-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}\right)}{t_1 \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}\\ \end{array} \]
Alternative 4
Accuracy99.5%
Cost41032
\[\begin{array}{l} t_0 := 1 + x \cdot 0.3275911\\ t_1 := e^{x \cdot x}\\ \mathbf{if}\;x \leq -0.0015:\\ \;\;\;\;e^{\log \left(\sqrt{{\left(1 + \frac{-0.254829592 + \frac{0.284496736 + \frac{-1.421413741 + \frac{1.453152027 + \frac{-1.061405429}{t_0}}{t_0}}{t_0}}{t_0}}{t_1 \cdot t_0}\right)}^{2}}\right)}\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-7}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-0.254829592 - \frac{1}{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \left(-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}}{\mathsf{fma}\left(0.3275911, x, 1\right)}\right)}{t_1 \cdot \mathsf{fma}\left(0.3275911, x, 1\right)}\\ \end{array} \]
Alternative 5
Accuracy99.5%
Cost35144
\[\begin{array}{l} t_0 := 1 + x \cdot 0.3275911\\ \mathbf{if}\;x \leq -0.86:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-7}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \log \left(e^{1 + \frac{-0.254829592 + \frac{0.284496736 + \frac{-1.421413741 + \frac{1.453152027 + \frac{-1.061405429}{t_0}}{t_0}}{t_0}}{t_0}}{e^{x \cdot x} \cdot t_0}}\right)}\\ \end{array} \]
Alternative 6
Accuracy99.5%
Cost35144
\[\begin{array}{l} t_0 := 1 + x \cdot 0.3275911\\ t_1 := 1 + \frac{-0.254829592 + \frac{0.284496736 + \frac{-1.421413741 + \frac{1.453152027 + \frac{-1.061405429}{t_0}}{t_0}}{t_0}}{t_0}}{e^{x \cdot x} \cdot t_0}\\ \mathbf{if}\;x \leq -0.0015:\\ \;\;\;\;e^{\log \left(\sqrt{{t_1}^{2}}\right)}\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-7}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \log \left(e^{t_1}\right)}\\ \end{array} \]
Alternative 7
Accuracy99.4%
Cost13380
\[\begin{array}{l} \mathbf{if}\;\left|x\right| \leq 0.2:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 8
Accuracy99.5%
Cost9544
\[\begin{array}{l} t_0 := 1 + x \cdot 0.3275911\\ \mathbf{if}\;x \leq -0.86:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-7}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \frac{-0.254829592 + \frac{0.284496736 + \frac{-1.421413741 + \frac{1.453152027 + \frac{-1.061405429}{t_0}}{t_0}}{t_0}}{t_0}}{e^{x \cdot x} \cdot t_0}\\ \end{array} \]
Alternative 9
Accuracy98.6%
Cost840
\[\begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{-10}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.9:\\ \;\;\;\;10^{-9} + x \cdot \left(1.128386358070218 + x \cdot -0.00011824294398844343\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 10
Accuracy98.5%
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{-10}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.9:\\ \;\;\;\;10^{-9} + x \cdot 1.128386358070218\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 11
Accuracy97.8%
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{-5}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-5}:\\ \;\;\;\;10^{-9}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 12
Accuracy53.8%
Cost64
\[10^{-9} \]

Error

Reproduce?

herbie shell --seed 2023122 
(FPCore (x)
  :name "Jmat.Real.erf"
  :precision binary64
  (- 1.0 (* (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ 0.254829592 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ -0.284496736 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ 1.421413741 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ -1.453152027 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) 1.061405429))))))))) (exp (- (* (fabs x) (fabs x)))))))