Average Error: 0.5 → 0.4
Time: 6.9s
Precision: binary64
Cost: 576
$\left(10^{-10} \leq muMeanInv \land muMeanInv \leq 1\right) \land \left(0.5 \leq vERatioMean \land vERatioMean \leq 1000\right)$
$\frac{\left(\left(4 \cdot \frac{1}{muMeanInv}\right) \cdot \frac{1}{muMeanInv}\right) \cdot vERatioMean}{1 - \left(6 \cdot \frac{1}{muMeanInv}\right) \cdot vERatioMean}$
$\frac{4}{muMeanInv \cdot \left(-6 + \frac{muMeanInv}{vERatioMean}\right)}$
(FPCore (muMeanInv vERatioMean)
:precision binary64
(/
(* (* (* 4.0 (/ 1.0 muMeanInv)) (/ 1.0 muMeanInv)) vERatioMean)
(- 1.0 (* (* 6.0 (/ 1.0 muMeanInv)) vERatioMean))))
(FPCore (muMeanInv vERatioMean)
:precision binary64
(/ 4.0 (* muMeanInv (+ -6.0 (/ muMeanInv vERatioMean)))))
double code(double muMeanInv, double vERatioMean) {
return (((4.0 * (1.0 / muMeanInv)) * (1.0 / muMeanInv)) * vERatioMean) / (1.0 - ((6.0 * (1.0 / muMeanInv)) * vERatioMean));
}

double code(double muMeanInv, double vERatioMean) {
return 4.0 / (muMeanInv * (-6.0 + (muMeanInv / vERatioMean)));
}

real(8) function code(mumeaninv, veratiomean)
real(8), intent (in) :: mumeaninv
real(8), intent (in) :: veratiomean
code = (((4.0d0 * (1.0d0 / mumeaninv)) * (1.0d0 / mumeaninv)) * veratiomean) / (1.0d0 - ((6.0d0 * (1.0d0 / mumeaninv)) * veratiomean))
end function

real(8) function code(mumeaninv, veratiomean)
real(8), intent (in) :: mumeaninv
real(8), intent (in) :: veratiomean
code = 4.0d0 / (mumeaninv * ((-6.0d0) + (mumeaninv / veratiomean)))
end function

public static double code(double muMeanInv, double vERatioMean) {
return (((4.0 * (1.0 / muMeanInv)) * (1.0 / muMeanInv)) * vERatioMean) / (1.0 - ((6.0 * (1.0 / muMeanInv)) * vERatioMean));
}

public static double code(double muMeanInv, double vERatioMean) {
return 4.0 / (muMeanInv * (-6.0 + (muMeanInv / vERatioMean)));
}

def code(muMeanInv, vERatioMean):
return (((4.0 * (1.0 / muMeanInv)) * (1.0 / muMeanInv)) * vERatioMean) / (1.0 - ((6.0 * (1.0 / muMeanInv)) * vERatioMean))

def code(muMeanInv, vERatioMean):
return 4.0 / (muMeanInv * (-6.0 + (muMeanInv / vERatioMean)))

function code(muMeanInv, vERatioMean)
return Float64(Float64(Float64(Float64(4.0 * Float64(1.0 / muMeanInv)) * Float64(1.0 / muMeanInv)) * vERatioMean) / Float64(1.0 - Float64(Float64(6.0 * Float64(1.0 / muMeanInv)) * vERatioMean)))
end

function code(muMeanInv, vERatioMean)
return Float64(4.0 / Float64(muMeanInv * Float64(-6.0 + Float64(muMeanInv / vERatioMean))))
end

function tmp = code(muMeanInv, vERatioMean)
tmp = (((4.0 * (1.0 / muMeanInv)) * (1.0 / muMeanInv)) * vERatioMean) / (1.0 - ((6.0 * (1.0 / muMeanInv)) * vERatioMean));
end

function tmp = code(muMeanInv, vERatioMean)
tmp = 4.0 / (muMeanInv * (-6.0 + (muMeanInv / vERatioMean)));
end

code[muMeanInv_, vERatioMean_] := N[(N[(N[(N[(4.0 * N[(1.0 / muMeanInv), $MachinePrecision]),$MachinePrecision] * N[(1.0 / muMeanInv), $MachinePrecision]),$MachinePrecision] * vERatioMean), $MachinePrecision] / N[(1.0 - N[(N[(6.0 * N[(1.0 / muMeanInv),$MachinePrecision]), $MachinePrecision] * vERatioMean),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]

code[muMeanInv_, vERatioMean_] := N[(4.0 / N[(muMeanInv * N[(-6.0 + N[(muMeanInv / vERatioMean), $MachinePrecision]),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]

\frac{\left(\left(4 \cdot \frac{1}{muMeanInv}\right) \cdot \frac{1}{muMeanInv}\right) \cdot vERatioMean}{1 - \left(6 \cdot \frac{1}{muMeanInv}\right) \cdot vERatioMean}

\frac{4}{muMeanInv \cdot \left(-6 + \frac{muMeanInv}{vERatioMean}\right)}


# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.5

$\frac{\left(\left(4 \cdot \frac{1}{muMeanInv}\right) \cdot \frac{1}{muMeanInv}\right) \cdot vERatioMean}{1 - \left(6 \cdot \frac{1}{muMeanInv}\right) \cdot vERatioMean}$
2. Simplified0.3

$\leadsto \color{blue}{\frac{\frac{4}{muMeanInv}}{-6 + \frac{muMeanInv}{vERatioMean}}}$
3. Applied egg-rr0.4

$\leadsto \color{blue}{\frac{4}{muMeanInv \cdot \left(-6 + \frac{muMeanInv}{vERatioMean}\right)} \cdot 1}$
4. Final simplification0.4

$\leadsto \frac{4}{muMeanInv \cdot \left(-6 + \frac{muMeanInv}{vERatioMean}\right)}$

# Alternatives

Alternative 1
Error0.3
Cost576
$\frac{\frac{4}{muMeanInv}}{-6 + \frac{muMeanInv}{vERatioMean}}$
Alternative 2
Error11.6
Cost448
$\frac{-0.6666666666666666}{muMeanInv} + \frac{-0.1111111111111111}{vERatioMean}$
Alternative 3
Error28.8
Cost320
$-0.6666666666666666 \cdot \frac{1}{muMeanInv}$
Alternative 4
Error28.8
Cost192
$\frac{-0.6666666666666666}{muMeanInv}$

# Reproduce

herbie shell --seed 1
(FPCore (muMeanInv vERatioMean)
:name "(4.0 * (1/muMeanInv)*(1/muMeanInv) * vERatioMean) / (1.0 - 6.0 * (1/muMeanInv) * vERatioMean)"
:precision binary64
:pre (and (and (<= 1e-10 muMeanInv) (<= muMeanInv 1.0)) (and (<= 0.5 vERatioMean) (<= vERatioMean 1000.0)))
(/ (* (* (* 4.0 (/ 1.0 muMeanInv)) (/ 1.0 muMeanInv)) vERatioMean) (- 1.0 (* (* 6.0 (/ 1.0 muMeanInv)) vERatioMean))))