?

Average Error: 13.5 → 0.5
Time: 21.9s
Precision: binary64
Cost: 268676

?

\[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 := \mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)\\ t_1 := {t_0}^{-2}\\ t_2 := \frac{-0.284496736 + \frac{1.421413741 + \mathsf{fma}\left(1.061405429, t_1, \frac{-1.453152027}{t_0}\right)}{t_0}}{t_0}\\ t_3 := 0.254829592 + t_2\\ t_4 := {\left(e^{x}\right)}^{x}\\ \mathbf{if}\;x \leq -2.45 \cdot 10^{-17}:\\ \;\;\;\;\frac{1 + t_1 \cdot \left(\frac{t_3}{t_4} \cdot \frac{-0.254829592 - t_2}{t_4}\right)}{1 + \frac{t_3}{t_0 \cdot t_4}}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(x \cdot x\right) \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \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 (fma (fabs x) 0.3275911 1.0))
        (t_1 (pow t_0 -2.0))
        (t_2
         (/
          (+
           -0.284496736
           (/ (+ 1.421413741 (fma 1.061405429 t_1 (/ -1.453152027 t_0))) t_0))
          t_0))
        (t_3 (+ 0.254829592 t_2))
        (t_4 (pow (exp x) x)))
   (if (<= x -2.45e-17)
     (/
      (+ 1.0 (* t_1 (* (/ t_3 t_4) (/ (- -0.254829592 t_2) t_4))))
      (+ 1.0 (/ t_3 (* t_0 t_4))))
     (if (<= x 1.1)
       (+
        (fma 1.128386358070218 x 1e-9)
        (* (* x x) (+ -0.00011824294398844343 (* x -0.37545125292247583))))
       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 = fma(fabs(x), 0.3275911, 1.0);
	double t_1 = pow(t_0, -2.0);
	double t_2 = (-0.284496736 + ((1.421413741 + fma(1.061405429, t_1, (-1.453152027 / t_0))) / t_0)) / t_0;
	double t_3 = 0.254829592 + t_2;
	double t_4 = pow(exp(x), x);
	double tmp;
	if (x <= -2.45e-17) {
		tmp = (1.0 + (t_1 * ((t_3 / t_4) * ((-0.254829592 - t_2) / t_4)))) / (1.0 + (t_3 / (t_0 * t_4)));
	} else if (x <= 1.1) {
		tmp = fma(1.128386358070218, x, 1e-9) + ((x * x) * (-0.00011824294398844343 + (x * -0.37545125292247583)));
	} else {
		tmp = 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 = fma(abs(x), 0.3275911, 1.0)
	t_1 = t_0 ^ -2.0
	t_2 = Float64(Float64(-0.284496736 + Float64(Float64(1.421413741 + fma(1.061405429, t_1, Float64(-1.453152027 / t_0))) / t_0)) / t_0)
	t_3 = Float64(0.254829592 + t_2)
	t_4 = exp(x) ^ x
	tmp = 0.0
	if (x <= -2.45e-17)
		tmp = Float64(Float64(1.0 + Float64(t_1 * Float64(Float64(t_3 / t_4) * Float64(Float64(-0.254829592 - t_2) / t_4)))) / Float64(1.0 + Float64(t_3 / Float64(t_0 * t_4))));
	elseif (x <= 1.1)
		tmp = Float64(fma(1.128386358070218, x, 1e-9) + Float64(Float64(x * x) * Float64(-0.00011824294398844343 + Float64(x * -0.37545125292247583))));
	else
		tmp = 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[(N[Abs[x], $MachinePrecision] * 0.3275911 + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, -2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(-0.284496736 + N[(N[(1.421413741 + N[(1.061405429 * t$95$1 + N[(-1.453152027 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(0.254829592 + t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[Power[N[Exp[x], $MachinePrecision], x], $MachinePrecision]}, If[LessEqual[x, -2.45e-17], N[(N[(1.0 + N[(t$95$1 * N[(N[(t$95$3 / t$95$4), $MachinePrecision] * N[(N[(-0.254829592 - t$95$2), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(t$95$3 / N[(t$95$0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.1], N[(N[(1.128386358070218 * x + 1e-9), $MachinePrecision] + N[(N[(x * x), $MachinePrecision] * N[(-0.00011824294398844343 + N[(x * -0.37545125292247583), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]]]]]
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 := \mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)\\
t_1 := {t_0}^{-2}\\
t_2 := \frac{-0.284496736 + \frac{1.421413741 + \mathsf{fma}\left(1.061405429, t_1, \frac{-1.453152027}{t_0}\right)}{t_0}}{t_0}\\
t_3 := 0.254829592 + t_2\\
t_4 := {\left(e^{x}\right)}^{x}\\
\mathbf{if}\;x \leq -2.45 \cdot 10^{-17}:\\
\;\;\;\;\frac{1 + t_1 \cdot \left(\frac{t_3}{t_4} \cdot \frac{-0.254829592 - t_2}{t_4}\right)}{1 + \frac{t_3}{t_0 \cdot t_4}}\\

\mathbf{elif}\;x \leq 1.1:\\
\;\;\;\;\mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(x \cdot x\right) \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right)\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}

Error?

Derivation?

  1. Split input into 3 regimes
  2. if x < -2.45000000000000006e-17

    1. Initial program 1.2

      \[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. Taylor expanded in x around 0 1.3

      \[\leadsto 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 \color{blue}{\left(\left(1.421413741 + 1.061405429 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{2}}\right) - 1.453152027 \cdot \frac{1}{0.3275911 \cdot \left|x\right| + 1}\right)}\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|} \]
    3. Applied egg-rr1.2

      \[\leadsto \color{blue}{\frac{1 - \frac{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.061405429 \cdot {\left(\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\right)}^{-2} + \left(1.421413741 + \frac{-1.453152027}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}\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)}}{e^{x \cdot x}} \cdot \frac{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.061405429 \cdot {\left(\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\right)}^{-2} + \left(1.421413741 + \frac{-1.453152027}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}\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)}}{e^{x \cdot x}}}{1 + \frac{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.061405429 \cdot {\left(\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\right)}^{-2} + \left(1.421413741 + \frac{-1.453152027}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}\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)}}{e^{x \cdot x}}}} \]
    4. Simplified1.2

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

      [Start]1.2

      \[ \frac{1 - \frac{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.061405429 \cdot {\left(\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\right)}^{-2} + \left(1.421413741 + \frac{-1.453152027}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}\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)}}{e^{x \cdot x}} \cdot \frac{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.061405429 \cdot {\left(\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\right)}^{-2} + \left(1.421413741 + \frac{-1.453152027}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}\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)}}{e^{x \cdot x}}}{1 + \frac{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.061405429 \cdot {\left(\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)\right)}^{-2} + \left(1.421413741 + \frac{-1.453152027}{\mathsf{fma}\left(0.3275911, \left|x\right|, 1\right)}\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)}}{e^{x \cdot x}}} \]

    if -2.45000000000000006e-17 < x < 1.1000000000000001

    1. Initial program 26.9

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

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

      \[ 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/ [=>]26.9

      \[ 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/ [=>]26.9

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

      \[\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)} \]
    4. Taylor expanded in x around 0 0.3

      \[\leadsto \color{blue}{10^{-9} + \left(-0.00011824294398844343 \cdot {x}^{2} + \left(-0.37545125292247583 \cdot {x}^{3} + 1.128386358070218 \cdot x\right)\right)} \]
    5. Simplified0.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(x \cdot x\right) \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right)} \]
      Proof

      [Start]0.3

      \[ 10^{-9} + \left(-0.00011824294398844343 \cdot {x}^{2} + \left(-0.37545125292247583 \cdot {x}^{3} + 1.128386358070218 \cdot x\right)\right) \]

      associate-+r+ [=>]0.3

      \[ 10^{-9} + \color{blue}{\left(\left(-0.00011824294398844343 \cdot {x}^{2} + -0.37545125292247583 \cdot {x}^{3}\right) + 1.128386358070218 \cdot x\right)} \]

      +-commutative [=>]0.3

      \[ 10^{-9} + \color{blue}{\left(1.128386358070218 \cdot x + \left(-0.00011824294398844343 \cdot {x}^{2} + -0.37545125292247583 \cdot {x}^{3}\right)\right)} \]

      associate-+r+ [=>]0.3

      \[ \color{blue}{\left(10^{-9} + 1.128386358070218 \cdot x\right) + \left(-0.00011824294398844343 \cdot {x}^{2} + -0.37545125292247583 \cdot {x}^{3}\right)} \]

      +-commutative [=>]0.3

      \[ \color{blue}{\left(1.128386358070218 \cdot x + 10^{-9}\right)} + \left(-0.00011824294398844343 \cdot {x}^{2} + -0.37545125292247583 \cdot {x}^{3}\right) \]

      fma-def [=>]0.3

      \[ \color{blue}{\mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right)} + \left(-0.00011824294398844343 \cdot {x}^{2} + -0.37545125292247583 \cdot {x}^{3}\right) \]

      cube-mult [=>]0.3

      \[ \mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(-0.00011824294398844343 \cdot {x}^{2} + -0.37545125292247583 \cdot \color{blue}{\left(x \cdot \left(x \cdot x\right)\right)}\right) \]

      unpow2 [<=]0.3

      \[ \mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(-0.00011824294398844343 \cdot {x}^{2} + -0.37545125292247583 \cdot \left(x \cdot \color{blue}{{x}^{2}}\right)\right) \]

      associate-*r* [=>]0.3

      \[ \mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(-0.00011824294398844343 \cdot {x}^{2} + \color{blue}{\left(-0.37545125292247583 \cdot x\right) \cdot {x}^{2}}\right) \]

      *-commutative [<=]0.3

      \[ \mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(-0.00011824294398844343 \cdot {x}^{2} + \color{blue}{\left(x \cdot -0.37545125292247583\right)} \cdot {x}^{2}\right) \]

      distribute-rgt-out [=>]0.3

      \[ \mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \color{blue}{{x}^{2} \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right)} \]

      unpow2 [=>]0.3

      \[ \mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \color{blue}{\left(x \cdot x\right)} \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right) \]

    if 1.1000000000000001 < x

    1. Initial program 0

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

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

      \[ 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 [=>]0

      \[ \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 [=>]0

      \[ \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-rr64.0

      \[\leadsto \color{blue}{\frac{e^{x \cdot x}}{\mathsf{fma}\left(0.3275911, x, 1\right)} \cdot \left(-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)}\right) + 1} \]
    4. Taylor expanded in x around inf 0.0

      \[\leadsto \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{-17}:\\ \;\;\;\;\frac{1 + {\left(\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)\right)}^{-2} \cdot \left(\frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \mathsf{fma}\left(1.061405429, {\left(\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)\right)}^{-2}, \frac{-1.453152027}{\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)}\right)}{\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)}}{\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)}}{{\left(e^{x}\right)}^{x}} \cdot \frac{-0.254829592 - \frac{-0.284496736 + \frac{1.421413741 + \mathsf{fma}\left(1.061405429, {\left(\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)\right)}^{-2}, \frac{-1.453152027}{\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)}\right)}{\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)}}{\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)}}{{\left(e^{x}\right)}^{x}}\right)}{1 + \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \mathsf{fma}\left(1.061405429, {\left(\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)\right)}^{-2}, \frac{-1.453152027}{\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)}\right)}{\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)}}{\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right)}}{\mathsf{fma}\left(\left|x\right|, 0.3275911, 1\right) \cdot {\left(e^{x}\right)}^{x}}}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(x \cdot x\right) \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]

Alternatives

Alternative 1
Error0.5
Cost169732
\[\begin{array}{l} t_0 := 1 + \left|x\right| \cdot 0.3275911\\ t_1 := {t_0}^{3}\\ t_2 := \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}\\ \mathbf{if}\;x \leq -1.2 \cdot 10^{-16}:\\ \;\;\;\;\frac{1 - \frac{{\left(\left(0.254829592 + \left(1.061405429 \cdot \frac{1}{{t_0}^{4}} + 1.421413741 \cdot \frac{1}{{t_0}^{2}}\right)\right) + \left(-0.284496736 \cdot \frac{1}{t_0} + -1.453152027 \cdot \frac{1}{t_1}\right)\right)}^{3}}{t_1 \cdot {\left(e^{{x}^{2}}\right)}^{3}}}{1 + t_2 \cdot \left(1 + t_2\right)}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(x \cdot x\right) \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 2
Error0.5
Cost150660
\[\begin{array}{l} t_0 := 1 + \left|x\right| \cdot 0.3275911\\ t_1 := \frac{1.061405429}{t_0}\\ t_2 := e^{x \cdot x}\\ t_3 := \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + t_1}{t_0}}{t_0}}{t_0}}{t_2}\\ \mathbf{if}\;x \leq -2.85 \cdot 10^{-18}:\\ \;\;\;\;\frac{1 - \frac{1}{\frac{{t_0}^{3}}{{t_3}^{3}}}}{1 + \left(1 + \frac{t_3}{t_0}\right) \cdot \frac{\frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{\frac{1.126581484710674 \cdot {t_0}^{-2} + -2.111650813574209}{1.453152027 + t_1}}{t_0}}{t_0}}{t_0}}{t_2}}{t_0}}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(x \cdot x\right) \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 3
Error0.5
Cost137156
\[\begin{array}{l} t_0 := 1 + \left|x\right| \cdot 0.3275911\\ t_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}}\\ t_2 := \frac{t_1}{t_0}\\ \mathbf{if}\;x \leq -2.85 \cdot 10^{-18}:\\ \;\;\;\;\frac{1 + \frac{-1}{\frac{{t_0}^{3}}{{t_1}^{3}}}}{1 + t_2 \cdot \left(1 + t_2\right)}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(x \cdot x\right) \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 4
Error0.5
Cost54212
\[\begin{array}{l} t_0 := 1 + \left|x\right| \cdot 0.3275911\\ \mathbf{if}\;x \leq -2.42 \cdot 10^{-17}:\\ \;\;\;\;\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_0}}{e^{x \cdot x}}}\right)\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(x \cdot x\right) \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 5
Error0.5
Cost41412
\[\begin{array}{l} t_0 := 1 + \left|x\right| \cdot 0.3275911\\ \mathbf{if}\;x \leq -2.5 \cdot 10^{-17}:\\ \;\;\;\;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}\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;\mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right) + \left(x \cdot x\right) \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 6
Error0.4
Cost7112
\[\begin{array}{l} \mathbf{if}\;x \leq -0.9:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.9:\\ \;\;\;\;10^{-9} + \sqrt{\left(x \cdot x\right) \cdot 1.2732557730789702}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 7
Error0.9
Cost1096
\[\begin{array}{l} \mathbf{if}\;x \leq -8.9 \cdot 10^{-10}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 1.1:\\ \;\;\;\;10^{-9} + x \cdot \left(1.128386358070218 + x \cdot \left(-0.00011824294398844343 + x \cdot -0.37545125292247583\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 8
Error1.0
Cost968
\[\begin{array}{l} \mathbf{if}\;x \leq -8.9 \cdot 10^{-10}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.9:\\ \;\;\;\;10^{-9} + \left(x \cdot 1.128386358070218 + \left(x \cdot x\right) \cdot -0.00011824294398844343\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 9
Error1.0
Cost840
\[\begin{array}{l} \mathbf{if}\;x \leq -8.9 \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
Error1.1
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -8.9 \cdot 10^{-10}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.9:\\ \;\;\;\;10^{-9} + x \cdot 1.128386358070218\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 11
Error1.6
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
Error29.7
Cost64
\[10^{-9} \]

Error

Reproduce?

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