Average Error: 0.0 → 0.0
Time: 3.8s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}\right)
double f(double x) {
        double r15569 = 2.0;
        double r15570 = 1.0;
        double r15571 = x;
        double r15572 = r15570 - r15571;
        double r15573 = r15570 + r15571;
        double r15574 = r15572 / r15573;
        double r15575 = sqrt(r15574);
        double r15576 = atan(r15575);
        double r15577 = r15569 * r15576;
        return r15577;
}

double f(double x) {
        double r15578 = 2.0;
        double r15579 = 1.0;
        double r15580 = x;
        double r15581 = r15579 - r15580;
        double r15582 = r15579 + r15580;
        double r15583 = r15581 / r15582;
        double r15584 = log1p(r15583);
        double r15585 = expm1(r15584);
        double r15586 = sqrt(r15585);
        double r15587 = atan(r15586);
        double r15588 = r15578 * r15587;
        return r15588;
}

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 2 \cdot \tan^{-1} \left(\sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - x}{1 + x}\right)\right)}\right)\]

Reproduce

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