Average Error: 0.0 → 0.0
Time: 1.1s
Precision: binary64
\[\sqrt{1 - x \cdot x} \]
\[\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{1 - x \cdot x}\right)\right) \]
(FPCore (x) :precision binary64 (sqrt (- 1.0 (* x x))))
(FPCore (x) :precision binary64 (expm1 (log1p (sqrt (- 1.0 (* x x))))))
double code(double x) {
	return sqrt((1.0 - (x * x)));
}
double code(double x) {
	return expm1(log1p(sqrt((1.0 - (x * x)))));
}
public static double code(double x) {
	return Math.sqrt((1.0 - (x * x)));
}
public static double code(double x) {
	return Math.expm1(Math.log1p(Math.sqrt((1.0 - (x * x)))));
}
def code(x):
	return math.sqrt((1.0 - (x * x)))
def code(x):
	return math.expm1(math.log1p(math.sqrt((1.0 - (x * x)))))
function code(x)
	return sqrt(Float64(1.0 - Float64(x * x)))
end
function code(x)
	return expm1(log1p(sqrt(Float64(1.0 - Float64(x * x)))))
end
code[x_] := N[Sqrt[N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[x_] := N[(Exp[N[Log[1 + N[Sqrt[N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]
\sqrt{1 - x \cdot x}
\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{1 - x \cdot x}\right)\right)

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. Applied egg-rr0.0

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

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

Reproduce

herbie shell --seed 2022156 
(FPCore (x)
  :name "Diagrams.TwoD.Ellipse:ellipse from diagrams-lib-1.3.0.3"
  :precision binary64
  (sqrt (- 1.0 (* x x))))