Average Error: 13.9 → 13.9
Time: 7.7s
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|}\]
\[\mathsf{fma}\left(\frac{\log \left({\left(e^{\frac{1}{\mathsf{fma}\left(\left|x\right|, 0.32759110000000002, 1\right)}}\right)}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(\left|x\right|, 0.32759110000000002, 1\right)}, -1.45315202700000001 + \frac{1 \cdot 1.0614054289999999}{{\left(\sqrt[3]{\mathsf{fma}\left(0.32759110000000002, \left|x\right|, 1\right)}\right)}^{3}}, 1.42141374100000006\right), \frac{1}{\mathsf{fma}\left(\left|x\right|, 0.32759110000000002, 1\right)}, -0.284496735999999972\right)\right)} \cdot e^{0.25482959199999999}\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.32759110000000002, 1\right)}, 1\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|}
\mathsf{fma}\left(\frac{\log \left({\left(e^{\frac{1}{\mathsf{fma}\left(\left|x\right|, 0.32759110000000002, 1\right)}}\right)}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(\left|x\right|, 0.32759110000000002, 1\right)}, -1.45315202700000001 + \frac{1 \cdot 1.0614054289999999}{{\left(\sqrt[3]{\mathsf{fma}\left(0.32759110000000002, \left|x\right|, 1\right)}\right)}^{3}}, 1.42141374100000006\right), \frac{1}{\mathsf{fma}\left(\left|x\right|, 0.32759110000000002, 1\right)}, -0.284496735999999972\right)\right)} \cdot e^{0.25482959199999999}\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.32759110000000002, 1\right)}, 1\right)
double code(double x) {
	return ((double) (1.0 - ((double) (((double) (((double) (1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x)))))))) * ((double) (0.254829592 + ((double) (((double) (1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x)))))))) * ((double) (-0.284496736 + ((double) (((double) (1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x)))))))) * ((double) (1.421413741 + ((double) (((double) (1.0 / ((double) (1.0 + ((double) (0.3275911 * ((double) fabs(x)))))))) * ((double) (-1.453152027 + ((double) (((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) fma(((double) (((double) log(((double) (((double) pow(((double) exp(((double) (1.0 / ((double) fma(((double) fabs(x)), 0.3275911, 1.0)))))), ((double) fma(((double) fma(((double) (1.0 / ((double) fma(((double) fabs(x)), 0.3275911, 1.0)))), ((double) (-1.453152027 + ((double) (((double) (1.0 * 1.061405429)) / ((double) pow(((double) cbrt(((double) fma(0.3275911, ((double) fabs(x)), 1.0)))), 3.0)))))), 1.421413741)), ((double) (1.0 / ((double) fma(((double) fabs(x)), 0.3275911, 1.0)))), -0.284496736)))) * ((double) exp(0.254829592)))))) / ((double) exp(((double) (((double) fabs(x)) * ((double) fabs(x)))))))), ((double) (((double) -(1.0)) / ((double) fma(((double) fabs(x)), 0.3275911, 1.0)))), 1.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. Simplified13.9

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

    \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|}, \mathsf{fma}\left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|}, \mathsf{fma}\left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|}, \mathsf{fma}\left(\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|}}}, 1.0614054289999999, -1.45315202700000001\right), 1.42141374100000006\right), -0.284496735999999972\right), 0.25482959199999999\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.32759110000000002, 1\right)}, 1\right)\]
  5. Applied associate-/r*13.9

    \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|}, \mathsf{fma}\left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|}, \mathsf{fma}\left(\frac{1}{1 + 0.32759110000000002 \cdot \left|x\right|}, \mathsf{fma}\left(\color{blue}{\frac{\frac{1}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|} \cdot \sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}}}{\sqrt[3]{1 + 0.32759110000000002 \cdot \left|x\right|}}}, 1.0614054289999999, -1.45315202700000001\right), 1.42141374100000006\right), -0.284496735999999972\right), 0.25482959199999999\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.32759110000000002, 1\right)}, 1\right)\]
  6. Using strategy rm
  7. Applied add-log-exp13.9

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

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

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

Reproduce

herbie shell --seed 2020121 +o rules:numerics
(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)))))))