Average Error: 0.0 → 0.0
Time: 1.9s
Precision: 64
\[\frac{x + 1}{1 - x}\]
\[\frac{x + 1}{1 - x}\]
\frac{x + 1}{1 - x}
\frac{x + 1}{1 - x}
double code(double x) {
	return ((double) (((double) (x + 1.0)) / ((double) (1.0 - x))));
}
double code(double x) {
	return ((double) (((double) (x + 1.0)) / ((double) (1.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 0.0

    \[\frac{x + 1}{1 - x}\]
  2. Using strategy rm
  3. Applied add-log-exp0.0

    \[\leadsto \color{blue}{\log \left(e^{\frac{x + 1}{1 - x}}\right)}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity0.0

    \[\leadsto \log \left(e^{\frac{x + 1}{\color{blue}{1 \cdot \left(1 - x\right)}}}\right)\]
  6. Applied *-un-lft-identity0.0

    \[\leadsto \log \left(e^{\frac{\color{blue}{1 \cdot \left(x + 1\right)}}{1 \cdot \left(1 - x\right)}}\right)\]
  7. Applied times-frac0.0

    \[\leadsto \log \left(e^{\color{blue}{\frac{1}{1} \cdot \frac{x + 1}{1 - x}}}\right)\]
  8. Applied exp-prod0.0

    \[\leadsto \log \color{blue}{\left({\left(e^{\frac{1}{1}}\right)}^{\left(\frac{x + 1}{1 - x}\right)}\right)}\]
  9. Applied log-pow0.0

    \[\leadsto \color{blue}{\frac{x + 1}{1 - x} \cdot \log \left(e^{\frac{1}{1}}\right)}\]
  10. Simplified0.0

    \[\leadsto \frac{x + 1}{1 - x} \cdot \color{blue}{1}\]
  11. Final simplification0.0

    \[\leadsto \frac{x + 1}{1 - x}\]

Reproduce

herbie shell --seed 2020113 +o rules:numerics
(FPCore (x)
  :name "Prelude:atanh from fay-base-0.20.0.1"
  :precision binary64
  (/ (+ x 1) (- 1 x)))