Average Error: 0.0 → 0.0
Time: 3.6s
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 r56793 = 1.0;
        double r56794 = x;
        double r56795 = r56793 / r56794;
        double r56796 = r56794 * r56794;
        double r56797 = r56793 - r56796;
        double r56798 = sqrt(r56797);
        double r56799 = r56798 / r56794;
        double r56800 = r56795 + r56799;
        double r56801 = log(r56800);
        return r56801;
}

double f(double x) {
        double r56802 = 1.0;
        double r56803 = x;
        double r56804 = r56802 / r56803;
        double r56805 = r56803 * r56803;
        double r56806 = r56802 - r56805;
        double r56807 = sqrt(r56806);
        double r56808 = r56807 / r56803;
        double r56809 = r56804 + r56808;
        double r56810 = log(r56809);
        return r56810;
}

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 2020034 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))