Average Error: 13.6 → 13.6
Time: 1.8m
Precision: 64
Internal Precision: 384
\[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{0.254829592 + \frac{\left(-0.284496736 + \frac{1.421413741}{\left|x\right| \cdot 0.3275911 + 1}\right) + \frac{-1.453152027 + \frac{1.061405429}{\left|x\right| \cdot 0.3275911 + 1}}{\left(\left|x\right| \cdot 0.3275911 + 1\right) \cdot \left(\left|x\right| \cdot 0.3275911 + 1\right)}}{\left|x\right| \cdot 0.3275911 + 1}}{e^{\left|x\right| \cdot \left|x\right|} \cdot \left(\left|x\right| \cdot 0.3275911 + 1\right)}\]

Error

Bits error versus x

Derivation

  1. Initial program 13.6

    \[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. Taylor expanded around 0 13.6

    \[\leadsto 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 + \color{blue}{\frac{1}{0.3275911 \cdot \left|x\right| + 1}} \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|}\]
  3. Applied simplify13.6

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

Runtime

Time bar (total: 1.8m)Debug logProfile

herbie shell --seed '#(1062930989 876886121 3990119081 3032829768 3060892583 1929069376)' 
(FPCore (x)
  :name "Jmat.Real.erf"
  (- 1 (* (* (/ 1 (+ 1 (* 0.3275911 (fabs x)))) (+ 0.254829592 (* (/ 1 (+ 1 (* 0.3275911 (fabs x)))) (+ -0.284496736 (* (/ 1 (+ 1 (* 0.3275911 (fabs x)))) (+ 1.421413741 (* (/ 1 (+ 1 (* 0.3275911 (fabs x)))) (+ -1.453152027 (* (/ 1 (+ 1 (* 0.3275911 (fabs x)))) 1.061405429))))))))) (exp (- (* (fabs x) (fabs x)))))))