Average Error: 0.0 → 0.0
Time: 2.0s
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 r4762 = 2.0;
        double r4763 = 1.0;
        double r4764 = x;
        double r4765 = r4763 - r4764;
        double r4766 = r4763 + r4764;
        double r4767 = r4765 / r4766;
        double r4768 = sqrt(r4767);
        double r4769 = atan(r4768);
        double r4770 = r4762 * r4769;
        return r4770;
}

double f(double x) {
        double r4771 = 2.0;
        double r4772 = 1.0;
        double r4773 = x;
        double r4774 = r4772 - r4773;
        double r4775 = r4772 * r4772;
        double r4776 = r4773 * r4773;
        double r4777 = r4775 - r4776;
        double r4778 = r4774 / r4777;
        double r4779 = r4778 * r4774;
        double r4780 = sqrt(r4779);
        double r4781 = atan(r4780);
        double r4782 = r4771 * r4781;
        return r4782;
}

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