Average Error: 13.9 → 13.9
Time: 11.4s
Precision: 64
\[1 - \left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(0.25482959199999999 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\]
\[\log \left(e^{1 - \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(\left(0.25482959199999999 + \frac{1}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}} \cdot \left(\frac{1}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right)\right) \cdot \frac{1}{e^{{\left(\left|x\right|\right)}^{2}}}\right)}\right)\]
1 - \left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(0.25482959199999999 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}
\log \left(e^{1 - \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(\left(0.25482959199999999 + \frac{1}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}} \cdot \left(\frac{1}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right)\right) \cdot \frac{1}{e^{{\left(\left|x\right|\right)}^{2}}}\right)}\right)
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 - ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * ((0.254829592 + ((1.0 / (cbrt((1.0 + (0.3275911 * fabs(x)))) * cbrt((1.0 + (0.3275911 * fabs(x)))))) * ((1.0 / cbrt((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))))))))) * (1.0 / 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 13.9

    \[1 - \left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(0.25482959199999999 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\]
  2. Using strategy rm
  3. Applied add-log-exp13.9

    \[\leadsto 1 - \color{blue}{\log \left(e^{\left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(0.25482959199999999 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}}\right)}\]
  4. Applied add-log-exp13.9

    \[\leadsto \color{blue}{\log \left(e^{1}\right)} - \log \left(e^{\left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(0.25482959199999999 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}}\right)\]
  5. Applied diff-log14.7

    \[\leadsto \color{blue}{\log \left(\frac{e^{1}}{e^{\left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(0.25482959199999999 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}}}\right)}\]
  6. Simplified13.9

    \[\leadsto \log \color{blue}{\left(e^{1 - \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(\left(0.25482959199999999 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right) \cdot \frac{1}{e^{{\left(\left|x\right|\right)}^{2}}}\right)}\right)}\]
  7. Using strategy rm
  8. Applied add-cube-cbrt13.9

    \[\leadsto \log \left(e^{1 - \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(\left(0.25482959199999999 + \frac{1}{\color{blue}{\left(\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}\right) \cdot \sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}}} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right) \cdot \frac{1}{e^{{\left(\left|x\right|\right)}^{2}}}\right)}\right)\]
  9. Applied *-un-lft-identity13.9

    \[\leadsto \log \left(e^{1 - \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(\left(0.25482959199999999 + \frac{\color{blue}{1 \cdot 1}}{\left(\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}\right) \cdot \sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right) \cdot \frac{1}{e^{{\left(\left|x\right|\right)}^{2}}}\right)}\right)\]
  10. Applied times-frac13.9

    \[\leadsto \log \left(e^{1 - \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(\left(0.25482959199999999 + \color{blue}{\left(\frac{1}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}} \cdot \frac{1}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}}\right)} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right) \cdot \frac{1}{e^{{\left(\left|x\right|\right)}^{2}}}\right)}\right)\]
  11. Applied associate-*l*13.9

    \[\leadsto \log \left(e^{1 - \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(\left(0.25482959199999999 + \color{blue}{\frac{1}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}} \cdot \left(\frac{1}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right)}\right) \cdot \frac{1}{e^{{\left(\left|x\right|\right)}^{2}}}\right)}\right)\]
  12. Final simplification13.9

    \[\leadsto \log \left(e^{1 - \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(\left(0.25482959199999999 + \frac{1}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}} \cdot \left(\frac{1}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}} \cdot \left(-0.284496735999999972 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(1.42141374100000006 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \left(-1.45315202700000001 + \frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot 1.0614054289999999\right)\right)\right)\right)\right) \cdot \frac{1}{e^{{\left(\left|x\right|\right)}^{2}}}\right)}\right)\]

Reproduce

herbie shell --seed 2020092 
(FPCore (x)
  :name "Jmat.Real.erf"
  :precision binary64
  (- 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)))))))