Average Error: 0.0 → 0.0
Time: 2.1s
Precision: 64
\[\sqrt{1 - x \cdot x}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{1 - x \cdot x}\right)\right)\]
\sqrt{1 - x \cdot x}
\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{1 - x \cdot x}\right)\right)
double code(double x) {
	return ((double) sqrt(((double) (1.0 - ((double) (x * x))))));
}
double code(double x) {
	return ((double) log1p(((double) expm1(((double) sqrt(((double) (1.0 - ((double) (x * 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

    \[\sqrt{1 - x \cdot x}\]
  2. Using strategy rm
  3. Applied log1p-expm1-u0.0

    \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{1 - x \cdot x}\right)\right)}\]
  4. Final simplification0.0

    \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{1 - x \cdot x}\right)\right)\]

Reproduce

herbie shell --seed 2020120 +o rules:numerics
(FPCore (x)
  :name "Diagrams.TwoD.Ellipse:ellipse from diagrams-lib-1.3.0.3"
  :precision binary64
  (sqrt (- 1 (* x x))))