Average Error: 0.1 → 0.1
Time: 20.5s
Precision: 64
\[\tanh \left(x + 1\right) + 1\]
\[1 + \tanh \left(x + 1\right)\]
\tanh \left(x + 1\right) + 1
1 + \tanh \left(x + 1\right)
double f(double x) {
        double r48474924 = x;
        double r48474925 = 1.0;
        double r48474926 = r48474924 + r48474925;
        double r48474927 = tanh(r48474926);
        double r48474928 = r48474927 + r48474925;
        return r48474928;
}

double f(double x) {
        double r48474929 = 1.0;
        double r48474930 = x;
        double r48474931 = r48474930 + r48474929;
        double r48474932 = tanh(r48474931);
        double r48474933 = r48474929 + r48474932;
        return r48474933;
}

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

    \[\tanh \left(x + 1\right) + 1\]
  2. Final simplification0.1

    \[\leadsto 1 + \tanh \left(x + 1\right)\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "tanh(x+1)+1"
  (+ (tanh (+ x 1.0)) 1.0))