# ?

Average Error: 14.7 → 0.3
Time: 4.8s
Precision: binary64
Cost: 12992

# ?

$\left(0 \leq x \land x \leq 1.79 \cdot 10^{+308}\right) \land \left(0 \leq y \land y \leq 1.79 \cdot 10^{+308}\right)$
$\sqrt{x \cdot y}$
$\sqrt{y} \cdot \sqrt{x}$
(FPCore (x y) :precision binary64 (sqrt (* x y)))
(FPCore (x y) :precision binary64 (* (sqrt y) (sqrt x)))
double code(double x, double y) {
return sqrt((x * y));
}

double code(double x, double y) {
return sqrt(y) * sqrt(x);
}

real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt((x * y))
end function

real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(y) * sqrt(x)
end function

public static double code(double x, double y) {
return Math.sqrt((x * y));
}

public static double code(double x, double y) {
return Math.sqrt(y) * Math.sqrt(x);
}

def code(x, y):
return math.sqrt((x * y))

def code(x, y):
return math.sqrt(y) * math.sqrt(x)

function code(x, y)
return sqrt(Float64(x * y))
end

function code(x, y)
return Float64(sqrt(y) * sqrt(x))
end

function tmp = code(x, y)
tmp = sqrt((x * y));
end

function tmp = code(x, y)
tmp = sqrt(y) * sqrt(x);
end

code[x_, y_] := N[Sqrt[N[(x * y), $MachinePrecision]],$MachinePrecision]

code[x_, y_] := N[(N[Sqrt[y], $MachinePrecision] * N[Sqrt[x],$MachinePrecision]), \$MachinePrecision]

\sqrt{x \cdot y}

\sqrt{y} \cdot \sqrt{x}


# Try it out?

Results

 In Out
Enter valid numbers for all inputs

# Derivation?

1. Initial program 14.7

$\sqrt{x \cdot y}$
2. Applied egg-rr0.3

$\leadsto \color{blue}{\sqrt{y} \cdot \sqrt{x}}$
3. Final simplification0.3

$\leadsto \sqrt{y} \cdot \sqrt{x}$

# Alternatives

Alternative 1
Error14.7
Cost6592
$\sqrt{y \cdot x}$

# Reproduce?

herbie shell --seed 1
(FPCore (x y)
:name "sqrt(x * y)"
:precision binary64
:pre (and (and (<= 0.0 x) (<= x 1.79e+308)) (and (<= 0.0 y) (<= y 1.79e+308)))
(sqrt (* x y)))