Average Error: 0.0 → 0.0
Time: 25.8s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\left(1 - x\right) \cdot \frac{1 - x}{1 - x \cdot x}}\right)\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
2 \cdot \tan^{-1} \left(\sqrt{\left(1 - x\right) \cdot \frac{1 - x}{1 - x \cdot x}}\right)
double f(double x) {
        double r729688 = 2.0;
        double r729689 = 1.0;
        double r729690 = x;
        double r729691 = r729689 - r729690;
        double r729692 = r729689 + r729690;
        double r729693 = r729691 / r729692;
        double r729694 = sqrt(r729693);
        double r729695 = atan(r729694);
        double r729696 = r729688 * r729695;
        return r729696;
}

double f(double x) {
        double r729697 = 2.0;
        double r729698 = 1.0;
        double r729699 = x;
        double r729700 = r729698 - r729699;
        double r729701 = r729699 * r729699;
        double r729702 = r729698 - r729701;
        double r729703 = r729700 / r729702;
        double r729704 = r729700 * r729703;
        double r729705 = sqrt(r729704);
        double r729706 = atan(r729705);
        double r729707 = r729697 * r729706;
        return r729707;
}

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{\left(1 - x\right) \cdot \frac{1 - x}{1 - x \cdot x}}\right)\]

Reproduce

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