Average Error: 0.1 → 0.1
Time: 1.7s
Precision: binary64
\[\frac{2 \cdot \tanh \left(\frac{x}{2}\right)}{1 - \tanh \left(\frac{x}{2}\right)}\]
\[\frac{2 \cdot \tanh \left(\frac{x}{2}\right)}{1 - \tanh \left(\frac{x}{2}\right)}\]
\frac{2 \cdot \tanh \left(\frac{x}{2}\right)}{1 - \tanh \left(\frac{x}{2}\right)}
\frac{2 \cdot \tanh \left(\frac{x}{2}\right)}{1 - \tanh \left(\frac{x}{2}\right)}
double code(double x) {
	return ((double) (((double) (2.0 * ((double) tanh(((double) (x / 2.0)))))) / ((double) (1.0 - ((double) tanh(((double) (x / 2.0))))))));
}
double code(double x) {
	return ((double) (((double) (2.0 * ((double) tanh(((double) (x / 2.0)))))) / ((double) (1.0 - ((double) tanh(((double) (x / 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 0.1

    \[\frac{2 \cdot \tanh \left(\frac{x}{2}\right)}{1 - \tanh \left(\frac{x}{2}\right)}\]
  2. Final simplification0.1

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

Reproduce

herbie shell --seed 2020152 
(FPCore (x)
  :name "(/ (* 2 (tanh (/ x 2))) (- 1 (tanh (/ x 2))))"
  :precision binary64
  (/ (* 2.0 (tanh (/ x 2.0))) (- 1.0 (tanh (/ x 2.0)))))