Average Error: 0.0 → 0.0
Time: 45.3s
Precision: 64
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\frac{1 - x}{\sqrt{1 + x}}} \cdot \sqrt{\frac{1}{\sqrt{1 + x}}}\right) \cdot 2\]
double f(double x) {
        double r1126011 = 2.0;
        double r1126012 = 1.0;
        double r1126013 = x;
        double r1126014 = r1126012 - r1126013;
        double r1126015 = r1126012 + r1126013;
        double r1126016 = r1126014 / r1126015;
        double r1126017 = sqrt(r1126016);
        double r1126018 = atan(r1126017);
        double r1126019 = r1126011 * r1126018;
        return r1126019;
}

double f(double x) {
        double r1126020 = 1.0;
        double r1126021 = x;
        double r1126022 = r1126020 - r1126021;
        double r1126023 = r1126020 + r1126021;
        double r1126024 = sqrt(r1126023);
        double r1126025 = r1126022 / r1126024;
        double r1126026 = sqrt(r1126025);
        double r1126027 = r1126020 / r1126024;
        double r1126028 = sqrt(r1126027);
        double r1126029 = r1126026 * r1126028;
        double r1126030 = atan(r1126029);
        double r1126031 = 2.0;
        double r1126032 = r1126030 * r1126031;
        return r1126032;
}

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

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{\color{blue}{\sqrt{1 + x} \cdot \sqrt{1 + x}}}}\right)\]
  4. Applied *-un-lft-identity0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - \color{blue}{1 \cdot x}}{\sqrt{1 + x} \cdot \sqrt{1 + x}}}\right)\]
  5. Applied *-un-lft-identity0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{\color{blue}{1 \cdot 1} - 1 \cdot x}{\sqrt{1 + x} \cdot \sqrt{1 + x}}}\right)\]
  6. Applied distribute-lft-out--0.0

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

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

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

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

Reproduce

herbie shell --seed 2019102 
(FPCore (x)
  :name "arccos"
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))