Average Error: 13.8 → 13.8
Time: 7.6s
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{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \frac{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 + \log \left(e^{\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)}{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{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \frac{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 + \log \left(e^{\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)}{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
    (*
     (/ 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
           (log
            (exp
             (*
              (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
              (+
               -1.453152027
               (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) 1.061405429))))))))))
      (exp (pow (fabs x) 2.0))))))))
double code(double x) {
	return ((double) (1.0 - ((double) (((double) ((1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x))))))) * ((double) (0.254829592 + ((double) ((1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x))))))) * ((double) (-0.284496736 + ((double) ((1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x))))))) * ((double) (1.421413741 + ((double) ((1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x))))))) * ((double) (-1.453152027 + ((double) ((1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x))))))) * 1.061405429)))))))))))))))))) * ((double) exp(((double) -(((double) (((double) fabs(x)) * ((double) fabs(x))))))))))));
}
double code(double x) {
	return ((double) log(((double) exp(((double) (1.0 - ((double) ((1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x))))))) * (((double) (0.254829592 + ((double) ((1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x))))))) * ((double) (-0.284496736 + ((double) ((1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x))))))) * ((double) (1.421413741 + ((double) log(((double) exp(((double) ((1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x))))))) * ((double) (-1.453152027 + ((double) ((1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x))))))) * 1.061405429)))))))))))))))))))) / ((double) exp(((double) pow(((double) 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 13.8

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

    \[\leadsto \color{blue}{1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \frac{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)}{e^{\left|x\right| \cdot \left|x\right|}}}\]
  3. Using strategy rm
  4. Applied add-log-exp_binary6413.8

    \[\leadsto 1 - \color{blue}{\log \left(e^{\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \frac{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)}{e^{\left|x\right| \cdot \left|x\right|}}}\right)}\]
  5. Applied add-log-exp_binary6413.8

    \[\leadsto \color{blue}{\log \left(e^{1}\right)} - \log \left(e^{\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \frac{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)}{e^{\left|x\right| \cdot \left|x\right|}}}\right)\]
  6. Applied diff-log_binary6414.5

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

    \[\leadsto \log \color{blue}{\left(e^{1 - \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \frac{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)}{e^{{\left(\left|x\right|\right)}^{2}}}}\right)}\]
  8. Using strategy rm
  9. Applied add-log-exp_binary6413.8

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

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

Reproduce

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