?

Average Accuracy: 78.4% → 85.8%
Time: 24.2s
Precision: binary64
Cost: 40452

?

\[ \begin{array}{c}[M, D] = \mathsf{sort}([M, D])\\ \end{array} \]
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
\[\begin{array}{l} t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{fma}\left(-2, -\log D, \log \left(\frac{M}{\frac{\ell}{M}} \cdot \left(\frac{h}{d \cdot d} \cdot -0.25\right)\right)\right)\right)}\\ \mathbf{elif}\;t_0 \leq 10^{-116}:\\ \;\;\;\;w0 \cdot \sqrt{1 - t_0}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - M \cdot \frac{0.25}{\frac{d}{D} \cdot \left(\frac{\ell}{M} \cdot \frac{d}{D \cdot h}\right)}}\\ \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
(FPCore (w0 M D h l d)
 :precision binary64
 (let* ((t_0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))
   (if (<= t_0 (- INFINITY))
     (*
      w0
      (pow
       (exp 0.5)
       (fma -2.0 (- (log D)) (log (* (/ M (/ l M)) (* (/ h (* d d)) -0.25))))))
     (if (<= t_0 1e-116)
       (* w0 (sqrt (- 1.0 t_0)))
       (*
        w0
        (sqrt
         (- 1.0 (* M (/ 0.25 (* (/ d D) (* (/ l M) (/ d (* D h)))))))))))))
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
double code(double w0, double M, double D, double h, double l, double d) {
	double t_0 = pow(((M * D) / (2.0 * d)), 2.0) * (h / l);
	double tmp;
	if (t_0 <= -((double) INFINITY)) {
		tmp = w0 * pow(exp(0.5), fma(-2.0, -log(D), log(((M / (l / M)) * ((h / (d * d)) * -0.25)))));
	} else if (t_0 <= 1e-116) {
		tmp = w0 * sqrt((1.0 - t_0));
	} else {
		tmp = w0 * sqrt((1.0 - (M * (0.25 / ((d / D) * ((l / M) * (d / (D * h))))))));
	}
	return tmp;
}
function code(w0, M, D, h, l, d)
	return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)))))
end
function code(w0, M, D, h, l, d)
	t_0 = Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))
	tmp = 0.0
	if (t_0 <= Float64(-Inf))
		tmp = Float64(w0 * (exp(0.5) ^ fma(-2.0, Float64(-log(D)), log(Float64(Float64(M / Float64(l / M)) * Float64(Float64(h / Float64(d * d)) * -0.25))))));
	elseif (t_0 <= 1e-116)
		tmp = Float64(w0 * sqrt(Float64(1.0 - t_0)));
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(M * Float64(0.25 / Float64(Float64(d / D) * Float64(Float64(l / M) * Float64(d / Float64(D * h)))))))));
	end
	return tmp
end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(w0 * N[Power[N[Exp[0.5], $MachinePrecision], N[(-2.0 * (-N[Log[D], $MachinePrecision]) + N[Log[N[(N[(M / N[(l / M), $MachinePrecision]), $MachinePrecision] * N[(N[(h / N[(d * d), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e-116], N[(w0 * N[Sqrt[N[(1.0 - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(M * N[(0.25 / N[(N[(d / D), $MachinePrecision] * N[(N[(l / M), $MachinePrecision] * N[(d / N[(D * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\begin{array}{l}
t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{fma}\left(-2, -\log D, \log \left(\frac{M}{\frac{\ell}{M}} \cdot \left(\frac{h}{d \cdot d} \cdot -0.25\right)\right)\right)\right)}\\

\mathbf{elif}\;t_0 \leq 10^{-116}:\\
\;\;\;\;w0 \cdot \sqrt{1 - t_0}\\

\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - M \cdot \frac{0.25}{\frac{d}{D} \cdot \left(\frac{\ell}{M} \cdot \frac{d}{D \cdot h}\right)}}\\


\end{array}

Error?

Derivation?

  1. Split input into 3 regimes
  2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -inf.0

    1. Initial program 0.0%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Applied egg-rr14.4%

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{M \cdot \left(0.5 \cdot \frac{D}{d}\right)}{\frac{\ell}{h} \cdot \left(\frac{2}{D} \cdot \frac{d}{M}\right)}}} \]
    3. Applied egg-rr12.2%

      \[\leadsto w0 \cdot \color{blue}{e^{0.5 \cdot \mathsf{log1p}\left(\frac{-M}{\frac{\frac{2}{D} \cdot \left(\frac{d}{M} \cdot \frac{\ell}{h}\right)}{0.5 \cdot \frac{D}{d}}}\right)}} \]
    4. Simplified12.4%

      \[\leadsto w0 \cdot \color{blue}{{\left(e^{0.5}\right)}^{\left(\mathsf{log1p}\left(\frac{-M}{\frac{2 \cdot \left(d \cdot \ell\right)}{D \cdot \left(h \cdot M\right)}} \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)\right)}} \]
      Proof

      [Start]12.2

      \[ w0 \cdot e^{0.5 \cdot \mathsf{log1p}\left(\frac{-M}{\frac{\frac{2}{D} \cdot \left(\frac{d}{M} \cdot \frac{\ell}{h}\right)}{0.5 \cdot \frac{D}{d}}}\right)} \]

      exp-prod [=>]12.1

      \[ w0 \cdot \color{blue}{{\left(e^{0.5}\right)}^{\left(\mathsf{log1p}\left(\frac{-M}{\frac{\frac{2}{D} \cdot \left(\frac{d}{M} \cdot \frac{\ell}{h}\right)}{0.5 \cdot \frac{D}{d}}}\right)\right)}} \]

      associate-/r/ [=>]11.4

      \[ w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{log1p}\left(\color{blue}{\frac{-M}{\frac{2}{D} \cdot \left(\frac{d}{M} \cdot \frac{\ell}{h}\right)} \cdot \left(0.5 \cdot \frac{D}{d}\right)}\right)\right)} \]
    5. Taylor expanded in D around inf 11.7%

      \[\leadsto w0 \cdot {\left(e^{0.5}\right)}^{\color{blue}{\left(-2 \cdot \log \left(\frac{1}{D}\right) + \log \left(-0.25 \cdot \frac{{M}^{2} \cdot h}{\ell \cdot {d}^{2}}\right)\right)}} \]
    6. Simplified13.7%

      \[\leadsto w0 \cdot {\left(e^{0.5}\right)}^{\color{blue}{\left(\mathsf{fma}\left(-2, -\log D, \log \left(\frac{M}{\frac{\ell}{M}} \cdot \left(\frac{h}{d \cdot d} \cdot -0.25\right)\right)\right)\right)}} \]
      Proof

      [Start]11.7

      \[ w0 \cdot {\left(e^{0.5}\right)}^{\left(-2 \cdot \log \left(\frac{1}{D}\right) + \log \left(-0.25 \cdot \frac{{M}^{2} \cdot h}{\ell \cdot {d}^{2}}\right)\right)} \]

      fma-def [=>]11.7

      \[ w0 \cdot {\left(e^{0.5}\right)}^{\color{blue}{\left(\mathsf{fma}\left(-2, \log \left(\frac{1}{D}\right), \log \left(-0.25 \cdot \frac{{M}^{2} \cdot h}{\ell \cdot {d}^{2}}\right)\right)\right)}} \]

      log-rec [=>]11.7

      \[ w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{fma}\left(-2, \color{blue}{-\log D}, \log \left(-0.25 \cdot \frac{{M}^{2} \cdot h}{\ell \cdot {d}^{2}}\right)\right)\right)} \]

      *-commutative [=>]11.7

      \[ w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{fma}\left(-2, -\log D, \log \color{blue}{\left(\frac{{M}^{2} \cdot h}{\ell \cdot {d}^{2}} \cdot -0.25\right)}\right)\right)} \]

      times-frac [=>]11.7

      \[ w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{fma}\left(-2, -\log D, \log \left(\color{blue}{\left(\frac{{M}^{2}}{\ell} \cdot \frac{h}{{d}^{2}}\right)} \cdot -0.25\right)\right)\right)} \]

      associate-*l* [=>]11.7

      \[ w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{fma}\left(-2, -\log D, \log \color{blue}{\left(\frac{{M}^{2}}{\ell} \cdot \left(\frac{h}{{d}^{2}} \cdot -0.25\right)\right)}\right)\right)} \]

      unpow2 [=>]11.7

      \[ w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{fma}\left(-2, -\log D, \log \left(\frac{\color{blue}{M \cdot M}}{\ell} \cdot \left(\frac{h}{{d}^{2}} \cdot -0.25\right)\right)\right)\right)} \]

      associate-/l* [=>]13.7

      \[ w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{fma}\left(-2, -\log D, \log \left(\color{blue}{\frac{M}{\frac{\ell}{M}}} \cdot \left(\frac{h}{{d}^{2}} \cdot -0.25\right)\right)\right)\right)} \]

      unpow2 [=>]13.7

      \[ w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{fma}\left(-2, -\log D, \log \left(\frac{M}{\frac{\ell}{M}} \cdot \left(\frac{h}{\color{blue}{d \cdot d}} \cdot -0.25\right)\right)\right)\right)} \]

    if -inf.0 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < 9.9999999999999999e-117

    1. Initial program 99.8%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]

    if 9.9999999999999999e-117 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))

    1. Initial program 31.1%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Applied egg-rr38.8%

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{M \cdot \left(-D\right)}{\frac{\ell}{h} \cdot \left(\left(\frac{2}{D} \cdot \frac{d}{M}\right) \cdot \left(d \cdot -2\right)\right)}}} \]
    3. Simplified37.0%

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{M}{\frac{\frac{\ell}{h}}{-D}} \cdot \frac{M}{\frac{d}{D} \cdot \left(d \cdot -4\right)}}} \]
      Proof

      [Start]38.8

      \[ w0 \cdot \sqrt{1 - \frac{M \cdot \left(-D\right)}{\frac{\ell}{h} \cdot \left(\left(\frac{2}{D} \cdot \frac{d}{M}\right) \cdot \left(d \cdot -2\right)\right)}} \]

      *-commutative [=>]38.8

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

      associate-*r* [=>]41.0

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

      *-commutative [=>]41.0

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

      associate-*l/ [=>]40.4

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

      associate-*r/ [=>]40.4

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

      *-commutative [<=]40.4

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

      associate-*r/ [<=]40.4

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

      associate-*r/ [=>]37.8

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

      associate-*r* [<=]35.0

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

      associate-/l* [<=]30.5

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

      *-commutative [<=]30.5

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

      times-frac [=>]33.0

      \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{M \cdot \left(-D\right)}{\frac{\ell}{h}} \cdot \frac{M}{\left(2 \cdot \frac{d}{D}\right) \cdot \left(d \cdot -2\right)}}} \]
    4. Applied egg-rr70.3%

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{-M}{\frac{\ell}{M \cdot \left(D \cdot h\right)} \cdot \left(d \cdot \left(-4 \cdot \frac{d}{D}\right)\right)}}} \]
    5. Applied egg-rr67.1%

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\left(0 - e^{\mathsf{log1p}\left(M \cdot \frac{\frac{M}{\ell} \cdot \left(D \cdot h\right)}{\frac{d}{D} \cdot \left(d \cdot -4\right)}\right)}\right) + 1\right)}} \]
    6. Simplified78.3%

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{M \cdot \frac{0.25}{\frac{d}{D} \cdot \left(\frac{d}{D \cdot h} \cdot \frac{\ell}{M}\right)}}} \]
      Proof

      [Start]67.1

      \[ w0 \cdot \sqrt{1 - \left(\left(0 - e^{\mathsf{log1p}\left(M \cdot \frac{\frac{M}{\ell} \cdot \left(D \cdot h\right)}{\frac{d}{D} \cdot \left(d \cdot -4\right)}\right)}\right) + 1\right)} \]

      associate-+l- [=>]67.1

      \[ w0 \cdot \sqrt{1 - \color{blue}{\left(0 - \left(e^{\mathsf{log1p}\left(M \cdot \frac{\frac{M}{\ell} \cdot \left(D \cdot h\right)}{\frac{d}{D} \cdot \left(d \cdot -4\right)}\right)} - 1\right)\right)}} \]

      expm1-def [=>]67.1

      \[ w0 \cdot \sqrt{1 - \left(0 - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(M \cdot \frac{\frac{M}{\ell} \cdot \left(D \cdot h\right)}{\frac{d}{D} \cdot \left(d \cdot -4\right)}\right)\right)}\right)} \]

      expm1-log1p [=>]67.4

      \[ w0 \cdot \sqrt{1 - \left(0 - \color{blue}{M \cdot \frac{\frac{M}{\ell} \cdot \left(D \cdot h\right)}{\frac{d}{D} \cdot \left(d \cdot -4\right)}}\right)} \]

      sub0-neg [=>]67.4

      \[ w0 \cdot \sqrt{1 - \color{blue}{\left(-M \cdot \frac{\frac{M}{\ell} \cdot \left(D \cdot h\right)}{\frac{d}{D} \cdot \left(d \cdot -4\right)}\right)}} \]

      mul-1-neg [<=]67.4

      \[ w0 \cdot \sqrt{1 - \color{blue}{-1 \cdot \left(M \cdot \frac{\frac{M}{\ell} \cdot \left(D \cdot h\right)}{\frac{d}{D} \cdot \left(d \cdot -4\right)}\right)}} \]

      associate-*r/ [=>]63.4

      \[ w0 \cdot \sqrt{1 - -1 \cdot \color{blue}{\frac{M \cdot \left(\frac{M}{\ell} \cdot \left(D \cdot h\right)\right)}{\frac{d}{D} \cdot \left(d \cdot -4\right)}}} \]

      associate-*r/ [=>]63.4

      \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{-1 \cdot \left(M \cdot \left(\frac{M}{\ell} \cdot \left(D \cdot h\right)\right)\right)}{\frac{d}{D} \cdot \left(d \cdot -4\right)}}} \]

      associate-/l* [=>]63.4

      \[ w0 \cdot \sqrt{1 - \color{blue}{\frac{-1}{\frac{\frac{d}{D} \cdot \left(d \cdot -4\right)}{M \cdot \left(\frac{M}{\ell} \cdot \left(D \cdot h\right)\right)}}}} \]

      /-rgt-identity [<=]63.4

      \[ w0 \cdot \sqrt{1 - \frac{-1}{\frac{\frac{d}{D} \cdot \left(d \cdot -4\right)}{\color{blue}{\frac{M \cdot \left(\frac{M}{\ell} \cdot \left(D \cdot h\right)\right)}{1}}}}} \]

      associate-/l* [=>]63.4

      \[ w0 \cdot \sqrt{1 - \frac{-1}{\frac{\frac{d}{D} \cdot \left(d \cdot -4\right)}{\color{blue}{\frac{M}{\frac{1}{\frac{M}{\ell} \cdot \left(D \cdot h\right)}}}}}} \]

      associate-*l/ [=>]64.4

      \[ w0 \cdot \sqrt{1 - \frac{-1}{\frac{\frac{d}{D} \cdot \left(d \cdot -4\right)}{\frac{M}{\frac{1}{\color{blue}{\frac{M \cdot \left(D \cdot h\right)}{\ell}}}}}}} \]

      associate-/l* [<=]65.1

      \[ w0 \cdot \sqrt{1 - \frac{-1}{\frac{\frac{d}{D} \cdot \left(d \cdot -4\right)}{\frac{M}{\color{blue}{\frac{1 \cdot \ell}{M \cdot \left(D \cdot h\right)}}}}}} \]

      associate-*r/ [<=]65.1

      \[ w0 \cdot \sqrt{1 - \frac{-1}{\frac{\frac{d}{D} \cdot \left(d \cdot -4\right)}{\frac{M}{\color{blue}{1 \cdot \frac{\ell}{M \cdot \left(D \cdot h\right)}}}}}} \]

      *-lft-identity [=>]65.1

      \[ w0 \cdot \sqrt{1 - \frac{-1}{\frac{\frac{d}{D} \cdot \left(d \cdot -4\right)}{\frac{M}{\color{blue}{\frac{\ell}{M \cdot \left(D \cdot h\right)}}}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification85.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -\infty:\\ \;\;\;\;w0 \cdot {\left(e^{0.5}\right)}^{\left(\mathsf{fma}\left(-2, -\log D, \log \left(\frac{M}{\frac{\ell}{M}} \cdot \left(\frac{h}{d \cdot d} \cdot -0.25\right)\right)\right)\right)}\\ \mathbf{elif}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 10^{-116}:\\ \;\;\;\;w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - M \cdot \frac{0.25}{\frac{d}{D} \cdot \left(\frac{\ell}{M} \cdot \frac{d}{D \cdot h}\right)}}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy86.7%
Cost27784
\[\begin{array}{l} t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;w0\\ \mathbf{elif}\;t_0 \leq 4 \cdot 10^{+304}:\\ \;\;\;\;w0 \cdot \sqrt{1 - t_0 \cdot \frac{h}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - M \cdot \frac{0.25}{\frac{d}{D} \cdot \left(\frac{\ell}{M} \cdot \frac{d}{D \cdot h}\right)}}\\ \end{array} \]
Alternative 2
Accuracy82.8%
Cost14344
\[\begin{array}{l} \mathbf{if}\;\frac{h}{\ell} \leq -\infty:\\ \;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)}\\ \mathbf{elif}\;\frac{h}{\ell} \leq -5 \cdot 10^{-242}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{M}{\frac{\ell}{\frac{M \cdot \left(D \cdot h\right)}{d \cdot -4} \cdot \frac{D}{d}}}}\\ \end{array} \]
Alternative 3
Accuracy84.0%
Cost8392
\[\begin{array}{l} \mathbf{if}\;\frac{h}{\ell} \leq -\infty:\\ \;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)}\\ \mathbf{elif}\;\frac{h}{\ell} \leq 2 \cdot 10^{-282}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{M \cdot \left(\frac{D}{d} \cdot -0.5\right)}{\frac{\ell}{h} \cdot \left(\frac{2}{D} \cdot \frac{d}{M}\right)}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
Alternative 4
Accuracy84.1%
Cost8264
\[\begin{array}{l} t_0 := D \cdot \frac{M}{d}\\ \mathbf{if}\;\frac{h}{\ell} \leq -\infty:\\ \;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)}\\ \mathbf{elif}\;\frac{h}{\ell} \leq -1 \cdot 10^{-181}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{t_0 \cdot t_0}{\frac{\ell}{h} \cdot 4}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
Alternative 5
Accuracy82.8%
Cost8264
\[\begin{array}{l} t_0 := D \cdot \frac{M}{d}\\ \mathbf{if}\;\frac{h}{\ell} \leq -\infty:\\ \;\;\;\;w0 \cdot \sqrt{1 + -0.25 \cdot \left(\frac{D \cdot D}{\ell} \cdot \frac{h \cdot \left(M \cdot M\right)}{d \cdot d}\right)}\\ \mathbf{elif}\;\frac{h}{\ell} \leq -5 \cdot 10^{-242}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{t_0 \cdot t_0}{\frac{\ell}{h} \cdot 4}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{M}{\frac{\ell}{\frac{M \cdot \left(D \cdot h\right)}{d \cdot -4} \cdot \frac{D}{d}}}}\\ \end{array} \]
Alternative 6
Accuracy80.9%
Cost8140
\[\begin{array}{l} t_0 := D \cdot \frac{M}{d}\\ \mathbf{if}\;D \leq 5 \cdot 10^{-135}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{M}{\frac{\ell}{M \cdot \left(D \cdot h\right)} \cdot \left(d \cdot \left(\frac{d}{D} \cdot -4\right)\right)}}\\ \mathbf{elif}\;D \leq 4000000000:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{M}{d \cdot -4} \cdot \left(\left(D \cdot h\right) \cdot \frac{M}{\frac{d \cdot \ell}{D}}\right)}\\ \mathbf{elif}\;D \leq 3.3 \cdot 10^{+40}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{M}{\frac{\ell}{D} \cdot \frac{d}{\frac{-0.25}{\frac{d}{\left(M \cdot D\right) \cdot h}}}}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{t_0 \cdot t_0}{\frac{\ell}{h} \cdot 4}}\\ \end{array} \]
Alternative 7
Accuracy81.7%
Cost7876
\[\begin{array}{l} \mathbf{if}\;M \leq -3.4 \cdot 10^{-60}:\\ \;\;\;\;w0 \cdot \sqrt{1 - M \cdot \left(\left(D \cdot h\right) \cdot \frac{\frac{M}{\frac{d}{D}}}{\ell \cdot \left(d \cdot 4\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
Alternative 8
Accuracy78.5%
Cost64
\[w0 \]

Error

Reproduce?

herbie shell --seed 2023125 
(FPCore (w0 M D h l d)
  :name "Henrywood and Agarwal, Equation (9a)"
  :precision binary64
  (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))