Average Error: 0.0 → 0.0
Time: 5.7s
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 r39666 = 1.0;
        double r39667 = x;
        double r39668 = r39666 / r39667;
        double r39669 = r39667 * r39667;
        double r39670 = r39666 - r39669;
        double r39671 = sqrt(r39670);
        double r39672 = r39671 / r39667;
        double r39673 = r39668 + r39672;
        double r39674 = log(r39673);
        return r39674;
}

double f(double x) {
        double r39675 = 1.0;
        double r39676 = x;
        double r39677 = r39675 / r39676;
        double r39678 = r39676 * r39676;
        double r39679 = r39675 - r39678;
        double r39680 = sqrt(r39679);
        double r39681 = r39680 / r39676;
        double r39682 = r39677 + r39681;
        double r39683 = log(r39682);
        return r39683;
}

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