Average Error: 0.0 → 0.0
Time: 3.5s
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 r13846 = 2.0;
        double r13847 = 1.0;
        double r13848 = x;
        double r13849 = r13847 - r13848;
        double r13850 = r13847 + r13848;
        double r13851 = r13849 / r13850;
        double r13852 = sqrt(r13851);
        double r13853 = atan(r13852);
        double r13854 = r13846 * r13853;
        return r13854;
}

double f(double x) {
        double r13855 = 2.0;
        double r13856 = 1.0;
        double r13857 = x;
        double r13858 = r13856 - r13857;
        double r13859 = r13856 * r13856;
        double r13860 = r13857 * r13857;
        double r13861 = r13859 - r13860;
        double r13862 = r13858 / r13861;
        double r13863 = r13862 * r13858;
        double r13864 = sqrt(r13863);
        double r13865 = atan(r13864);
        double r13866 = r13855 * r13865;
        return r13866;
}

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 2020039 +o rules:numerics
(FPCore (x)
  :name "arccos"
  :precision binary64
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))