Average Error: 0.0 → 0.0
Time: 8.6s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}\right) \cdot 2\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
\tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}\right) \cdot 2
double f(double x) {
        double r211846 = 2.0;
        double r211847 = 1.0;
        double r211848 = x;
        double r211849 = r211847 - r211848;
        double r211850 = r211847 + r211848;
        double r211851 = r211849 / r211850;
        double r211852 = sqrt(r211851);
        double r211853 = atan(r211852);
        double r211854 = r211846 * r211853;
        return r211854;
}

double f(double x) {
        double r211855 = 1.0;
        double r211856 = x;
        double r211857 = r211855 - r211856;
        double r211858 = r211855 + r211856;
        double r211859 = r211857 / r211858;
        double r211860 = log1p(r211859);
        double r211861 = expm1(r211860);
        double r211862 = sqrt(r211861);
        double r211863 = atan(r211862);
        double r211864 = 2.0;
        double r211865 = r211863 * r211864;
        return r211865;
}

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(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}}\right)\]
  4. Final simplification0.0

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

Reproduce

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