Average Error: 0.0 → 0.0
Time: 23.1s
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 r428475 = 2.0;
        double r428476 = 1.0;
        double r428477 = x;
        double r428478 = r428476 - r428477;
        double r428479 = r428476 + r428477;
        double r428480 = r428478 / r428479;
        double r428481 = sqrt(r428480);
        double r428482 = atan(r428481);
        double r428483 = r428475 * r428482;
        return r428483;
}

double f(double x) {
        double r428484 = 1.0;
        double r428485 = x;
        double r428486 = r428484 - r428485;
        double r428487 = r428485 * r428485;
        double r428488 = r428484 - r428487;
        double r428489 = r428486 / r428488;
        double r428490 = r428486 * r428489;
        double r428491 = sqrt(r428490);
        double r428492 = atan(r428491);
        double r428493 = 2.0;
        double r428494 = r428492 * r428493;
        return r428494;
}

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