Average Error: 58.5 → 0.3
Time: 6.7s
Precision: 64
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[\frac{1}{2} \cdot \left(\left(1.6666666666666665 \cdot {x}^{3} + \left(2 \cdot \log 1 + 2 \cdot x\right)\right) - 1 \cdot \frac{{x}^{3}}{{1}^{2}}\right)\]
\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)
\frac{1}{2} \cdot \left(\left(1.6666666666666665 \cdot {x}^{3} + \left(2 \cdot \log 1 + 2 \cdot x\right)\right) - 1 \cdot \frac{{x}^{3}}{{1}^{2}}\right)
double code(double x) {
	return ((double) (((double) (1.0 / 2.0)) * ((double) log(((double) (((double) (1.0 + x)) / ((double) (1.0 - x))))))));
}
double code(double x) {
	return ((double) (((double) (1.0 / 2.0)) * ((double) (((double) (((double) (1.6666666666666665 * ((double) pow(x, 3.0)))) + ((double) (((double) (2.0 * ((double) log(1.0)))) + ((double) (2.0 * x)))))) - ((double) (1.0 * ((double) (((double) pow(x, 3.0)) / ((double) pow(1.0, 2.0))))))))));
}

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. Using strategy rm
  3. Applied flip3--58.5

    \[\leadsto \frac{1}{2} \cdot \log \left(\frac{1 + x}{\color{blue}{\frac{{1}^{3} - {x}^{3}}{1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)}}}\right)\]
  4. Applied associate-/r/58.5

    \[\leadsto \frac{1}{2} \cdot \log \color{blue}{\left(\frac{1 + x}{{1}^{3} - {x}^{3}} \cdot \left(1 \cdot 1 + \left(x \cdot x + 1 \cdot x\right)\right)\right)}\]
  5. Applied log-prod58.5

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

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

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

Reproduce

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