Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.8% → 54.7%
Time: 27.4s
Alternatives: 7
Speedup: 21.6×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* 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));
	return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
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
    t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
    code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M):
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
	return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M)))))
end
function tmp = code(c0, w, h, D, d, M)
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
end
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]}, 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]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 7 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 24.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* 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));
	return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
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
    t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
    code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M):
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
	return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M)))))
end
function tmp = code(c0, w, h, D, d, M)
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
end
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]}, 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]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}

Alternative 1: 54.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := c0 \cdot \left(d \cdot d\right)\\ t_2 := \frac{t_1}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_3 := \frac{t_1}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\\ \mathbf{if}\;t_0 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right) \leq \infty:\\ \;\;\;\;t_0 \cdot \left(t_3 + \sqrt{\left(M + t_3\right) \cdot \left(t_3 - M\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w)))
        (t_1 (* c0 (* d d)))
        (t_2 (/ t_1 (* (* w h) (* D D))))
        (t_3 (/ t_1 (* w (* h (* D D))))))
   (if (<= (* t_0 (+ t_2 (sqrt (- (* t_2 t_2) (* M M))))) INFINITY)
     (* t_0 (+ t_3 (sqrt (* (+ M t_3) (- t_3 M)))))
     (* -0.5 (/ (cbrt 0.0) w)))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = c0 * (d * d);
	double t_2 = t_1 / ((w * h) * (D * D));
	double t_3 = t_1 / (w * (h * (D * D)));
	double tmp;
	if ((t_0 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= ((double) INFINITY)) {
		tmp = t_0 * (t_3 + sqrt(((M + t_3) * (t_3 - M))));
	} else {
		tmp = -0.5 * (cbrt(0.0) / w);
	}
	return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = c0 * (d * d);
	double t_2 = t_1 / ((w * h) * (D * D));
	double t_3 = t_1 / (w * (h * (D * D)));
	double tmp;
	if ((t_0 * (t_2 + Math.sqrt(((t_2 * t_2) - (M * M))))) <= Double.POSITIVE_INFINITY) {
		tmp = t_0 * (t_3 + Math.sqrt(((M + t_3) * (t_3 - M))));
	} else {
		tmp = -0.5 * (Math.cbrt(0.0) / w);
	}
	return tmp;
}
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(c0 * Float64(d * d))
	t_2 = Float64(t_1 / Float64(Float64(w * h) * Float64(D * D)))
	t_3 = Float64(t_1 / Float64(w * Float64(h * Float64(D * D))))
	tmp = 0.0
	if (Float64(t_0 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M))))) <= Inf)
		tmp = Float64(t_0 * Float64(t_3 + sqrt(Float64(Float64(M + t_3) * Float64(t_3 - M)))));
	else
		tmp = Float64(-0.5 * Float64(cbrt(0.0) / w));
	end
	return tmp
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(w * N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * 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[(t$95$0 * N[(t$95$3 + N[Sqrt[N[(N[(M + t$95$3), $MachinePrecision] * N[(t$95$3 - M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[Power[0.0, 1/3], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := c0 \cdot \left(d \cdot d\right)\\
t_2 := \frac{t_1}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_3 := \frac{t_1}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\\
\mathbf{if}\;t_0 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;t_0 \cdot \left(t_3 + \sqrt{\left(M + t_3\right) \cdot \left(t_3 - M\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\


\end{array}
\end{array}
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.5%

      \[\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. Step-by-step derivation
      1. associate-*l*75.8%

        \[\leadsto \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) \]
      2. difference-of-squares75.8%

        \[\leadsto \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) \]
      3. associate-*l*77.1%

        \[\leadsto \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) \]
      4. associate-*l*78.5%

        \[\leadsto \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. Simplified78.5%

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

    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. Step-by-step derivation
      1. associate-*l*0.0%

        \[\leadsto \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) \]
      2. difference-of-squares10.4%

        \[\leadsto \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) \]
      3. associate-*l*10.4%

        \[\leadsto \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) \]
      4. associate-*l*11.5%

        \[\leadsto \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. Simplified11.5%

      \[\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)} \]
    4. Taylor expanded in c0 around -inf 0.1%

      \[\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}} \]
    5. Taylor expanded in w around 0 1.8%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{\frac{{d}^{2}}{{D}^{2} \cdot h} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}{w}} \cdot {c0}^{2}}{w} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in1.8%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}}{w} \cdot {c0}^{2}}{w} \]
      2. metadata-eval1.8%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}{w} \cdot {c0}^{2}}{w} \]
      3. mul0-lft34.9%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{0}}{w} \cdot {c0}^{2}}{w} \]
    7. Simplified34.9%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{0}{w}} \cdot {c0}^{2}}{w} \]
    8. Step-by-step derivation
      1. add-cbrt-cube34.9%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{\left(\left(\frac{0}{w} \cdot {c0}^{2}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}}{w} \]
      2. pow234.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      3. div034.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      4. *-commutative34.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)} \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      5. pow234.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      6. div034.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      7. *-commutative34.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      8. pow234.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right)}}{w} \]
      9. div034.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right)}}{w} \]
      10. *-commutative34.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)}}}{w} \]
    9. Applied egg-rr34.9%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}}{w} \]
    10. Step-by-step derivation
      1. unpow234.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\color{blue}{{c0}^{2}} \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      2. mul0-rgt34.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\color{blue}{0} \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      3. unpow234.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(0 \cdot \left(\color{blue}{{c0}^{2}} \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      4. mul0-rgt34.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(0 \cdot \color{blue}{0}\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      5. metadata-eval34.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\color{blue}{0} \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      6. unpow234.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{0 \cdot \left(\color{blue}{{c0}^{2}} \cdot 0\right)}}{w} \]
      7. mul0-rgt44.8%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{0 \cdot \color{blue}{0}}}{w} \]
      8. metadata-eval44.8%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\color{blue}{0}}}{w} \]
    11. Simplified44.8%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{0}}}{w} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.3%

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

Alternative 2: 43.0% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := {\left(\frac{d}{D}\right)}^{2}\\ t_2 := \left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{t_1}{h}\\ \mathbf{if}\;c0 \leq -2.8 \cdot 10^{-90}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c0 \leq 180:\\ \;\;\;\;t_0 \cdot 0\\ \mathbf{elif}\;c0 \leq 3.9 \cdot 10^{+93}:\\ \;\;\;\;t_0 \cdot \left(t_1 \cdot \left(2 \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\ \mathbf{elif}\;c0 \leq 4.5 \cdot 10^{+217}:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w)))
        (t_1 (pow (/ d D) 2.0))
        (t_2 (* (* (/ c0 w) (/ c0 w)) (/ t_1 h))))
   (if (<= c0 -2.8e-90)
     t_2
     (if (<= c0 180.0)
       (* t_0 0.0)
       (if (<= c0 3.9e+93)
         (* t_0 (* t_1 (* 2.0 (/ (/ c0 w) h))))
         (if (<= c0 4.5e+217) (* -0.5 (/ (cbrt 0.0) w)) t_2))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = pow((d / D), 2.0);
	double t_2 = ((c0 / w) * (c0 / w)) * (t_1 / h);
	double tmp;
	if (c0 <= -2.8e-90) {
		tmp = t_2;
	} else if (c0 <= 180.0) {
		tmp = t_0 * 0.0;
	} else if (c0 <= 3.9e+93) {
		tmp = t_0 * (t_1 * (2.0 * ((c0 / w) / h)));
	} else if (c0 <= 4.5e+217) {
		tmp = -0.5 * (cbrt(0.0) / w);
	} else {
		tmp = t_2;
	}
	return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = Math.pow((d / D), 2.0);
	double t_2 = ((c0 / w) * (c0 / w)) * (t_1 / h);
	double tmp;
	if (c0 <= -2.8e-90) {
		tmp = t_2;
	} else if (c0 <= 180.0) {
		tmp = t_0 * 0.0;
	} else if (c0 <= 3.9e+93) {
		tmp = t_0 * (t_1 * (2.0 * ((c0 / w) / h)));
	} else if (c0 <= 4.5e+217) {
		tmp = -0.5 * (Math.cbrt(0.0) / w);
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(d / D) ^ 2.0
	t_2 = Float64(Float64(Float64(c0 / w) * Float64(c0 / w)) * Float64(t_1 / h))
	tmp = 0.0
	if (c0 <= -2.8e-90)
		tmp = t_2;
	elseif (c0 <= 180.0)
		tmp = Float64(t_0 * 0.0);
	elseif (c0 <= 3.9e+93)
		tmp = Float64(t_0 * Float64(t_1 * Float64(2.0 * Float64(Float64(c0 / w) / h))));
	elseif (c0 <= 4.5e+217)
		tmp = Float64(-0.5 * Float64(cbrt(0.0) / w));
	else
		tmp = t_2;
	end
	return tmp
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(c0 / w), $MachinePrecision] * N[(c0 / w), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -2.8e-90], t$95$2, If[LessEqual[c0, 180.0], N[(t$95$0 * 0.0), $MachinePrecision], If[LessEqual[c0, 3.9e+93], N[(t$95$0 * N[(t$95$1 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 4.5e+217], N[(-0.5 * N[(N[Power[0.0, 1/3], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := {\left(\frac{d}{D}\right)}^{2}\\
t_2 := \left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{t_1}{h}\\
\mathbf{if}\;c0 \leq -2.8 \cdot 10^{-90}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c0 \leq 180:\\
\;\;\;\;t_0 \cdot 0\\

\mathbf{elif}\;c0 \leq 3.9 \cdot 10^{+93}:\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot \left(2 \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\

\mathbf{elif}\;c0 \leq 4.5 \cdot 10^{+217}:\\
\;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c0 < -2.7999999999999999e-90 or 4.49999999999999988e217 < c0

    1. Initial program 24.5%

      \[\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. Step-by-step derivation
      1. associate-*l*23.7%

        \[\leadsto \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) \]
      2. difference-of-squares32.9%

        \[\leadsto \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) \]
      3. associate-*l*32.9%

        \[\leadsto \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) \]
      4. associate-*l*35.5%

        \[\leadsto \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. Simplified35.5%

      \[\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)} \]
    4. Taylor expanded in c0 around inf 31.1%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    5. Step-by-step derivation
      1. times-frac30.2%

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

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow230.2%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. unpow230.2%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h} \]
      5. *-commutative30.2%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{\color{blue}{h \cdot {w}^{2}}} \]
      6. unpow230.2%

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

      \[\leadsto \color{blue}{\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}} \]
    7. Step-by-step derivation
      1. times-frac41.3%

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

      \[\leadsto \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
    9. Step-by-step derivation
      1. pow241.3%

        \[\leadsto \color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
      2. associate-*r/41.4%

        \[\leadsto \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}} \]
    10. Applied egg-rr41.4%

      \[\leadsto \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}} \]
    11. Step-by-step derivation
      1. unpow241.4%

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

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

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

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

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

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

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

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

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

    if -2.7999999999999999e-90 < c0 < 180

    1. Initial program 17.3%

      \[\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. Step-by-step derivation
      1. times-frac13.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \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. fma-def13.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \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. associate-/r*13.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \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) \]
      4. difference-of-squares16.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \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) \]
    3. Simplified18.8%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r/18.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D}}{D}} - M\right)}\right) \]
      2. associate-/l*17.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d}{\frac{D}{d}}}}{D} - M\right)}\right) \]
      3. div-inv17.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\left(d \cdot \frac{1}{\frac{D}{d}}\right)}}{D} - M\right)}\right) \]
      4. clear-num17.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \color{blue}{\frac{d}{D}}\right)}{D} - M\right)}\right) \]
    5. Applied egg-rr17.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D}} - M\right)}\right) \]
    6. Step-by-step derivation
      1. fma-udef17.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right)} \]
      2. associate-/r*17.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D \cdot D}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      3. times-frac17.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      4. unpow217.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      5. associate-/r*17.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d \cdot d}{D \cdot D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      6. times-frac20.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d}{D} \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      7. unpow220.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{{\left(\frac{d}{D}\right)}^{2}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      8. associate-*r/19.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D}}}{D} - M\right)}\right) \]
      9. associate-/l*19.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h}}{\frac{D}{\frac{d \cdot d}{D}}}} - M\right)}\right) \]
      10. associate-*r/20.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{\color{blue}{d \cdot \frac{d}{D}}}} - M\right)}\right) \]
    7. Applied egg-rr20.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{d \cdot \frac{d}{D}}} - M\right)}\right)} \]
    8. Taylor expanded in c0 around -inf 8.6%

      \[\leadsto \frac{c0}{2 \cdot 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)} \]
    9. Step-by-step derivation
      1. *-commutative8.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \color{blue}{\left(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)}\right) \]
      2. distribute-rgt1-in8.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right)\right) \]
      3. metadata-eval8.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)\right) \]
      4. mul0-lft54.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \color{blue}{0}\right)\right) \]
      5. mul0-rgt54.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \color{blue}{0}\right) \]
      6. metadata-eval54.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    10. Simplified54.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]

    if 180 < c0 < 3.9000000000000002e93

    1. Initial program 26.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. Step-by-step derivation
      1. times-frac26.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \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. fma-def26.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \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. associate-/r*26.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \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) \]
      4. difference-of-squares41.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \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) \]
    3. Simplified41.1%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r/41.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D}}{D}} - M\right)}\right) \]
      2. associate-/l*41.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d}{\frac{D}{d}}}}{D} - M\right)}\right) \]
      3. div-inv41.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\left(d \cdot \frac{1}{\frac{D}{d}}\right)}}{D} - M\right)}\right) \]
      4. clear-num41.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \color{blue}{\frac{d}{D}}\right)}{D} - M\right)}\right) \]
    5. Applied egg-rr41.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D}} - M\right)}\right) \]
    6. Step-by-step derivation
      1. fma-udef41.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right)} \]
      2. associate-/r*41.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D \cdot D}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      3. times-frac41.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      4. unpow241.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      5. associate-/r*41.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d \cdot d}{D \cdot D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      6. times-frac48.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d}{D} \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      7. unpow248.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{{\left(\frac{d}{D}\right)}^{2}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      8. associate-*r/45.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D}}}{D} - M\right)}\right) \]
      9. associate-/l*45.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h}}{\frac{D}{\frac{d \cdot d}{D}}}} - M\right)}\right) \]
      10. associate-*r/48.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{\color{blue}{d \cdot \frac{d}{D}}}} - M\right)}\right) \]
    7. Applied egg-rr48.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{d \cdot \frac{d}{D}}} - M\right)}\right)} \]
    8. Taylor expanded in c0 around inf 45.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(2 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \]
    9. Step-by-step derivation
      1. times-frac45.2%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      4. times-frac56.1%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right)}\right) \]
      7. associate-*r*56.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\left(2 \cdot \frac{c0}{w \cdot h}\right) \cdot {\left(\frac{d}{D}\right)}^{2}\right)} \]
      8. associate-/r*56.2%

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

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

    if 3.9000000000000002e93 < c0 < 4.49999999999999988e217

    1. Initial program 21.5%

      \[\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. Step-by-step derivation
      1. associate-*l*21.5%

        \[\leadsto \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) \]
      2. difference-of-squares28.6%

        \[\leadsto \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) \]
      3. associate-*l*28.6%

        \[\leadsto \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) \]
      4. associate-*l*28.6%

        \[\leadsto \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. Simplified28.6%

      \[\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)} \]
    4. Taylor expanded in c0 around -inf 3.6%

      \[\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}} \]
    5. Taylor expanded in w around 0 3.6%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{\frac{{d}^{2}}{{D}^{2} \cdot h} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}{w}} \cdot {c0}^{2}}{w} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in3.6%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}}{w} \cdot {c0}^{2}}{w} \]
      2. metadata-eval3.6%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}{w} \cdot {c0}^{2}}{w} \]
      3. mul0-lft25.0%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{0}}{w} \cdot {c0}^{2}}{w} \]
    7. Simplified25.0%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{0}{w}} \cdot {c0}^{2}}{w} \]
    8. Step-by-step derivation
      1. add-cbrt-cube25.0%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{\left(\left(\frac{0}{w} \cdot {c0}^{2}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}}{w} \]
      2. pow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      3. div025.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      4. *-commutative25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)} \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      5. pow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      6. div025.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      7. *-commutative25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      8. pow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right)}}{w} \]
      9. div025.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right)}}{w} \]
      10. *-commutative25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)}}}{w} \]
    9. Applied egg-rr25.0%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}}{w} \]
    10. Step-by-step derivation
      1. unpow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\color{blue}{{c0}^{2}} \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      2. mul0-rgt25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\color{blue}{0} \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      3. unpow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(0 \cdot \left(\color{blue}{{c0}^{2}} \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      4. mul0-rgt25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(0 \cdot \color{blue}{0}\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      5. metadata-eval25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\color{blue}{0} \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      6. unpow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{0 \cdot \left(\color{blue}{{c0}^{2}} \cdot 0\right)}}{w} \]
      7. mul0-rgt47.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{0 \cdot \color{blue}{0}}}{w} \]
      8. metadata-eval47.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\color{blue}{0}}}{w} \]
    11. Simplified47.9%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{0}}}{w} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification50.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -2.8 \cdot 10^{-90}:\\ \;\;\;\;\left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\\ \mathbf{elif}\;c0 \leq 180:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\ \mathbf{elif}\;c0 \leq 3.9 \cdot 10^{+93}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \left(2 \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\ \mathbf{elif}\;c0 \leq 4.5 \cdot 10^{+217}:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\\ \end{array} \]

Alternative 3: 42.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\\ \mathbf{if}\;c0 \leq -7.5 \cdot 10^{-86}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c0 \leq 3.05 \cdot 10^{+43}:\\ \;\;\;\;-0.5 \cdot \frac{\frac{0 \cdot \left(c0 \cdot c0\right)}{w}}{w}\\ \mathbf{elif}\;c0 \leq 2.05 \cdot 10^{+93} \lor \neg \left(c0 \leq 4.2 \cdot 10^{+217}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* (* (/ c0 w) (/ c0 w)) (/ (pow (/ d D) 2.0) h))))
   (if (<= c0 -7.5e-86)
     t_0
     (if (<= c0 3.05e+43)
       (* -0.5 (/ (/ (* 0.0 (* c0 c0)) w) w))
       (if (or (<= c0 2.05e+93) (not (<= c0 4.2e+217)))
         t_0
         (* -0.5 (/ (cbrt 0.0) w)))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = ((c0 / w) * (c0 / w)) * (pow((d / D), 2.0) / h);
	double tmp;
	if (c0 <= -7.5e-86) {
		tmp = t_0;
	} else if (c0 <= 3.05e+43) {
		tmp = -0.5 * (((0.0 * (c0 * c0)) / w) / w);
	} else if ((c0 <= 2.05e+93) || !(c0 <= 4.2e+217)) {
		tmp = t_0;
	} else {
		tmp = -0.5 * (cbrt(0.0) / w);
	}
	return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = ((c0 / w) * (c0 / w)) * (Math.pow((d / D), 2.0) / h);
	double tmp;
	if (c0 <= -7.5e-86) {
		tmp = t_0;
	} else if (c0 <= 3.05e+43) {
		tmp = -0.5 * (((0.0 * (c0 * c0)) / w) / w);
	} else if ((c0 <= 2.05e+93) || !(c0 <= 4.2e+217)) {
		tmp = t_0;
	} else {
		tmp = -0.5 * (Math.cbrt(0.0) / w);
	}
	return tmp;
}
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(Float64(c0 / w) * Float64(c0 / w)) * Float64((Float64(d / D) ^ 2.0) / h))
	tmp = 0.0
	if (c0 <= -7.5e-86)
		tmp = t_0;
	elseif (c0 <= 3.05e+43)
		tmp = Float64(-0.5 * Float64(Float64(Float64(0.0 * Float64(c0 * c0)) / w) / w));
	elseif ((c0 <= 2.05e+93) || !(c0 <= 4.2e+217))
		tmp = t_0;
	else
		tmp = Float64(-0.5 * Float64(cbrt(0.0) / w));
	end
	return tmp
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(N[(c0 / w), $MachinePrecision] * N[(c0 / w), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -7.5e-86], t$95$0, If[LessEqual[c0, 3.05e+43], N[(-0.5 * N[(N[(N[(0.0 * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, 2.05e+93], N[Not[LessEqual[c0, 4.2e+217]], $MachinePrecision]], t$95$0, N[(-0.5 * N[(N[Power[0.0, 1/3], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\\
\mathbf{if}\;c0 \leq -7.5 \cdot 10^{-86}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;c0 \leq 3.05 \cdot 10^{+43}:\\
\;\;\;\;-0.5 \cdot \frac{\frac{0 \cdot \left(c0 \cdot c0\right)}{w}}{w}\\

\mathbf{elif}\;c0 \leq 2.05 \cdot 10^{+93} \lor \neg \left(c0 \leq 4.2 \cdot 10^{+217}\right):\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c0 < -7.50000000000000055e-86 or 3.0499999999999999e43 < c0 < 2.0500000000000001e93 or 4.2000000000000002e217 < c0

    1. Initial program 26.7%

      \[\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. Step-by-step derivation
      1. associate-*l*25.9%

        \[\leadsto \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) \]
      2. difference-of-squares35.8%

        \[\leadsto \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) \]
      3. associate-*l*35.8%

        \[\leadsto \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) \]
      4. associate-*l*38.0%

        \[\leadsto \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. Simplified38.0%

      \[\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)} \]
    4. Taylor expanded in c0 around inf 33.4%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    5. Step-by-step derivation
      1. times-frac32.6%

        \[\leadsto \color{blue}{\frac{{d}^{2}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}} \]
      2. unpow232.6%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow232.6%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. unpow232.6%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h} \]
      5. *-commutative32.6%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{\color{blue}{h \cdot {w}^{2}}} \]
      6. unpow232.6%

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

      \[\leadsto \color{blue}{\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}} \]
    7. Step-by-step derivation
      1. times-frac43.4%

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

      \[\leadsto \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
    9. Step-by-step derivation
      1. pow243.4%

        \[\leadsto \color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
      2. associate-*r/43.4%

        \[\leadsto \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}} \]
    10. Applied egg-rr43.4%

      \[\leadsto \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}} \]
    11. Step-by-step derivation
      1. unpow243.4%

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

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

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

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

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

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

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

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

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

    if -7.50000000000000055e-86 < c0 < 3.0499999999999999e43

    1. Initial program 15.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. Step-by-step derivation
      1. associate-*l*14.9%

        \[\leadsto \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) \]
      2. difference-of-squares19.2%

        \[\leadsto \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) \]
      3. associate-*l*20.2%

        \[\leadsto \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) \]
      4. associate-*l*20.2%

        \[\leadsto \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. Simplified20.2%

      \[\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)} \]
    4. Taylor expanded in c0 around -inf 7.5%

      \[\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}} \]
    5. Taylor expanded in w around 0 9.6%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{\frac{{d}^{2}}{{D}^{2} \cdot h} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}{w}} \cdot {c0}^{2}}{w} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in9.6%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}}{w} \cdot {c0}^{2}}{w} \]
      2. metadata-eval9.6%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}{w} \cdot {c0}^{2}}{w} \]
      3. mul0-lft50.7%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{0}}{w} \cdot {c0}^{2}}{w} \]
    7. Simplified50.7%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{0}{w}} \cdot {c0}^{2}}{w} \]
    8. Step-by-step derivation
      1. pow250.7%

        \[\leadsto -0.5 \cdot \frac{\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}}{w} \]
      2. associate-*l/50.7%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{0 \cdot \left(c0 \cdot c0\right)}{w}}}{w} \]
      3. *-commutative50.7%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{\left(c0 \cdot c0\right) \cdot 0}}{w}}{w} \]
    9. Applied egg-rr50.7%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{\left(c0 \cdot c0\right) \cdot 0}{w}}}{w} \]

    if 2.0500000000000001e93 < c0 < 4.2000000000000002e217

    1. Initial program 21.5%

      \[\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. Step-by-step derivation
      1. associate-*l*21.5%

        \[\leadsto \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) \]
      2. difference-of-squares28.6%

        \[\leadsto \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) \]
      3. associate-*l*28.6%

        \[\leadsto \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) \]
      4. associate-*l*28.6%

        \[\leadsto \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. Simplified28.6%

      \[\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)} \]
    4. Taylor expanded in c0 around -inf 3.6%

      \[\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}} \]
    5. Taylor expanded in w around 0 3.6%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{\frac{{d}^{2}}{{D}^{2} \cdot h} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}{w}} \cdot {c0}^{2}}{w} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in3.6%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}}{w} \cdot {c0}^{2}}{w} \]
      2. metadata-eval3.6%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}{w} \cdot {c0}^{2}}{w} \]
      3. mul0-lft25.0%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{0}}{w} \cdot {c0}^{2}}{w} \]
    7. Simplified25.0%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{0}{w}} \cdot {c0}^{2}}{w} \]
    8. Step-by-step derivation
      1. add-cbrt-cube25.0%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{\left(\left(\frac{0}{w} \cdot {c0}^{2}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}}{w} \]
      2. pow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      3. div025.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      4. *-commutative25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)} \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      5. pow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      6. div025.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      7. *-commutative25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      8. pow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right)}}{w} \]
      9. div025.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right)}}{w} \]
      10. *-commutative25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)}}}{w} \]
    9. Applied egg-rr25.0%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}}{w} \]
    10. Step-by-step derivation
      1. unpow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\color{blue}{{c0}^{2}} \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      2. mul0-rgt25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\color{blue}{0} \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      3. unpow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(0 \cdot \left(\color{blue}{{c0}^{2}} \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      4. mul0-rgt25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(0 \cdot \color{blue}{0}\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      5. metadata-eval25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\color{blue}{0} \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      6. unpow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{0 \cdot \left(\color{blue}{{c0}^{2}} \cdot 0\right)}}{w} \]
      7. mul0-rgt47.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{0 \cdot \color{blue}{0}}}{w} \]
      8. metadata-eval47.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\color{blue}{0}}}{w} \]
    11. Simplified47.9%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{0}}}{w} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -7.5 \cdot 10^{-86}:\\ \;\;\;\;\left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\\ \mathbf{elif}\;c0 \leq 3.05 \cdot 10^{+43}:\\ \;\;\;\;-0.5 \cdot \frac{\frac{0 \cdot \left(c0 \cdot c0\right)}{w}}{w}\\ \mathbf{elif}\;c0 \leq 2.05 \cdot 10^{+93} \lor \neg \left(c0 \leq 4.2 \cdot 10^{+217}\right):\\ \;\;\;\;\left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\ \end{array} \]

Alternative 4: 42.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\frac{d}{D}\right)}^{2}\\ t_1 := \left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{t_0}{h}\\ \mathbf{if}\;c0 \leq -5.6 \cdot 10^{-83}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c0 \leq 0.125:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\ \mathbf{elif}\;c0 \leq 3.9 \cdot 10^{+93}:\\ \;\;\;\;t_0 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{c0}{w}}{h}\right)\\ \mathbf{elif}\;c0 \leq 6.2 \cdot 10^{+217}:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (pow (/ d D) 2.0)) (t_1 (* (* (/ c0 w) (/ c0 w)) (/ t_0 h))))
   (if (<= c0 -5.6e-83)
     t_1
     (if (<= c0 0.125)
       (* (/ c0 (* 2.0 w)) 0.0)
       (if (<= c0 3.9e+93)
         (* t_0 (* (/ c0 w) (/ (/ c0 w) h)))
         (if (<= c0 6.2e+217) (* -0.5 (/ (cbrt 0.0) w)) t_1))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = pow((d / D), 2.0);
	double t_1 = ((c0 / w) * (c0 / w)) * (t_0 / h);
	double tmp;
	if (c0 <= -5.6e-83) {
		tmp = t_1;
	} else if (c0 <= 0.125) {
		tmp = (c0 / (2.0 * w)) * 0.0;
	} else if (c0 <= 3.9e+93) {
		tmp = t_0 * ((c0 / w) * ((c0 / w) / h));
	} else if (c0 <= 6.2e+217) {
		tmp = -0.5 * (cbrt(0.0) / w);
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = Math.pow((d / D), 2.0);
	double t_1 = ((c0 / w) * (c0 / w)) * (t_0 / h);
	double tmp;
	if (c0 <= -5.6e-83) {
		tmp = t_1;
	} else if (c0 <= 0.125) {
		tmp = (c0 / (2.0 * w)) * 0.0;
	} else if (c0 <= 3.9e+93) {
		tmp = t_0 * ((c0 / w) * ((c0 / w) / h));
	} else if (c0 <= 6.2e+217) {
		tmp = -0.5 * (Math.cbrt(0.0) / w);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(c0, w, h, D, d, M)
	t_0 = Float64(d / D) ^ 2.0
	t_1 = Float64(Float64(Float64(c0 / w) * Float64(c0 / w)) * Float64(t_0 / h))
	tmp = 0.0
	if (c0 <= -5.6e-83)
		tmp = t_1;
	elseif (c0 <= 0.125)
		tmp = Float64(Float64(c0 / Float64(2.0 * w)) * 0.0);
	elseif (c0 <= 3.9e+93)
		tmp = Float64(t_0 * Float64(Float64(c0 / w) * Float64(Float64(c0 / w) / h)));
	elseif (c0 <= 6.2e+217)
		tmp = Float64(-0.5 * Float64(cbrt(0.0) / w));
	else
		tmp = t_1;
	end
	return tmp
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(c0 / w), $MachinePrecision] * N[(c0 / w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -5.6e-83], t$95$1, If[LessEqual[c0, 0.125], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision], If[LessEqual[c0, 3.9e+93], N[(t$95$0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 6.2e+217], N[(-0.5 * N[(N[Power[0.0, 1/3], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\frac{d}{D}\right)}^{2}\\
t_1 := \left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{t_0}{h}\\
\mathbf{if}\;c0 \leq -5.6 \cdot 10^{-83}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c0 \leq 0.125:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\

\mathbf{elif}\;c0 \leq 3.9 \cdot 10^{+93}:\\
\;\;\;\;t_0 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{c0}{w}}{h}\right)\\

\mathbf{elif}\;c0 \leq 6.2 \cdot 10^{+217}:\\
\;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c0 < -5.6000000000000002e-83 or 6.2000000000000003e217 < c0

    1. Initial program 24.5%

      \[\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. Step-by-step derivation
      1. associate-*l*23.7%

        \[\leadsto \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) \]
      2. difference-of-squares32.9%

        \[\leadsto \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) \]
      3. associate-*l*32.9%

        \[\leadsto \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) \]
      4. associate-*l*35.5%

        \[\leadsto \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. Simplified35.5%

      \[\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)} \]
    4. Taylor expanded in c0 around inf 31.1%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    5. Step-by-step derivation
      1. times-frac30.2%

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

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow230.2%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. unpow230.2%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h} \]
      5. *-commutative30.2%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{\color{blue}{h \cdot {w}^{2}}} \]
      6. unpow230.2%

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

      \[\leadsto \color{blue}{\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}} \]
    7. Step-by-step derivation
      1. times-frac41.3%

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

      \[\leadsto \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
    9. Step-by-step derivation
      1. pow241.3%

        \[\leadsto \color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
      2. associate-*r/41.4%

        \[\leadsto \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}} \]
    10. Applied egg-rr41.4%

      \[\leadsto \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}} \]
    11. Step-by-step derivation
      1. unpow241.4%

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

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

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

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

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

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

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

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

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

    if -5.6000000000000002e-83 < c0 < 0.125

    1. Initial program 17.3%

      \[\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. Step-by-step derivation
      1. times-frac13.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \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. fma-def13.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \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. associate-/r*13.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \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) \]
      4. difference-of-squares16.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \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) \]
    3. Simplified18.8%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r/18.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D}}{D}} - M\right)}\right) \]
      2. associate-/l*17.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d}{\frac{D}{d}}}}{D} - M\right)}\right) \]
      3. div-inv17.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\left(d \cdot \frac{1}{\frac{D}{d}}\right)}}{D} - M\right)}\right) \]
      4. clear-num17.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \color{blue}{\frac{d}{D}}\right)}{D} - M\right)}\right) \]
    5. Applied egg-rr17.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D}} - M\right)}\right) \]
    6. Step-by-step derivation
      1. fma-udef17.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right)} \]
      2. associate-/r*17.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D \cdot D}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      3. times-frac17.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      4. unpow217.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      5. associate-/r*17.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d \cdot d}{D \cdot D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      6. times-frac20.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d}{D} \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      7. unpow220.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{{\left(\frac{d}{D}\right)}^{2}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      8. associate-*r/19.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D}}}{D} - M\right)}\right) \]
      9. associate-/l*19.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h}}{\frac{D}{\frac{d \cdot d}{D}}}} - M\right)}\right) \]
      10. associate-*r/20.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{\color{blue}{d \cdot \frac{d}{D}}}} - M\right)}\right) \]
    7. Applied egg-rr20.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{d \cdot \frac{d}{D}}} - M\right)}\right)} \]
    8. Taylor expanded in c0 around -inf 8.6%

      \[\leadsto \frac{c0}{2 \cdot 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)} \]
    9. Step-by-step derivation
      1. *-commutative8.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \color{blue}{\left(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)}\right) \]
      2. distribute-rgt1-in8.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right)\right) \]
      3. metadata-eval8.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)\right) \]
      4. mul0-lft54.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \color{blue}{0}\right)\right) \]
      5. mul0-rgt54.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \color{blue}{0}\right) \]
      6. metadata-eval54.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    10. Simplified54.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]

    if 0.125 < c0 < 3.9000000000000002e93

    1. Initial program 26.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. Step-by-step derivation
      1. associate-*l*26.2%

        \[\leadsto \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) \]
      2. difference-of-squares41.0%

        \[\leadsto \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) \]
      3. associate-*l*41.2%

        \[\leadsto \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) \]
      4. associate-*l*41.2%

        \[\leadsto \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. Simplified41.2%

      \[\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)} \]
    4. Taylor expanded in c0 around inf 37.7%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    5. Step-by-step derivation
      1. times-frac37.7%

        \[\leadsto \color{blue}{\frac{{d}^{2}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}} \]
      2. unpow237.7%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow237.7%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. unpow237.7%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h} \]
      5. *-commutative37.7%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{\color{blue}{h \cdot {w}^{2}}} \]
      6. unpow237.7%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \color{blue}{\left(w \cdot w\right)}} \]
    6. Simplified37.7%

      \[\leadsto \color{blue}{\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}} \]
    7. Step-by-step derivation
      1. times-frac41.7%

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

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

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    10. Step-by-step derivation
      1. times-frac37.7%

        \[\leadsto \color{blue}{\frac{{d}^{2}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}} \]
      2. unpow237.7%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow237.7%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. times-frac41.7%

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

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

        \[\leadsto {\left(\frac{d}{D}\right)}^{2} \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h} \]
      7. *-commutative41.7%

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

        \[\leadsto {\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0 \cdot c0}{h \cdot \color{blue}{\left(w \cdot w\right)}} \]
      9. associate-*r*49.0%

        \[\leadsto {\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0 \cdot c0}{\color{blue}{\left(h \cdot w\right) \cdot w}} \]
      10. *-commutative49.0%

        \[\leadsto {\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0 \cdot c0}{\color{blue}{\left(w \cdot h\right)} \cdot w} \]
      11. times-frac56.2%

        \[\leadsto {\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{c0}{w}\right)} \]
      12. associate-/r*56.2%

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

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

    if 3.9000000000000002e93 < c0 < 6.2000000000000003e217

    1. Initial program 21.5%

      \[\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. Step-by-step derivation
      1. associate-*l*21.5%

        \[\leadsto \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) \]
      2. difference-of-squares28.6%

        \[\leadsto \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) \]
      3. associate-*l*28.6%

        \[\leadsto \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) \]
      4. associate-*l*28.6%

        \[\leadsto \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. Simplified28.6%

      \[\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)} \]
    4. Taylor expanded in c0 around -inf 3.6%

      \[\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}} \]
    5. Taylor expanded in w around 0 3.6%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{\frac{{d}^{2}}{{D}^{2} \cdot h} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}{w}} \cdot {c0}^{2}}{w} \]
    6. Step-by-step derivation
      1. distribute-rgt1-in3.6%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}}{w} \cdot {c0}^{2}}{w} \]
      2. metadata-eval3.6%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot h}}{w} \cdot {c0}^{2}}{w} \]
      3. mul0-lft25.0%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{0}}{w} \cdot {c0}^{2}}{w} \]
    7. Simplified25.0%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{0}{w}} \cdot {c0}^{2}}{w} \]
    8. Step-by-step derivation
      1. add-cbrt-cube25.0%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{\left(\left(\frac{0}{w} \cdot {c0}^{2}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}}{w} \]
      2. pow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      3. div025.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      4. *-commutative25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)} \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      5. pow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      6. div025.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right)\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      7. *-commutative25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)}\right) \cdot \left(\frac{0}{w} \cdot {c0}^{2}\right)}}{w} \]
      8. pow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\frac{0}{w} \cdot \color{blue}{\left(c0 \cdot c0\right)}\right)}}{w} \]
      9. div025.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\color{blue}{0} \cdot \left(c0 \cdot c0\right)\right)}}{w} \]
      10. *-commutative25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \color{blue}{\left(\left(c0 \cdot c0\right) \cdot 0\right)}}}{w} \]
    9. Applied egg-rr25.0%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{\left(\left(\left(c0 \cdot c0\right) \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}}{w} \]
    10. Step-by-step derivation
      1. unpow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\left(\color{blue}{{c0}^{2}} \cdot 0\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      2. mul0-rgt25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(\color{blue}{0} \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      3. unpow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(0 \cdot \left(\color{blue}{{c0}^{2}} \cdot 0\right)\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      4. mul0-rgt25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\left(0 \cdot \color{blue}{0}\right) \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      5. metadata-eval25.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\color{blue}{0} \cdot \left(\left(c0 \cdot c0\right) \cdot 0\right)}}{w} \]
      6. unpow225.0%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{0 \cdot \left(\color{blue}{{c0}^{2}} \cdot 0\right)}}{w} \]
      7. mul0-rgt47.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{0 \cdot \color{blue}{0}}}{w} \]
      8. metadata-eval47.9%

        \[\leadsto -0.5 \cdot \frac{\sqrt[3]{\color{blue}{0}}}{w} \]
    11. Simplified47.9%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt[3]{0}}}{w} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification50.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -5.6 \cdot 10^{-83}:\\ \;\;\;\;\left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\\ \mathbf{elif}\;c0 \leq 0.125:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\ \mathbf{elif}\;c0 \leq 3.9 \cdot 10^{+93}:\\ \;\;\;\;{\left(\frac{d}{D}\right)}^{2} \cdot \left(\frac{c0}{w} \cdot \frac{\frac{c0}{w}}{h}\right)\\ \mathbf{elif}\;c0 \leq 6.2 \cdot 10^{+217}:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\\ \end{array} \]

Alternative 5: 42.2% accurate, 6.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{h} \cdot \frac{c0}{w \cdot w}\\ t_1 := \frac{c0}{2 \cdot w} \cdot 0\\ \mathbf{if}\;w \leq -2.2 \cdot 10^{+24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;w \leq 3.2 \cdot 10^{-23}:\\ \;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot t_0\\ \mathbf{elif}\;w \leq 8.5 \cdot 10^{+50} \lor \neg \left(w \leq 6.4 \cdot 10^{+94}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot d}{D} \cdot \frac{t_0}{D}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* (/ c0 h) (/ c0 (* w w)))) (t_1 (* (/ c0 (* 2.0 w)) 0.0)))
   (if (<= w -2.2e+24)
     t_1
     (if (<= w 3.2e-23)
       (* (* (/ d D) (/ d D)) t_0)
       (if (or (<= w 8.5e+50) (not (<= w 6.4e+94)))
         t_1
         (* (/ (* d d) D) (/ t_0 D)))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 / h) * (c0 / (w * w));
	double t_1 = (c0 / (2.0 * w)) * 0.0;
	double tmp;
	if (w <= -2.2e+24) {
		tmp = t_1;
	} else if (w <= 3.2e-23) {
		tmp = ((d / D) * (d / D)) * t_0;
	} else if ((w <= 8.5e+50) || !(w <= 6.4e+94)) {
		tmp = t_1;
	} else {
		tmp = ((d * d) / D) * (t_0 / D);
	}
	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
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (c0 / h) * (c0 / (w * w))
    t_1 = (c0 / (2.0d0 * w)) * 0.0d0
    if (w <= (-2.2d+24)) then
        tmp = t_1
    else if (w <= 3.2d-23) then
        tmp = ((d_1 / d) * (d_1 / d)) * t_0
    else if ((w <= 8.5d+50) .or. (.not. (w <= 6.4d+94))) then
        tmp = t_1
    else
        tmp = ((d_1 * d_1) / d) * (t_0 / d)
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 / h) * (c0 / (w * w));
	double t_1 = (c0 / (2.0 * w)) * 0.0;
	double tmp;
	if (w <= -2.2e+24) {
		tmp = t_1;
	} else if (w <= 3.2e-23) {
		tmp = ((d / D) * (d / D)) * t_0;
	} else if ((w <= 8.5e+50) || !(w <= 6.4e+94)) {
		tmp = t_1;
	} else {
		tmp = ((d * d) / D) * (t_0 / D);
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = (c0 / h) * (c0 / (w * w))
	t_1 = (c0 / (2.0 * w)) * 0.0
	tmp = 0
	if w <= -2.2e+24:
		tmp = t_1
	elif w <= 3.2e-23:
		tmp = ((d / D) * (d / D)) * t_0
	elif (w <= 8.5e+50) or not (w <= 6.4e+94):
		tmp = t_1
	else:
		tmp = ((d * d) / D) * (t_0 / D)
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(c0 / h) * Float64(c0 / Float64(w * w)))
	t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * 0.0)
	tmp = 0.0
	if (w <= -2.2e+24)
		tmp = t_1;
	elseif (w <= 3.2e-23)
		tmp = Float64(Float64(Float64(d / D) * Float64(d / D)) * t_0);
	elseif ((w <= 8.5e+50) || !(w <= 6.4e+94))
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(d * d) / D) * Float64(t_0 / D));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (c0 / h) * (c0 / (w * w));
	t_1 = (c0 / (2.0 * w)) * 0.0;
	tmp = 0.0;
	if (w <= -2.2e+24)
		tmp = t_1;
	elseif (w <= 3.2e-23)
		tmp = ((d / D) * (d / D)) * t_0;
	elseif ((w <= 8.5e+50) || ~((w <= 6.4e+94)))
		tmp = t_1;
	else
		tmp = ((d * d) / D) * (t_0 / D);
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / h), $MachinePrecision] * N[(c0 / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision]}, If[LessEqual[w, -2.2e+24], t$95$1, If[LessEqual[w, 3.2e-23], N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[Or[LessEqual[w, 8.5e+50], N[Not[LessEqual[w, 6.4e+94]], $MachinePrecision]], t$95$1, N[(N[(N[(d * d), $MachinePrecision] / D), $MachinePrecision] * N[(t$95$0 / D), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c0}{h} \cdot \frac{c0}{w \cdot w}\\
t_1 := \frac{c0}{2 \cdot w} \cdot 0\\
\mathbf{if}\;w \leq -2.2 \cdot 10^{+24}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;w \leq 3.2 \cdot 10^{-23}:\\
\;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot t_0\\

\mathbf{elif}\;w \leq 8.5 \cdot 10^{+50} \lor \neg \left(w \leq 6.4 \cdot 10^{+94}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{d \cdot d}{D} \cdot \frac{t_0}{D}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if w < -2.20000000000000002e24 or 3.19999999999999976e-23 < w < 8.49999999999999961e50 or 6.40000000000000028e94 < w

    1. Initial program 12.2%

      \[\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. Step-by-step derivation
      1. times-frac11.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \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. fma-def11.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \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. associate-/r*11.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \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) \]
      4. difference-of-squares15.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \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) \]
    3. Simplified19.9%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r/19.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D}}{D}} - M\right)}\right) \]
      2. associate-/l*17.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d}{\frac{D}{d}}}}{D} - M\right)}\right) \]
      3. div-inv17.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\left(d \cdot \frac{1}{\frac{D}{d}}\right)}}{D} - M\right)}\right) \]
      4. clear-num17.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \color{blue}{\frac{d}{D}}\right)}{D} - M\right)}\right) \]
    5. Applied egg-rr17.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D}} - M\right)}\right) \]
    6. Step-by-step derivation
      1. fma-udef17.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right)} \]
      2. associate-/r*16.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D \cdot D}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      3. times-frac17.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      4. unpow217.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      5. associate-/r*16.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d \cdot d}{D \cdot D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      6. times-frac21.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d}{D} \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      7. unpow221.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{{\left(\frac{d}{D}\right)}^{2}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      8. associate-*r/18.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D}}}{D} - M\right)}\right) \]
      9. associate-/l*18.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h}}{\frac{D}{\frac{d \cdot d}{D}}}} - M\right)}\right) \]
      10. associate-*r/20.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{\color{blue}{d \cdot \frac{d}{D}}}} - M\right)}\right) \]
    7. Applied egg-rr20.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{d \cdot \frac{d}{D}}} - M\right)}\right)} \]
    8. Taylor expanded in c0 around -inf 5.5%

      \[\leadsto \frac{c0}{2 \cdot 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)} \]
    9. Step-by-step derivation
      1. *-commutative5.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \color{blue}{\left(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)}\right) \]
      2. distribute-rgt1-in5.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right)\right) \]
      3. metadata-eval5.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)\right) \]
      4. mul0-lft55.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \color{blue}{0}\right)\right) \]
      5. mul0-rgt55.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \color{blue}{0}\right) \]
      6. metadata-eval55.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    10. Simplified55.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]

    if -2.20000000000000002e24 < w < 3.19999999999999976e-23

    1. Initial program 27.6%

      \[\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. Step-by-step derivation
      1. associate-*l*26.9%

        \[\leadsto \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) \]
      2. difference-of-squares35.2%

        \[\leadsto \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) \]
      3. associate-*l*35.3%

        \[\leadsto \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) \]
      4. associate-*l*35.9%

        \[\leadsto \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. Simplified35.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)} \]
    4. Taylor expanded in c0 around inf 32.0%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    5. Step-by-step derivation
      1. times-frac32.1%

        \[\leadsto \color{blue}{\frac{{d}^{2}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}} \]
      2. unpow232.1%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow232.1%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. unpow232.1%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h} \]
      5. *-commutative32.1%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{\color{blue}{h \cdot {w}^{2}}} \]
      6. unpow232.1%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \color{blue}{\left(w \cdot w\right)}} \]
    6. Simplified32.1%

      \[\leadsto \color{blue}{\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}} \]
    7. Step-by-step derivation
      1. times-frac39.3%

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

      \[\leadsto \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
    9. Step-by-step derivation
      1. *-un-lft-identity39.3%

        \[\leadsto \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \color{blue}{\left(1 \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\right)} \]
      2. times-frac42.1%

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

      \[\leadsto \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \color{blue}{\left(1 \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)\right)} \]
    11. Step-by-step derivation
      1. *-lft-identity42.1%

        \[\leadsto \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \color{blue}{\left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)} \]
    12. Simplified42.1%

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

    if 8.49999999999999961e50 < w < 6.40000000000000028e94

    1. Initial program 29.3%

      \[\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. Step-by-step derivation
      1. associate-*l*29.3%

        \[\leadsto \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) \]
      2. difference-of-squares57.8%

        \[\leadsto \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) \]
      3. associate-*l*57.8%

        \[\leadsto \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) \]
      4. associate-*l*57.8%

        \[\leadsto \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. Simplified57.8%

      \[\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)} \]
    4. Taylor expanded in c0 around inf 57.8%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    5. Step-by-step derivation
      1. times-frac43.5%

        \[\leadsto \color{blue}{\frac{{d}^{2}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}} \]
      2. unpow243.5%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow243.5%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. unpow243.5%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h} \]
      5. *-commutative43.5%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{\color{blue}{h \cdot {w}^{2}}} \]
      6. unpow243.5%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \color{blue}{\left(w \cdot w\right)}} \]
    6. Simplified43.5%

      \[\leadsto \color{blue}{\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}} \]
    7. Step-by-step derivation
      1. associate-*l/57.1%

        \[\leadsto \color{blue}{\frac{\left(d \cdot d\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}}{D \cdot D}} \]
      2. times-frac71.4%

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

      \[\leadsto \color{blue}{\frac{\left(d \cdot d\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)}{D \cdot D}} \]
    9. Step-by-step derivation
      1. unpow271.4%

        \[\leadsto \frac{\color{blue}{{d}^{2}} \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)}{D \cdot D} \]
      2. times-frac86.0%

        \[\leadsto \color{blue}{\frac{{d}^{2}}{D} \cdot \frac{\frac{c0}{h} \cdot \frac{c0}{w \cdot w}}{D}} \]
      3. unpow286.0%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{D} \cdot \frac{\frac{c0}{h} \cdot \frac{c0}{w \cdot w}}{D} \]
    10. Simplified86.0%

      \[\leadsto \color{blue}{\frac{d \cdot d}{D} \cdot \frac{\frac{c0}{h} \cdot \frac{c0}{w \cdot w}}{D}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -2.2 \cdot 10^{+24}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\ \mathbf{elif}\;w \leq 3.2 \cdot 10^{-23}:\\ \;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)\\ \mathbf{elif}\;w \leq 8.5 \cdot 10^{+50} \lor \neg \left(w \leq 6.4 \cdot 10^{+94}\right):\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot d}{D} \cdot \frac{\frac{c0}{h} \cdot \frac{c0}{w \cdot w}}{D}\\ \end{array} \]

Alternative 6: 42.4% accurate, 7.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -2.3 \cdot 10^{+24} \lor \neg \left(w \leq 1.75 \cdot 10^{-23}\right):\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (or (<= w -2.3e+24) (not (<= w 1.75e-23)))
   (* (/ c0 (* 2.0 w)) 0.0)
   (* (* (/ d D) (/ d D)) (* (/ c0 h) (/ c0 (* w w))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((w <= -2.3e+24) || !(w <= 1.75e-23)) {
		tmp = (c0 / (2.0 * w)) * 0.0;
	} else {
		tmp = ((d / D) * (d / D)) * ((c0 / h) * (c0 / (w * w)));
	}
	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
    real(8) :: tmp
    if ((w <= (-2.3d+24)) .or. (.not. (w <= 1.75d-23))) then
        tmp = (c0 / (2.0d0 * w)) * 0.0d0
    else
        tmp = ((d_1 / d) * (d_1 / d)) * ((c0 / h) * (c0 / (w * w)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((w <= -2.3e+24) || !(w <= 1.75e-23)) {
		tmp = (c0 / (2.0 * w)) * 0.0;
	} else {
		tmp = ((d / D) * (d / D)) * ((c0 / h) * (c0 / (w * w)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if (w <= -2.3e+24) or not (w <= 1.75e-23):
		tmp = (c0 / (2.0 * w)) * 0.0
	else:
		tmp = ((d / D) * (d / D)) * ((c0 / h) * (c0 / (w * w)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if ((w <= -2.3e+24) || !(w <= 1.75e-23))
		tmp = Float64(Float64(c0 / Float64(2.0 * w)) * 0.0);
	else
		tmp = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 / h) * Float64(c0 / Float64(w * w))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if ((w <= -2.3e+24) || ~((w <= 1.75e-23)))
		tmp = (c0 / (2.0 * w)) * 0.0;
	else
		tmp = ((d / D) * (d / D)) * ((c0 / h) * (c0 / (w * w)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[w, -2.3e+24], N[Not[LessEqual[w, 1.75e-23]], $MachinePrecision]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision], N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] * N[(c0 / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;w \leq -2.3 \cdot 10^{+24} \lor \neg \left(w \leq 1.75 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if w < -2.2999999999999999e24 or 1.74999999999999997e-23 < w

    1. Initial program 13.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. Step-by-step derivation
      1. times-frac11.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \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. fma-def11.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \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. associate-/r*11.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \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) \]
      4. difference-of-squares17.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \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) \]
    3. Simplified21.6%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r/21.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D}}{D}} - M\right)}\right) \]
      2. associate-/l*19.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d}{\frac{D}{d}}}}{D} - M\right)}\right) \]
      3. div-inv19.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\left(d \cdot \frac{1}{\frac{D}{d}}\right)}}{D} - M\right)}\right) \]
      4. clear-num19.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \color{blue}{\frac{d}{D}}\right)}{D} - M\right)}\right) \]
    5. Applied egg-rr19.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D}} - M\right)}\right) \]
    6. Step-by-step derivation
      1. fma-udef19.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right)} \]
      2. associate-/r*18.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D \cdot D}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      3. times-frac19.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      4. unpow219.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      5. associate-/r*18.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d \cdot d}{D \cdot D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      6. times-frac22.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d}{D} \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      7. unpow222.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{{\left(\frac{d}{D}\right)}^{2}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
      8. associate-*r/19.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D}}}{D} - M\right)}\right) \]
      9. associate-/l*19.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h}}{\frac{D}{\frac{d \cdot d}{D}}}} - M\right)}\right) \]
      10. associate-*r/21.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{\color{blue}{d \cdot \frac{d}{D}}}} - M\right)}\right) \]
    7. Applied egg-rr21.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{d \cdot \frac{d}{D}}} - M\right)}\right)} \]
    8. Taylor expanded in c0 around -inf 6.1%

      \[\leadsto \frac{c0}{2 \cdot 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)} \]
    9. Step-by-step derivation
      1. *-commutative6.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \color{blue}{\left(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)}\right) \]
      2. distribute-rgt1-in6.1%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)\right) \]
      4. mul0-lft52.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \color{blue}{0}\right)\right) \]
      5. mul0-rgt52.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \color{blue}{0}\right) \]
      6. metadata-eval52.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    10. Simplified52.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]

    if -2.2999999999999999e24 < w < 1.74999999999999997e-23

    1. Initial program 27.6%

      \[\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. Step-by-step derivation
      1. associate-*l*26.9%

        \[\leadsto \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) \]
      2. difference-of-squares35.2%

        \[\leadsto \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) \]
      3. associate-*l*35.3%

        \[\leadsto \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) \]
      4. associate-*l*35.9%

        \[\leadsto \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. Simplified35.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)} \]
    4. Taylor expanded in c0 around inf 32.0%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    5. Step-by-step derivation
      1. times-frac32.1%

        \[\leadsto \color{blue}{\frac{{d}^{2}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}} \]
      2. unpow232.1%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow232.1%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. unpow232.1%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h} \]
      5. *-commutative32.1%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{\color{blue}{h \cdot {w}^{2}}} \]
      6. unpow232.1%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \color{blue}{\left(w \cdot w\right)}} \]
    6. Simplified32.1%

      \[\leadsto \color{blue}{\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}} \]
    7. Step-by-step derivation
      1. times-frac39.3%

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

      \[\leadsto \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
    9. Step-by-step derivation
      1. *-un-lft-identity39.3%

        \[\leadsto \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \color{blue}{\left(1 \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\right)} \]
      2. times-frac42.1%

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

      \[\leadsto \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \color{blue}{\left(1 \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)\right)} \]
    11. Step-by-step derivation
      1. *-lft-identity42.1%

        \[\leadsto \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \color{blue}{\left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)} \]
    12. Simplified42.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -2.3 \cdot 10^{+24} \lor \neg \left(w \leq 1.75 \cdot 10^{-23}\right):\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)\\ \end{array} \]

Alternative 7: 30.0% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \frac{c0}{2 \cdot w} \cdot 0 \end{array} \]
(FPCore (c0 w h D d M) :precision binary64 (* (/ c0 (* 2.0 w)) 0.0))
double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * 0.0;
}
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)) * 0.0d0
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * 0.0;
}
def code(c0, w, h, D, d, M):
	return (c0 / (2.0 * w)) * 0.0
function code(c0, w, h, D, d, M)
	return Float64(Float64(c0 / Float64(2.0 * w)) * 0.0)
end
function tmp = code(c0, w, h, D, d, M)
	tmp = (c0 / (2.0 * w)) * 0.0;
end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision]
\begin{array}{l}

\\
\frac{c0}{2 \cdot w} \cdot 0
\end{array}
Derivation
  1. Initial program 22.1%

    \[\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. Step-by-step derivation
    1. times-frac20.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \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. fma-def20.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \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. associate-/r*20.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \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) \]
    4. difference-of-squares27.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \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) \]
  3. Simplified30.1%

    \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
  4. Step-by-step derivation
    1. associate-*r/30.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D}}{D}} - M\right)}\right) \]
    2. associate-/l*29.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d}{\frac{D}{d}}}}{D} - M\right)}\right) \]
    3. div-inv29.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\left(d \cdot \frac{1}{\frac{D}{d}}\right)}}{D} - M\right)}\right) \]
    4. clear-num29.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \color{blue}{\frac{d}{D}}\right)}{D} - M\right)}\right) \]
  5. Applied egg-rr29.3%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D}} - M\right)}\right) \]
  6. Step-by-step derivation
    1. fma-udef29.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right)} \]
    2. associate-/r*28.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D \cdot D}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
    3. times-frac29.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
    4. unpow229.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
    5. associate-/r*28.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d \cdot d}{D \cdot D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
    6. times-frac33.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d}{D} \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
    7. unpow233.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{{\left(\frac{d}{D}\right)}^{2}}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \left(d \cdot \frac{d}{D}\right)}{D} - M\right)}\right) \]
    8. associate-*r/31.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{d \cdot d}{D}}}{D} - M\right)}\right) \]
    9. associate-/l*31.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h}}{\frac{D}{\frac{d \cdot d}{D}}}} - M\right)}\right) \]
    10. associate-*r/32.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{\color{blue}{d \cdot \frac{d}{D}}}} - M\right)}\right) \]
  7. Applied egg-rr32.8%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, M\right) \cdot \left(\frac{\frac{c0}{w \cdot h}}{\frac{D}{d \cdot \frac{d}{D}}} - M\right)}\right)} \]
  8. Taylor expanded in c0 around -inf 4.1%

    \[\leadsto \frac{c0}{2 \cdot 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)} \]
  9. Step-by-step derivation
    1. *-commutative4.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \color{blue}{\left(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)}\right) \]
    2. distribute-rgt1-in4.1%

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)\right) \]
    4. mul0-lft33.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \left(c0 \cdot \color{blue}{0}\right)\right) \]
    5. mul0-rgt33.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(-1 \cdot \color{blue}{0}\right) \]
    6. metadata-eval33.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
  10. Simplified33.8%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
  11. Final simplification33.8%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot 0 \]

Reproduce

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