Average Error: 58.5 → 0.2
Time: 27.4s
Precision: 64
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[\frac{1}{2} \cdot \left({x}^{5} \cdot \frac{2}{5} + \left(2 \cdot x + \log \left(e^{x \cdot \left(x \cdot \frac{2}{3}\right)}\right) \cdot x\right)\right)\]
\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)
\frac{1}{2} \cdot \left({x}^{5} \cdot \frac{2}{5} + \left(2 \cdot x + \log \left(e^{x \cdot \left(x \cdot \frac{2}{3}\right)}\right) \cdot x\right)\right)
double f(double x) {
        double r9115062 = 1.0;
        double r9115063 = 2.0;
        double r9115064 = r9115062 / r9115063;
        double r9115065 = x;
        double r9115066 = r9115062 + r9115065;
        double r9115067 = r9115062 - r9115065;
        double r9115068 = r9115066 / r9115067;
        double r9115069 = log(r9115068);
        double r9115070 = r9115064 * r9115069;
        return r9115070;
}

double f(double x) {
        double r9115071 = 0.5;
        double r9115072 = x;
        double r9115073 = 5.0;
        double r9115074 = pow(r9115072, r9115073);
        double r9115075 = 0.4;
        double r9115076 = r9115074 * r9115075;
        double r9115077 = 2.0;
        double r9115078 = r9115077 * r9115072;
        double r9115079 = 0.6666666666666666;
        double r9115080 = r9115072 * r9115079;
        double r9115081 = r9115072 * r9115080;
        double r9115082 = exp(r9115081);
        double r9115083 = log(r9115082);
        double r9115084 = r9115083 * r9115072;
        double r9115085 = r9115078 + r9115084;
        double r9115086 = r9115076 + r9115085;
        double r9115087 = r9115071 * r9115086;
        return r9115087;
}

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. Simplified58.5

    \[\leadsto \color{blue}{\log \left(\frac{x + 1}{1 - x}\right) \cdot \frac{1}{2}}\]
  3. Taylor expanded around 0 0.2

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

    \[\leadsto \color{blue}{\left(x \cdot \left(x \cdot \left(\frac{2}{3} \cdot x\right) + 2\right) + {x}^{5} \cdot \frac{2}{5}\right)} \cdot \frac{1}{2}\]
  5. Using strategy rm
  6. Applied distribute-rgt-in0.2

    \[\leadsto \left(\color{blue}{\left(\left(x \cdot \left(\frac{2}{3} \cdot x\right)\right) \cdot x + 2 \cdot x\right)} + {x}^{5} \cdot \frac{2}{5}\right) \cdot \frac{1}{2}\]
  7. Using strategy rm
  8. Applied add-log-exp0.2

    \[\leadsto \left(\left(\color{blue}{\log \left(e^{x \cdot \left(\frac{2}{3} \cdot x\right)}\right)} \cdot x + 2 \cdot x\right) + {x}^{5} \cdot \frac{2}{5}\right) \cdot \frac{1}{2}\]
  9. Final simplification0.2

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

Reproduce

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