Average Error: 14.1 → 14.1
Time: 7.3s
Precision: 64
\[1 - \left(\frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(0.2548295919999999936678136691625695675611 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(-0.2844967359999999723108032867457950487733 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(1.421413741000000063863240029604639858007 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(-1.453152027000000012790792425221297889948 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot 1.061405428999999900341322245367337018251\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\]
\[\log \left(e^{\mathsf{fma}\left(\frac{\mathsf{fma}\left(1.421413741000000063863240029604639858007, \sqrt[3]{\frac{1}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{6}}}, 0.2548295919999999936678136691625695675611\right) - \left(\mathsf{fma}\left(0.2844967359999999723108032867457950487733, \frac{1}{\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)}, \frac{1 \cdot 1.453152027000000012790792425221297889948}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{3}}\right) - \frac{1 \cdot 1.061405428999999900341322245367337018251}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{4}}\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.3275911000000000239396058532292954623699, 1\right)}, 1\right)}\right)\]
1 - \left(\frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(0.2548295919999999936678136691625695675611 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(-0.2844967359999999723108032867457950487733 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(1.421413741000000063863240029604639858007 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(-1.453152027000000012790792425221297889948 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot 1.061405428999999900341322245367337018251\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}
\log \left(e^{\mathsf{fma}\left(\frac{\mathsf{fma}\left(1.421413741000000063863240029604639858007, \sqrt[3]{\frac{1}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{6}}}, 0.2548295919999999936678136691625695675611\right) - \left(\mathsf{fma}\left(0.2844967359999999723108032867457950487733, \frac{1}{\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)}, \frac{1 \cdot 1.453152027000000012790792425221297889948}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{3}}\right) - \frac{1 \cdot 1.061405428999999900341322245367337018251}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{4}}\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.3275911000000000239396058532292954623699, 1\right)}, 1\right)}\right)
double f(double x) {
        double r178960 = 1.0;
        double r178961 = 0.3275911;
        double r178962 = x;
        double r178963 = fabs(r178962);
        double r178964 = r178961 * r178963;
        double r178965 = r178960 + r178964;
        double r178966 = r178960 / r178965;
        double r178967 = 0.254829592;
        double r178968 = -0.284496736;
        double r178969 = 1.421413741;
        double r178970 = -1.453152027;
        double r178971 = 1.061405429;
        double r178972 = r178966 * r178971;
        double r178973 = r178970 + r178972;
        double r178974 = r178966 * r178973;
        double r178975 = r178969 + r178974;
        double r178976 = r178966 * r178975;
        double r178977 = r178968 + r178976;
        double r178978 = r178966 * r178977;
        double r178979 = r178967 + r178978;
        double r178980 = r178966 * r178979;
        double r178981 = r178963 * r178963;
        double r178982 = -r178981;
        double r178983 = exp(r178982);
        double r178984 = r178980 * r178983;
        double r178985 = r178960 - r178984;
        return r178985;
}

double f(double x) {
        double r178986 = 1.421413741;
        double r178987 = 1.0;
        double r178988 = 0.3275911;
        double r178989 = x;
        double r178990 = fabs(r178989);
        double r178991 = 1.0;
        double r178992 = fma(r178988, r178990, r178991);
        double r178993 = 6.0;
        double r178994 = pow(r178992, r178993);
        double r178995 = r178987 / r178994;
        double r178996 = cbrt(r178995);
        double r178997 = 0.254829592;
        double r178998 = fma(r178986, r178996, r178997);
        double r178999 = 0.284496736;
        double r179000 = r178987 / r178992;
        double r179001 = 1.453152027;
        double r179002 = r178987 * r179001;
        double r179003 = 3.0;
        double r179004 = pow(r178992, r179003);
        double r179005 = r179002 / r179004;
        double r179006 = fma(r178999, r179000, r179005);
        double r179007 = 1.061405429;
        double r179008 = r178987 * r179007;
        double r179009 = 4.0;
        double r179010 = pow(r178992, r179009);
        double r179011 = r179008 / r179010;
        double r179012 = r179006 - r179011;
        double r179013 = r178998 - r179012;
        double r179014 = r178990 * r178990;
        double r179015 = exp(r179014);
        double r179016 = r179013 / r179015;
        double r179017 = -r178991;
        double r179018 = fma(r178990, r178988, r178991);
        double r179019 = r179017 / r179018;
        double r179020 = fma(r179016, r179019, r178991);
        double r179021 = exp(r179020);
        double r179022 = log(r179021);
        return r179022;
}

Error

Bits error versus x

Derivation

  1. Initial program 14.1

    \[1 - \left(\frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(0.2548295919999999936678136691625695675611 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(-0.2844967359999999723108032867457950487733 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(1.421413741000000063863240029604639858007 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot \left(-1.453152027000000012790792425221297889948 + \frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|} \cdot 1.061405428999999900341322245367337018251\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\]
  2. Simplified14.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|}, \mathsf{fma}\left(\frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|}, \mathsf{fma}\left(\frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|}, \mathsf{fma}\left(\frac{1}{1 + 0.3275911000000000239396058532292954623699 \cdot \left|x\right|}, 1.061405428999999900341322245367337018251, -1.453152027000000012790792425221297889948\right), 1.421413741000000063863240029604639858007\right), -0.2844967359999999723108032867457950487733\right), 0.2548295919999999936678136691625695675611\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.3275911000000000239396058532292954623699, 1\right)}, 1\right)}\]
  3. Taylor expanded around 0 14.8

    \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(1.061405428999999900341322245367337018251 \cdot \frac{1}{{\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{4}} + \left(1.421413741000000063863240029604639858007 \cdot \frac{1}{{\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{2}} + 0.2548295919999999936678136691625695675611\right)\right) - \left(1.453152027000000012790792425221297889948 \cdot \frac{1}{{\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{3}} + 0.2844967359999999723108032867457950487733 \cdot \frac{1}{0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1}\right)}}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.3275911000000000239396058532292954623699, 1\right)}, 1\right)\]
  4. Simplified14.1

    \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{fma}\left(1.421413741000000063863240029604639858007, \frac{1}{{\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{2}}, 0.2548295919999999936678136691625695675611\right) - \left(\mathsf{fma}\left(0.2844967359999999723108032867457950487733, \frac{1}{\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)}, \frac{1 \cdot 1.453152027000000012790792425221297889948}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{3}}\right) - \frac{1 \cdot 1.061405428999999900341322245367337018251}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{4}}\right)}}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.3275911000000000239396058532292954623699, 1\right)}, 1\right)\]
  5. Using strategy rm
  6. Applied add-cbrt-cube14.1

    \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(1.421413741000000063863240029604639858007, \frac{1}{\color{blue}{\sqrt[3]{\left({\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{2} \cdot {\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{2}\right) \cdot {\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{2}}}}, 0.2548295919999999936678136691625695675611\right) - \left(\mathsf{fma}\left(0.2844967359999999723108032867457950487733, \frac{1}{\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)}, \frac{1 \cdot 1.453152027000000012790792425221297889948}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{3}}\right) - \frac{1 \cdot 1.061405428999999900341322245367337018251}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{4}}\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.3275911000000000239396058532292954623699, 1\right)}, 1\right)\]
  7. Applied add-cbrt-cube14.1

    \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(1.421413741000000063863240029604639858007, \frac{\color{blue}{\sqrt[3]{\left(1 \cdot 1\right) \cdot 1}}}{\sqrt[3]{\left({\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{2} \cdot {\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{2}\right) \cdot {\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{2}}}, 0.2548295919999999936678136691625695675611\right) - \left(\mathsf{fma}\left(0.2844967359999999723108032867457950487733, \frac{1}{\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)}, \frac{1 \cdot 1.453152027000000012790792425221297889948}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{3}}\right) - \frac{1 \cdot 1.061405428999999900341322245367337018251}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{4}}\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.3275911000000000239396058532292954623699, 1\right)}, 1\right)\]
  8. Applied cbrt-undiv14.1

    \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(1.421413741000000063863240029604639858007, \color{blue}{\sqrt[3]{\frac{\left(1 \cdot 1\right) \cdot 1}{\left({\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{2} \cdot {\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{2}\right) \cdot {\left(0.3275911000000000239396058532292954623699 \cdot \left|x\right| + 1\right)}^{2}}}}, 0.2548295919999999936678136691625695675611\right) - \left(\mathsf{fma}\left(0.2844967359999999723108032867457950487733, \frac{1}{\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)}, \frac{1 \cdot 1.453152027000000012790792425221297889948}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{3}}\right) - \frac{1 \cdot 1.061405428999999900341322245367337018251}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{4}}\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.3275911000000000239396058532292954623699, 1\right)}, 1\right)\]
  9. Simplified14.1

    \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(1.421413741000000063863240029604639858007, \sqrt[3]{\color{blue}{\frac{1}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{6}}}}, 0.2548295919999999936678136691625695675611\right) - \left(\mathsf{fma}\left(0.2844967359999999723108032867457950487733, \frac{1}{\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)}, \frac{1 \cdot 1.453152027000000012790792425221297889948}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{3}}\right) - \frac{1 \cdot 1.061405428999999900341322245367337018251}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{4}}\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.3275911000000000239396058532292954623699, 1\right)}, 1\right)\]
  10. Using strategy rm
  11. Applied add-log-exp14.1

    \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(\frac{\mathsf{fma}\left(1.421413741000000063863240029604639858007, \sqrt[3]{\frac{1}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{6}}}, 0.2548295919999999936678136691625695675611\right) - \left(\mathsf{fma}\left(0.2844967359999999723108032867457950487733, \frac{1}{\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)}, \frac{1 \cdot 1.453152027000000012790792425221297889948}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{3}}\right) - \frac{1 \cdot 1.061405428999999900341322245367337018251}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{4}}\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.3275911000000000239396058532292954623699, 1\right)}, 1\right)}\right)}\]
  12. Final simplification14.1

    \[\leadsto \log \left(e^{\mathsf{fma}\left(\frac{\mathsf{fma}\left(1.421413741000000063863240029604639858007, \sqrt[3]{\frac{1}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{6}}}, 0.2548295919999999936678136691625695675611\right) - \left(\mathsf{fma}\left(0.2844967359999999723108032867457950487733, \frac{1}{\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)}, \frac{1 \cdot 1.453152027000000012790792425221297889948}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{3}}\right) - \frac{1 \cdot 1.061405428999999900341322245367337018251}{{\left(\mathsf{fma}\left(0.3275911000000000239396058532292954623699, \left|x\right|, 1\right)\right)}^{4}}\right)}{e^{\left|x\right| \cdot \left|x\right|}}, \frac{-1}{\mathsf{fma}\left(\left|x\right|, 0.3275911000000000239396058532292954623699, 1\right)}, 1\right)}\right)\]

Reproduce

herbie shell --seed 2019346 +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)))))))