Average Error: 0.0 → 0.0
Time: 11.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 r317445 = 2.0;
        double r317446 = 1.0;
        double r317447 = x;
        double r317448 = r317446 - r317447;
        double r317449 = r317446 + r317447;
        double r317450 = r317448 / r317449;
        double r317451 = sqrt(r317450);
        double r317452 = atan(r317451);
        double r317453 = r317445 * r317452;
        return r317453;
}

double f(double x) {
        double r317454 = 1.0;
        double r317455 = x;
        double r317456 = r317454 - r317455;
        double r317457 = r317455 * r317455;
        double r317458 = r317454 - r317457;
        double r317459 = r317456 / r317458;
        double r317460 = r317456 * r317459;
        double r317461 = sqrt(r317460);
        double r317462 = atan(r317461);
        double r317463 = 2.0;
        double r317464 = r317462 * r317463;
        return r317464;
}

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