Average Error: 58.6 → 0.7
Time: 38.0s
Precision: 64
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[\frac{1}{2} \cdot \left(2 \cdot \left({x}^{2} + x\right) + \left(\log 1 - 2 \cdot \frac{{x}^{2}}{{1}^{2}}\right)\right)\]
\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)
\frac{1}{2} \cdot \left(2 \cdot \left({x}^{2} + x\right) + \left(\log 1 - 2 \cdot \frac{{x}^{2}}{{1}^{2}}\right)\right)
double f(double x) {
        double r234268 = 1.0;
        double r234269 = 2.0;
        double r234270 = r234268 / r234269;
        double r234271 = x;
        double r234272 = r234268 + r234271;
        double r234273 = r234268 - r234271;
        double r234274 = r234272 / r234273;
        double r234275 = log(r234274);
        double r234276 = r234270 * r234275;
        return r234276;
}

double f(double x) {
        double r234277 = 1.0;
        double r234278 = 2.0;
        double r234279 = r234277 / r234278;
        double r234280 = x;
        double r234281 = 2.0;
        double r234282 = pow(r234280, r234281);
        double r234283 = r234282 + r234280;
        double r234284 = r234278 * r234283;
        double r234285 = log(r234277);
        double r234286 = pow(r234277, r234281);
        double r234287 = r234282 / r234286;
        double r234288 = r234278 * r234287;
        double r234289 = r234285 - r234288;
        double r234290 = r234284 + r234289;
        double r234291 = r234279 * r234290;
        return r234291;
}

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(2 \cdot {x}^{2} + \left(2 \cdot x + \log 1\right)\right) - 2 \cdot \frac{{x}^{2}}{{1}^{2}}\right)}\]
  3. Simplified0.7

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

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

Reproduce

herbie shell --seed 2020036 
(FPCore (x)
  :name "Hyperbolic arc-(co)tangent"
  :precision binary64
  (* (/ 1 2) (log (/ (+ 1 x) (- 1 x)))))