?

Average Accuracy: 6.8% → 71.1%
Time: 44.4s
Precision: binary64
Cost: 26953

?

\[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
\[\begin{array}{l} t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_1 := \frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)\\ \mathbf{if}\;t_1 \leq 0 \lor \neg \left(t_1 \leq \infty\right):\\ \;\;\;\;\mathsf{fma}\left(-0.5, 0, 0.25 \cdot \frac{D \cdot M}{\frac{d}{h} \cdot \frac{d}{D \cdot M}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{D} \cdot \left(\frac{c0}{w} \cdot \frac{c0}{h}\right)}{w \cdot \frac{D}{d}}\\ \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (*
  (/ c0 (* 2.0 w))
  (+
   (/ (* c0 (* d d)) (* (* w h) (* D D)))
   (sqrt
    (-
     (*
      (/ (* c0 (* d d)) (* (* w h) (* D D)))
      (/ (* c0 (* d d)) (* (* w h) (* D D))))
     (* M M))))))
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))
        (t_1 (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
   (if (or (<= t_1 0.0) (not (<= t_1 INFINITY)))
     (fma -0.5 0.0 (* 0.25 (/ (* D M) (* (/ d h) (/ d (* D M))))))
     (/ (* (/ d D) (* (/ c0 w) (/ c0 h))) (* w (/ D d))))))
double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
	double tmp;
	if ((t_1 <= 0.0) || !(t_1 <= ((double) INFINITY))) {
		tmp = fma(-0.5, 0.0, (0.25 * ((D * M) / ((d / h) * (d / (D * M))))));
	} else {
		tmp = ((d / D) * ((c0 / w) * (c0 / h))) / (w * (D / d));
	}
	return tmp;
}
function code(c0, w, h, D, d, M)
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) + sqrt(Float64(Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))) - Float64(M * M)))))
end
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M)))))
	tmp = 0.0
	if ((t_1 <= 0.0) || !(t_1 <= Inf))
		tmp = fma(-0.5, 0.0, Float64(0.25 * Float64(Float64(D * M) / Float64(Float64(d / h) * Float64(d / Float64(D * M))))));
	else
		tmp = Float64(Float64(Float64(d / D) * Float64(Float64(c0 / w) * Float64(c0 / h))) / Float64(w * Float64(D / d)));
	end
	return tmp
end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 0.0], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(-0.5 * 0.0 + N[(0.25 * N[(N[(D * M), $MachinePrecision] / N[(N[(d / h), $MachinePrecision] * N[(d / N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / D), $MachinePrecision] * N[(N[(c0 / w), $MachinePrecision] * N[(c0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(w * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_1 := \frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)\\
\mathbf{if}\;t_1 \leq 0 \lor \neg \left(t_1 \leq \infty\right):\\
\;\;\;\;\mathsf{fma}\left(-0.5, 0, 0.25 \cdot \frac{D \cdot M}{\frac{d}{h} \cdot \frac{d}{D \cdot M}}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{D} \cdot \left(\frac{c0}{w} \cdot \frac{c0}{h}\right)}{w \cdot \frac{D}{d}}\\


\end{array}

Error?

Derivation?

  1. Split input into 2 regimes
  2. if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < 0.0 or +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M)))))

    1. Initial program 5.4%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 5.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot {c0}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    3. Simplified6.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{0 \cdot \left(\frac{d}{w} \cdot \frac{\frac{d}{h}}{D \cdot D}\right)}{\frac{w}{c0 \cdot c0}}, 0.25 \cdot \frac{\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(D \cdot D\right)}{d \cdot d}\right)} \]
      Proof

      [Start]5.2

      \[ -0.5 \cdot \frac{\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot {c0}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \]

      fma-def [=>]5.2

      \[ \color{blue}{\mathsf{fma}\left(-0.5, \frac{\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot {c0}^{2}}{w}, 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}\right)} \]
    4. Applied egg-rr8.2%

      \[\leadsto \mathsf{fma}\left(-0.5, \frac{0 \cdot \left(\frac{d}{w} \cdot \frac{\frac{d}{h}}{D \cdot D}\right)}{\frac{w}{c0 \cdot c0}}, 0.25 \cdot \color{blue}{\left(\frac{h}{d} \cdot \frac{{\left(M \cdot D\right)}^{2}}{d}\right)}\right) \]
    5. Taylor expanded in d around 0 66.0%

      \[\leadsto \mathsf{fma}\left(-0.5, \color{blue}{0}, 0.25 \cdot \left(\frac{h}{d} \cdot \frac{{\left(M \cdot D\right)}^{2}}{d}\right)\right) \]
    6. Applied egg-rr72.6%

      \[\leadsto \mathsf{fma}\left(-0.5, 0, 0.25 \cdot \color{blue}{\frac{M \cdot D}{\frac{d}{h} \cdot \frac{d}{M \cdot D}}}\right) \]

    if 0.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0

    1. Initial program 27.4%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around inf 19.6%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    3. Simplified21.3%

      \[\leadsto \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{\frac{h \cdot \left(w \cdot w\right)}{c0}}} \]
      Proof

      [Start]19.6

      \[ \frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)} \]

      times-frac [=>]16.4

      \[ \color{blue}{\frac{{d}^{2}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}} \]

      unpow2 [=>]16.4

      \[ \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]

      unpow2 [=>]16.4

      \[ \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]

      associate-/r* [=>]17.7

      \[ \color{blue}{\frac{\frac{d \cdot d}{D}}{D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]

      associate-*r/ [<=]18.0

      \[ \frac{\color{blue}{d \cdot \frac{d}{D}}}{D} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]

      associate-*l/ [<=]18.0

      \[ \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]

      unpow2 [=>]18.0

      \[ \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h} \]

      associate-/l* [=>]21.3

      \[ \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \color{blue}{\frac{c0}{\frac{{w}^{2} \cdot h}{c0}}} \]

      *-commutative [=>]21.3

      \[ \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{\frac{\color{blue}{h \cdot {w}^{2}}}{c0}} \]

      unpow2 [=>]21.3

      \[ \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{\frac{h \cdot \color{blue}{\left(w \cdot w\right)}}{c0}} \]
    4. Applied egg-rr38.0%

      \[\leadsto \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \color{blue}{\left(\frac{c0}{h \cdot w} \cdot \frac{c0}{w}\right)} \]
    5. Applied egg-rr48.8%

      \[\leadsto \color{blue}{\frac{\frac{d}{D} \cdot \left(\frac{c0}{w} \cdot \frac{c0}{h}\right)}{\frac{D}{d} \cdot w}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification71.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \leq 0 \lor \neg \left(\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \leq \infty\right):\\ \;\;\;\;\mathsf{fma}\left(-0.5, 0, 0.25 \cdot \frac{D \cdot M}{\frac{d}{h} \cdot \frac{d}{D \cdot M}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{D} \cdot \left(\frac{c0}{w} \cdot \frac{c0}{h}\right)}{w \cdot \frac{D}{d}}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy66.7%
Cost7753
\[\begin{array}{l} \mathbf{if}\;M \leq 3.8 \cdot 10^{-127} \lor \neg \left(M \leq 8.6 \cdot 10^{-101}\right):\\ \;\;\;\;\mathsf{fma}\left(-0.5, 0, 0.25 \cdot \left(\frac{h}{d} \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-d}{-D}}{D \cdot \frac{\frac{h \cdot \frac{w}{c0}}{\frac{c0}{w}}}{d}}\\ \end{array} \]
Alternative 2
Accuracy46.5%
Cost2960
\[\begin{array}{l} t_0 := \frac{c0}{w \cdot h}\\ t_1 := \frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ t_2 := h \cdot \left(w \cdot \left(D \cdot D\right)\right)\\ \mathbf{if}\;d \leq -8.8 \cdot 10^{+47}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-142}:\\ \;\;\;\;\frac{\frac{M \cdot M}{w}}{c0 \cdot \left(\frac{-d \cdot d}{t_2} - \frac{d \cdot d}{t_2}\right)} \cdot \frac{c0}{-2}\\ \mathbf{elif}\;d \leq 2.4 \cdot 10^{+54}:\\ \;\;\;\;\frac{\frac{d \cdot \left(\frac{\frac{d}{D}}{h} \cdot \left(-\frac{c0}{w}\right)\right)}{-D}}{\frac{w}{c0}}\\ \mathbf{elif}\;d \leq 2.6 \cdot 10^{+118}:\\ \;\;\;\;\left(-\frac{c0}{-2}\right) \cdot \frac{M \cdot M}{w \cdot \left(\frac{\frac{d}{w}}{h \cdot \frac{D}{\frac{c0}{\frac{D}{d}}}} + \frac{d \cdot d}{D \cdot D} \cdot t_0\right)}\\ \mathbf{elif}\;d \leq 8.8 \cdot 10^{+138}:\\ \;\;\;\;\frac{\left(d \cdot d\right) \cdot t_0}{\left(D \cdot D\right) \cdot \frac{w}{c0}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Accuracy46.2%
Cost2960
\[\begin{array}{l} t_0 := \frac{c0}{w \cdot h}\\ t_1 := \frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ t_2 := h \cdot \left(w \cdot \left(D \cdot D\right)\right)\\ \mathbf{if}\;d \leq -8.8 \cdot 10^{+48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-142}:\\ \;\;\;\;\frac{\frac{M \cdot M}{w}}{c0 \cdot \left(\frac{-d \cdot d}{t_2} - \frac{d \cdot d}{t_2}\right)} \cdot \frac{c0}{-2}\\ \mathbf{elif}\;d \leq 4.3 \cdot 10^{+54}:\\ \;\;\;\;\frac{\frac{d \cdot \left(\frac{\frac{d}{D}}{h} \cdot \left(-\frac{c0}{w}\right)\right)}{-D}}{\frac{w}{c0}}\\ \mathbf{elif}\;d \leq 3.7 \cdot 10^{+116}:\\ \;\;\;\;\frac{c0 \cdot \left(M \cdot \left(-M\right)\right)}{w \cdot \left(-2 \cdot \left(\frac{\frac{d}{w} \cdot \frac{c0 \cdot d}{D \cdot D}}{h} + \frac{d \cdot d}{D \cdot D} \cdot t_0\right)\right)}\\ \mathbf{elif}\;d \leq 8.8 \cdot 10^{+138}:\\ \;\;\;\;\frac{\left(d \cdot d\right) \cdot t_0}{\left(D \cdot D\right) \cdot \frac{w}{c0}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Accuracy48.0%
Cost2568
\[\begin{array}{l} t_0 := \frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ t_1 := h \cdot \left(w \cdot \left(D \cdot D\right)\right)\\ \mathbf{if}\;d \leq -4.2 \cdot 10^{+47}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-142}:\\ \;\;\;\;\frac{\frac{M \cdot M}{w}}{c0 \cdot \left(\frac{-d \cdot d}{t_1} - \frac{d \cdot d}{t_1}\right)} \cdot \frac{c0}{-2}\\ \mathbf{elif}\;d \leq 2.4 \cdot 10^{+54}:\\ \;\;\;\;\frac{\frac{d \cdot \left(\frac{\frac{d}{D}}{h} \cdot \left(-\frac{c0}{w}\right)\right)}{-D}}{\frac{w}{c0}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Accuracy49.3%
Cost2384
\[\begin{array}{l} t_0 := -0.5 \cdot \frac{\frac{M \cdot M}{w}}{-2 \cdot \frac{d \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}}\\ \mathbf{if}\;d \cdot d \leq 10^{-188}:\\ \;\;\;\;\frac{\frac{d \cdot \left(\frac{\frac{d}{D}}{h} \cdot \left(-\frac{c0}{w}\right)\right)}{-D}}{\frac{w}{c0}}\\ \mathbf{elif}\;d \cdot d \leq 10^{+21}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \cdot d \leq 5 \cdot 10^{+32}:\\ \;\;\;\;\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D \cdot \frac{w}{c0}}\\ \mathbf{elif}\;d \cdot d \leq 10^{+92}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ \end{array} \]
Alternative 6
Accuracy49.3%
Cost2384
\[\begin{array}{l} t_0 := -0.5 \cdot \frac{\frac{M \cdot M}{w}}{-2 \cdot \frac{d \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}}\\ \mathbf{if}\;d \cdot d \leq 10^{-188}:\\ \;\;\;\;\frac{\frac{d \cdot \left(\frac{\frac{d}{D}}{h} \cdot \left(-\frac{c0}{w}\right)\right)}{-D}}{\frac{w}{c0}}\\ \mathbf{elif}\;d \cdot d \leq 10^{+21}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \cdot d \leq 5 \cdot 10^{+32}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{d}{D}}{\frac{D}{d} \cdot \frac{w \cdot h}{c0}}\right)\\ \mathbf{elif}\;d \cdot d \leq 10^{+92}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ \end{array} \]
Alternative 7
Accuracy48.1%
Cost1864
\[\begin{array}{l} t_0 := \frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ \mathbf{if}\;d \leq -8.5 \cdot 10^{+48}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-142}:\\ \;\;\;\;\frac{c0}{-2} \cdot \frac{\frac{M}{\frac{w}{M}}}{c0 \cdot \left(-2 \cdot \frac{d \cdot d}{h \cdot \left(w \cdot \left(D \cdot D\right)\right)}\right)}\\ \mathbf{elif}\;d \leq 2.4 \cdot 10^{+54}:\\ \;\;\;\;\frac{\frac{d \cdot \left(\frac{\frac{d}{D}}{h} \cdot \left(-\frac{c0}{w}\right)\right)}{-D}}{\frac{w}{c0}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Accuracy46.0%
Cost1748
\[\begin{array}{l} t_0 := \frac{c0}{w} \cdot \left(\frac{\frac{d}{h \cdot D}}{D} \cdot \left(c0 \cdot \frac{d}{w}\right)\right)\\ t_1 := \frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ \mathbf{if}\;d \leq -3.5 \cdot 10^{-176}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq 4.5 \cdot 10^{-148}:\\ \;\;\;\;\frac{d \cdot \left(\frac{c0}{w} \cdot \frac{c0}{h}\right)}{\frac{D}{d} \cdot \left(w \cdot D\right)}\\ \mathbf{elif}\;d \leq 2.3 \cdot 10^{-35}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 3.9 \cdot 10^{+32}:\\ \;\;\;\;\frac{c0 \cdot d}{\frac{D}{d} \cdot \left(D \cdot \left(h \cdot \frac{w \cdot w}{c0}\right)\right)}\\ \mathbf{elif}\;d \leq 2.4 \cdot 10^{+54}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Accuracy46.6%
Cost1748
\[\begin{array}{l} t_0 := \frac{c0}{w} \cdot \left(\frac{\frac{d}{h \cdot D}}{D} \cdot \left(c0 \cdot \frac{d}{w}\right)\right)\\ t_1 := \frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ \mathbf{if}\;d \leq -7.5 \cdot 10^{-170}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq 2.1 \cdot 10^{-95}:\\ \;\;\;\;\frac{\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)}{\frac{w}{c0}}\\ \mathbf{elif}\;d \leq 3.5 \cdot 10^{-35}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 3.8 \cdot 10^{+32}:\\ \;\;\;\;\frac{c0 \cdot d}{\frac{D}{d} \cdot \left(D \cdot \left(h \cdot \frac{w \cdot w}{c0}\right)\right)}\\ \mathbf{elif}\;d \leq 2.4 \cdot 10^{+54}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Accuracy45.5%
Cost1485
\[\begin{array}{l} \mathbf{if}\;D \leq -60000000:\\ \;\;\;\;\frac{\frac{-d}{-D}}{D \cdot \frac{\frac{h \cdot \frac{w}{c0}}{\frac{c0}{w}}}{d}}\\ \mathbf{elif}\;D \leq 3.8 \cdot 10^{-94} \lor \neg \left(D \leq 4.2 \cdot 10^{-12}\right):\\ \;\;\;\;\frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0 \cdot \left(d \cdot \left(c0 \cdot d\right)\right)}{D \cdot D}}{w \cdot \left(w \cdot h\right)}\\ \end{array} \]
Alternative 11
Accuracy47.8%
Cost1481
\[\begin{array}{l} \mathbf{if}\;d \leq -1.75 \cdot 10^{-142} \lor \neg \left(d \leq 2.4 \cdot 10^{+54}\right):\\ \;\;\;\;\frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d \cdot \left(\frac{\frac{d}{D}}{h} \cdot \left(-\frac{c0}{w}\right)\right)}{-D}}{\frac{w}{c0}}\\ \end{array} \]
Alternative 12
Accuracy48.5%
Cost1353
\[\begin{array}{l} \mathbf{if}\;D \leq 10^{-71} \lor \neg \left(D \leq 4.2 \cdot 10^{-12}\right):\\ \;\;\;\;\frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{d \cdot \left(c0 \cdot \frac{d}{w}\right)}{\left(h \cdot D\right) \cdot \left(w \cdot D\right)}\\ \end{array} \]
Alternative 13
Accuracy46.8%
Cost1353
\[\begin{array}{l} \mathbf{if}\;d \leq -5 \cdot 10^{-177} \lor \neg \left(d \leq 2.4 \cdot 10^{+54}\right):\\ \;\;\;\;\frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0}{w} \cdot \frac{c0}{h}}{\frac{D}{d} \cdot \left(w \cdot \frac{D}{d}\right)}\\ \end{array} \]
Alternative 14
Accuracy47.4%
Cost1353
\[\begin{array}{l} \mathbf{if}\;D \leq 3.8 \cdot 10^{-94} \lor \neg \left(D \leq 4.2 \cdot 10^{-12}\right):\\ \;\;\;\;\frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0 \cdot \left(d \cdot \left(c0 \cdot d\right)\right)}{D \cdot D}}{w \cdot \left(w \cdot h\right)}\\ \end{array} \]
Alternative 15
Accuracy49.9%
Cost576
\[\frac{c0 \cdot 0}{w} \cdot \frac{c0}{-2} \]

Error

Reproduce?

herbie shell --seed 2023141 
(FPCore (c0 w h D d M)
  :name "Henrywood and Agarwal, Equation (13)"
  :precision binary64
  (* (/ c0 (* 2.0 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))