?

Average Error: 0.2 → 0.2
Time: 14.4s
Precision: binary64
Cost: 27392

?

\[x \leq 0.5\]
\[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
\[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left|x\right| \cdot \left(2 + \left(x \cdot \left(x \cdot 0.6666666666666666\right) + \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(0.2 + x \cdot \left(x \cdot 0.047619047619047616\right)\right)\right)\right)\right)\right| \]
(FPCore (x)
 :precision binary64
 (fabs
  (*
   (/ 1.0 (sqrt PI))
   (+
    (+
     (+ (* 2.0 (fabs x)) (* (/ 2.0 3.0) (* (* (fabs x) (fabs x)) (fabs x))))
     (*
      (/ 1.0 5.0)
      (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x))))
    (*
     (/ 1.0 21.0)
     (*
      (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x))
      (fabs x)))))))
(FPCore (x)
 :precision binary64
 (fabs
  (*
   (/ 1.0 (sqrt PI))
   (*
    (fabs x)
    (+
     2.0
     (+
      (* x (* x 0.6666666666666666))
      (* (* x (* x (* x x))) (+ 0.2 (* x (* x 0.047619047619047616))))))))))
double code(double x) {
	return fabs(((1.0 / sqrt(((double) M_PI))) * ((((2.0 * fabs(x)) + ((2.0 / 3.0) * ((fabs(x) * fabs(x)) * fabs(x)))) + ((1.0 / 5.0) * ((((fabs(x) * fabs(x)) * fabs(x)) * fabs(x)) * fabs(x)))) + ((1.0 / 21.0) * ((((((fabs(x) * fabs(x)) * fabs(x)) * fabs(x)) * fabs(x)) * fabs(x)) * fabs(x))))));
}
double code(double x) {
	return fabs(((1.0 / sqrt(((double) M_PI))) * (fabs(x) * (2.0 + ((x * (x * 0.6666666666666666)) + ((x * (x * (x * x))) * (0.2 + (x * (x * 0.047619047619047616)))))))));
}
public static double code(double x) {
	return Math.abs(((1.0 / Math.sqrt(Math.PI)) * ((((2.0 * Math.abs(x)) + ((2.0 / 3.0) * ((Math.abs(x) * Math.abs(x)) * Math.abs(x)))) + ((1.0 / 5.0) * ((((Math.abs(x) * Math.abs(x)) * Math.abs(x)) * Math.abs(x)) * Math.abs(x)))) + ((1.0 / 21.0) * ((((((Math.abs(x) * Math.abs(x)) * Math.abs(x)) * Math.abs(x)) * Math.abs(x)) * Math.abs(x)) * Math.abs(x))))));
}
public static double code(double x) {
	return Math.abs(((1.0 / Math.sqrt(Math.PI)) * (Math.abs(x) * (2.0 + ((x * (x * 0.6666666666666666)) + ((x * (x * (x * x))) * (0.2 + (x * (x * 0.047619047619047616)))))))));
}
def code(x):
	return math.fabs(((1.0 / math.sqrt(math.pi)) * ((((2.0 * math.fabs(x)) + ((2.0 / 3.0) * ((math.fabs(x) * math.fabs(x)) * math.fabs(x)))) + ((1.0 / 5.0) * ((((math.fabs(x) * math.fabs(x)) * math.fabs(x)) * math.fabs(x)) * math.fabs(x)))) + ((1.0 / 21.0) * ((((((math.fabs(x) * math.fabs(x)) * math.fabs(x)) * math.fabs(x)) * math.fabs(x)) * math.fabs(x)) * math.fabs(x))))))
def code(x):
	return math.fabs(((1.0 / math.sqrt(math.pi)) * (math.fabs(x) * (2.0 + ((x * (x * 0.6666666666666666)) + ((x * (x * (x * x))) * (0.2 + (x * (x * 0.047619047619047616)))))))))
function code(x)
	return abs(Float64(Float64(1.0 / sqrt(pi)) * Float64(Float64(Float64(Float64(2.0 * abs(x)) + Float64(Float64(2.0 / 3.0) * Float64(Float64(abs(x) * abs(x)) * abs(x)))) + Float64(Float64(1.0 / 5.0) * Float64(Float64(Float64(Float64(abs(x) * abs(x)) * abs(x)) * abs(x)) * abs(x)))) + Float64(Float64(1.0 / 21.0) * Float64(Float64(Float64(Float64(Float64(Float64(abs(x) * abs(x)) * abs(x)) * abs(x)) * abs(x)) * abs(x)) * abs(x))))))
end
function code(x)
	return abs(Float64(Float64(1.0 / sqrt(pi)) * Float64(abs(x) * Float64(2.0 + Float64(Float64(x * Float64(x * 0.6666666666666666)) + Float64(Float64(x * Float64(x * Float64(x * x))) * Float64(0.2 + Float64(x * Float64(x * 0.047619047619047616)))))))))
end
function tmp = code(x)
	tmp = abs(((1.0 / sqrt(pi)) * ((((2.0 * abs(x)) + ((2.0 / 3.0) * ((abs(x) * abs(x)) * abs(x)))) + ((1.0 / 5.0) * ((((abs(x) * abs(x)) * abs(x)) * abs(x)) * abs(x)))) + ((1.0 / 21.0) * ((((((abs(x) * abs(x)) * abs(x)) * abs(x)) * abs(x)) * abs(x)) * abs(x))))));
end
function tmp = code(x)
	tmp = abs(((1.0 / sqrt(pi)) * (abs(x) * (2.0 + ((x * (x * 0.6666666666666666)) + ((x * (x * (x * x))) * (0.2 + (x * (x * 0.047619047619047616)))))))));
end
code[x_] := N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(2.0 * N[Abs[x], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / 3.0), $MachinePrecision] * N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 5.0), $MachinePrecision] * N[(N[(N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 21.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[x_] := N[Abs[N[(N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[x], $MachinePrecision] * N[(2.0 + N[(N[(x * N[(x * 0.6666666666666666), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.2 + N[(x * N[(x * 0.047619047619047616), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right|
\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left|x\right| \cdot \left(2 + \left(x \cdot \left(x \cdot 0.6666666666666666\right) + \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(0.2 + x \cdot \left(x \cdot 0.047619047619047616\right)\right)\right)\right)\right)\right|

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.2

    \[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]
  2. Simplified0.6

    \[\leadsto \color{blue}{\left|\frac{\left|x\right| \cdot \left(2 + x \cdot \left(x \cdot 0.6666666666666666\right)\right) + \left|x\right| \cdot \left(0.2 \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) + 0.047619047619047616 \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)\right)\right)}{\sqrt{\pi}}\right|} \]
    Proof

    [Start]0.2

    \[ \left|\frac{1}{\sqrt{\pi}} \cdot \left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right)\right| \]

    rational_best-simplify-1 [=>]0.2

    \[ \left|\color{blue}{\left(\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) \cdot \frac{1}{\sqrt{\pi}}}\right| \]

    rational_best-simplify-55 [=>]0.6

    \[ \left|\color{blue}{1 \cdot \frac{\left(\left(2 \cdot \left|x\right| + \frac{2}{3} \cdot \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{5} \cdot \left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)\right) + \frac{1}{21} \cdot \left(\left(\left(\left(\left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot \left|x\right|\right)}{\sqrt{\pi}}}\right| \]
  3. Applied egg-rr0.2

    \[\leadsto \left|\color{blue}{\frac{1}{\sqrt{\pi}} \cdot \left(\left|x\right| \cdot \left(2 + \left(x \cdot \left(x \cdot 0.6666666666666666\right) + \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(0.2 + x \cdot \left(x \cdot 0.047619047619047616\right)\right)\right)\right)\right)}\right| \]
  4. Final simplification0.2

    \[\leadsto \left|\frac{1}{\sqrt{\pi}} \cdot \left(\left|x\right| \cdot \left(2 + \left(x \cdot \left(x \cdot 0.6666666666666666\right) + \left(x \cdot \left(x \cdot \left(x \cdot x\right)\right)\right) \cdot \left(0.2 + x \cdot \left(x \cdot 0.047619047619047616\right)\right)\right)\right)\right)\right| \]

Alternatives

Alternative 1
Error0.2
Cost27136
\[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left|x\right| \cdot \left(2 + \left(x \cdot x\right) \cdot \left(0.6666666666666666 + \left(x \cdot x\right) \cdot \left(x \cdot \left(x \cdot 0.047619047619047616\right) + 0.2\right)\right)\right)\right)\right| \]
Alternative 2
Error0.5
Cost27008
\[\left|\frac{\left|x\right|}{\sqrt{\pi}} \cdot \left(2 + x \cdot \left(x \cdot \left(0.6666666666666666 + \left(x \cdot x\right) \cdot \left(0.2 + x \cdot \left(x \cdot 0.047619047619047616\right)\right)\right)\right)\right)\right| \]
Alternative 3
Error0.6
Cost27008
\[\left|\frac{\left|x\right| \cdot \left(2 + x \cdot \left(x \cdot \left(0.6666666666666666 + x \cdot \left(x \cdot \left(0.2 + 0.047619047619047616 \cdot \left(x \cdot x\right)\right)\right)\right)\right)\right)}{\sqrt{\pi}}\right| \]
Alternative 4
Error4.3
Cost26368
\[\left|\frac{1}{\sqrt{\pi}} \cdot \left(\left|x\right| \cdot \left(2 + 0.6666666666666666 \cdot \left(x \cdot x\right)\right)\right)\right| \]
Alternative 5
Error4.6
Cost25984
\[\left|\sqrt{\frac{1}{\pi}} \cdot \left(\left|x\right| \cdot 2\right)\right| \]
Alternative 6
Error5.1
Cost25856
\[\left|\frac{2 \cdot \left|x\right|}{\sqrt{\pi}}\right| \]

Error

Reproduce?

herbie shell --seed 2023100 
(FPCore (x)
  :name "Jmat.Real.erfi, branch x less than or equal to 0.5"
  :precision binary64
  :pre (<= x 0.5)
  (fabs (* (/ 1.0 (sqrt PI)) (+ (+ (+ (* 2.0 (fabs x)) (* (/ 2.0 3.0) (* (* (fabs x) (fabs x)) (fabs x)))) (* (/ 1.0 5.0) (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)))) (* (/ 1.0 21.0) (* (* (* (* (* (* (fabs x) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)) (fabs x)))))))