Average Error: 58.5 → 0.7
Time: 14.7s
Precision: 64
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[\frac{1}{2} \cdot \left(2 \cdot \left(\left(x \cdot x + x\right) - \frac{{x}^{2}}{{1}^{2}}\right) + \log 1\right)\]
\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)
\frac{1}{2} \cdot \left(2 \cdot \left(\left(x \cdot x + x\right) - \frac{{x}^{2}}{{1}^{2}}\right) + \log 1\right)
double f(double x) {
        double r66105 = 1.0;
        double r66106 = 2.0;
        double r66107 = r66105 / r66106;
        double r66108 = x;
        double r66109 = r66105 + r66108;
        double r66110 = r66105 - r66108;
        double r66111 = r66109 / r66110;
        double r66112 = log(r66111);
        double r66113 = r66107 * r66112;
        return r66113;
}

double f(double x) {
        double r66114 = 1.0;
        double r66115 = 2.0;
        double r66116 = r66114 / r66115;
        double r66117 = x;
        double r66118 = r66117 * r66117;
        double r66119 = r66118 + r66117;
        double r66120 = 2.0;
        double r66121 = pow(r66117, r66120);
        double r66122 = pow(r66114, r66120);
        double r66123 = r66121 / r66122;
        double r66124 = r66119 - r66123;
        double r66125 = r66115 * r66124;
        double r66126 = log(r66114);
        double r66127 = r66125 + r66126;
        double r66128 = r66116 * r66127;
        return r66128;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 58.5

    \[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
  2. Taylor expanded around 0 0.7

    \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(\left(\log 1 + \left(2 \cdot {x}^{2} + 2 \cdot x\right)\right) - 2 \cdot \frac{{x}^{2}}{{1}^{2}}\right)}\]
  3. Simplified0.7

    \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(2 \cdot \left(\left(x \cdot x + x\right) - \frac{{x}^{2}}{{1}^{2}}\right) + \log 1\right)}\]
  4. Final simplification0.7

    \[\leadsto \frac{1}{2} \cdot \left(2 \cdot \left(\left(x \cdot x + x\right) - \frac{{x}^{2}}{{1}^{2}}\right) + \log 1\right)\]

Reproduce

herbie shell --seed 2019195 
(FPCore (x)
  :name "Hyperbolic arc-(co)tangent"
  (* (/ 1.0 2.0) (log (/ (+ 1.0 x) (- 1.0 x)))))