Average Error: 13.9 → 13.9
Time: 7.7s
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 - \left(\frac{1}{\sqrt{1 + 0.3275911 \cdot \left|x\right|}} \cdot \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|}}{\sqrt{1 + 0.3275911 \cdot \left|x\right|}}\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\]
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 - \left(\frac{1}{\sqrt{1 + 0.3275911 \cdot \left|x\right|}} \cdot \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|}}{\sqrt{1 + 0.3275911 \cdot \left|x\right|}}\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}
(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
  (*
   (*
    (/ 1.0 (sqrt (+ 1.0 (* 0.3275911 (fabs x)))))
    (/
     (+
      0.254829592
      (/
       (+
        -0.284496736
        (/
         (+
          1.421413741
          (/
           (+ -1.453152027 (/ 1.061405429 (+ 1.0 (* 0.3275911 (fabs x)))))
           (+ 1.0 (* 0.3275911 (fabs x)))))
         (+ 1.0 (* 0.3275911 (fabs x)))))
       (+ 1.0 (* 0.3275911 (fabs x)))))
     (sqrt (+ 1.0 (* 0.3275911 (fabs x))))))
   (exp (- (* (fabs x) (fabs 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 - (((1.0 / sqrt(1.0 + (0.3275911 * fabs(x)))) * ((0.254829592 + ((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / (1.0 + (0.3275911 * fabs(x))))) / (1.0 + (0.3275911 * fabs(x))))) / (1.0 + (0.3275911 * fabs(x))))) / (1.0 + (0.3275911 * fabs(x))))) / sqrt(1.0 + (0.3275911 * fabs(x))))) * exp(-(fabs(x) * fabs(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. Using strategy rm
  3. Applied add-sqr-sqrt_binary6413.9

    \[\leadsto 1 - \left(\frac{1}{\color{blue}{\sqrt{1 + 0.3275911 \cdot \left|x\right|} \cdot \sqrt{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|}\]
  4. Applied *-un-lft-identity_binary6413.9

    \[\leadsto 1 - \left(\frac{\color{blue}{1 \cdot 1}}{\sqrt{1 + 0.3275911 \cdot \left|x\right|} \cdot \sqrt{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|}\]
  5. Applied times-frac_binary6413.9

    \[\leadsto 1 - \left(\color{blue}{\left(\frac{1}{\sqrt{1 + 0.3275911 \cdot \left|x\right|}} \cdot \frac{1}{\sqrt{1 + 0.3275911 \cdot \left|x\right|}}\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|}\]
  6. Applied associate-*l*_binary6413.9

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

    \[\leadsto 1 - \left(\frac{1}{\sqrt{1 + 0.3275911 \cdot \left|x\right|}} \cdot \color{blue}{\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|}}{\sqrt{1 + 0.3275911 \cdot \left|x\right|}}}\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\]
  8. Final simplification13.9

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

Reproduce

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