Average Error: 0.0 → 0.0
Time: 9.8s
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}{\left(1 - x\right) \cdot \left(1 + x\right)}}\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}{\left(1 - x\right) \cdot \left(1 + x\right)}}\right) \cdot 2
double f(double x) {
        double r20108 = 2.0;
        double r20109 = 1.0;
        double r20110 = x;
        double r20111 = r20109 - r20110;
        double r20112 = r20109 + r20110;
        double r20113 = r20111 / r20112;
        double r20114 = sqrt(r20113);
        double r20115 = atan(r20114);
        double r20116 = r20108 * r20115;
        return r20116;
}

double f(double x) {
        double r20117 = 1.0;
        double r20118 = x;
        double r20119 = r20117 - r20118;
        double r20120 = r20117 + r20118;
        double r20121 = r20119 * r20120;
        double r20122 = r20119 / r20121;
        double r20123 = r20119 * r20122;
        double r20124 = sqrt(r20123);
        double r20125 = atan(r20124);
        double r20126 = 2.0;
        double r20127 = r20125 * r20126;
        return r20127;
}

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}{\left(1 - x\right) \cdot \left(x + 1\right)}} \cdot \left(1 - x\right)}\right)\]
  6. Final simplification0.0

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x)
  :name "arccos"
  (* 2.0 (atan (sqrt (/ (- 1.0 x) (+ 1.0 x))))))