Average Error: 0.0 → 0.0
Time: 19.5s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\left(1 + \sqrt{1 - x \cdot x}\right) \cdot \frac{1}{x}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\left(1 + \sqrt{1 - x \cdot x}\right) \cdot \frac{1}{x}\right)
double f(double x) {
        double r9528938 = 1.0;
        double r9528939 = x;
        double r9528940 = r9528938 / r9528939;
        double r9528941 = r9528939 * r9528939;
        double r9528942 = r9528938 - r9528941;
        double r9528943 = sqrt(r9528942);
        double r9528944 = r9528943 / r9528939;
        double r9528945 = r9528940 + r9528944;
        double r9528946 = log(r9528945);
        return r9528946;
}

double f(double x) {
        double r9528947 = 1.0;
        double r9528948 = x;
        double r9528949 = r9528948 * r9528948;
        double r9528950 = r9528947 - r9528949;
        double r9528951 = sqrt(r9528950);
        double r9528952 = r9528947 + r9528951;
        double r9528953 = r9528947 / r9528948;
        double r9528954 = r9528952 * r9528953;
        double r9528955 = log(r9528954);
        return r9528955;
}

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

    \[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
  2. Using strategy rm
  3. Applied div-inv0.0

    \[\leadsto \log \left(\frac{1}{x} + \color{blue}{\sqrt{1 - x \cdot x} \cdot \frac{1}{x}}\right)\]
  4. Applied distribute-rgt1-in0.0

    \[\leadsto \log \color{blue}{\left(\left(\sqrt{1 - x \cdot x} + 1\right) \cdot \frac{1}{x}\right)}\]
  5. Final simplification0.0

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

Reproduce

herbie shell --seed 2019120 
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))