Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.3% → 44.6%
Time: 41.3s
Alternatives: 10
Speedup: 151.0×

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 10 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.3% 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: 44.6% accurate, 0.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := \frac{c0}{\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \left|\frac{c0}{w \cdot h}\right|}}\\ \mathbf{if}\;M_m \leq 1.05 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;M_m \leq 4 \cdot 10^{-99}:\\ \;\;\;\;0\\ \mathbf{elif}\;M_m \leq 2.1 \cdot 10^{-40}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}{c0}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (let* ((t_0 (/ c0 (/ w (* (pow (/ d D) 2.0) (fabs (/ c0 (* w h))))))))
   (if (<= M_m 1.05e-217)
     t_0
     (if (<= M_m 4e-99)
       0.0
       (if (<= M_m 2.1e-40)
         t_0
         (/ 1.0 (/ (* (/ (* w (pow (/ d D) -2.0)) c0) (* w h)) c0)))))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 / (w / (pow((d / D), 2.0) * fabs((c0 / (w * h)))));
	double tmp;
	if (M_m <= 1.05e-217) {
		tmp = t_0;
	} else if (M_m <= 4e-99) {
		tmp = 0.0;
	} else if (M_m <= 2.1e-40) {
		tmp = t_0;
	} else {
		tmp = 1.0 / ((((w * pow((d / D), -2.0)) / c0) * (w * h)) / c0);
	}
	return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0 / (w / (((d_1 / d) ** 2.0d0) * abs((c0 / (w * h)))))
    if (m_m <= 1.05d-217) then
        tmp = t_0
    else if (m_m <= 4d-99) then
        tmp = 0.0d0
    else if (m_m <= 2.1d-40) then
        tmp = t_0
    else
        tmp = 1.0d0 / ((((w * ((d_1 / d) ** (-2.0d0))) / c0) * (w * h)) / c0)
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 / (w / (Math.pow((d / D), 2.0) * Math.abs((c0 / (w * h)))));
	double tmp;
	if (M_m <= 1.05e-217) {
		tmp = t_0;
	} else if (M_m <= 4e-99) {
		tmp = 0.0;
	} else if (M_m <= 2.1e-40) {
		tmp = t_0;
	} else {
		tmp = 1.0 / ((((w * Math.pow((d / D), -2.0)) / c0) * (w * h)) / c0);
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	t_0 = c0 / (w / (math.pow((d / D), 2.0) * math.fabs((c0 / (w * h)))))
	tmp = 0
	if M_m <= 1.05e-217:
		tmp = t_0
	elif M_m <= 4e-99:
		tmp = 0.0
	elif M_m <= 2.1e-40:
		tmp = t_0
	else:
		tmp = 1.0 / ((((w * math.pow((d / D), -2.0)) / c0) * (w * h)) / c0)
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	t_0 = Float64(c0 / Float64(w / Float64((Float64(d / D) ^ 2.0) * abs(Float64(c0 / Float64(w * h))))))
	tmp = 0.0
	if (M_m <= 1.05e-217)
		tmp = t_0;
	elseif (M_m <= 4e-99)
		tmp = 0.0;
	elseif (M_m <= 2.1e-40)
		tmp = t_0;
	else
		tmp = Float64(1.0 / Float64(Float64(Float64(Float64(w * (Float64(d / D) ^ -2.0)) / c0) * Float64(w * h)) / c0));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	t_0 = c0 / (w / (((d / D) ^ 2.0) * abs((c0 / (w * h)))));
	tmp = 0.0;
	if (M_m <= 1.05e-217)
		tmp = t_0;
	elseif (M_m <= 4e-99)
		tmp = 0.0;
	elseif (M_m <= 2.1e-40)
		tmp = t_0;
	else
		tmp = 1.0 / ((((w * ((d / D) ^ -2.0)) / c0) * (w * h)) / c0);
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(w / N[(N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] * N[Abs[N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 1.05e-217], t$95$0, If[LessEqual[M$95$m, 4e-99], 0.0, If[LessEqual[M$95$m, 2.1e-40], t$95$0, N[(1.0 / N[(N[(N[(N[(w * N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|

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

\mathbf{elif}\;M_m \leq 4 \cdot 10^{-99}:\\
\;\;\;\;0\\

\mathbf{elif}\;M_m \leq 2.1 \cdot 10^{-40}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if M < 1.05e-217 or 4.0000000000000001e-99 < M < 2.10000000000000018e-40

    1. Initial program 27.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. +-commutative27.2%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac26.6%

        \[\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) \]
      4. fma-neg26.6%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around inf 37.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\frac{c0}{2 \cdot w} \cdot 2\right) \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}\right)\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def23.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\frac{w}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \left(\color{blue}{{\left(\frac{c0}{h \cdot w}\right)}^{0.5}} \cdot \sqrt{\frac{c0}{h \cdot w}}\right)}{1}}} \]
      3. pow1/245.6%

        \[\leadsto \frac{c0}{\frac{w}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \left({\left(\frac{c0}{h \cdot w}\right)}^{0.5} \cdot \color{blue}{{\left(\frac{c0}{h \cdot w}\right)}^{0.5}}\right)}{1}}} \]
      4. pow-prod-down47.8%

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

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

        \[\leadsto \frac{c0}{\frac{w}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot {\left({\left(\frac{c0}{\color{blue}{w \cdot h}}\right)}^{2}\right)}^{0.5}}{1}}} \]
    12. Applied egg-rr47.8%

      \[\leadsto \frac{c0}{\frac{w}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{{\left({\left(\frac{c0}{w \cdot h}\right)}^{2}\right)}^{0.5}}}{1}}} \]
    13. Step-by-step derivation
      1. unpow1/247.8%

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

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

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

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

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

    if 1.05e-217 < M < 4.0000000000000001e-99

    1. Initial program 15.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. +-commutative15.7%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac15.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) \]
      4. fma-neg15.7%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around -inf 4.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*4.1%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-c0\right) \cdot \color{blue}{0}\right) \]
      6. distribute-lft-neg-in45.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-c0 \cdot 0\right)} \]
      7. distribute-rgt-neg-in45.4%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
      11. distribute-lft1-in4.1%

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    8. Taylor expanded in c0 around 0 53.1%

      \[\leadsto \color{blue}{0} \]

    if 2.10000000000000018e-40 < M

    1. Initial program 18.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. +-commutative18.5%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac18.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) \]
      4. fma-neg18.5%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around inf 43.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\frac{c0}{2 \cdot w} \cdot 2\right) \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}\right)\right)\right)} \]
      2. expm1-log1p53.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\frac{\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\frac{\frac{c0}{h}}{w}}}}{c0}\right)}^{-1} \]
      5. associate-/l/53.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{\frac{\frac{w}{{\left(\frac{d}{D}\right)}^{2}}}{\frac{c0}{h \cdot w}}}{c0}}} \]
    15. Step-by-step derivation
      1. associate-/r/55.0%

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

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

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

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

        \[\leadsto \frac{1}{\frac{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \color{blue}{\left(w \cdot h\right)}}{c0}} \]
    16. Applied egg-rr55.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.05 \cdot 10^{-217}:\\ \;\;\;\;\frac{c0}{\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \left|\frac{c0}{w \cdot h}\right|}}\\ \mathbf{elif}\;M \leq 4 \cdot 10^{-99}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 2.1 \cdot 10^{-40}:\\ \;\;\;\;\frac{c0}{\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \left|\frac{c0}{w \cdot h}\right|}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}{c0}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 49.3% accurate, 0.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \mathbf{if}\;\frac{c0}{w \cdot 2} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M_m \cdot M_m}\right) \leq \infty:\\ \;\;\;\;\frac{1}{\frac{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}{c0}}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (if (<=
        (* (/ c0 (* w 2.0)) (+ t_0 (sqrt (- (* t_0 t_0) (* M_m M_m)))))
        INFINITY)
     (/ 1.0 (/ (* (/ (* w (pow (/ d D) -2.0)) c0) (* w h)) c0))
     0.0)))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if (((c0 / (w * 2.0)) * (t_0 + sqrt(((t_0 * t_0) - (M_m * M_m))))) <= ((double) INFINITY)) {
		tmp = 1.0 / ((((w * pow((d / D), -2.0)) / c0) * (w * h)) / c0);
	} else {
		tmp = 0.0;
	}
	return tmp;
}
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if (((c0 / (w * 2.0)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M_m * M_m))))) <= Double.POSITIVE_INFINITY) {
		tmp = 1.0 / ((((w * Math.pow((d / D), -2.0)) / c0) * (w * h)) / c0);
	} else {
		tmp = 0.0;
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
	tmp = 0
	if ((c0 / (w * 2.0)) * (t_0 + math.sqrt(((t_0 * t_0) - (M_m * M_m))))) <= math.inf:
		tmp = 1.0 / ((((w * math.pow((d / D), -2.0)) / c0) * (w * h)) / c0)
	else:
		tmp = 0.0
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	tmp = 0.0
	if (Float64(Float64(c0 / Float64(w * 2.0)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M_m * M_m))))) <= Inf)
		tmp = Float64(1.0 / Float64(Float64(Float64(Float64(w * (Float64(d / D) ^ -2.0)) / c0) * Float64(w * h)) / c0));
	else
		tmp = 0.0;
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	tmp = 0.0;
	if (((c0 / (w * 2.0)) * (t_0 + sqrt(((t_0 * t_0) - (M_m * M_m))))) <= Inf)
		tmp = 1.0 / ((((w * ((d / D) ^ -2.0)) / c0) * (w * h)) / c0);
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(c0 / N[(w * 2.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(1.0 / N[(N[(N[(N[(w * N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
M_m = \left|M\right|

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

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


\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 80.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. +-commutative80.1%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac78.8%

        \[\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) \]
      4. fma-neg78.8%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around inf 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\frac{c0}{2 \cdot w} \cdot 2\right) \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}\right)\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def42.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\frac{\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\frac{\frac{c0}{h}}{w}}}}{c0}\right)}^{-1} \]
      5. associate-/l/87.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{\frac{\frac{w}{{\left(\frac{d}{D}\right)}^{2}}}{\frac{c0}{h \cdot w}}}{c0}}} \]
    15. Step-by-step derivation
      1. associate-/r/91.3%

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

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

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

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

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

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

    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. +-commutative0.0%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac0.0%

        \[\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) \]
      4. fma-neg0.0%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around -inf 1.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*1.2%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-c0\right) \cdot \color{blue}{0}\right) \]
      6. distribute-lft-neg-in31.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-c0 \cdot 0\right)} \]
      7. distribute-rgt-neg-in31.8%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
      11. distribute-lft1-in1.2%

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    8. Taylor expanded in c0 around 0 36.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{c0}{w \cdot 2} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \leq \infty:\\ \;\;\;\;\frac{1}{\frac{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}{c0}}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 47.0% accurate, 1.1× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;w \leq -1.6 \cdot 10^{+49}:\\ \;\;\;\;0\\ \mathbf{elif}\;w \leq 7.2 \cdot 10^{-173} \lor \neg \left(w \leq 3.8 \cdot 10^{-154}\right) \land w \leq 4.4 \cdot 10^{+180}:\\ \;\;\;\;\frac{c0}{w} \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (if (<= w -1.6e+49)
   0.0
   (if (or (<= w 7.2e-173) (and (not (<= w 3.8e-154)) (<= w 4.4e+180)))
     (* (/ c0 w) (* (pow (/ d D) 2.0) (/ c0 (* w h))))
     0.0)))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if (w <= -1.6e+49) {
		tmp = 0.0;
	} else if ((w <= 7.2e-173) || (!(w <= 3.8e-154) && (w <= 4.4e+180))) {
		tmp = (c0 / w) * (pow((d / D), 2.0) * (c0 / (w * h)));
	} else {
		tmp = 0.0;
	}
	return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
    real(8) :: tmp
    if (w <= (-1.6d+49)) then
        tmp = 0.0d0
    else if ((w <= 7.2d-173) .or. (.not. (w <= 3.8d-154)) .and. (w <= 4.4d+180)) then
        tmp = (c0 / w) * (((d_1 / d) ** 2.0d0) * (c0 / (w * h)))
    else
        tmp = 0.0d0
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if (w <= -1.6e+49) {
		tmp = 0.0;
	} else if ((w <= 7.2e-173) || (!(w <= 3.8e-154) && (w <= 4.4e+180))) {
		tmp = (c0 / w) * (Math.pow((d / D), 2.0) * (c0 / (w * h)));
	} else {
		tmp = 0.0;
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	tmp = 0
	if w <= -1.6e+49:
		tmp = 0.0
	elif (w <= 7.2e-173) or (not (w <= 3.8e-154) and (w <= 4.4e+180)):
		tmp = (c0 / w) * (math.pow((d / D), 2.0) * (c0 / (w * h)))
	else:
		tmp = 0.0
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	tmp = 0.0
	if (w <= -1.6e+49)
		tmp = 0.0;
	elseif ((w <= 7.2e-173) || (!(w <= 3.8e-154) && (w <= 4.4e+180)))
		tmp = Float64(Float64(c0 / w) * Float64((Float64(d / D) ^ 2.0) * Float64(c0 / Float64(w * h))));
	else
		tmp = 0.0;
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	tmp = 0.0;
	if (w <= -1.6e+49)
		tmp = 0.0;
	elseif ((w <= 7.2e-173) || (~((w <= 3.8e-154)) && (w <= 4.4e+180)))
		tmp = (c0 / w) * (((d / D) ^ 2.0) * (c0 / (w * h)));
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[w, -1.6e+49], 0.0, If[Or[LessEqual[w, 7.2e-173], And[N[Not[LessEqual[w, 3.8e-154]], $MachinePrecision], LessEqual[w, 4.4e+180]]], N[(N[(c0 / w), $MachinePrecision] * N[(N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.6 \cdot 10^{+49}:\\
\;\;\;\;0\\

\mathbf{elif}\;w \leq 7.2 \cdot 10^{-173} \lor \neg \left(w \leq 3.8 \cdot 10^{-154}\right) \land w \leq 4.4 \cdot 10^{+180}:\\
\;\;\;\;\frac{c0}{w} \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if w < -1.60000000000000007e49 or 7.19999999999999943e-173 < w < 3.8000000000000001e-154 or 4.3999999999999999e180 < w

    1. Initial program 7.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. +-commutative7.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac5.6%

        \[\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) \]
      4. fma-neg5.6%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around -inf 5.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*5.7%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-c0\right) \cdot \color{blue}{0}\right) \]
      6. distribute-lft-neg-in49.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-c0 \cdot 0\right)} \]
      7. distribute-rgt-neg-in49.5%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
      11. distribute-lft1-in5.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right) \]
      12. distribute-lft-in5.7%

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    8. Taylor expanded in c0 around 0 51.3%

      \[\leadsto \color{blue}{0} \]

    if -1.60000000000000007e49 < w < 7.19999999999999943e-173 or 3.8000000000000001e-154 < w < 4.3999999999999999e180

    1. Initial program 28.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. +-commutative28.3%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac28.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) \]
      4. fma-neg28.2%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around inf 44.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\frac{c0}{2 \cdot w} \cdot 2\right) \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}\right)\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def26.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\frac{c0}{2 \cdot w} \cdot 2\right) \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}\right)\right)\right)} \]
      2. expm1-log1p55.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}}{1}} \]
      2. /-rgt-identity55.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -1.6 \cdot 10^{+49}:\\ \;\;\;\;0\\ \mathbf{elif}\;w \leq 7.2 \cdot 10^{-173} \lor \neg \left(w \leq 3.8 \cdot 10^{-154}\right) \land w \leq 4.4 \cdot 10^{+180}:\\ \;\;\;\;\frac{c0}{w} \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 44.4% accurate, 1.1× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := \frac{c0}{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}\\ \mathbf{if}\;M_m \leq 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;M_m \leq 1.56 \cdot 10^{-97}:\\ \;\;\;\;0\\ \mathbf{elif}\;M_m \leq 5.2 \cdot 10^{-76}:\\ \;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{{\left(\frac{d}{D}\right)}^{2}}}\\ \mathbf{elif}\;M_m \leq 1.3 \cdot 10^{-65}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (let* ((t_0 (/ c0 (* (/ (* w (pow (/ d D) -2.0)) c0) (* w h)))))
   (if (<= M_m 1e-217)
     t_0
     (if (<= M_m 1.56e-97)
       0.0
       (if (<= M_m 5.2e-76)
         (/ c0 (* w (/ (* h (/ w c0)) (pow (/ d D) 2.0))))
         (if (<= M_m 1.3e-65) 0.0 t_0))))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 / (((w * pow((d / D), -2.0)) / c0) * (w * h));
	double tmp;
	if (M_m <= 1e-217) {
		tmp = t_0;
	} else if (M_m <= 1.56e-97) {
		tmp = 0.0;
	} else if (M_m <= 5.2e-76) {
		tmp = c0 / (w * ((h * (w / c0)) / pow((d / D), 2.0)));
	} else if (M_m <= 1.3e-65) {
		tmp = 0.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0 / (((w * ((d_1 / d) ** (-2.0d0))) / c0) * (w * h))
    if (m_m <= 1d-217) then
        tmp = t_0
    else if (m_m <= 1.56d-97) then
        tmp = 0.0d0
    else if (m_m <= 5.2d-76) then
        tmp = c0 / (w * ((h * (w / c0)) / ((d_1 / d) ** 2.0d0)))
    else if (m_m <= 1.3d-65) then
        tmp = 0.0d0
    else
        tmp = t_0
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = c0 / (((w * Math.pow((d / D), -2.0)) / c0) * (w * h));
	double tmp;
	if (M_m <= 1e-217) {
		tmp = t_0;
	} else if (M_m <= 1.56e-97) {
		tmp = 0.0;
	} else if (M_m <= 5.2e-76) {
		tmp = c0 / (w * ((h * (w / c0)) / Math.pow((d / D), 2.0)));
	} else if (M_m <= 1.3e-65) {
		tmp = 0.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	t_0 = c0 / (((w * math.pow((d / D), -2.0)) / c0) * (w * h))
	tmp = 0
	if M_m <= 1e-217:
		tmp = t_0
	elif M_m <= 1.56e-97:
		tmp = 0.0
	elif M_m <= 5.2e-76:
		tmp = c0 / (w * ((h * (w / c0)) / math.pow((d / D), 2.0)))
	elif M_m <= 1.3e-65:
		tmp = 0.0
	else:
		tmp = t_0
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	t_0 = Float64(c0 / Float64(Float64(Float64(w * (Float64(d / D) ^ -2.0)) / c0) * Float64(w * h)))
	tmp = 0.0
	if (M_m <= 1e-217)
		tmp = t_0;
	elseif (M_m <= 1.56e-97)
		tmp = 0.0;
	elseif (M_m <= 5.2e-76)
		tmp = Float64(c0 / Float64(w * Float64(Float64(h * Float64(w / c0)) / (Float64(d / D) ^ 2.0))));
	elseif (M_m <= 1.3e-65)
		tmp = 0.0;
	else
		tmp = t_0;
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	t_0 = c0 / (((w * ((d / D) ^ -2.0)) / c0) * (w * h));
	tmp = 0.0;
	if (M_m <= 1e-217)
		tmp = t_0;
	elseif (M_m <= 1.56e-97)
		tmp = 0.0;
	elseif (M_m <= 5.2e-76)
		tmp = c0 / (w * ((h * (w / c0)) / ((d / D) ^ 2.0)));
	elseif (M_m <= 1.3e-65)
		tmp = 0.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(N[(N[(w * N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 1e-217], t$95$0, If[LessEqual[M$95$m, 1.56e-97], 0.0, If[LessEqual[M$95$m, 5.2e-76], N[(c0 / N[(w * N[(N[(h * N[(w / c0), $MachinePrecision]), $MachinePrecision] / N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M$95$m, 1.3e-65], 0.0, t$95$0]]]]]
\begin{array}{l}
M_m = \left|M\right|

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

\mathbf{elif}\;M_m \leq 1.56 \cdot 10^{-97}:\\
\;\;\;\;0\\

\mathbf{elif}\;M_m \leq 5.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{{\left(\frac{d}{D}\right)}^{2}}}\\

\mathbf{elif}\;M_m \leq 1.3 \cdot 10^{-65}:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if M < 1.00000000000000008e-217 or 1.30000000000000005e-65 < M

    1. Initial program 25.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. +-commutative25.0%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac24.6%

        \[\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) \]
      4. fma-neg24.6%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around inf 39.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\frac{c0}{2 \cdot w} \cdot 2\right) \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}\right)\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def23.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{c0 \cdot \frac{1}{\frac{w}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}}{1}}}} \]
      2. /-rgt-identity49.9%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\frac{\frac{c0}{h}}{w}}}} \]
      4. associate-/l/49.9%

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000008e-217 < M < 1.55999999999999989e-97 or 5.1999999999999999e-76 < M < 1.30000000000000005e-65

    1. Initial program 14.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. +-commutative14.1%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac14.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) \]
      4. fma-neg14.1%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around -inf 3.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*3.7%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-c0\right) \cdot \color{blue}{0}\right) \]
      6. distribute-lft-neg-in50.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-c0 \cdot 0\right)} \]
      7. distribute-rgt-neg-in50.9%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
      11. distribute-lft1-in3.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right) \]
      12. distribute-lft-in3.7%

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    8. Taylor expanded in c0 around 0 57.7%

      \[\leadsto \color{blue}{0} \]

    if 1.55999999999999989e-97 < M < 5.1999999999999999e-76

    1. Initial program 27.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. +-commutative27.2%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac27.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) \]
      4. fma-neg27.2%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around inf 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
      4. *-commutative74.0%

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

        \[\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) \]
      6. times-frac51.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{{d}^{2}}{D} \cdot \frac{c0}{w}}{D \cdot h}\right)\right)\right)} \]
      2. expm1-udef2.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{{d}^{2}}{D} \cdot \frac{c0}{w}}{D \cdot h}\right)\right)} - 1} \]
      3. associate-*r*2.2%

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(\color{blue}{\frac{\frac{c0}{2}}{w}} \cdot 2\right) \cdot \frac{\frac{{d}^{2}}{D} \cdot \frac{c0}{w}}{D \cdot h}\right)} - 1 \]
      5. times-frac24.2%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(\frac{\frac{c0}{2}}{w} \cdot 2\right) \cdot \left(\frac{\frac{{d}^{2}}{D}}{D} \cdot \color{blue}{\frac{\frac{c0}{h}}{w}}\right)\right)} - 1 \]
    11. Applied egg-rr24.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\frac{\frac{c0}{2}}{w} \cdot 2\right) \cdot \left(\frac{\frac{{d}^{2}}{D}}{D} \cdot \frac{\frac{c0}{h}}{w}\right)\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def24.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\frac{\frac{c0}{2}}{w} \cdot 2\right) \cdot \left(\frac{\frac{{d}^{2}}{D}}{D} \cdot \frac{\frac{c0}{h}}{w}\right)\right)\right)} \]
      2. expm1-log1p51.2%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\frac{w}{\color{blue}{\frac{\frac{\frac{{d}^{2}}{D}}{D} \cdot \frac{\frac{c0}{h}}{w}}{\frac{2}{2}}}}} \]
      9. associate-/l/51.2%

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

        \[\leadsto \frac{c0}{\frac{w}{\frac{\frac{\color{blue}{d \cdot d}}{D \cdot D} \cdot \frac{\frac{c0}{h}}{w}}{\frac{2}{2}}}} \]
      11. times-frac74.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 10^{-217}:\\ \;\;\;\;\frac{c0}{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}\\ \mathbf{elif}\;M \leq 1.56 \cdot 10^{-97}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 5.2 \cdot 10^{-76}:\\ \;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{{\left(\frac{d}{D}\right)}^{2}}}\\ \mathbf{elif}\;M \leq 1.3 \cdot 10^{-65}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 44.2% accurate, 1.1× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := {\left(\frac{d}{D}\right)}^{2}\\ \mathbf{if}\;M_m \leq 1.3 \cdot 10^{-217}:\\ \;\;\;\;\frac{c0}{\frac{\frac{w}{t_0}}{\frac{c0}{w \cdot h}}}\\ \mathbf{elif}\;M_m \leq 2.05 \cdot 10^{-97}:\\ \;\;\;\;0\\ \mathbf{elif}\;M_m \leq 3.6 \cdot 10^{-76}:\\ \;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{t_0}}\\ \mathbf{elif}\;M_m \leq 1.22 \cdot 10^{-65}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (let* ((t_0 (pow (/ d D) 2.0)))
   (if (<= M_m 1.3e-217)
     (/ c0 (/ (/ w t_0) (/ c0 (* w h))))
     (if (<= M_m 2.05e-97)
       0.0
       (if (<= M_m 3.6e-76)
         (/ c0 (* w (/ (* h (/ w c0)) t_0)))
         (if (<= M_m 1.22e-65)
           0.0
           (/ c0 (* (/ (* w (pow (/ d D) -2.0)) c0) (* w h)))))))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = pow((d / D), 2.0);
	double tmp;
	if (M_m <= 1.3e-217) {
		tmp = c0 / ((w / t_0) / (c0 / (w * h)));
	} else if (M_m <= 2.05e-97) {
		tmp = 0.0;
	} else if (M_m <= 3.6e-76) {
		tmp = c0 / (w * ((h * (w / c0)) / t_0));
	} else if (M_m <= 1.22e-65) {
		tmp = 0.0;
	} else {
		tmp = c0 / (((w * pow((d / D), -2.0)) / c0) * (w * h));
	}
	return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (d_1 / d) ** 2.0d0
    if (m_m <= 1.3d-217) then
        tmp = c0 / ((w / t_0) / (c0 / (w * h)))
    else if (m_m <= 2.05d-97) then
        tmp = 0.0d0
    else if (m_m <= 3.6d-76) then
        tmp = c0 / (w * ((h * (w / c0)) / t_0))
    else if (m_m <= 1.22d-65) then
        tmp = 0.0d0
    else
        tmp = c0 / (((w * ((d_1 / d) ** (-2.0d0))) / c0) * (w * h))
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double t_0 = Math.pow((d / D), 2.0);
	double tmp;
	if (M_m <= 1.3e-217) {
		tmp = c0 / ((w / t_0) / (c0 / (w * h)));
	} else if (M_m <= 2.05e-97) {
		tmp = 0.0;
	} else if (M_m <= 3.6e-76) {
		tmp = c0 / (w * ((h * (w / c0)) / t_0));
	} else if (M_m <= 1.22e-65) {
		tmp = 0.0;
	} else {
		tmp = c0 / (((w * Math.pow((d / D), -2.0)) / c0) * (w * h));
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	t_0 = math.pow((d / D), 2.0)
	tmp = 0
	if M_m <= 1.3e-217:
		tmp = c0 / ((w / t_0) / (c0 / (w * h)))
	elif M_m <= 2.05e-97:
		tmp = 0.0
	elif M_m <= 3.6e-76:
		tmp = c0 / (w * ((h * (w / c0)) / t_0))
	elif M_m <= 1.22e-65:
		tmp = 0.0
	else:
		tmp = c0 / (((w * math.pow((d / D), -2.0)) / c0) * (w * h))
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	t_0 = Float64(d / D) ^ 2.0
	tmp = 0.0
	if (M_m <= 1.3e-217)
		tmp = Float64(c0 / Float64(Float64(w / t_0) / Float64(c0 / Float64(w * h))));
	elseif (M_m <= 2.05e-97)
		tmp = 0.0;
	elseif (M_m <= 3.6e-76)
		tmp = Float64(c0 / Float64(w * Float64(Float64(h * Float64(w / c0)) / t_0)));
	elseif (M_m <= 1.22e-65)
		tmp = 0.0;
	else
		tmp = Float64(c0 / Float64(Float64(Float64(w * (Float64(d / D) ^ -2.0)) / c0) * Float64(w * h)));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	t_0 = (d / D) ^ 2.0;
	tmp = 0.0;
	if (M_m <= 1.3e-217)
		tmp = c0 / ((w / t_0) / (c0 / (w * h)));
	elseif (M_m <= 2.05e-97)
		tmp = 0.0;
	elseif (M_m <= 3.6e-76)
		tmp = c0 / (w * ((h * (w / c0)) / t_0));
	elseif (M_m <= 1.22e-65)
		tmp = 0.0;
	else
		tmp = c0 / (((w * ((d / D) ^ -2.0)) / c0) * (w * h));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[M$95$m, 1.3e-217], N[(c0 / N[(N[(w / t$95$0), $MachinePrecision] / N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M$95$m, 2.05e-97], 0.0, If[LessEqual[M$95$m, 3.6e-76], N[(c0 / N[(w * N[(N[(h * N[(w / c0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M$95$m, 1.22e-65], 0.0, N[(c0 / N[(N[(N[(w * N[Power[N[(d / D), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision] * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|

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

\mathbf{elif}\;M_m \leq 2.05 \cdot 10^{-97}:\\
\;\;\;\;0\\

\mathbf{elif}\;M_m \leq 3.6 \cdot 10^{-76}:\\
\;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{t_0}}\\

\mathbf{elif}\;M_m \leq 1.22 \cdot 10^{-65}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if M < 1.29999999999999997e-217

    1. Initial program 28.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. +-commutative28.5%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac27.8%

        \[\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) \]
      4. fma-neg27.8%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around inf 38.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\frac{c0}{2 \cdot w} \cdot 2\right) \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}\right)\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def24.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{w}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}}{1}}\right)\right)}} \]
      2. expm1-udef27.3%

        \[\leadsto \frac{c0}{\color{blue}{e^{\mathsf{log1p}\left(\frac{w}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}}{1}}\right)} - 1}} \]
      3. /-rgt-identity27.3%

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

        \[\leadsto \frac{c0}{e^{\mathsf{log1p}\left(\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\frac{\frac{c0}{h}}{w}}}\right)} - 1} \]
      5. associate-/l/27.3%

        \[\leadsto \frac{c0}{e^{\mathsf{log1p}\left(\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\frac{c0}{w \cdot h}}}\right)} - 1} \]
    12. Applied egg-rr27.3%

      \[\leadsto \frac{c0}{\color{blue}{e^{\mathsf{log1p}\left(\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}}\right)} - 1}} \]
    13. Step-by-step derivation
      1. expm1-def46.8%

        \[\leadsto \frac{c0}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}}\right)\right)}} \]
      2. expm1-log1p49.6%

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

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

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

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

    if 1.29999999999999997e-217 < M < 2.04999999999999996e-97 or 3.6e-76 < M < 1.21999999999999999e-65

    1. Initial program 14.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. +-commutative14.1%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac14.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) \]
      4. fma-neg14.1%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around -inf 3.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*3.7%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-c0\right) \cdot \color{blue}{0}\right) \]
      6. distribute-lft-neg-in50.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-c0 \cdot 0\right)} \]
      7. distribute-rgt-neg-in50.9%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
      11. distribute-lft1-in3.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right) \]
      12. distribute-lft-in3.7%

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    8. Taylor expanded in c0 around 0 57.7%

      \[\leadsto \color{blue}{0} \]

    if 2.04999999999999996e-97 < M < 3.6e-76

    1. Initial program 27.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. +-commutative27.2%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac27.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) \]
      4. fma-neg27.2%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around inf 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
      4. *-commutative74.0%

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

        \[\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) \]
      6. times-frac51.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{{d}^{2}}{D} \cdot \frac{c0}{w}}{D \cdot h}\right)\right)\right)} \]
      2. expm1-udef2.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{{d}^{2}}{D} \cdot \frac{c0}{w}}{D \cdot h}\right)\right)} - 1} \]
      3. associate-*r*2.2%

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(\color{blue}{\frac{\frac{c0}{2}}{w}} \cdot 2\right) \cdot \frac{\frac{{d}^{2}}{D} \cdot \frac{c0}{w}}{D \cdot h}\right)} - 1 \]
      5. times-frac24.2%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(\frac{\frac{c0}{2}}{w} \cdot 2\right) \cdot \left(\frac{\frac{{d}^{2}}{D}}{D} \cdot \color{blue}{\frac{\frac{c0}{h}}{w}}\right)\right)} - 1 \]
    11. Applied egg-rr24.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\frac{\frac{c0}{2}}{w} \cdot 2\right) \cdot \left(\frac{\frac{{d}^{2}}{D}}{D} \cdot \frac{\frac{c0}{h}}{w}\right)\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def24.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\frac{\frac{c0}{2}}{w} \cdot 2\right) \cdot \left(\frac{\frac{{d}^{2}}{D}}{D} \cdot \frac{\frac{c0}{h}}{w}\right)\right)\right)} \]
      2. expm1-log1p51.2%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\frac{w}{\color{blue}{\frac{\frac{\frac{{d}^{2}}{D}}{D} \cdot \frac{\frac{c0}{h}}{w}}{\frac{2}{2}}}}} \]
      9. associate-/l/51.2%

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

        \[\leadsto \frac{c0}{\frac{w}{\frac{\frac{\color{blue}{d \cdot d}}{D \cdot D} \cdot \frac{\frac{c0}{h}}{w}}{\frac{2}{2}}}} \]
      11. times-frac74.6%

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

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

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

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

    if 1.21999999999999999e-65 < M

    1. Initial program 17.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. +-commutative17.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac17.4%

        \[\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) \]
      4. fma-neg17.4%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around inf 41.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\frac{c0}{2 \cdot w} \cdot 2\right) \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}\right)\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def20.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\frac{c0}{2 \cdot w} \cdot 2\right) \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}\right)\right)\right)} \]
      2. expm1-log1p50.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \frac{1}{\frac{w}{{\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\frac{\frac{c0}{h}}{w}}}} \]
      4. associate-/l/50.6%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.3 \cdot 10^{-217}:\\ \;\;\;\;\frac{c0}{\frac{\frac{w}{{\left(\frac{d}{D}\right)}^{2}}}{\frac{c0}{w \cdot h}}}\\ \mathbf{elif}\;M \leq 2.05 \cdot 10^{-97}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 3.6 \cdot 10^{-76}:\\ \;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{{\left(\frac{d}{D}\right)}^{2}}}\\ \mathbf{elif}\;M \leq 1.22 \cdot 10^{-65}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{w \cdot {\left(\frac{d}{D}\right)}^{-2}}{c0} \cdot \left(w \cdot h\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 45.1% accurate, 1.2× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M_m \leq 8.5 \cdot 10^{-210} \lor \neg \left(M_m \leq 1.65 \cdot 10^{-97}\right):\\ \;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{{\left(\frac{d}{D}\right)}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (if (or (<= M_m 8.5e-210) (not (<= M_m 1.65e-97)))
   (/ c0 (* w (/ (* h (/ w c0)) (pow (/ d D) 2.0))))
   0.0))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if ((M_m <= 8.5e-210) || !(M_m <= 1.65e-97)) {
		tmp = c0 / (w * ((h * (w / c0)) / pow((d / D), 2.0)));
	} else {
		tmp = 0.0;
	}
	return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
    real(8) :: tmp
    if ((m_m <= 8.5d-210) .or. (.not. (m_m <= 1.65d-97))) then
        tmp = c0 / (w * ((h * (w / c0)) / ((d_1 / d) ** 2.0d0)))
    else
        tmp = 0.0d0
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if ((M_m <= 8.5e-210) || !(M_m <= 1.65e-97)) {
		tmp = c0 / (w * ((h * (w / c0)) / Math.pow((d / D), 2.0)));
	} else {
		tmp = 0.0;
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	tmp = 0
	if (M_m <= 8.5e-210) or not (M_m <= 1.65e-97):
		tmp = c0 / (w * ((h * (w / c0)) / math.pow((d / D), 2.0)))
	else:
		tmp = 0.0
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	tmp = 0.0
	if ((M_m <= 8.5e-210) || !(M_m <= 1.65e-97))
		tmp = Float64(c0 / Float64(w * Float64(Float64(h * Float64(w / c0)) / (Float64(d / D) ^ 2.0))));
	else
		tmp = 0.0;
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	tmp = 0.0;
	if ((M_m <= 8.5e-210) || ~((M_m <= 1.65e-97)))
		tmp = c0 / (w * ((h * (w / c0)) / ((d / D) ^ 2.0)));
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := If[Or[LessEqual[M$95$m, 8.5e-210], N[Not[LessEqual[M$95$m, 1.65e-97]], $MachinePrecision]], N[(c0 / N[(w * N[(N[(h * N[(w / c0), $MachinePrecision]), $MachinePrecision] / N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
\mathbf{if}\;M_m \leq 8.5 \cdot 10^{-210} \lor \neg \left(M_m \leq 1.65 \cdot 10^{-97}\right):\\
\;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{{\left(\frac{d}{D}\right)}^{2}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 8.4999999999999997e-210 or 1.6500000000000001e-97 < M

    1. Initial program 24.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. +-commutative24.7%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac24.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) \]
      4. fma-neg24.3%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around inf 38.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
      4. *-commutative48.8%

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

        \[\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) \]
      6. times-frac39.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{{d}^{2}}{D} \cdot \frac{c0}{w}}{D \cdot h}\right)\right)} - 1} \]
      3. associate-*r*21.4%

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(\color{blue}{\frac{\frac{c0}{2}}{w}} \cdot 2\right) \cdot \frac{\frac{{d}^{2}}{D} \cdot \frac{c0}{w}}{D \cdot h}\right)} - 1 \]
      5. times-frac21.2%

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(\frac{\frac{c0}{2}}{w} \cdot 2\right) \cdot \left(\frac{\frac{{d}^{2}}{D}}{D} \cdot \color{blue}{\frac{c0}{w \cdot h}}\right)\right)} - 1 \]
      7. *-commutative19.9%

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(\frac{\frac{c0}{2}}{w} \cdot 2\right) \cdot \left(\frac{\frac{{d}^{2}}{D}}{D} \cdot \color{blue}{\frac{\frac{c0}{h}}{w}}\right)\right)} - 1 \]
    11. Applied egg-rr19.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\frac{\frac{c0}{2}}{w} \cdot 2\right) \cdot \left(\frac{\frac{{d}^{2}}{D}}{D} \cdot \frac{\frac{c0}{h}}{w}\right)\right)} - 1} \]
    12. Step-by-step derivation
      1. expm1-def20.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\frac{\frac{c0}{2}}{w} \cdot 2\right) \cdot \left(\frac{\frac{{d}^{2}}{D}}{D} \cdot \frac{\frac{c0}{h}}{w}\right)\right)\right)} \]
      2. expm1-log1p43.5%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\frac{w}{\color{blue}{\frac{\frac{\frac{{d}^{2}}{D}}{D} \cdot \frac{\frac{c0}{h}}{w}}{\frac{2}{2}}}}} \]
      9. associate-/l/38.1%

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

        \[\leadsto \frac{c0}{\frac{w}{\frac{\frac{\color{blue}{d \cdot d}}{D \cdot D} \cdot \frac{\frac{c0}{h}}{w}}{\frac{2}{2}}}} \]
      11. times-frac47.5%

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

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

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

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

    if 8.4999999999999997e-210 < M < 1.6500000000000001e-97

    1. Initial program 14.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. +-commutative14.1%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac14.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) \]
      4. fma-neg14.1%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around -inf 4.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*4.9%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-c0\right) \cdot \color{blue}{0}\right) \]
      6. distribute-lft-neg-in44.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-c0 \cdot 0\right)} \]
      7. distribute-rgt-neg-in44.6%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
      11. distribute-lft1-in4.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right) \]
      12. distribute-lft-in4.9%

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    8. Taylor expanded in c0 around 0 53.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 8.5 \cdot 10^{-210} \lor \neg \left(M \leq 1.65 \cdot 10^{-97}\right):\\ \;\;\;\;\frac{c0}{w \cdot \frac{h \cdot \frac{w}{c0}}{{\left(\frac{d}{D}\right)}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 28.7% accurate, 12.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M_m \leq 1.55 \cdot 10^{+241}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \left(M_m \cdot \frac{c0}{w}\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (if (<= M_m 1.55e+241) 0.0 (* -0.5 (* M_m (/ c0 w)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if (M_m <= 1.55e+241) {
		tmp = 0.0;
	} else {
		tmp = -0.5 * (M_m * (c0 / w));
	}
	return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
    real(8) :: tmp
    if (m_m <= 1.55d+241) then
        tmp = 0.0d0
    else
        tmp = (-0.5d0) * (m_m * (c0 / w))
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if (M_m <= 1.55e+241) {
		tmp = 0.0;
	} else {
		tmp = -0.5 * (M_m * (c0 / w));
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	tmp = 0
	if M_m <= 1.55e+241:
		tmp = 0.0
	else:
		tmp = -0.5 * (M_m * (c0 / w))
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	tmp = 0.0
	if (M_m <= 1.55e+241)
		tmp = 0.0;
	else
		tmp = Float64(-0.5 * Float64(M_m * Float64(c0 / w)));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	tmp = 0.0;
	if (M_m <= 1.55e+241)
		tmp = 0.0;
	else
		tmp = -0.5 * (M_m * (c0 / w));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[M$95$m, 1.55e+241], 0.0, N[(-0.5 * N[(M$95$m * N[(c0 / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
\mathbf{if}\;M_m \leq 1.55 \cdot 10^{+241}:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(M_m \cdot \frac{c0}{w}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 1.55e241

    1. Initial program 25.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. +-commutative25.0%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac24.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) \]
      4. fma-neg24.5%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around -inf 2.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*2.7%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-c0\right) \cdot \color{blue}{0}\right) \]
      6. distribute-lft-neg-in25.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-c0 \cdot 0\right)} \]
      7. distribute-rgt-neg-in25.9%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
      11. distribute-lft1-in2.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right) \]
      12. distribute-lft-in2.7%

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    8. Taylor expanded in c0 around 0 29.1%

      \[\leadsto \color{blue}{0} \]

    if 1.55e241 < 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. +-commutative0.0%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac0.0%

        \[\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) \]
      4. fma-neg0.0%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Applied egg-rr0.0%

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w} + \mathsf{hypot}\left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}, M\right)\right)} \]
    8. Step-by-step derivation
      1. fma-def25.0%

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{M \cdot c0}{w}} \]
    11. Step-by-step derivation
      1. associate-/l*43.1%

        \[\leadsto -0.5 \cdot \color{blue}{\frac{M}{\frac{w}{c0}}} \]
    12. Simplified43.1%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{M}{\frac{w}{c0}}} \]
    13. Step-by-step derivation
      1. div-inv43.1%

        \[\leadsto -0.5 \cdot \color{blue}{\left(M \cdot \frac{1}{\frac{w}{c0}}\right)} \]
      2. clear-num43.1%

        \[\leadsto -0.5 \cdot \left(M \cdot \color{blue}{\frac{c0}{w}}\right) \]
    14. Applied egg-rr43.1%

      \[\leadsto -0.5 \cdot \color{blue}{\left(M \cdot \frac{c0}{w}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification29.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.55 \cdot 10^{+241}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \left(M \cdot \frac{c0}{w}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 32.9% accurate, 12.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M_m \leq 4.8 \cdot 10^{+116}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{M_m}{\frac{w}{c0}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (if (<= M_m 4.8e+116) 0.0 (* 0.5 (/ M_m (/ w c0)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if (M_m <= 4.8e+116) {
		tmp = 0.0;
	} else {
		tmp = 0.5 * (M_m / (w / c0));
	}
	return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
    real(8) :: tmp
    if (m_m <= 4.8d+116) then
        tmp = 0.0d0
    else
        tmp = 0.5d0 * (m_m / (w / c0))
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if (M_m <= 4.8e+116) {
		tmp = 0.0;
	} else {
		tmp = 0.5 * (M_m / (w / c0));
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	tmp = 0
	if M_m <= 4.8e+116:
		tmp = 0.0
	else:
		tmp = 0.5 * (M_m / (w / c0))
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	tmp = 0.0
	if (M_m <= 4.8e+116)
		tmp = 0.0;
	else
		tmp = Float64(0.5 * Float64(M_m / Float64(w / c0)));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	tmp = 0.0;
	if (M_m <= 4.8e+116)
		tmp = 0.0;
	else
		tmp = 0.5 * (M_m / (w / c0));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[M$95$m, 4.8e+116], 0.0, N[(0.5 * N[(M$95$m / N[(w / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
\mathbf{if}\;M_m \leq 4.8 \cdot 10^{+116}:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{M_m}{\frac{w}{c0}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 4.8000000000000001e116

    1. Initial program 25.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. +-commutative25.7%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac25.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) \]
      4. fma-neg25.3%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around -inf 3.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*3.0%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-c0\right) \cdot \color{blue}{0}\right) \]
      6. distribute-lft-neg-in27.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-c0 \cdot 0\right)} \]
      7. distribute-rgt-neg-in27.8%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
      11. distribute-lft1-in3.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right) \]
      12. distribute-lft-in3.0%

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    8. Taylor expanded in c0 around 0 31.3%

      \[\leadsto \color{blue}{0} \]

    if 4.8000000000000001e116 < M

    1. Initial program 11.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. +-commutative11.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac11.4%

        \[\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) \]
      4. fma-neg11.4%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Applied egg-rr8.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left({\left(\frac{d}{D}\right)}^{2}, \frac{\frac{c0}{h}}{w}, \mathsf{hypot}\left({\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\frac{\frac{c0}{h}}{w}}, M\right)\right) \]
    9. Simplified40.2%

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{M \cdot c0}{w}} \]
    11. Step-by-step derivation
      1. associate-/l*32.9%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{M}{\frac{w}{c0}}} \]
    12. Simplified32.9%

      \[\leadsto \color{blue}{0.5 \cdot \frac{M}{\frac{w}{c0}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 4.8 \cdot 10^{+116}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{M}{\frac{w}{c0}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 33.6% accurate, 12.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M_m \leq 9.2 \cdot 10^{+115}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(M_m \cdot c0\right) \cdot 0.5}{w}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
 :precision binary64
 (if (<= M_m 9.2e+115) 0.0 (/ (* (* M_m c0) 0.5) w)))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if (M_m <= 9.2e+115) {
		tmp = 0.0;
	} else {
		tmp = ((M_m * c0) * 0.5) / w;
	}
	return tmp;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
    real(8) :: tmp
    if (m_m <= 9.2d+115) then
        tmp = 0.0d0
    else
        tmp = ((m_m * c0) * 0.5d0) / w
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	double tmp;
	if (M_m <= 9.2e+115) {
		tmp = 0.0;
	} else {
		tmp = ((M_m * c0) * 0.5) / w;
	}
	return tmp;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	tmp = 0
	if M_m <= 9.2e+115:
		tmp = 0.0
	else:
		tmp = ((M_m * c0) * 0.5) / w
	return tmp
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	tmp = 0.0
	if (M_m <= 9.2e+115)
		tmp = 0.0;
	else
		tmp = Float64(Float64(Float64(M_m * c0) * 0.5) / w);
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(c0, w, h, D, d, M_m)
	tmp = 0.0;
	if (M_m <= 9.2e+115)
		tmp = 0.0;
	else
		tmp = ((M_m * c0) * 0.5) / w;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[M$95$m, 9.2e+115], 0.0, N[(N[(N[(M$95$m * c0), $MachinePrecision] * 0.5), $MachinePrecision] / w), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
\mathbf{if}\;M_m \leq 9.2 \cdot 10^{+115}:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(M_m \cdot c0\right) \cdot 0.5}{w}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 9.20000000000000014e115

    1. Initial program 25.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. +-commutative25.7%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac25.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) \]
      4. fma-neg25.3%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c0 around -inf 3.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*3.0%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-c0\right) \cdot \color{blue}{0}\right) \]
      6. distribute-lft-neg-in27.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-c0 \cdot 0\right)} \]
      7. distribute-rgt-neg-in27.8%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
      11. distribute-lft1-in3.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right) \]
      12. distribute-lft-in3.0%

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    8. Taylor expanded in c0 around 0 31.3%

      \[\leadsto \color{blue}{0} \]

    if 9.20000000000000014e115 < M

    1. Initial program 11.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. +-commutative11.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
      3. times-frac11.4%

        \[\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) \]
      4. fma-neg11.4%

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
    4. Add Preprocessing
    5. Applied egg-rr8.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left({\left(\frac{d}{D}\right)}^{2}, \frac{\frac{c0}{h}}{w}, \mathsf{hypot}\left({\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\frac{\frac{c0}{h}}{w}}, M\right)\right) \]
    9. Simplified40.2%

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{M \cdot c0}{w}} \]
    11. Step-by-step derivation
      1. *-commutative38.2%

        \[\leadsto \color{blue}{\frac{M \cdot c0}{w} \cdot 0.5} \]
      2. associate-*l/38.2%

        \[\leadsto \color{blue}{\frac{\left(M \cdot c0\right) \cdot 0.5}{w}} \]
      3. *-commutative38.2%

        \[\leadsto \frac{\color{blue}{\left(c0 \cdot M\right)} \cdot 0.5}{w} \]
    12. Simplified38.2%

      \[\leadsto \color{blue}{\frac{\left(c0 \cdot M\right) \cdot 0.5}{w}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification32.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 9.2 \cdot 10^{+115}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(M \cdot c0\right) \cdot 0.5}{w}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 28.2% accurate, 151.0× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ 0 \end{array} \]
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m) :precision binary64 0.0)
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
	return 0.0;
}
M_m = abs(M)
real(8) function code(c0, w, h, d, d_1, m_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_m
    code = 0.0d0
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
	return 0.0;
}
M_m = math.fabs(M)
def code(c0, w, h, D, d, M_m):
	return 0.0
M_m = abs(M)
function code(c0, w, h, D, d, M_m)
	return 0.0
end
M_m = abs(M);
function tmp = code(c0, w, h, D, d, M_m)
	tmp = 0.0;
end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := 0.0
\begin{array}{l}
M_m = \left|M\right|

\\
0
\end{array}
Derivation
  1. Initial program 23.8%

    \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
  2. Step-by-step derivation
    1. +-commutative23.8%

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\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)} \]
    3. times-frac23.4%

      \[\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) \]
    4. fma-neg23.4%

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

    \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in c0 around -inf 2.6%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right)} \]
  6. Step-by-step derivation
    1. associate-*r*2.6%

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-c0\right) \cdot \color{blue}{0}\right) \]
    6. distribute-lft-neg-in24.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-c0 \cdot 0\right)} \]
    7. distribute-rgt-neg-in24.8%

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right) \]
    11. distribute-lft1-in2.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right) \]
    12. distribute-lft-in2.6%

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

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
  8. Taylor expanded in c0 around 0 27.8%

    \[\leadsto \color{blue}{0} \]
  9. Final simplification27.8%

    \[\leadsto 0 \]
  10. Add Preprocessing

Reproduce

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