?

Average Error: 59.5 → 30.4
Time: 23.6s
Precision: binary64
Cost: 19396

?

\[\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{d \cdot \left(d \cdot c0\right)}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\\ 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 5 \cdot 10^{+228}:\\ \;\;\;\;t_1 \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \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 (* d c0)) (* D (* D (* w h)))))
        (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))))) 5e+228)
     (* t_1 (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
     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 * (d * c0)) / (D * (D * (w * h)));
	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))))) <= 5e+228) {
		tmp = t_1 * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
	} else {
		tmp = 0.0;
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = (c0 / (2.0d0 * w)) * (((c0 * (d_1 * d_1)) / ((w * h) * (d * d))) + sqrt(((((c0 * (d_1 * d_1)) / ((w * h) * (d * d))) * ((c0 * (d_1 * d_1)) / ((w * h) * (d * d)))) - (m * m))))
end function
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (d_1 * (d_1 * c0)) / (d * (d * (w * h)))
    t_1 = c0 / (2.0d0 * w)
    t_2 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
    if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (m * m))))) <= 5d+228) then
        tmp = t_1 * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
    else
        tmp = 0.0d0
    end if
    code = tmp
end function
public static 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))) + Math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (d * (d * c0)) / (D * (D * (w * h)));
	double t_1 = c0 / (2.0 * w);
	double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if ((t_1 * (t_2 + Math.sqrt(((t_2 * t_2) - (M * M))))) <= 5e+228) {
		tmp = t_1 * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))))
def code(c0, w, h, D, d, M):
	t_0 = (d * (d * c0)) / (D * (D * (w * h)))
	t_1 = c0 / (2.0 * w)
	t_2 = (c0 * (d * d)) / ((w * h) * (D * D))
	tmp = 0
	if (t_1 * (t_2 + math.sqrt(((t_2 * t_2) - (M * M))))) <= 5e+228:
		tmp = t_1 * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
	else:
		tmp = 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(Float64(d * Float64(d * c0)) / Float64(D * Float64(D * Float64(w * h))))
	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))))) <= 5e+228)
		tmp = Float64(t_1 * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M)))));
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp = code(c0, w, h, D, d, M)
	tmp = (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))));
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (d * (d * c0)) / (D * (D * (w * h)));
	t_1 = c0 / (2.0 * w);
	t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
	tmp = 0.0;
	if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= 5e+228)
		tmp = t_1 * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
	else
		tmp = 0.0;
	end
	tmp_2 = 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[(d * N[(d * c0), $MachinePrecision]), $MachinePrecision] / N[(D * N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $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], 5e+228], N[(t$95$1 * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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)
\begin{array}{l}
t_0 := \frac{d \cdot \left(d \cdot c0\right)}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\\
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 5 \cdot 10^{+228}:\\
\;\;\;\;t_1 \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)\\

\mathbf{else}:\\
\;\;\;\;0\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

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))))) < 5e228

    1. Initial program 33.9

      \[\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. Applied egg-rr32.8

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

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

      [Start]32.8

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

      rational_best_oopsla_all_46_json_45_simplify-81 [=>]32.8

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

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]32.8

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

      rational_best_oopsla_all_46_json_45_simplify-7 [=>]35.1

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

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]35.1

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

    if 5e228 < (*.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 63.8

      \[\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. Simplified62.2

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

      [Start]63.8

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

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]63.8

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

      metadata-eval [<=]63.8

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

      metadata-eval [<=]63.8

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

      metadata-eval [<=]63.8

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

      rational_best_oopsla_all_46_json_45_simplify-23 [<=]63.8

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

      rational_best_oopsla_all_46_json_45_simplify-74 [<=]63.8

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

      metadata-eval [=>]63.8

      \[ \frac{c0}{w \cdot \color{blue}{1} + w \cdot \frac{2}{2}} \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) \]

      rational_best_oopsla_all_46_json_45_simplify-52 [=>]63.8

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

      metadata-eval [=>]63.8

      \[ \frac{c0}{w + w \cdot \color{blue}{1}} \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) \]

      rational_best_oopsla_all_46_json_45_simplify-52 [=>]63.8

      \[ \frac{c0}{w + \color{blue}{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) \]

      rational_best_oopsla_all_46_json_45_simplify-7 [=>]63.8

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

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]63.8

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

      rational_best_oopsla_all_46_json_45_simplify-7 [=>]63.8

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

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]63.8

      \[ \frac{c0}{w + w} \cdot \left(\frac{d \cdot \left(c0 \cdot d\right)}{w \cdot \color{blue}{\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) \]
    3. Taylor expanded in c0 around -inf 62.7

      \[\leadsto \frac{c0}{w + w} \cdot \color{blue}{\left(-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. Simplified62.7

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

      [Start]62.7

      \[ \frac{c0}{w + w} \cdot \left(-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) \]

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]62.7

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

      rational_best_oopsla_all_46_json_45_simplify-92 [=>]62.7

      \[ \frac{c0}{w + w} \cdot \color{blue}{\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)} \]

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]62.7

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

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]62.7

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

      rational_best_oopsla_all_46_json_45_simplify-92 [=>]62.7

      \[ \frac{c0}{w + w} \cdot \left(-c0 \cdot \left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + \color{blue}{\left(-\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right)\right) \]
    5. Taylor expanded in d around 0 35.2

      \[\leadsto \frac{c0}{w + w} \cdot \left(-c0 \cdot \color{blue}{0}\right) \]
    6. Taylor expanded in c0 around 0 30.3

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.4

    \[\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 5 \cdot 10^{+228}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{d \cdot \left(d \cdot c0\right)}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \sqrt{\frac{d \cdot \left(d \cdot c0\right)}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} \cdot \frac{d \cdot \left(d \cdot c0\right)}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} - M \cdot M}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]

Alternatives

Alternative 1
Error30.8
Cost19396
\[\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 5 \cdot 10^{+228}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 2
Error32.3
Cost64
\[0 \]

Error

Reproduce?

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