Average Error: 0.1 → 0.1
Time: 10.4s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{x} \cdot \left(1 + \sqrt{1 - x \cdot x}\right)\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{x} \cdot \left(1 + \sqrt{1 - x \cdot x}\right)\right)
double f(double x) {
        double r41799 = 1.0;
        double r41800 = x;
        double r41801 = r41799 / r41800;
        double r41802 = r41800 * r41800;
        double r41803 = r41799 - r41802;
        double r41804 = sqrt(r41803);
        double r41805 = r41804 / r41800;
        double r41806 = r41801 + r41805;
        double r41807 = log(r41806);
        return r41807;
}

double f(double x) {
        double r41808 = 1.0;
        double r41809 = x;
        double r41810 = r41808 / r41809;
        double r41811 = 1.0;
        double r41812 = r41809 * r41809;
        double r41813 = r41811 - r41812;
        double r41814 = sqrt(r41813);
        double r41815 = r41811 + r41814;
        double r41816 = r41810 * r41815;
        double r41817 = log(r41816);
        return r41817;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

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

    \[\leadsto \log \left(\frac{1}{x} + \color{blue}{\sqrt{1 - x \cdot x} \cdot \frac{1}{x}}\right)\]
  4. Applied div-inv0.1

    \[\leadsto \log \left(\color{blue}{1 \cdot \frac{1}{x}} + \sqrt{1 - x \cdot x} \cdot \frac{1}{x}\right)\]
  5. Applied distribute-rgt-out0.1

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

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

Reproduce

herbie shell --seed 2019303 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))