Average Error: 0.1 → 0.1
Time: 59.9s
Precision: binary64
Cost: 2688
\[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|\left|x\right| \cdot \frac{0.047619047619047616 \cdot {x}^{6} + \left(2 + \left(0.6666666666666666 \cdot \left(x \cdot x\right) + \sqrt[3]{{x}^{4} \cdot 0.2} \cdot \left({\left({x}^{4} \cdot 0.2\right)}^{0.3333333333333333} \cdot \sqrt[3]{{x}^{4} \cdot 0.2}\right)\right)\right)}{\sqrt{\pi}}\right|\]
\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|\left|x\right| \cdot \frac{0.047619047619047616 \cdot {x}^{6} + \left(2 + \left(0.6666666666666666 \cdot \left(x \cdot x\right) + \sqrt[3]{{x}^{4} \cdot 0.2} \cdot \left({\left({x}^{4} \cdot 0.2\right)}^{0.3333333333333333} \cdot \sqrt[3]{{x}^{4} \cdot 0.2}\right)\right)\right)}{\sqrt{\pi}}\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
  (*
   (fabs x)
   (/
    (+
     (* 0.047619047619047616 (pow x 6.0))
     (+
      2.0
      (+
       (* 0.6666666666666666 (* x x))
       (*
        (cbrt (* (pow x 4.0) 0.2))
        (*
         (pow (* (pow x 4.0) 0.2) 0.3333333333333333)
         (cbrt (* (pow x 4.0) 0.2)))))))
    (sqrt PI)))))
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(fabs(x) * (((0.047619047619047616 * pow(x, 6.0)) + (2.0 + ((0.6666666666666666 * (x * x)) + (cbrt(pow(x, 4.0) * 0.2) * (pow((pow(x, 4.0) * 0.2), 0.3333333333333333) * cbrt(pow(x, 4.0) * 0.2)))))) / sqrt((double) M_PI)));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs
Alternative 1
Accuracy1.1
Cost3712
\[\left|\left(\sqrt{\left|x\right|} \cdot \sqrt{\frac{{x}^{6} \cdot 0.047619047619047616 + \left(2 + \left(\sqrt[3]{{x}^{6} \cdot 0.2962962962962963} + 0.2 \cdot {x}^{4}\right)\right)}{\sqrt{\pi}}}\right) \cdot \left(\sqrt{\left|x\right|} \cdot \sqrt{\frac{{x}^{6} \cdot 0.047619047619047616 + \left(2 + \left(\sqrt[3]{{x}^{6} \cdot 0.2962962962962963} + 0.2 \cdot {x}^{4}\right)\right)}{\sqrt{\pi}}}\right)\right|\]

Derivation

  1. Initial program 0.1

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

    \[\leadsto \color{blue}{\left|\left|x\right| \cdot \frac{0.047619047619047616 \cdot {x}^{6} + \left(2 + \left(0.6666666666666666 \cdot \left(x \cdot x\right) + 0.2 \cdot {x}^{4}\right)\right)}{\sqrt{\pi}}\right|}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt_binary64_38640.1

    \[\leadsto \left|\left|x\right| \cdot \frac{0.047619047619047616 \cdot {x}^{6} + \left(2 + \left(0.6666666666666666 \cdot \left(x \cdot x\right) + \color{blue}{\left(\sqrt[3]{0.2 \cdot {x}^{4}} \cdot \sqrt[3]{0.2 \cdot {x}^{4}}\right) \cdot \sqrt[3]{0.2 \cdot {x}^{4}}}\right)\right)}{\sqrt{\pi}}\right|\]
  5. Simplified0.1

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

    \[\leadsto \left|\left|x\right| \cdot \frac{0.047619047619047616 \cdot {x}^{6} + \left(2 + \left(0.6666666666666666 \cdot \left(x \cdot x\right) + \left(\sqrt[3]{{x}^{4} \cdot 0.2} \cdot \sqrt[3]{{x}^{4} \cdot 0.2}\right) \cdot \color{blue}{\sqrt[3]{{x}^{4} \cdot 0.2}}\right)\right)}{\sqrt{\pi}}\right|\]
  7. Using strategy rm
  8. Applied pow1/3_binary64_39110.1

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

    \[\leadsto \left|\left|x\right| \cdot \frac{0.047619047619047616 \cdot {x}^{6} + \left(2 + \left(0.6666666666666666 \cdot \left(x \cdot x\right) + \sqrt[3]{{x}^{4} \cdot 0.2} \cdot \left({\left({x}^{4} \cdot 0.2\right)}^{0.3333333333333333} \cdot \sqrt[3]{{x}^{4} \cdot 0.2}\right)\right)\right)}{\sqrt{\pi}}\right|\]

Reproduce

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