Average Error: 0.0 → 0.0
Time: 16.5s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\left(1 - x\right) \cdot \sqrt{\frac{1}{1 - x \cdot x}}\right) \cdot 2\]
2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)
\tan^{-1} \left(\left(1 - x\right) \cdot \sqrt{\frac{1}{1 - x \cdot x}}\right) \cdot 2
double f(double x) {
        double r614385 = 2.0;
        double r614386 = 1.0;
        double r614387 = x;
        double r614388 = r614386 - r614387;
        double r614389 = r614386 + r614387;
        double r614390 = r614388 / r614389;
        double r614391 = sqrt(r614390);
        double r614392 = atan(r614391);
        double r614393 = r614385 * r614392;
        return r614393;
}

double f(double x) {
        double r614394 = 1.0;
        double r614395 = x;
        double r614396 = r614394 - r614395;
        double r614397 = r614395 * r614395;
        double r614398 = r614394 - r614397;
        double r614399 = r614394 / r614398;
        double r614400 = sqrt(r614399);
        double r614401 = r614396 * r614400;
        double r614402 = atan(r614401);
        double r614403 = 2.0;
        double r614404 = r614402 * r614403;
        return r614404;
}

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. Taylor expanded around 0 0.0

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

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

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

Reproduce

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