?

Average Accuracy: 100.0% → 100.0%
Time: 2.1s
Precision: binary64
Cost: 13184

?

\[\sqrt{1 - x \cdot x} \]
\[e^{\mathsf{log1p}\left(-x \cdot x\right) \cdot 0.5} \]
(FPCore (x) :precision binary64 (sqrt (- 1.0 (* x x))))
(FPCore (x) :precision binary64 (exp (* (log1p (- (* x x))) 0.5)))
double code(double x) {
	return sqrt((1.0 - (x * x)));
}
double code(double x) {
	return exp((log1p(-(x * x)) * 0.5));
}
public static double code(double x) {
	return Math.sqrt((1.0 - (x * x)));
}
public static double code(double x) {
	return Math.exp((Math.log1p(-(x * x)) * 0.5));
}
def code(x):
	return math.sqrt((1.0 - (x * x)))
def code(x):
	return math.exp((math.log1p(-(x * x)) * 0.5))
function code(x)
	return sqrt(Float64(1.0 - Float64(x * x)))
end
function code(x)
	return exp(Float64(log1p(Float64(-Float64(x * x))) * 0.5))
end
code[x_] := N[Sqrt[N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[x_] := N[Exp[N[(N[Log[1 + (-N[(x * x), $MachinePrecision])], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]
\sqrt{1 - x \cdot x}
e^{\mathsf{log1p}\left(-x \cdot x\right) \cdot 0.5}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 100.0%

    \[\sqrt{1 - x \cdot x} \]
  2. Applied egg-rr100.0%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(x \cdot \left(-x\right)\right) \cdot 0.5}} \]
    Proof

    [Start]100.0

    \[ \sqrt{1 - x \cdot x} \]

    pow1/2 [=>]100.0

    \[ \color{blue}{{\left(1 - x \cdot x\right)}^{0.5}} \]

    pow-to-exp [=>]100.0

    \[ \color{blue}{e^{\log \left(1 - x \cdot x\right) \cdot 0.5}} \]

    sub-neg [=>]100.0

    \[ e^{\log \color{blue}{\left(1 + \left(-x \cdot x\right)\right)} \cdot 0.5} \]

    log1p-def [=>]100.0

    \[ e^{\color{blue}{\mathsf{log1p}\left(-x \cdot x\right)} \cdot 0.5} \]

    distribute-rgt-neg-in [=>]100.0

    \[ e^{\mathsf{log1p}\left(\color{blue}{x \cdot \left(-x\right)}\right) \cdot 0.5} \]
  3. Final simplification100.0%

    \[\leadsto e^{\mathsf{log1p}\left(-x \cdot x\right) \cdot 0.5} \]

Alternatives

Alternative 1
Accuracy100.0%
Cost6720
\[\sqrt{1 - x \cdot x} \]
Alternative 2
Accuracy99.4%
Cost448
\[1 + \left(x \cdot x\right) \cdot -0.5 \]
Alternative 3
Accuracy98.8%
Cost64
\[1 \]

Error

Reproduce?

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