Average Error: 0.0 → 0.0
Time: 9.0s
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}{1 + 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}{1 + x}}\right)
double f(double x) {
        double r13501 = 2.0;
        double r13502 = 1.0;
        double r13503 = x;
        double r13504 = r13502 - r13503;
        double r13505 = r13502 + r13503;
        double r13506 = r13504 / r13505;
        double r13507 = sqrt(r13506);
        double r13508 = atan(r13507);
        double r13509 = r13501 * r13508;
        return r13509;
}

double f(double x) {
        double r13510 = 2.0;
        double r13511 = 1.0;
        double r13512 = x;
        double r13513 = r13511 - r13512;
        double r13514 = 1.0;
        double r13515 = r13511 + r13512;
        double r13516 = r13514 / r13515;
        double r13517 = r13513 * r13516;
        double r13518 = sqrt(r13517);
        double r13519 = atan(r13518);
        double r13520 = r13510 * r13519;
        return r13520;
}

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 div-inv0.0

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

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

Reproduce

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