?

Average Error: 20.54% → 0.31%
Time: 26.5s
Precision: binary64
Cost: 126344

?

\[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 := e^{{x}^{2}}\\ \mathbf{if}\;x \leq -1.3 \cdot 10^{-6}:\\ \;\;\;\;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_0 \cdot {\left(e^{x}\right)}^{x}}\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-6}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \left(1.453152027 \cdot \frac{1}{{t_0}^{4} \cdot t_1} + 0.284496736 \cdot \frac{1}{t_1 \cdot {t_0}^{2}}\right)\right) + \left(1.421413741 \cdot \frac{-1}{t_1 \cdot {t_0}^{3}} + \left(1.061405429 \cdot \frac{-1}{t_1 \cdot {t_0}^{5}} + 0.254829592 \cdot \frac{-1}{t_0 \cdot t_1}\right)\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 (exp (pow x 2.0))))
   (if (<= x -1.3e-6)
     (-
      1.0
      (/
       (+
        0.254829592
        (/
         (+
          -0.284496736
          (/ (+ 1.421413741 (/ (+ -1.453152027 (/ 1.061405429 t_0)) t_0)) t_0))
         t_0))
       (* t_0 (pow (exp x) x))))
     (if (<= x 1.35e-6)
       (+ 1e-9 (sqrt (* x (* x 1.2732557730789702))))
       (+
        (+
         1.0
         (+
          (* 1.453152027 (/ 1.0 (* (pow t_0 4.0) t_1)))
          (* 0.284496736 (/ 1.0 (* t_1 (pow t_0 2.0))))))
        (+
         (* 1.421413741 (/ -1.0 (* t_1 (pow t_0 3.0))))
         (+
          (* 1.061405429 (/ -1.0 (* t_1 (pow t_0 5.0))))
          (* 0.254829592 (/ -1.0 (* t_0 t_1))))))))))
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 = exp(pow(x, 2.0));
	double tmp;
	if (x <= -1.3e-6) {
		tmp = 1.0 - ((0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / t_0)) / (t_0 * pow(exp(x), x)));
	} else if (x <= 1.35e-6) {
		tmp = 1e-9 + sqrt((x * (x * 1.2732557730789702)));
	} else {
		tmp = (1.0 + ((1.453152027 * (1.0 / (pow(t_0, 4.0) * t_1))) + (0.284496736 * (1.0 / (t_1 * pow(t_0, 2.0)))))) + ((1.421413741 * (-1.0 / (t_1 * pow(t_0, 3.0)))) + ((1.061405429 * (-1.0 / (t_1 * pow(t_0, 5.0)))) + (0.254829592 * (-1.0 / (t_0 * t_1)))));
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 1.0d0 - (((1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))) * (0.254829592d0 + ((1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))) * ((-0.284496736d0) + ((1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))) * (1.421413741d0 + ((1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))) * ((-1.453152027d0) + ((1.0d0 / (1.0d0 + (0.3275911d0 * abs(x)))) * 1.061405429d0))))))))) * exp(-(abs(x) * abs(x))))
end function
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 + (0.3275911d0 * abs(x))
    t_1 = exp((x ** 2.0d0))
    if (x <= (-1.3d-6)) then
        tmp = 1.0d0 - ((0.254829592d0 + (((-0.284496736d0) + ((1.421413741d0 + (((-1.453152027d0) + (1.061405429d0 / t_0)) / t_0)) / t_0)) / t_0)) / (t_0 * (exp(x) ** x)))
    else if (x <= 1.35d-6) then
        tmp = 1d-9 + sqrt((x * (x * 1.2732557730789702d0)))
    else
        tmp = (1.0d0 + ((1.453152027d0 * (1.0d0 / ((t_0 ** 4.0d0) * t_1))) + (0.284496736d0 * (1.0d0 / (t_1 * (t_0 ** 2.0d0)))))) + ((1.421413741d0 * ((-1.0d0) / (t_1 * (t_0 ** 3.0d0)))) + ((1.061405429d0 * ((-1.0d0) / (t_1 * (t_0 ** 5.0d0)))) + (0.254829592d0 * ((-1.0d0) / (t_0 * t_1)))))
    end if
    code = tmp
end function
public static double code(double x) {
	return 1.0 - (((1.0 / (1.0 + (0.3275911 * Math.abs(x)))) * (0.254829592 + ((1.0 / (1.0 + (0.3275911 * Math.abs(x)))) * (-0.284496736 + ((1.0 / (1.0 + (0.3275911 * Math.abs(x)))) * (1.421413741 + ((1.0 / (1.0 + (0.3275911 * Math.abs(x)))) * (-1.453152027 + ((1.0 / (1.0 + (0.3275911 * Math.abs(x)))) * 1.061405429))))))))) * Math.exp(-(Math.abs(x) * Math.abs(x))));
}
public static double code(double x) {
	double t_0 = 1.0 + (0.3275911 * Math.abs(x));
	double t_1 = Math.exp(Math.pow(x, 2.0));
	double tmp;
	if (x <= -1.3e-6) {
		tmp = 1.0 - ((0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / t_0)) / (t_0 * Math.pow(Math.exp(x), x)));
	} else if (x <= 1.35e-6) {
		tmp = 1e-9 + Math.sqrt((x * (x * 1.2732557730789702)));
	} else {
		tmp = (1.0 + ((1.453152027 * (1.0 / (Math.pow(t_0, 4.0) * t_1))) + (0.284496736 * (1.0 / (t_1 * Math.pow(t_0, 2.0)))))) + ((1.421413741 * (-1.0 / (t_1 * Math.pow(t_0, 3.0)))) + ((1.061405429 * (-1.0 / (t_1 * Math.pow(t_0, 5.0)))) + (0.254829592 * (-1.0 / (t_0 * t_1)))));
	}
	return tmp;
}
def code(x):
	return 1.0 - (((1.0 / (1.0 + (0.3275911 * math.fabs(x)))) * (0.254829592 + ((1.0 / (1.0 + (0.3275911 * math.fabs(x)))) * (-0.284496736 + ((1.0 / (1.0 + (0.3275911 * math.fabs(x)))) * (1.421413741 + ((1.0 / (1.0 + (0.3275911 * math.fabs(x)))) * (-1.453152027 + ((1.0 / (1.0 + (0.3275911 * math.fabs(x)))) * 1.061405429))))))))) * math.exp(-(math.fabs(x) * math.fabs(x))))
def code(x):
	t_0 = 1.0 + (0.3275911 * math.fabs(x))
	t_1 = math.exp(math.pow(x, 2.0))
	tmp = 0
	if x <= -1.3e-6:
		tmp = 1.0 - ((0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / t_0)) / (t_0 * math.pow(math.exp(x), x)))
	elif x <= 1.35e-6:
		tmp = 1e-9 + math.sqrt((x * (x * 1.2732557730789702)))
	else:
		tmp = (1.0 + ((1.453152027 * (1.0 / (math.pow(t_0, 4.0) * t_1))) + (0.284496736 * (1.0 / (t_1 * math.pow(t_0, 2.0)))))) + ((1.421413741 * (-1.0 / (t_1 * math.pow(t_0, 3.0)))) + ((1.061405429 * (-1.0 / (t_1 * math.pow(t_0, 5.0)))) + (0.254829592 * (-1.0 / (t_0 * t_1)))))
	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 = exp((x ^ 2.0))
	tmp = 0.0
	if (x <= -1.3e-6)
		tmp = Float64(1.0 - 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)) / Float64(t_0 * (exp(x) ^ x))));
	elseif (x <= 1.35e-6)
		tmp = Float64(1e-9 + sqrt(Float64(x * Float64(x * 1.2732557730789702))));
	else
		tmp = Float64(Float64(1.0 + Float64(Float64(1.453152027 * Float64(1.0 / Float64((t_0 ^ 4.0) * t_1))) + Float64(0.284496736 * Float64(1.0 / Float64(t_1 * (t_0 ^ 2.0)))))) + Float64(Float64(1.421413741 * Float64(-1.0 / Float64(t_1 * (t_0 ^ 3.0)))) + Float64(Float64(1.061405429 * Float64(-1.0 / Float64(t_1 * (t_0 ^ 5.0)))) + Float64(0.254829592 * Float64(-1.0 / Float64(t_0 * t_1))))));
	end
	return tmp
end
function tmp = code(x)
	tmp = 1.0 - (((1.0 / (1.0 + (0.3275911 * abs(x)))) * (0.254829592 + ((1.0 / (1.0 + (0.3275911 * abs(x)))) * (-0.284496736 + ((1.0 / (1.0 + (0.3275911 * abs(x)))) * (1.421413741 + ((1.0 / (1.0 + (0.3275911 * abs(x)))) * (-1.453152027 + ((1.0 / (1.0 + (0.3275911 * abs(x)))) * 1.061405429))))))))) * exp(-(abs(x) * abs(x))));
end
function tmp_2 = code(x)
	t_0 = 1.0 + (0.3275911 * abs(x));
	t_1 = exp((x ^ 2.0));
	tmp = 0.0;
	if (x <= -1.3e-6)
		tmp = 1.0 - ((0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / t_0)) / t_0)) / t_0)) / t_0)) / (t_0 * (exp(x) ^ x)));
	elseif (x <= 1.35e-6)
		tmp = 1e-9 + sqrt((x * (x * 1.2732557730789702)));
	else
		tmp = (1.0 + ((1.453152027 * (1.0 / ((t_0 ^ 4.0) * t_1))) + (0.284496736 * (1.0 / (t_1 * (t_0 ^ 2.0)))))) + ((1.421413741 * (-1.0 / (t_1 * (t_0 ^ 3.0)))) + ((1.061405429 * (-1.0 / (t_1 * (t_0 ^ 5.0)))) + (0.254829592 * (-1.0 / (t_0 * t_1)))));
	end
	tmp_2 = 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[Exp[N[Power[x, 2.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.3e-6], N[(1.0 - 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[(t$95$0 * N[Power[N[Exp[x], $MachinePrecision], x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e-6], N[(1e-9 + N[Sqrt[N[(x * N[(x * 1.2732557730789702), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(1.453152027 * N[(1.0 / N[(N[Power[t$95$0, 4.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.284496736 * N[(1.0 / N[(t$95$1 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.421413741 * N[(-1.0 / N[(t$95$1 * N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.061405429 * N[(-1.0 / N[(t$95$1 * N[Power[t$95$0, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.254829592 * N[(-1.0 / N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $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 := 1 + 0.3275911 \cdot \left|x\right|\\
t_1 := e^{{x}^{2}}\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{-6}:\\
\;\;\;\;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_0 \cdot {\left(e^{x}\right)}^{x}}\\

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

\mathbf{else}:\\
\;\;\;\;\left(1 + \left(1.453152027 \cdot \frac{1}{{t_0}^{4} \cdot t_1} + 0.284496736 \cdot \frac{1}{t_1 \cdot {t_0}^{2}}\right)\right) + \left(1.421413741 \cdot \frac{-1}{t_1 \cdot {t_0}^{3}} + \left(1.061405429 \cdot \frac{-1}{t_1 \cdot {t_0}^{5}} + 0.254829592 \cdot \frac{-1}{t_0 \cdot t_1}\right)\right)\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

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

    1. Initial program 0.25

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

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

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

      \[ 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-rr0.24

      \[\leadsto \color{blue}{\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|} + 1} \]
    4. Applied egg-rr0.24

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

    if -1.30000000000000005e-6 < x < 1.34999999999999999e-6

    1. Initial program 42.28

      \[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. Simplified42.28

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

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

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

      \[ \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-rr42.97

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

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

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

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

      [Start]0.35

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

      *-commutative [=>]0.35

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

      associate-*l* [=>]0.35

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

    if 1.34999999999999999e-6 < x

    1. Initial program 0.3

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

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

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

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

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

      \[\leadsto \color{blue}{\left(1 + \left(1.453152027 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{4} \cdot e^{{x}^{2}}} + 0.284496736 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{2} \cdot e^{{x}^{2}}}\right)\right) - \left(1.421413741 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{3} \cdot e^{{x}^{2}}} + \left(1.061405429 \cdot \frac{1}{{\left(0.3275911 \cdot \left|x\right| + 1\right)}^{5} \cdot e^{{x}^{2}}} + 0.254829592 \cdot \frac{1}{\left(0.3275911 \cdot \left|x\right| + 1\right) \cdot e^{{x}^{2}}}\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.31

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

Alternatives

Alternative 1
Error0.31%
Cost102152
\[\begin{array}{l} t_0 := 1 + 0.3275911 \cdot \left|x\right|\\ t_1 := 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{if}\;x \leq -1.3 \cdot 10^{-6}:\\ \;\;\;\;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_0 \cdot {\left(e^{x}\right)}^{x}}\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-6}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{t_1}^{2}} \cdot \sqrt[3]{t_1}\\ \end{array} \]
Alternative 2
Error0.31%
Cost54344
\[\begin{array}{l} t_0 := 1 + 0.3275911 \cdot \left|x\right|\\ \mathbf{if}\;x \leq -1.3 \cdot 10^{-6}:\\ \;\;\;\;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_0 \cdot {\left(e^{x}\right)}^{x}}\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-6}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(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)}\\ \end{array} \]
Alternative 3
Error0.31%
Cost47748
\[\begin{array}{l} t_0 := 1 + 0.3275911 \cdot \left|x\right|\\ \mathbf{if}\;x \leq -1.3 \cdot 10^{-6}:\\ \;\;\;\;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_0 \cdot {\left(e^{x}\right)}^{x}}\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-6}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;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}\\ \end{array} \]
Alternative 4
Error0.31%
Cost41545
\[\begin{array}{l} t_0 := 1 + 0.3275911 \cdot \left|x\right|\\ \mathbf{if}\;x \leq -1.3 \cdot 10^{-6} \lor \neg \left(x \leq 1.4 \cdot 10^{-6}\right):\\ \;\;\;\;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{else}:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \end{array} \]
Alternative 5
Error0.77%
Cost7112
\[\begin{array}{l} \mathbf{if}\;x \leq -0.88:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.9:\\ \;\;\;\;10^{-9} + \sqrt{x \cdot \left(x \cdot 1.2732557730789702\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 6
Error1.71%
Cost6856
\[\begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{-10}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 0.9:\\ \;\;\;\;\mathsf{fma}\left(1.128386358070218, x, 10^{-9}\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 7
Error1.71%
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 8
Error2.61%
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 9
Error47.71%
Cost64
\[10^{-9} \]

Error

Reproduce?

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