Average Error: 58.6 → 0.6
Time: 12.5s
Precision: 64
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[\frac{1}{2} \cdot \left(2 \cdot \left(x \cdot x + 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 \cdot x + x\right) + \left(\log 1 - 2 \cdot \frac{{x}^{2}}{{1}^{2}}\right)\right)
double f(double x) {
        double r70216 = 1.0;
        double r70217 = 2.0;
        double r70218 = r70216 / r70217;
        double r70219 = x;
        double r70220 = r70216 + r70219;
        double r70221 = r70216 - r70219;
        double r70222 = r70220 / r70221;
        double r70223 = log(r70222);
        double r70224 = r70218 * r70223;
        return r70224;
}

double f(double x) {
        double r70225 = 1.0;
        double r70226 = 2.0;
        double r70227 = r70225 / r70226;
        double r70228 = x;
        double r70229 = r70228 * r70228;
        double r70230 = r70229 + r70228;
        double r70231 = r70226 * r70230;
        double r70232 = log(r70225);
        double r70233 = 2.0;
        double r70234 = pow(r70228, r70233);
        double r70235 = pow(r70225, r70233);
        double r70236 = r70234 / r70235;
        double r70237 = r70226 * r70236;
        double r70238 = r70232 - r70237;
        double r70239 = r70231 + r70238;
        double r70240 = r70227 * r70239;
        return r70240;
}

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.6

    \[\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.6

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

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

Reproduce

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