Average Error: 0.0 → 0.2
Time: 3.2s
Precision: binary64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{\sqrt{x}} + \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right) - \log \left(\sqrt{x}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{\sqrt{x}} + \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right) - \log \left(\sqrt{x}\right)
(FPCore (x)
 :precision binary64
 (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))
(FPCore (x)
 :precision binary64
 (-
  (log (+ (/ 1.0 (sqrt x)) (/ (sqrt (- 1.0 (* x x))) (sqrt x))))
  (log (sqrt x))))
double code(double x) {
	return log((1.0 / x) + (sqrt(1.0 - (x * x)) / x));
}
double code(double x) {
	return log((1.0 / sqrt(x)) + (sqrt(1.0 - (x * x)) / sqrt(x))) - log(sqrt(x));
}

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 add-sqr-sqrt_binary64_7720.0

    \[\leadsto \log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}\right)\]
  4. Applied *-un-lft-identity_binary64_7510.0

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

    \[\leadsto \log \left(\frac{1}{x} + \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1 - x \cdot x}}}{\sqrt{x} \cdot \sqrt{x}}\right)\]
  6. Applied times-frac_binary64_7570.0

    \[\leadsto \log \left(\frac{1}{x} + \color{blue}{\frac{\sqrt{1}}{\sqrt{x}} \cdot \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}}\right)\]
  7. Applied add-sqr-sqrt_binary64_7720.0

    \[\leadsto \log \left(\frac{1}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}} + \frac{\sqrt{1}}{\sqrt{x}} \cdot \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right)\]
  8. Applied add-sqr-sqrt_binary64_7720.0

    \[\leadsto \log \left(\frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{\sqrt{x} \cdot \sqrt{x}} + \frac{\sqrt{1}}{\sqrt{x}} \cdot \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right)\]
  9. Applied times-frac_binary64_7570.0

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

    \[\leadsto \log \color{blue}{\left(\frac{\sqrt{1}}{\sqrt{x}} \cdot \left(\frac{\sqrt{1}}{\sqrt{x}} + \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right)\right)}\]
  11. Applied log-prod_binary64_8340.2

    \[\leadsto \color{blue}{\log \left(\frac{\sqrt{1}}{\sqrt{x}}\right) + \log \left(\frac{\sqrt{1}}{\sqrt{x}} + \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right)}\]
  12. Simplified0.2

    \[\leadsto \color{blue}{\left(-\log \left(\sqrt{x}\right)\right)} + \log \left(\frac{\sqrt{1}}{\sqrt{x}} + \frac{\sqrt{1 - x \cdot x}}{\sqrt{x}}\right)\]
  13. Simplified0.2

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

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

Reproduce

herbie shell --seed 2020292 
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))