Average Error: 0.0 → 0.0
Time: 12.4s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\left(1 - x\right) \cdot \frac{1 - x}{1 - x \cdot x}}\right) \cdot 2\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
\tan^{-1} \left(\sqrt{\left(1 - x\right) \cdot \frac{1 - x}{1 - x \cdot x}}\right) \cdot 2
double f(double x) {
        double r366566 = 2.0;
        double r366567 = 1.0;
        double r366568 = x;
        double r366569 = r366567 - r366568;
        double r366570 = r366567 + r366568;
        double r366571 = r366569 / r366570;
        double r366572 = sqrt(r366571);
        double r366573 = atan(r366572);
        double r366574 = r366566 * r366573;
        return r366574;
}

double f(double x) {
        double r366575 = 1.0;
        double r366576 = x;
        double r366577 = r366575 - r366576;
        double r366578 = r366576 * r366576;
        double r366579 = r366575 - r366578;
        double r366580 = r366577 / r366579;
        double r366581 = r366577 * r366580;
        double r366582 = sqrt(r366581);
        double r366583 = atan(r366582);
        double r366584 = 2.0;
        double r366585 = r366583 * r366584;
        return r366585;
}

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. Simplified0.0

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

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

Reproduce

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