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

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

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

Reproduce

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