Average Error: 13.9 → 13.9
Time: 16.5s
Precision: binary64
\[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|}\]
\[1 - \frac{\left(0.254829592 + \frac{\sqrt{1.421413741}}{1 + 0.3275911 \cdot \left|x\right|} \cdot \frac{\sqrt{1.421413741}}{1 + 0.3275911 \cdot \left|x\right|}\right) + \left(\frac{1.061405429}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{4}} - \left(\frac{1.453152027}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{3}} + \frac{0.284496736}{1 + 0.3275911 \cdot \left|x\right|}\right)\right)}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{x \cdot x}}\]
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|}
1 - \frac{\left(0.254829592 + \frac{\sqrt{1.421413741}}{1 + 0.3275911 \cdot \left|x\right|} \cdot \frac{\sqrt{1.421413741}}{1 + 0.3275911 \cdot \left|x\right|}\right) + \left(\frac{1.061405429}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{4}} - \left(\frac{1.453152027}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{3}} + \frac{0.284496736}{1 + 0.3275911 \cdot \left|x\right|}\right)\right)}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{x \cdot x}}
(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
 (-
  1.0
  (/
   (+
    (+
     0.254829592
     (*
      (/ (sqrt 1.421413741) (+ 1.0 (* 0.3275911 (fabs x))))
      (/ (sqrt 1.421413741) (+ 1.0 (* 0.3275911 (fabs x))))))
    (-
     (/ 1.061405429 (pow (+ 1.0 (* 0.3275911 (fabs x))) 4.0))
     (+
      (/ 1.453152027 (pow (+ 1.0 (* 0.3275911 (fabs x))) 3.0))
      (/ 0.284496736 (+ 1.0 (* 0.3275911 (fabs x)))))))
   (* (+ 1.0 (* 0.3275911 (fabs x))) (exp (* x x))))))
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) {
	return 1.0 - (((0.254829592 + ((sqrt(1.421413741) / (1.0 + (0.3275911 * fabs(x)))) * (sqrt(1.421413741) / (1.0 + (0.3275911 * fabs(x)))))) + ((1.061405429 / pow((1.0 + (0.3275911 * fabs(x))), 4.0)) - ((1.453152027 / pow((1.0 + (0.3275911 * fabs(x))), 3.0)) + (0.284496736 / (1.0 + (0.3275911 * fabs(x))))))) / ((1.0 + (0.3275911 * fabs(x))) * exp(x * x)));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 13.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. Simplified13.9

    \[\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 e^{x \cdot x}}}\]
  3. Taylor expanded around 0 14.6

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

    \[\leadsto 1 - \frac{\color{blue}{\left(0.254829592 + \frac{1.421413741}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{2}}\right) + \left(\frac{1.061405429}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{4}} - \left(\frac{1.453152027}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{3}} + \frac{0.284496736}{1 + 0.3275911 \cdot \left|x\right|}\right)\right)}}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{x \cdot x}}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt_binary64_248713.9

    \[\leadsto 1 - \frac{\left(0.254829592 + \frac{1.421413741}{{\color{blue}{\left(\sqrt{1 + 0.3275911 \cdot \left|x\right|} \cdot \sqrt{1 + 0.3275911 \cdot \left|x\right|}\right)}}^{2}}\right) + \left(\frac{1.061405429}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{4}} - \left(\frac{1.453152027}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{3}} + \frac{0.284496736}{1 + 0.3275911 \cdot \left|x\right|}\right)\right)}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{x \cdot x}}\]
  7. Applied unpow-prod-down_binary64_254413.9

    \[\leadsto 1 - \frac{\left(0.254829592 + \frac{1.421413741}{\color{blue}{{\left(\sqrt{1 + 0.3275911 \cdot \left|x\right|}\right)}^{2} \cdot {\left(\sqrt{1 + 0.3275911 \cdot \left|x\right|}\right)}^{2}}}\right) + \left(\frac{1.061405429}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{4}} - \left(\frac{1.453152027}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{3}} + \frac{0.284496736}{1 + 0.3275911 \cdot \left|x\right|}\right)\right)}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{x \cdot x}}\]
  8. Applied add-sqr-sqrt_binary64_248713.9

    \[\leadsto 1 - \frac{\left(0.254829592 + \frac{\color{blue}{\sqrt{1.421413741} \cdot \sqrt{1.421413741}}}{{\left(\sqrt{1 + 0.3275911 \cdot \left|x\right|}\right)}^{2} \cdot {\left(\sqrt{1 + 0.3275911 \cdot \left|x\right|}\right)}^{2}}\right) + \left(\frac{1.061405429}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{4}} - \left(\frac{1.453152027}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{3}} + \frac{0.284496736}{1 + 0.3275911 \cdot \left|x\right|}\right)\right)}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{x \cdot x}}\]
  9. Applied times-frac_binary64_247113.9

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

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

    \[\leadsto 1 - \frac{\left(0.254829592 + \frac{\sqrt{1.421413741}}{1 + 0.3275911 \cdot \left|x\right|} \cdot \color{blue}{\frac{\sqrt{1.421413741}}{1 + 0.3275911 \cdot \left|x\right|}}\right) + \left(\frac{1.061405429}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{4}} - \left(\frac{1.453152027}{{\left(1 + 0.3275911 \cdot \left|x\right|\right)}^{3}} + \frac{0.284496736}{1 + 0.3275911 \cdot \left|x\right|}\right)\right)}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{x \cdot x}}\]
  12. Final simplification13.9

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

Reproduce

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