Average Error: 0.0 → 0.0
Time: 3.9s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 \cdot 1 - x \cdot x} \cdot \left(1 - x\right)}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 \cdot 1 - x \cdot x} \cdot \left(1 - x\right)}\right)
double f(double x) {
        double r16409 = 2.0;
        double r16410 = 1.0;
        double r16411 = x;
        double r16412 = r16410 - r16411;
        double r16413 = r16410 + r16411;
        double r16414 = r16412 / r16413;
        double r16415 = sqrt(r16414);
        double r16416 = atan(r16415);
        double r16417 = r16409 * r16416;
        return r16417;
}

double f(double x) {
        double r16418 = 2.0;
        double r16419 = 1.0;
        double r16420 = x;
        double r16421 = r16419 - r16420;
        double r16422 = r16419 * r16419;
        double r16423 = r16420 * r16420;
        double r16424 = r16422 - r16423;
        double r16425 = r16421 / r16424;
        double r16426 = r16425 * r16421;
        double r16427 = sqrt(r16426);
        double r16428 = atan(r16427);
        double r16429 = r16418 * r16428;
        return r16429;
}

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 flip-+0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{\color{blue}{\frac{1 \cdot 1 - x \cdot x}{1 - x}}}}\right)\]
  4. Applied associate-/r/0.0

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

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

Reproduce

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