Average Error: 58.7 → 0.6
Time: 7.2s
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 r68155 = 1.0;
        double r68156 = 2.0;
        double r68157 = r68155 / r68156;
        double r68158 = x;
        double r68159 = r68155 + r68158;
        double r68160 = r68155 - r68158;
        double r68161 = r68159 / r68160;
        double r68162 = log(r68161);
        double r68163 = r68157 * r68162;
        return r68163;
}

double f(double x) {
        double r68164 = 1.0;
        double r68165 = 2.0;
        double r68166 = r68164 / r68165;
        double r68167 = x;
        double r68168 = 2.0;
        double r68169 = pow(r68167, r68168);
        double r68170 = r68169 + r68167;
        double r68171 = r68165 * r68170;
        double r68172 = log(r68164);
        double r68173 = pow(r68164, r68168);
        double r68174 = r68169 / r68173;
        double r68175 = r68165 * r68174;
        double r68176 = r68172 - r68175;
        double r68177 = r68171 + r68176;
        double r68178 = r68166 * r68177;
        return r68178;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 58.7

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

Reproduce

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