Average Error: 58.6 → 0.3
Time: 6.2s
Precision: binary64
\[\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\]
\[\frac{1}{2} \cdot \left(0.66666666666666652 \cdot {x}^{3} + \left(2 \cdot \log 1 + 2 \cdot x\right)\right)\]
\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)
\frac{1}{2} \cdot \left(0.66666666666666652 \cdot {x}^{3} + \left(2 \cdot \log 1 + 2 \cdot x\right)\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) (0.6666666666666665 * ((double) pow(x, 3.0)))) + ((double) (((double) (2.0 * ((double) log(1.0)))) + ((double) (2.0 * x))))))));
}

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

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

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

    \[\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. Taylor expanded around 0 0.3

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

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

Reproduce

herbie shell --seed 2020161 
(FPCore (x)
  :name "Hyperbolic arc-(co)tangent"
  :precision binary64
  (* (/ 1.0 2.0) (log (/ (+ 1.0 x) (- 1.0 x)))))