Average Error: 0.0 → 0.0
Time: 9.9s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\mathsf{log1p}\left(\mathsf{expm1}\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{log1p}\left(\mathsf{expm1}\left(\frac{1 - x}{1 + x}\right)\right)}\right) \cdot 2
double f(double x) {
        double r301715 = 2.0;
        double r301716 = 1.0;
        double r301717 = x;
        double r301718 = r301716 - r301717;
        double r301719 = r301716 + r301717;
        double r301720 = r301718 / r301719;
        double r301721 = sqrt(r301720);
        double r301722 = atan(r301721);
        double r301723 = r301715 * r301722;
        return r301723;
}

double f(double x) {
        double r301724 = 1.0;
        double r301725 = x;
        double r301726 = r301724 - r301725;
        double r301727 = r301724 + r301725;
        double r301728 = r301726 / r301727;
        double r301729 = expm1(r301728);
        double r301730 = log1p(r301729);
        double r301731 = sqrt(r301730);
        double r301732 = atan(r301731);
        double r301733 = 2.0;
        double r301734 = r301732 * r301733;
        return r301734;
}

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 log1p-expm1-u0.0

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

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

Reproduce

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