Average Error: 58.6 → 0.7
Time: 17.4s
Precision: 64
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[\frac{1}{2} \cdot \left(\log 1 + 2 \cdot \left(\left(x + {x}^{2}\right) - \frac{{x}^{2}}{{1}^{2}}\right)\right)\]
\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)
\frac{1}{2} \cdot \left(\log 1 + 2 \cdot \left(\left(x + {x}^{2}\right) - \frac{{x}^{2}}{{1}^{2}}\right)\right)
double f(double x) {
        double r53856 = 1.0;
        double r53857 = 2.0;
        double r53858 = r53856 / r53857;
        double r53859 = x;
        double r53860 = r53856 + r53859;
        double r53861 = r53856 - r53859;
        double r53862 = r53860 / r53861;
        double r53863 = log(r53862);
        double r53864 = r53858 * r53863;
        return r53864;
}

double f(double x) {
        double r53865 = 1.0;
        double r53866 = 2.0;
        double r53867 = r53865 / r53866;
        double r53868 = log(r53865);
        double r53869 = x;
        double r53870 = 2.0;
        double r53871 = pow(r53869, r53870);
        double r53872 = r53869 + r53871;
        double r53873 = pow(r53865, r53870);
        double r53874 = r53871 / r53873;
        double r53875 = r53872 - r53874;
        double r53876 = r53866 * r53875;
        double r53877 = r53868 + r53876;
        double r53878 = r53867 * r53877;
        return r53878;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 58.6

    \[\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 + {x}^{2}\right) - \frac{{x}^{2}}{{1}^{2}}\right) + \log 1\right)}\]
  4. Final simplification0.7

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

Reproduce

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