Average Error: 0.0 → 0.0
Time: 10.9s
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 r271914 = 2.0;
        double r271915 = 1.0;
        double r271916 = x;
        double r271917 = r271915 - r271916;
        double r271918 = r271915 + r271916;
        double r271919 = r271917 / r271918;
        double r271920 = sqrt(r271919);
        double r271921 = atan(r271920);
        double r271922 = r271914 * r271921;
        return r271922;
}

double f(double x) {
        double r271923 = 1.0;
        double r271924 = x;
        double r271925 = r271923 - r271924;
        double r271926 = r271924 * r271924;
        double r271927 = r271923 - r271926;
        double r271928 = r271925 / r271927;
        double r271929 = r271925 * r271928;
        double r271930 = sqrt(r271929);
        double r271931 = atan(r271930);
        double r271932 = 2.0;
        double r271933 = r271931 * r271932;
        return r271933;
}

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