# ?

Average Error: 0.1 → 0.1
Time: 11.1s
Precision: binary64
Cost: 19968

# ?

$0 \leq x \land x \leq 100$
$\sqrt{3 \cdot x - {x}^{2}} + \sqrt{8 \cdot {x}^{3}}$
$\sqrt{3 \cdot x - x \cdot x} + \sqrt{8 \cdot {x}^{3}}$
(FPCore (x)
:precision binary64
(+ (sqrt (- (* 3.0 x) (pow x 2.0))) (sqrt (* 8.0 (pow x 3.0)))))
(FPCore (x)
:precision binary64
(+ (sqrt (- (* 3.0 x) (* x x))) (sqrt (* 8.0 (pow x 3.0)))))
double code(double x) {
return sqrt(((3.0 * x) - pow(x, 2.0))) + sqrt((8.0 * pow(x, 3.0)));
}

double code(double x) {
return sqrt(((3.0 * x) - (x * x))) + sqrt((8.0 * pow(x, 3.0)));
}

real(8) function code(x)
real(8), intent (in) :: x
code = sqrt(((3.0d0 * x) - (x ** 2.0d0))) + sqrt((8.0d0 * (x ** 3.0d0)))
end function

real(8) function code(x)
real(8), intent (in) :: x
code = sqrt(((3.0d0 * x) - (x * x))) + sqrt((8.0d0 * (x ** 3.0d0)))
end function

public static double code(double x) {
return Math.sqrt(((3.0 * x) - Math.pow(x, 2.0))) + Math.sqrt((8.0 * Math.pow(x, 3.0)));
}

public static double code(double x) {
return Math.sqrt(((3.0 * x) - (x * x))) + Math.sqrt((8.0 * Math.pow(x, 3.0)));
}

def code(x):
return math.sqrt(((3.0 * x) - math.pow(x, 2.0))) + math.sqrt((8.0 * math.pow(x, 3.0)))

def code(x):
return math.sqrt(((3.0 * x) - (x * x))) + math.sqrt((8.0 * math.pow(x, 3.0)))

function code(x)
return Float64(sqrt(Float64(Float64(3.0 * x) - (x ^ 2.0))) + sqrt(Float64(8.0 * (x ^ 3.0))))
end

function code(x)
return Float64(sqrt(Float64(Float64(3.0 * x) - Float64(x * x))) + sqrt(Float64(8.0 * (x ^ 3.0))))
end

function tmp = code(x)
tmp = sqrt(((3.0 * x) - (x ^ 2.0))) + sqrt((8.0 * (x ^ 3.0)));
end

function tmp = code(x)
tmp = sqrt(((3.0 * x) - (x * x))) + sqrt((8.0 * (x ^ 3.0)));
end

code[x_] := N[(N[Sqrt[N[(N[(3.0 * x), $MachinePrecision] - N[Power[x, 2.0],$MachinePrecision]), $MachinePrecision]],$MachinePrecision] + N[Sqrt[N[(8.0 * N[Power[x, 3.0], $MachinePrecision]),$MachinePrecision]], $MachinePrecision]),$MachinePrecision]

code[x_] := N[(N[Sqrt[N[(N[(3.0 * x), $MachinePrecision] - N[(x * x),$MachinePrecision]), $MachinePrecision]],$MachinePrecision] + N[Sqrt[N[(8.0 * N[Power[x, 3.0], $MachinePrecision]),$MachinePrecision]], $MachinePrecision]),$MachinePrecision]

\sqrt{3 \cdot x - {x}^{2}} + \sqrt{8 \cdot {x}^{3}}

\sqrt{3 \cdot x - x \cdot x} + \sqrt{8 \cdot {x}^{3}}


# Try it out?

Results

 In Out
Enter valid numbers for all inputs

# Derivation?

1. Initial program 0.1

$\sqrt{3 \cdot x - {x}^{2}} + \sqrt{8 \cdot {x}^{3}}$
2. Simplified0.1

$\leadsto \color{blue}{\sqrt{3 \cdot x - x \cdot x} + \sqrt{8 \cdot {x}^{3}}}$
Proof
[Start]0.1 $\sqrt{3 \cdot x - {x}^{2}} + \sqrt{8 \cdot {x}^{3}}$ $\sqrt{3 \cdot x - \color{blue}{x \cdot x}} + \sqrt{8 \cdot {x}^{3}}$
3. Final simplification0.1

$\leadsto \sqrt{3 \cdot x - x \cdot x} + \sqrt{8 \cdot {x}^{3}}$

# Alternatives

Alternative 1
Error0.1
Cost19840
$\sqrt{8 \cdot {x}^{3}} + \sqrt{x \cdot \left(3 - x\right)}$
Alternative 2
Error1.3
Cost19712
$\sqrt{8 \cdot {x}^{3}} + \sqrt{3 \cdot x}$

# Reproduce?

herbie shell --seed 1
(FPCore (x)
:name "sqrt(3*x - x^2) + sqrt(8*x^3)"
:precision binary64
:pre (and (<= 0.0 x) (<= x 100.0))
(+ (sqrt (- (* 3.0 x) (pow x 2.0))) (sqrt (* 8.0 (pow x 3.0)))))