Average Error: 0.0 → 0.0
Time: 13.3s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
double f(double x) {
        double r4687779 = 1.0;
        double r4687780 = x;
        double r4687781 = r4687779 / r4687780;
        double r4687782 = r4687780 * r4687780;
        double r4687783 = r4687779 - r4687782;
        double r4687784 = sqrt(r4687783);
        double r4687785 = r4687784 / r4687780;
        double r4687786 = r4687781 + r4687785;
        double r4687787 = log(r4687786);
        return r4687787;
}

double f(double x) {
        double r4687788 = 1.0;
        double r4687789 = x;
        double r4687790 = r4687788 / r4687789;
        double r4687791 = r4687789 * r4687789;
        double r4687792 = r4687788 - r4687791;
        double r4687793 = sqrt(r4687792);
        double r4687794 = r4687793 / r4687789;
        double r4687795 = r4687790 + r4687794;
        double r4687796 = log(r4687795);
        return r4687796;
}

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. Final simplification0.0

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

Reproduce

herbie shell --seed 2019173 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))