?

Average Accuracy: 24.8% → 59.8%
Time: 39.4s
Precision: binary64
Cost: 17860

?

\[\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 := d \cdot \frac{c0}{D}\\ t_1 := \frac{c0}{2 \cdot w}\\ t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \mathbf{if}\;t_1 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right) \leq \infty:\\ \;\;\;\;\frac{t_0}{w \cdot h} \cdot \frac{t_0}{w}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \mathsf{fma}\left(0.5, \frac{\frac{D}{d} \cdot \frac{h}{\frac{\frac{d}{D}}{w \cdot \left(M \cdot M\right)}}}{c0}, c0 \cdot 0\right)\\ \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 (* d (/ c0 D)))
        (t_1 (/ c0 (* 2.0 w)))
        (t_2 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (if (<= (* t_1 (+ t_2 (sqrt (- (* t_2 t_2) (* M M))))) INFINITY)
     (* (/ t_0 (* w h)) (/ t_0 w))
     (*
      t_1
      (fma
       0.5
       (/ (* (/ D d) (/ h (/ (/ d D) (* w (* M M))))) c0)
       (* c0 0.0))))))
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 = d * (c0 / D);
	double t_1 = c0 / (2.0 * w);
	double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= ((double) INFINITY)) {
		tmp = (t_0 / (w * h)) * (t_0 / w);
	} else {
		tmp = t_1 * fma(0.5, (((D / d) * (h / ((d / D) / (w * (M * M))))) / c0), (c0 * 0.0));
	}
	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(d * Float64(c0 / D))
	t_1 = Float64(c0 / Float64(2.0 * w))
	t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	tmp = 0.0
	if (Float64(t_1 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M))))) <= Inf)
		tmp = Float64(Float64(t_0 / Float64(w * h)) * Float64(t_0 / w));
	else
		tmp = Float64(t_1 * fma(0.5, Float64(Float64(Float64(D / d) * Float64(h / Float64(Float64(d / D) / Float64(w * Float64(M * M))))) / c0), Float64(c0 * 0.0)));
	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[(d * N[(c0 / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(t$95$0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / w), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(0.5 * N[(N[(N[(D / d), $MachinePrecision] * N[(h / N[(N[(d / D), $MachinePrecision] / N[(w * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision] + N[(c0 * 0.0), $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 := d \cdot \frac{c0}{D}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t_1 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;\frac{t_0}{w \cdot h} \cdot \frac{t_0}{w}\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \mathsf{fma}\left(0.5, \frac{\frac{D}{d} \cdot \frac{h}{\frac{\frac{d}{D}}{w \cdot \left(M \cdot M\right)}}}{c0}, c0 \cdot 0\right)\\


\end{array}

Error?

Bogosity?

Bogosity

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))))) < +inf.0

    1. Initial program 78.0%

      \[\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. Simplified74.9%

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

      [Start]78.0

      \[ \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) \]

      associate-*l* [=>]74.9

      \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\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) \]

      difference-of-squares [=>]74.9

      \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]

      associate-*l* [=>]74.9

      \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}\right) \]

      associate-*l* [=>]74.9

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

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

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

      [Start]63.2

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

      times-frac [=>]61.0

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

      unpow2 [=>]61.0

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

      unpow2 [=>]61.0

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

      times-frac [=>]63.5

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

      unpow2 [=>]63.5

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

      *-commutative [=>]63.5

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

      unpow2 [=>]63.5

      \[ \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \color{blue}{\left(w \cdot w\right)}} \]
    5. Taylor expanded in d around 0 63.2%

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

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

      [Start]63.2

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

      unpow2 [=>]63.2

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

      unpow2 [=>]63.2

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

      unpow2 [=>]63.2

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

      times-frac [=>]61.0

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

      times-frac [=>]63.5

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

      unpow2 [<=]63.5

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

      unpow2 [=>]63.5

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

      *-commutative [=>]63.5

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

      associate-*r/ [=>]62.0

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

      unpow2 [=>]62.0

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

      swap-sqr [<=]73.9

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

      unpow2 [<=]73.9

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

      associate-*l/ [=>]75.8

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

      associate-/l* [=>]75.8

      \[ \frac{{\color{blue}{\left(\frac{d}{\frac{D}{c0}}\right)}}^{2}}{h \cdot \left(w \cdot w\right)} \]
    7. Applied egg-rr89.3%

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

      [Start]75.8

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

      unpow2 [=>]75.8

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

      associate-*r* [=>]79.8

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

      times-frac [=>]90.6

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

      div-inv [=>]89.3

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

      clear-num [<=]89.3

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

      div-inv [=>]89.3

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

      clear-num [<=]89.3

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

    if +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 0.0%

      \[\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. Simplified2.7%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(h \cdot D\right) \cdot \left(w \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{\frac{c0}{h}}{w}, {\left(\frac{d}{D}\right)}^{4} \cdot \frac{\frac{c0}{h}}{w}, M \cdot \left(-M\right)\right)}\right)} \]
      Proof

      [Start]0.0

      \[ \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) \]

      associate-*l/ [<=]0.0

      \[ \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\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) \]

      *-commutative [=>]0.0

      \[ \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(d \cdot d\right) \cdot \frac{c0}{\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) \]

      fma-def [=>]0.0

      \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(d \cdot d, \frac{c0}{\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)} \]

      associate-*l* [=>]0.0

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\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) \]

      *-commutative [=>]0.0

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\color{blue}{\left(h \cdot \left(D \cdot D\right)\right) \cdot w}}, \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) \]

      associate-*r* [=>]0.0

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\color{blue}{\left(\left(h \cdot D\right) \cdot D\right)} \cdot w}, \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) \]

      associate-*l* [=>]0.0

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\color{blue}{\left(h \cdot D\right) \cdot \left(D \cdot w\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) \]

      *-commutative [<=]0.0

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(h \cdot D\right) \cdot \color{blue}{\left(w \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) \]
    3. Taylor expanded in c0 around -inf 0.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \left(\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\right)\right)} \]
    4. Simplified35.5%

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

      [Start]0.6

      \[ \frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \left(\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\right)\right) \]

      fma-def [=>]0.6

      \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0}, -1 \cdot \left(\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\right)\right)} \]
    5. Applied egg-rr43.6%

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

      [Start]35.5

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{\left(w \cdot h\right) \cdot \left(M \cdot M\right)}{{\left(\frac{d}{D}\right)}^{2}}}{c0}, c0 \cdot 0\right) \]

      *-un-lft-identity [=>]35.5

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{\color{blue}{1 \cdot \left(\left(w \cdot h\right) \cdot \left(M \cdot M\right)\right)}}{{\left(\frac{d}{D}\right)}^{2}}}{c0}, c0 \cdot 0\right) \]

      unpow2 [=>]35.5

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

      times-frac [=>]39.0

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

      clear-num [<=]39.0

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

      *-commutative [=>]39.0

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

      associate-*l* [=>]43.6

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{D}{d} \cdot \frac{\color{blue}{h \cdot \left(w \cdot \left(M \cdot M\right)\right)}}{\frac{d}{D}}}{c0}, c0 \cdot 0\right) \]
    6. Simplified48.1%

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

      [Start]43.6

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{D}{d} \cdot \frac{h \cdot \left(w \cdot \left(M \cdot M\right)\right)}{\frac{d}{D}}}{c0}, c0 \cdot 0\right) \]

      associate-/l* [=>]48.1

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{D}{d} \cdot \color{blue}{\frac{h}{\frac{\frac{d}{D}}{w \cdot \left(M \cdot M\right)}}}}{c0}, c0 \cdot 0\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.2%

    \[\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 \infty:\\ \;\;\;\;\frac{d \cdot \frac{c0}{D}}{w \cdot h} \cdot \frac{d \cdot \frac{c0}{D}}{w}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{D}{d} \cdot \frac{h}{\frac{\frac{d}{D}}{w \cdot \left(M \cdot M\right)}}}{c0}, c0 \cdot 0\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy48.1%
Cost8656
\[\begin{array}{l} t_0 := d \cdot \frac{c0}{D}\\ t_1 := \frac{t_0}{w \cdot h} \cdot \frac{t_0}{w}\\ \mathbf{if}\;h \leq -1.05 \cdot 10^{-207}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;h \leq -8.6 \cdot 10^{-266}:\\ \;\;\;\;0\\ \mathbf{elif}\;h \leq -7.2 \cdot 10^{-301}:\\ \;\;\;\;\frac{-{\left(\frac{d}{\frac{D}{c0}}\right)}^{2}}{w \cdot \left(w \cdot \left(-h\right)\right)}\\ \mathbf{elif}\;h \leq 1.06 \cdot 10^{-275}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\left(w \cdot h\right) \cdot \frac{M}{\frac{c0}{M}}\right), c0 \cdot 0\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Accuracy48.4%
Cost7692
\[\begin{array}{l} t_0 := d \cdot \frac{c0}{D}\\ t_1 := \frac{t_0}{w \cdot h} \cdot \frac{t_0}{w}\\ \mathbf{if}\;h \leq -4.5 \cdot 10^{-207}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;h \leq -8.6 \cdot 10^{-266}:\\ \;\;\;\;0\\ \mathbf{elif}\;h \leq -5.5 \cdot 10^{-306}:\\ \;\;\;\;\frac{-{\left(\frac{d}{\frac{D}{c0}}\right)}^{2}}{w \cdot \left(w \cdot \left(-h\right)\right)}\\ \mathbf{elif}\;h \leq 3.2 \cdot 10^{-260}:\\ \;\;\;\;\frac{0.25 \cdot \left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Accuracy45.6%
Cost1881
\[\begin{array}{l} t_0 := \left(c0 \cdot \frac{d}{w \cdot h}\right) \cdot \frac{\frac{d}{D} \cdot \frac{c0}{w}}{D}\\ t_1 := 0.25 \cdot \frac{\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d \cdot d}\\ \mathbf{if}\;M \leq -3.1 \cdot 10^{+47}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;M \leq -1.9 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;M \leq -2.8 \cdot 10^{-262}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;M \leq -1.36 \cdot 10^{-290}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 2.55 \cdot 10^{-20} \lor \neg \left(M \leq 5.2 \cdot 10^{+20}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Accuracy48.5%
Cost1617
\[\begin{array}{l} t_0 := d \cdot \frac{c0}{D}\\ t_1 := \frac{t_0}{w \cdot h} \cdot \frac{t_0}{w}\\ \mathbf{if}\;h \leq -3.8 \cdot 10^{-207}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;h \leq -9 \cdot 10^{-266}:\\ \;\;\;\;0\\ \mathbf{elif}\;h \leq -1 \cdot 10^{-307} \lor \neg \left(h \leq 1.85 \cdot 10^{-259}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25 \cdot \left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot d}\\ \end{array} \]
Alternative 5
Accuracy42.5%
Cost1616
\[\begin{array}{l} t_0 := \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \left(\frac{c0}{w} \cdot \frac{c0}{w \cdot h}\right)\\ \mathbf{if}\;d \leq -1.2 \cdot 10^{+231}:\\ \;\;\;\;0\\ \mathbf{elif}\;d \leq 3.5 \cdot 10^{+75}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 1.85 \cdot 10^{+139}:\\ \;\;\;\;\frac{0.25 \cdot \left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot d}\\ \mathbf{elif}\;d \leq 7.2 \cdot 10^{+247}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 6
Accuracy42.4%
Cost1616
\[\begin{array}{l} t_0 := \frac{d}{D} \cdot \frac{d}{D}\\ \mathbf{if}\;d \leq -2.4 \cdot 10^{+231}:\\ \;\;\;\;0\\ \mathbf{elif}\;d \leq 1.2 \cdot 10^{+75}:\\ \;\;\;\;t_0 \cdot \left(\frac{c0}{w} \cdot \frac{c0}{w \cdot h}\right)\\ \mathbf{elif}\;d \leq 2 \cdot 10^{+139}:\\ \;\;\;\;\frac{0.25 \cdot \left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot d}\\ \mathbf{elif}\;d \leq 3.8 \cdot 10^{+247}:\\ \;\;\;\;t_0 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{c0}{h}}{w}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 7
Accuracy43.6%
Cost1616
\[\begin{array}{l} t_0 := \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\frac{c0}{w}}{\frac{h}{\frac{c0}{w}}}\\ \mathbf{if}\;d \leq -1.52 \cdot 10^{+231}:\\ \;\;\;\;0\\ \mathbf{elif}\;d \leq 4.5 \cdot 10^{+75}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 9.5 \cdot 10^{+138}:\\ \;\;\;\;\frac{0.25 \cdot \left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot d}\\ \mathbf{elif}\;d \leq 1.16 \cdot 10^{+247}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 8
Accuracy45.4%
Cost1616
\[\begin{array}{l} \mathbf{if}\;d \leq -1.28 \cdot 10^{+231}:\\ \;\;\;\;0\\ \mathbf{elif}\;d \leq 2.85 \cdot 10^{+79}:\\ \;\;\;\;\left(c0 \cdot \frac{d}{w \cdot h}\right) \cdot \frac{\frac{d}{D} \cdot \frac{c0}{w}}{D}\\ \mathbf{elif}\;d \leq 8.5 \cdot 10^{+138}:\\ \;\;\;\;\frac{0.25 \cdot \left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot d}\\ \mathbf{elif}\;d \leq 6.6 \cdot 10^{+246}:\\ \;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{h} \cdot \frac{\frac{c0}{w \cdot D}}{\frac{D}{d}}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 9
Accuracy36.7%
Cost1357
\[\begin{array}{l} \mathbf{if}\;D \leq -6.2 \cdot 10^{-126} \lor \neg \left(D \leq 1.12 \cdot 10^{-127}\right) \land D \leq 1.8 \cdot 10^{+70}:\\ \;\;\;\;0.25 \cdot \frac{\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 10
Accuracy41.3%
Cost1220
\[\begin{array}{l} \mathbf{if}\;d \cdot d \leq 1.75 \cdot 10^{+308}:\\ \;\;\;\;\frac{0.25 \cdot \left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 11
Accuracy33.9%
Cost64
\[0 \]

Error

Reproduce?

herbie shell --seed 2023160 
(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))))))