Average Error: 26.2 → 23.1
Time: 40.6s
Precision: binary64
Cost: 27968
\[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
\[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(-\frac{h \cdot \left(\frac{M \cdot D}{d} \cdot \sqrt{0.125}\right)}{\ell} \cdot \frac{M \cdot D}{\sqrt{8} \cdot \left(-d\right)}\right)\right) \]
(FPCore (d h l M D)
 :precision binary64
 (*
  (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
  (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(FPCore (d h l M D)
 :precision binary64
 (*
  (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
  (-
   1.0
   (-
    (*
     (/ (* h (* (/ (* M D) d) (sqrt 0.125))) l)
     (/ (* M D) (* (sqrt 8.0) (- d))))))))
double code(double d, double h, double l, double M, double D) {
	return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
double code(double d, double h, double l, double M, double D) {
	return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - -(((h * (((M * D) / d) * sqrt(0.125))) / l) * ((M * D) / (sqrt(8.0) * -d))));
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - -(((h * (((m * d_1) / d) * sqrt(0.125d0))) / l) * ((m * d_1) / (sqrt(8.0d0) * -d))))
end function
public static double code(double d, double h, double l, double M, double D) {
	return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
public static double code(double d, double h, double l, double M, double D) {
	return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - -(((h * (((M * D) / d) * Math.sqrt(0.125))) / l) * ((M * D) / (Math.sqrt(8.0) * -d))));
}
def code(d, h, l, M, D):
	return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
def code(d, h, l, M, D):
	return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - -(((h * (((M * D) / d) * math.sqrt(0.125))) / l) * ((M * D) / (math.sqrt(8.0) * -d))))
function code(d, h, l, M, D)
	return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
end
function code(d, h, l, M, D)
	return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(-Float64(Float64(Float64(h * Float64(Float64(Float64(M * D) / d) * sqrt(0.125))) / l) * Float64(Float64(M * D) / Float64(sqrt(8.0) * Float64(-d)))))))
end
function tmp = code(d, h, l, M, D)
	tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
end
function tmp = code(d, h, l, M, D)
	tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - -(((h * (((M * D) / d) * sqrt(0.125))) / l) * ((M * D) / (sqrt(8.0) * -d))));
end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - (-N[(N[(N[(h * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[Sqrt[0.125], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(N[Sqrt[8.0], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(-\frac{h \cdot \left(\frac{M \cdot D}{d} \cdot \sqrt{0.125}\right)}{\ell} \cdot \frac{M \cdot D}{\sqrt{8} \cdot \left(-d\right)}\right)\right)

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 26.2

    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  2. Applied egg-rr30.1

    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{{\left({\left({\left(\frac{\frac{M \cdot D}{d}}{\sqrt{8}}\right)}^{2} \cdot \frac{h}{\ell}\right)}^{3}\right)}^{0.3333333333333333}}\right) \]
  3. Applied egg-rr23.1

    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\left(-\frac{h \cdot \left(\frac{M \cdot D}{d} \cdot \sqrt{0.125}\right)}{\ell} \cdot \frac{M \cdot D}{\sqrt{8} \cdot \left(-d\right)}\right)}\right) \]

Alternatives

Alternative 1
Error23.4
Cost36484
\[\begin{array}{l} t_0 := \frac{D \cdot M}{d + d}\\ t_1 := {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\\ \mathbf{if}\;t_1 \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 10^{+134}:\\ \;\;\;\;t_1 \cdot \left(1 - t_0 \cdot \left(t_0 \cdot \frac{0.5 \cdot h}{\ell}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\left(D \cdot M\right) \cdot \left(\frac{\frac{D \cdot M}{d}}{d} \cdot \left(-0.125 \cdot h\right)\right) + \ell}{\ell}\\ \end{array} \]
Alternative 2
Error25.5
Cost15300
\[\begin{array}{l} \mathbf{if}\;\ell \leq 2.7 \cdot 10^{-98}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\left(D \cdot M\right) \cdot \left(\frac{\frac{D \cdot M}{d}}{d} \cdot \left(-0.125 \cdot h\right)\right) + \ell}{\ell}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{D \cdot M}{2 \cdot \left(d + d\right)} \cdot \frac{\left(D \cdot M\right) \cdot h}{\left(d + d\right) \cdot \ell}\right)\\ \end{array} \]
Alternative 3
Error26.4
Cost14792
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ t_1 := t_0 \cdot \frac{\left(D \cdot M\right) \cdot \left(\frac{\frac{D \cdot M}{d}}{d} \cdot \left(-0.125 \cdot h\right)\right) + \ell}{\ell}\\ \mathbf{if}\;d \leq -1.08 \cdot 10^{-218}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq 6.8 \cdot 10^{-256}:\\ \;\;\;\;t_0 \cdot \left(-D \cdot \frac{\frac{\frac{\frac{D \cdot \left(M \cdot \left(M \cdot h\right)\right)}{\ell}}{d}}{d}}{8}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error26.0
Cost14660
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;M \leq -2.5 \cdot 10^{-129}:\\ \;\;\;\;t_0 \cdot \frac{\left(D \cdot M\right) \cdot \left(\frac{\frac{D \cdot M}{d}}{d} \cdot \left(-0.125 \cdot h\right)\right) + \ell}{\ell}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \frac{\frac{\frac{\left(-0.125 \cdot h\right) \cdot \left(D \cdot M\right)}{d} \cdot \left(D \cdot M\right)}{d} + \ell}{\ell}\\ \end{array} \]
Alternative 5
Error32.9
Cost14596
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;D \leq 9.2 \cdot 10^{+98}:\\ \;\;\;\;t_0 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(-D \cdot \left(\left(\left(D \cdot M\right) \cdot M\right) \cdot \left(\frac{h}{d \cdot d} \cdot \frac{0.125}{\ell}\right)\right)\right)\\ \end{array} \]
Alternative 6
Error32.7
Cost14596
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;D \leq 9.2 \cdot 10^{+98}:\\ \;\;\;\;t_0 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(-D \cdot \frac{\frac{\left(D \cdot M\right) \cdot M}{\ell \cdot d} \cdot \left(h \cdot 0.125\right)}{d}\right)\\ \end{array} \]
Alternative 7
Error31.3
Cost13376
\[\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot 1 \]

Error

Reproduce

herbie shell --seed 2023010 
(FPCore (d h l M D)
  :name "Henrywood and Agarwal, Equation (12)"
  :precision binary64
  (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))