# ?

Average Error: 0.6 → 0.5
Time: 12.2s
Precision: binary64
Cost: 14144

# ?

$\left(0 \leq w \land w \leq 10\right) \land \left(0 \leq k \land k \leq 10000\right)$
$\frac{1}{16 \cdot {w}^{2}} \cdot \sqrt{\left(\left(\left(k + 1\right) \cdot \left(k + 2\right)\right) \cdot \left(k + 3\right)\right) \cdot \left(k + 4\right)}$
$\frac{\frac{0.0625}{w}}{\frac{w}{\sqrt{k + 3}}} \cdot \sqrt{\left(k + 2\right) \cdot \left(\left(k + 4\right) \cdot \left(k + 1\right)\right)}$
(FPCore (w k)
:precision binary64
(*
(/ 1.0 (* 16.0 (pow w 2.0)))
(sqrt (* (* (* (+ k 1.0) (+ k 2.0)) (+ k 3.0)) (+ k 4.0)))))
(FPCore (w k)
:precision binary64
(*
(/ (/ 0.0625 w) (/ w (sqrt (+ k 3.0))))
(sqrt (* (+ k 2.0) (* (+ k 4.0) (+ k 1.0))))))
double code(double w, double k) {
return (1.0 / (16.0 * pow(w, 2.0))) * sqrt(((((k + 1.0) * (k + 2.0)) * (k + 3.0)) * (k + 4.0)));
}

double code(double w, double k) {
return ((0.0625 / w) / (w / sqrt((k + 3.0)))) * sqrt(((k + 2.0) * ((k + 4.0) * (k + 1.0))));
}

real(8) function code(w, k)
real(8), intent (in) :: w
real(8), intent (in) :: k
code = (1.0d0 / (16.0d0 * (w ** 2.0d0))) * sqrt(((((k + 1.0d0) * (k + 2.0d0)) * (k + 3.0d0)) * (k + 4.0d0)))
end function

real(8) function code(w, k)
real(8), intent (in) :: w
real(8), intent (in) :: k
code = ((0.0625d0 / w) / (w / sqrt((k + 3.0d0)))) * sqrt(((k + 2.0d0) * ((k + 4.0d0) * (k + 1.0d0))))
end function

public static double code(double w, double k) {
return (1.0 / (16.0 * Math.pow(w, 2.0))) * Math.sqrt(((((k + 1.0) * (k + 2.0)) * (k + 3.0)) * (k + 4.0)));
}

public static double code(double w, double k) {
return ((0.0625 / w) / (w / Math.sqrt((k + 3.0)))) * Math.sqrt(((k + 2.0) * ((k + 4.0) * (k + 1.0))));
}

def code(w, k):
return (1.0 / (16.0 * math.pow(w, 2.0))) * math.sqrt(((((k + 1.0) * (k + 2.0)) * (k + 3.0)) * (k + 4.0)))

def code(w, k):
return ((0.0625 / w) / (w / math.sqrt((k + 3.0)))) * math.sqrt(((k + 2.0) * ((k + 4.0) * (k + 1.0))))

function code(w, k)
return Float64(Float64(1.0 / Float64(16.0 * (w ^ 2.0))) * sqrt(Float64(Float64(Float64(Float64(k + 1.0) * Float64(k + 2.0)) * Float64(k + 3.0)) * Float64(k + 4.0))))
end

function code(w, k)
return Float64(Float64(Float64(0.0625 / w) / Float64(w / sqrt(Float64(k + 3.0)))) * sqrt(Float64(Float64(k + 2.0) * Float64(Float64(k + 4.0) * Float64(k + 1.0)))))
end

function tmp = code(w, k)
tmp = (1.0 / (16.0 * (w ^ 2.0))) * sqrt(((((k + 1.0) * (k + 2.0)) * (k + 3.0)) * (k + 4.0)));
end

function tmp = code(w, k)
tmp = ((0.0625 / w) / (w / sqrt((k + 3.0)))) * sqrt(((k + 2.0) * ((k + 4.0) * (k + 1.0))));
end

code[w_, k_] := N[(N[(1.0 / N[(16.0 * N[Power[w, 2.0], $MachinePrecision]),$MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(N[(N[(k + 1.0),$MachinePrecision] * N[(k + 2.0), $MachinePrecision]),$MachinePrecision] * N[(k + 3.0), $MachinePrecision]),$MachinePrecision] * N[(k + 4.0), $MachinePrecision]),$MachinePrecision]], $MachinePrecision]),$MachinePrecision]

code[w_, k_] := N[(N[(N[(0.0625 / w), $MachinePrecision] / N[(w / N[Sqrt[N[(k + 3.0),$MachinePrecision]], $MachinePrecision]),$MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(k + 2.0),$MachinePrecision] * N[(N[(k + 4.0), $MachinePrecision] * N[(k + 1.0),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]], $MachinePrecision]),$MachinePrecision]

\frac{1}{16 \cdot {w}^{2}} \cdot \sqrt{\left(\left(\left(k + 1\right) \cdot \left(k + 2\right)\right) \cdot \left(k + 3\right)\right) \cdot \left(k + 4\right)}

\frac{\frac{0.0625}{w}}{\frac{w}{\sqrt{k + 3}}} \cdot \sqrt{\left(k + 2\right) \cdot \left(\left(k + 4\right) \cdot \left(k + 1\right)\right)}


# Try it out?

Results

 In Out
Enter valid numbers for all inputs

# Derivation?

1. Initial program 0.6

$\frac{1}{16 \cdot {w}^{2}} \cdot \sqrt{\left(\left(\left(k + 1\right) \cdot \left(k + 2\right)\right) \cdot \left(k + 3\right)\right) \cdot \left(k + 4\right)}$
2. Simplified0.6

$\leadsto \color{blue}{\frac{0.0625}{w \cdot w} \cdot \sqrt{\left(k + 3\right) \cdot \left(\left(\left(1 + k\right) \cdot \left(2 + k\right)\right) \cdot \left(k + 4\right)\right)}}$
Proof
[Start]0.6 $\frac{1}{16 \cdot {w}^{2}} \cdot \sqrt{\left(\left(\left(k + 1\right) \cdot \left(k + 2\right)\right) \cdot \left(k + 3\right)\right) \cdot \left(k + 4\right)}$ $\color{blue}{\frac{\frac{1}{16}}{{w}^{2}}} \cdot \sqrt{\left(\left(\left(k + 1\right) \cdot \left(k + 2\right)\right) \cdot \left(k + 3\right)\right) \cdot \left(k + 4\right)}$ $\frac{\color{blue}{0.0625}}{{w}^{2}} \cdot \sqrt{\left(\left(\left(k + 1\right) \cdot \left(k + 2\right)\right) \cdot \left(k + 3\right)\right) \cdot \left(k + 4\right)}$ $\frac{0.0625}{\color{blue}{w \cdot w}} \cdot \sqrt{\left(\left(\left(k + 1\right) \cdot \left(k + 2\right)\right) \cdot \left(k + 3\right)\right) \cdot \left(k + 4\right)}$ $\frac{0.0625}{w \cdot w} \cdot \sqrt{\color{blue}{\left(\left(k + 3\right) \cdot \left(\left(k + 1\right) \cdot \left(k + 2\right)\right)\right)} \cdot \left(k + 4\right)}$ $\frac{0.0625}{w \cdot w} \cdot \sqrt{\color{blue}{\left(k + 3\right) \cdot \left(\left(\left(k + 1\right) \cdot \left(k + 2\right)\right) \cdot \left(k + 4\right)\right)}}$ $\frac{0.0625}{w \cdot w} \cdot \sqrt{\left(k + 3\right) \cdot \left(\left(\color{blue}{\left(1 + k\right)} \cdot \left(k + 2\right)\right) \cdot \left(k + 4\right)\right)}$ $\frac{0.0625}{w \cdot w} \cdot \sqrt{\left(k + 3\right) \cdot \left(\left(\left(1 + k\right) \cdot \color{blue}{\left(2 + k\right)}\right) \cdot \left(k + 4\right)\right)}$
3. Applied egg-rr0.6

$\leadsto \color{blue}{\frac{\frac{0.0625}{w} \cdot \sqrt{\left(k + 3\right) \cdot \left(\left(k + 1\right) \cdot \left(\left(k + 2\right) \cdot \left(k + 4\right)\right)\right)}}{w}}$
4. Applied egg-rr0.5

$\leadsto \color{blue}{\frac{\frac{0.0625}{w}}{\frac{w}{\sqrt{k + 3}}} \cdot \sqrt{\left(k + 2\right) \cdot \left(\left(k + 4\right) \cdot \left(k + 1\right)\right)}}$
5. Final simplification0.5

$\leadsto \frac{\frac{0.0625}{w}}{\frac{w}{\sqrt{k + 3}}} \cdot \sqrt{\left(k + 2\right) \cdot \left(\left(k + 4\right) \cdot \left(k + 1\right)\right)}$

# Alternatives

Alternative 1
Error0.6
Cost7744
$\frac{0.0625}{w \cdot w} \cdot \sqrt{\left(k + 3\right) \cdot \left(\left(k + 4\right) \cdot \left(\left(k + 2\right) \cdot \left(k + 1\right)\right)\right)}$
Alternative 2
Error1.9
Cost7616
$\frac{0.0625}{w \cdot w} \cdot \sqrt{\left(k + 3\right) \cdot \left(\left(k + 4\right) \cdot \left(2 + k \cdot 3\right)\right)}$
Alternative 3
Error1.9
Cost7360
$\frac{\frac{0.0625}{w} \cdot \sqrt{\left(k + 3\right) \cdot \left(k \cdot 14 + 8\right)}}{w}$
Alternative 4
Error1.9
Cost7104
$\frac{0.0625}{w \cdot w} \cdot \sqrt{k \cdot 50 + 24}$
Alternative 5
Error2.3
Cost6912
$\frac{0.0625}{w \cdot \left(w \cdot {24}^{-0.5}\right)}$
Alternative 6
Error2.3
Cost6912
$\frac{0.0625}{\left(w \cdot w\right) \cdot {24}^{-0.5}}$
Alternative 7
Error2.7
Cost6848
$0.0625 \cdot \frac{\sqrt{24}}{w \cdot w}$
Alternative 8
Error2.5
Cost6848
$\frac{0.0625}{w \cdot w} \cdot \sqrt{24}$
Alternative 9
Error2.5
Cost6848
$\frac{0.0625 \cdot \sqrt{24}}{w \cdot w}$
Alternative 10
Error61.3
Cost576
$0.0625 \cdot \left(\frac{k}{w} \cdot \frac{k}{w}\right)$

# Reproduce?

herbie shell --seed 1
(FPCore (w k)
:name " (1/(16*w^2))*sqrt((k+1)*(k+2)*(k+3)*(k+4))"
:precision binary64
:pre (and (and (<= 0.0 w) (<= w 10.0)) (and (<= 0.0 k) (<= k 10000.0)))
(* (/ 1.0 (* 16.0 (pow w 2.0))) (sqrt (* (* (* (+ k 1.0) (+ k 2.0)) (+ k 3.0)) (+ k 4.0)))))