Average Error: 14.0 → 14.0
Time: 43.0s
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|}\]
\[\log \left(e^{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 - {\left(\left|x\right|\right)}^{2} \cdot 0.10731592879921002} \cdot \left(1 - 0.3275911 \cdot \left|x\right|\right)}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{{\left(\left|x\right|\right)}^{2}}}}\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|}
\log \left(e^{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 - {\left(\left|x\right|\right)}^{2} \cdot 0.10731592879921002} \cdot \left(1 - 0.3275911 \cdot \left|x\right|\right)}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{{\left(\left|x\right|\right)}^{2}}}}\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
 (log
  (exp
   (-
    1.0
    (/
     (+
      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 (* (pow (fabs x) 2.0) 0.10731592879921002)))
       (- 1.0 (* 0.3275911 (fabs x)))))
     (* (+ 1.0 (* 0.3275911 (fabs x))) (exp (pow (fabs x) 2.0))))))))
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 log(exp(1.0 - ((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 - (pow(fabs(x), 2.0) * 0.10731592879921002))) * (1.0 - (0.3275911 * fabs(x))))) / ((1.0 + (0.3275911 * fabs(x))) * exp(pow(fabs(x), 2.0))))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.0

    \[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-log-exp_binary64_280914.0

    \[\leadsto 1 - \color{blue}{\log \left(e^{\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|}}\right)}\]
  4. Applied add-log-exp_binary64_280914.0

    \[\leadsto \color{blue}{\log \left(e^{1}\right)} - \log \left(e^{\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|}}\right)\]
  5. Applied diff-log_binary64_286214.7

    \[\leadsto \color{blue}{\log \left(\frac{e^{1}}{e^{\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|}}}\right)}\]
  6. Simplified14.0

    \[\leadsto \log \color{blue}{\left(e^{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^{{\left(\left|x\right|\right)}^{2}}}}\right)}\]
  7. Using strategy rm
  8. Applied flip-+_binary64_274714.0

    \[\leadsto \log \left(e^{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|}}{\color{blue}{\frac{1 \cdot 1 - \left(0.3275911 \cdot \left|x\right|\right) \cdot \left(0.3275911 \cdot \left|x\right|\right)}{1 - 0.3275911 \cdot \left|x\right|}}}}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{{\left(\left|x\right|\right)}^{2}}}}\right)\]
  9. Applied associate-/r/_binary64_272114.0

    \[\leadsto \log \left(e^{1 - \frac{0.254829592 + \color{blue}{\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 \cdot 1 - \left(0.3275911 \cdot \left|x\right|\right) \cdot \left(0.3275911 \cdot \left|x\right|\right)} \cdot \left(1 - 0.3275911 \cdot \left|x\right|\right)}}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{{\left(\left|x\right|\right)}^{2}}}}\right)\]
  10. Simplified14.0

    \[\leadsto \log \left(e^{1 - \frac{0.254829592 + \color{blue}{\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 - {\left(\left|x\right|\right)}^{2} \cdot 0.10731592879921002}} \cdot \left(1 - 0.3275911 \cdot \left|x\right|\right)}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{{\left(\left|x\right|\right)}^{2}}}}\right)\]
  11. Final simplification14.0

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

Reproduce

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