Average Error: 0.0 → 0.0
Time: 26.3s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\frac{1 - x}{1 + x}\right)\right)\right)\right)}\right) \cdot 2\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
\tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\frac{1 - x}{1 + x}\right)\right)\right)\right)}\right) \cdot 2
double f(double x) {
        double r757868 = 2.0;
        double r757869 = 1.0;
        double r757870 = x;
        double r757871 = r757869 - r757870;
        double r757872 = r757869 + r757870;
        double r757873 = r757871 / r757872;
        double r757874 = sqrt(r757873);
        double r757875 = atan(r757874);
        double r757876 = r757868 * r757875;
        return r757876;
}

double f(double x) {
        double r757877 = 1.0;
        double r757878 = x;
        double r757879 = r757877 - r757878;
        double r757880 = r757877 + r757878;
        double r757881 = r757879 / r757880;
        double r757882 = log1p(r757881);
        double r757883 = expm1(r757882);
        double r757884 = sqrt(r757883);
        double r757885 = atan(r757884);
        double r757886 = 2.0;
        double r757887 = r757885 * r757886;
        return r757887;
}

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

    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
  2. Using strategy rm
  3. Applied expm1-log1p-u0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\color{blue}{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\frac{1 - x}{1 + x}\right)\right)\right)\right)}}\right)\]
  4. Final simplification0.0

    \[\leadsto \tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\left(\mathsf{log1p}\left(\left(\frac{1 - x}{1 + x}\right)\right)\right)\right)}\right) \cdot 2\]

Reproduce

herbie shell --seed 2019128 +o rules:numerics
(FPCore (x)
  :name "arccos"
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))