?

Average Accuracy: 79.3% → 99.4%
Time: 19.9s
Precision: binary64
Cost: 101956

?

\[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 := \frac{1}{1 + 0.3275911 \cdot \left|x\right|}\\ \mathbf{if}\;\left(t_0 \cdot \left(0.254829592 + t_0 \cdot \left(-0.284496736 + t_0 \cdot \left(1.421413741 + t_0 \cdot \left(-1.453152027 + t_0 \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{x \cdot \left(-x\right)} \leq 0.999996:\\ \;\;\;\;1 - \frac{0.254829592 + \left(\frac{1.061405429}{{\left(\mathsf{fma}\left(0.3275911, x, 1\right)\right)}^{4}} + \left(\frac{1.421413741}{{\left(\mathsf{fma}\left(0.3275911, x, 1\right)\right)}^{2}} - \left(\frac{0.284496736}{\mathsf{fma}\left(0.3275911, x, 1\right)} + \frac{1.453152027}{{\left(\mathsf{fma}\left(0.3275911, x, 1\right)\right)}^{3}}\right)\right)\right)}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot e^{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\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 (+ 1.0 (* 0.3275911 (fabs x))))))
   (if (<=
        (*
         (*
          t_0
          (+
           0.254829592
           (*
            t_0
            (+
             -0.284496736
             (*
              t_0
              (+ 1.421413741 (* t_0 (+ -1.453152027 (* t_0 1.061405429)))))))))
         (exp (* x (- x))))
        0.999996)
     (-
      1.0
      (/
       (+
        0.254829592
        (+
         (/ 1.061405429 (pow (fma 0.3275911 x 1.0) 4.0))
         (-
          (/ 1.421413741 (pow (fma 0.3275911 x 1.0) 2.0))
          (+
           (/ 0.284496736 (fma 0.3275911 x 1.0))
           (/ 1.453152027 (pow (fma 0.3275911 x 1.0) 3.0))))))
       (* (fma 0.3275911 x 1.0) (exp (* x x)))))
     (+ 1e-9 (sqrt (* x (* x 1.2732557730789702)))))))
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 / (1.0 + (0.3275911 * fabs(x)));
	double tmp;
	if (((t_0 * (0.254829592 + (t_0 * (-0.284496736 + (t_0 * (1.421413741 + (t_0 * (-1.453152027 + (t_0 * 1.061405429))))))))) * exp((x * -x))) <= 0.999996) {
		tmp = 1.0 - ((0.254829592 + ((1.061405429 / pow(fma(0.3275911, x, 1.0), 4.0)) + ((1.421413741 / pow(fma(0.3275911, x, 1.0), 2.0)) - ((0.284496736 / fma(0.3275911, x, 1.0)) + (1.453152027 / pow(fma(0.3275911, x, 1.0), 3.0)))))) / (fma(0.3275911, x, 1.0) * exp((x * x))));
	} else {
		tmp = 1e-9 + sqrt((x * (x * 1.2732557730789702)));
	}
	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(1.0 + Float64(0.3275911 * abs(x))))
	tmp = 0.0
	if (Float64(Float64(t_0 * Float64(0.254829592 + Float64(t_0 * Float64(-0.284496736 + Float64(t_0 * Float64(1.421413741 + Float64(t_0 * Float64(-1.453152027 + Float64(t_0 * 1.061405429))))))))) * exp(Float64(x * Float64(-x)))) <= 0.999996)
		tmp = Float64(1.0 - Float64(Float64(0.254829592 + Float64(Float64(1.061405429 / (fma(0.3275911, x, 1.0) ^ 4.0)) + Float64(Float64(1.421413741 / (fma(0.3275911, x, 1.0) ^ 2.0)) - Float64(Float64(0.284496736 / fma(0.3275911, x, 1.0)) + Float64(1.453152027 / (fma(0.3275911, x, 1.0) ^ 3.0)))))) / Float64(fma(0.3275911, x, 1.0) * exp(Float64(x * x)))));
	else
		tmp = Float64(1e-9 + sqrt(Float64(x * Float64(x * 1.2732557730789702))));
	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[(1.0 + N[(0.3275911 * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$0 * N[(0.254829592 + N[(t$95$0 * N[(-0.284496736 + N[(t$95$0 * N[(1.421413741 + N[(t$95$0 * N[(-1.453152027 + N[(t$95$0 * 1.061405429), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.999996], N[(1.0 - N[(N[(0.254829592 + N[(N[(1.061405429 / N[Power[N[(0.3275911 * x + 1.0), $MachinePrecision], 4.0], $MachinePrecision]), $MachinePrecision] + N[(N[(1.421413741 / N[Power[N[(0.3275911 * x + 1.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - N[(N[(0.284496736 / N[(0.3275911 * x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(1.453152027 / N[Power[N[(0.3275911 * x + 1.0), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(0.3275911 * x + 1.0), $MachinePrecision] * N[Exp[N[(x * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1e-9 + N[Sqrt[N[(x * N[(x * 1.2732557730789702), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 := \frac{1}{1 + 0.3275911 \cdot \left|x\right|}\\
\mathbf{if}\;\left(t_0 \cdot \left(0.254829592 + t_0 \cdot \left(-0.284496736 + t_0 \cdot \left(1.421413741 + t_0 \cdot \left(-1.453152027 + t_0 \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{x \cdot \left(-x\right)} \leq 0.999996:\\
\;\;\;\;1 - \frac{0.254829592 + \left(\frac{1.061405429}{{\left(\mathsf{fma}\left(0.3275911, x, 1\right)\right)}^{4}} + \left(\frac{1.421413741}{{\left(\mathsf{fma}\left(0.3275911, x, 1\right)\right)}^{2}} - \left(\frac{0.284496736}{\mathsf{fma}\left(0.3275911, x, 1\right)} + \frac{1.453152027}{{\left(\mathsf{fma}\left(0.3275911, x, 1\right)\right)}^{3}}\right)\right)\right)}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot e^{x \cdot x}}\\

\mathbf{else}:\\
\;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\


\end{array}

Error?

Bogosity?

Bogosity

Derivation?

  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (/.f64 1 (+.f64 1 (*.f64 3275911/10000000 (fabs.f64 x)))) (+.f64 31853699/125000000 (*.f64 (/.f64 1 (+.f64 1 (*.f64 3275911/10000000 (fabs.f64 x)))) (+.f64 -8890523/31250000 (*.f64 (/.f64 1 (+.f64 1 (*.f64 3275911/10000000 (fabs.f64 x)))) (+.f64 1421413741/1000000000 (*.f64 (/.f64 1 (+.f64 1 (*.f64 3275911/10000000 (fabs.f64 x)))) (+.f64 -1453152027/1000000000 (*.f64 (/.f64 1 (+.f64 1 (*.f64 3275911/10000000 (fabs.f64 x)))) 1061405429/1000000000))))))))) (exp.f64 (neg.f64 (*.f64 (fabs.f64 x) (fabs.f64 x))))) < 0.999995999999999996

    1. Initial program 99.4%

      \[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.4%

      \[\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.4

      \[ 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.4

      \[ 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. Taylor expanded in x around inf 99.4%

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

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

      [Start]99.4

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

    if 0.999995999999999996 < (*.f64 (*.f64 (/.f64 1 (+.f64 1 (*.f64 3275911/10000000 (fabs.f64 x)))) (+.f64 31853699/125000000 (*.f64 (/.f64 1 (+.f64 1 (*.f64 3275911/10000000 (fabs.f64 x)))) (+.f64 -8890523/31250000 (*.f64 (/.f64 1 (+.f64 1 (*.f64 3275911/10000000 (fabs.f64 x)))) (+.f64 1421413741/1000000000 (*.f64 (/.f64 1 (+.f64 1 (*.f64 3275911/10000000 (fabs.f64 x)))) (+.f64 -1453152027/1000000000 (*.f64 (/.f64 1 (+.f64 1 (*.f64 3275911/10000000 (fabs.f64 x)))) 1061405429/1000000000))))))))) (exp.f64 (neg.f64 (*.f64 (fabs.f64 x) (fabs.f64 x)))))

    1. Initial program 57.5%

      \[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.5%

      \[\leadsto \color{blue}{1 - \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)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right) \cdot {\left(e^{x}\right)}^{x}}} \]
      Proof

      [Start]57.5

      \[ 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|} \]

      exp-neg [=>]57.5

      \[ 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 \color{blue}{\frac{1}{e^{\left|x\right| \cdot \left|x\right|}}} \]

      associate-*r/ [=>]57.5

      \[ 1 - \color{blue}{\frac{\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 1}{e^{\left|x\right| \cdot \left|x\right|}}} \]
    3. Applied egg-rr54.8%

      \[\leadsto \color{blue}{\log \left(e^{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)} \]
      Proof

      [Start]57.5

      \[ 1 - \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)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right) \cdot {\left(e^{x}\right)}^{x}} \]

      add-log-exp [=>]55.3

      \[ \color{blue}{\log \left(e^{1 - \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)}}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right) \cdot {\left(e^{x}\right)}^{x}}}\right)} \]
    4. Taylor expanded in x around 0 97.5%

      \[\leadsto \color{blue}{10^{-9} + 1.128386358070218 \cdot x} \]
    5. Applied egg-rr100.0%

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

      [Start]97.5

      \[ 10^{-9} + 1.128386358070218 \cdot x \]

      add-sqr-sqrt [=>]47.6

      \[ 10^{-9} + \color{blue}{\sqrt{1.128386358070218 \cdot x} \cdot \sqrt{1.128386358070218 \cdot x}} \]

      sqrt-unprod [=>]100.0

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

      swap-sqr [=>]100.0

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

      metadata-eval [=>]100.0

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

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

      [Start]100.0

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

      *-commutative [=>]100.0

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

      associate-*l* [=>]100.0

      \[ 10^{-9} + \sqrt{\color{blue}{x \cdot \left(x \cdot 1.2732557730789702\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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^{x \cdot \left(-x\right)} \leq 0.999996:\\ \;\;\;\;1 - \frac{0.254829592 + \left(\frac{1.061405429}{{\left(\mathsf{fma}\left(0.3275911, x, 1\right)\right)}^{4}} + \left(\frac{1.421413741}{{\left(\mathsf{fma}\left(0.3275911, x, 1\right)\right)}^{2}} - \left(\frac{0.284496736}{\mathsf{fma}\left(0.3275911, x, 1\right)} + \frac{1.453152027}{{\left(\mathsf{fma}\left(0.3275911, x, 1\right)\right)}^{3}}\right)\right)\right)}{\mathsf{fma}\left(0.3275911, x, 1\right) \cdot e^{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy99.0%
Cost60868
\[\begin{array}{l} t_0 := 1 + 0.3275911 \cdot \left|x\right|\\ t_1 := \frac{1}{t_0}\\ \mathbf{if}\;\left|x\right| \leq 5 \cdot 10^{-12}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\left(0.254829592 + t_1 \cdot \left(-0.284496736 + t_1 \cdot {\left(\sqrt{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)}^{2}\right)\right) \cdot e^{x \cdot \left(-x\right)}\right) \cdot \frac{-1}{t_0}\\ \end{array} \]
Alternative 2
Accuracy99.5%
Cost47240
\[\begin{array}{l} \mathbf{if}\;x \leq -0.88:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 7.2 \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}{\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}}\\ \end{array} \]
Alternative 3
Accuracy99.5%
Cost47240
\[\begin{array}{l} \mathbf{if}\;x \leq -0.88:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.76 \cdot 10^{-6}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\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)} + -0.254829592}{\mathsf{fma}\left(0.3275911, x, 1\right)}, e^{x \cdot \left(-x\right)}, 1\right)\\ \end{array} \]
Alternative 4
Accuracy99.5%
Cost35720
\[\begin{array}{l} t_0 := 1 + 0.3275911 \cdot \left|x\right|\\ t_1 := \frac{1}{t_0}\\ \mathbf{if}\;x \leq -0.88:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-6}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(e^{x \cdot \left(-x\right)} \cdot \left(0.254829592 + t_1 \cdot \left(-0.284496736 + t_1 \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot x} \cdot \left(-1.453152027 + \frac{1.061405429}{t_0}\right)\right)\right)\right)\right) \cdot \frac{-1}{t_0}\\ \end{array} \]
Alternative 5
Accuracy99.3%
Cost7112
\[\begin{array}{l} \mathbf{if}\;x \leq -0.88:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.88:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 6
Accuracy98.7%
Cost1224
\[\begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{-10}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.05:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot -0.37545125292247583 + -0.00011824294398844343\right) + \left(10^{-9} + x \cdot 1.128386358070218\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 7
Accuracy98.6%
Cost968
\[\begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{-10}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.88:\\ \;\;\;\;10^{-9} + \left(x \cdot 1.128386358070218 + \left(x \cdot x\right) \cdot -0.00011824294398844343\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 8
Accuracy98.6%
Cost840
\[\begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{-10}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.88:\\ \;\;\;\;10^{-9} + x \cdot \left(1.128386358070218 + x \cdot -0.00011824294398844343\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 9
Accuracy98.5%
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{-10}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.88:\\ \;\;\;\;10^{-9} + x \cdot 1.128386358070218\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 10
Accuracy97.6%
Cost328
\[\begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{-5}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 2.85 \cdot 10^{-5}:\\ \;\;\;\;10^{-9}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 11
Accuracy52.8%
Cost64
\[10^{-9} \]

Error

Reproduce?

herbie shell --seed 2023160 
(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)))))))