Average Error: 0.0 → 0.0
Time: 57.6s
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 r579559 = 2.0;
        double r579560 = 1.0;
        double r579561 = x;
        double r579562 = r579560 - r579561;
        double r579563 = r579560 + r579561;
        double r579564 = r579562 / r579563;
        double r579565 = sqrt(r579564);
        double r579566 = atan(r579565);
        double r579567 = r579559 * r579566;
        return r579567;
}

double f(double x) {
        double r579568 = 1.0;
        double r579569 = x;
        double r579570 = r579568 - r579569;
        double r579571 = r579569 * r579569;
        double r579572 = r579568 - r579571;
        double r579573 = r579570 / r579572;
        double r579574 = r579570 * r579573;
        double r579575 = sqrt(r579574);
        double r579576 = atan(r579575);
        double r579577 = 2.0;
        double r579578 = r579576 * r579577;
        return r579578;
}

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 2019151 
(FPCore (x)
  :name "arccos"
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))