Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.1% → 89.2%
Time: 17.8s
Alternatives: 14
Speedup: 1.8×

Specification

?
\[\begin{array}{l} \\ w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d):
	return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d)
	return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)))))
end
function tmp = code(w0, M, D, h, l, d)
	tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))));
end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\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 14 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: 81.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d):
	return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d)
	return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)))))
end
function tmp = code(w0, M, D, h, l, d)
	tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))));
end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}

Alternative 1: 89.2% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := \frac{M\_m}{\frac{d \cdot 2}{D}}\\ \mathbf{if}\;M\_m \leq 5 \cdot 10^{-242}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{\frac{D}{\frac{\frac{d}{M\_m \cdot D}}{M\_m}}}{-4}}{\ell}}{d}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{t\_0}{\ell} \cdot \frac{t\_0}{\frac{-1}{h}}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (w0 M_m D h l d)
 :precision binary64
 (let* ((t_0 (/ M_m (/ (* d 2.0) D))))
   (if (<= M_m 5e-242)
     (*
      w0
      (sqrt (+ 1.0 (/ (* h (/ (/ (/ D (/ (/ d (* M_m D)) M_m)) -4.0) l)) d))))
     (* w0 (sqrt (+ 1.0 (* (/ t_0 l) (/ t_0 (/ -1.0 h)))))))))
M_m = fabs(M);
double code(double w0, double M_m, double D, double h, double l, double d) {
	double t_0 = M_m / ((d * 2.0) / D);
	double tmp;
	if (M_m <= 5e-242) {
		tmp = w0 * sqrt((1.0 + ((h * (((D / ((d / (M_m * D)) / M_m)) / -4.0) / l)) / d)));
	} else {
		tmp = w0 * sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))));
	}
	return tmp;
}
M_m = abs(m)
real(8) function code(w0, m_m, d, h, l, d_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = m_m / ((d_1 * 2.0d0) / d)
    if (m_m <= 5d-242) then
        tmp = w0 * sqrt((1.0d0 + ((h * (((d / ((d_1 / (m_m * d)) / m_m)) / (-4.0d0)) / l)) / d_1)))
    else
        tmp = w0 * sqrt((1.0d0 + ((t_0 / l) * (t_0 / ((-1.0d0) / h)))))
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double w0, double M_m, double D, double h, double l, double d) {
	double t_0 = M_m / ((d * 2.0) / D);
	double tmp;
	if (M_m <= 5e-242) {
		tmp = w0 * Math.sqrt((1.0 + ((h * (((D / ((d / (M_m * D)) / M_m)) / -4.0) / l)) / d)));
	} else {
		tmp = w0 * Math.sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))));
	}
	return tmp;
}
M_m = math.fabs(M)
def code(w0, M_m, D, h, l, d):
	t_0 = M_m / ((d * 2.0) / D)
	tmp = 0
	if M_m <= 5e-242:
		tmp = w0 * math.sqrt((1.0 + ((h * (((D / ((d / (M_m * D)) / M_m)) / -4.0) / l)) / d)))
	else:
		tmp = w0 * math.sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))))
	return tmp
M_m = abs(M)
function code(w0, M_m, D, h, l, d)
	t_0 = Float64(M_m / Float64(Float64(d * 2.0) / D))
	tmp = 0.0
	if (M_m <= 5e-242)
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(h * Float64(Float64(Float64(D / Float64(Float64(d / Float64(M_m * D)) / M_m)) / -4.0) / l)) / d))));
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(t_0 / l) * Float64(t_0 / Float64(-1.0 / h))))));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(w0, M_m, D, h, l, d)
	t_0 = M_m / ((d * 2.0) / D);
	tmp = 0.0;
	if (M_m <= 5e-242)
		tmp = w0 * sqrt((1.0 + ((h * (((D / ((d / (M_m * D)) / M_m)) / -4.0) / l)) / d)));
	else
		tmp = w0 * sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(M$95$m / N[(N[(d * 2.0), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 5e-242], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(h * N[(N[(N[(D / N[(N[(d / N[(M$95$m * D), $MachinePrecision]), $MachinePrecision] / M$95$m), $MachinePrecision]), $MachinePrecision] / -4.0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(t$95$0 / l), $MachinePrecision] * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
t_0 := \frac{M\_m}{\frac{d \cdot 2}{D}}\\
\mathbf{if}\;M\_m \leq 5 \cdot 10^{-242}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{\frac{D}{\frac{\frac{d}{M\_m \cdot D}}{M\_m}}}{-4}}{\ell}}{d}}\\

\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{t\_0}{\ell} \cdot \frac{t\_0}{\frac{-1}{h}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 4.9999999999999998e-242

    1. Initial program 87.2%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified82.1%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{h \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{\ell}\right), d\right)\right)\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(h \cdot \frac{D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right), d\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(\frac{D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right)\right), d\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right), \ell\right)\right), d\right)\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\left(\frac{D \cdot \frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right), \ell\right)\right), d\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{M \cdot \left(M \cdot D\right)}{d}\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{1}{\frac{d}{M \cdot \left(M \cdot D\right)}}\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      8. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{D}{\frac{d}{M \cdot \left(M \cdot D\right)}}\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \left(\frac{d}{M \cdot \left(M \cdot D\right)}\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \left(\frac{d}{\left(M \cdot D\right) \cdot M}\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      11. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \left(\frac{\frac{d}{M \cdot D}}{M}\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\left(\frac{d}{M \cdot D}\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(M \cdot D\right)\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(D \cdot M\right)\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      15. *-lowering-*.f6488.0%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, M\right)\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
    5. Applied egg-rr88.0%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{h \cdot \frac{\frac{\frac{D}{\frac{\frac{d}{D \cdot M}}{M}}}{-4}}{\ell}}}{d}} \]

    if 4.9999999999999998e-242 < M

    1. Initial program 79.8%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{\frac{\ell}{h}}\right)\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \frac{1}{h}}\right)\right)\right)\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{D}{2 \cdot d}\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{1}{\frac{2 \cdot d}{D}}\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      10. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M}{\frac{2 \cdot d}{D}}\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \left(\frac{2 \cdot d}{D}\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\left(2 \cdot d\right), D\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\left(d \cdot 2\right), D\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \left(\frac{1}{h}\right)\right)\right)\right)\right)\right) \]
    4. Applied egg-rr92.8%

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M}{\frac{d \cdot 2}{D}}}{\ell} \cdot \frac{\frac{M}{\frac{d \cdot 2}{D}}}{\frac{1}{h}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 5 \cdot 10^{-242}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{\frac{D}{\frac{\frac{d}{M \cdot D}}{M}}}{-4}}{\ell}}{d}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{M}{\frac{d \cdot 2}{D}}}{\ell} \cdot \frac{\frac{M}{\frac{d \cdot 2}{D}}}{\frac{-1}{h}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 86.3% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 2 \cdot 10^{-133}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{\frac{D}{\frac{\frac{d}{M\_m \cdot D}}{M\_m}}}{-4}}{\ell}}{d}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M\_m}{\frac{d \cdot 2}{D}}}{\ell} \cdot \left(\frac{M\_m}{d \cdot 2} \cdot \left(h \cdot D\right)\right)}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (w0 M_m D h l d)
 :precision binary64
 (if (<= M_m 2e-133)
   (*
    w0
    (sqrt (+ 1.0 (/ (* h (/ (/ (/ D (/ (/ d (* M_m D)) M_m)) -4.0) l)) d))))
   (*
    w0
    (sqrt
     (-
      1.0
      (* (/ (/ M_m (/ (* d 2.0) D)) l) (* (/ M_m (* d 2.0)) (* h D))))))))
M_m = fabs(M);
double code(double w0, double M_m, double D, double h, double l, double d) {
	double tmp;
	if (M_m <= 2e-133) {
		tmp = w0 * sqrt((1.0 + ((h * (((D / ((d / (M_m * D)) / M_m)) / -4.0) / l)) / d)));
	} else {
		tmp = w0 * sqrt((1.0 - (((M_m / ((d * 2.0) / D)) / l) * ((M_m / (d * 2.0)) * (h * D)))));
	}
	return tmp;
}
M_m = abs(m)
real(8) function code(w0, m_m, d, h, l, d_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (m_m <= 2d-133) then
        tmp = w0 * sqrt((1.0d0 + ((h * (((d / ((d_1 / (m_m * d)) / m_m)) / (-4.0d0)) / l)) / d_1)))
    else
        tmp = w0 * sqrt((1.0d0 - (((m_m / ((d_1 * 2.0d0) / d)) / l) * ((m_m / (d_1 * 2.0d0)) * (h * d)))))
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double w0, double M_m, double D, double h, double l, double d) {
	double tmp;
	if (M_m <= 2e-133) {
		tmp = w0 * Math.sqrt((1.0 + ((h * (((D / ((d / (M_m * D)) / M_m)) / -4.0) / l)) / d)));
	} else {
		tmp = w0 * Math.sqrt((1.0 - (((M_m / ((d * 2.0) / D)) / l) * ((M_m / (d * 2.0)) * (h * D)))));
	}
	return tmp;
}
M_m = math.fabs(M)
def code(w0, M_m, D, h, l, d):
	tmp = 0
	if M_m <= 2e-133:
		tmp = w0 * math.sqrt((1.0 + ((h * (((D / ((d / (M_m * D)) / M_m)) / -4.0) / l)) / d)))
	else:
		tmp = w0 * math.sqrt((1.0 - (((M_m / ((d * 2.0) / D)) / l) * ((M_m / (d * 2.0)) * (h * D)))))
	return tmp
M_m = abs(M)
function code(w0, M_m, D, h, l, d)
	tmp = 0.0
	if (M_m <= 2e-133)
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(h * Float64(Float64(Float64(D / Float64(Float64(d / Float64(M_m * D)) / M_m)) / -4.0) / l)) / d))));
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(M_m / Float64(Float64(d * 2.0) / D)) / l) * Float64(Float64(M_m / Float64(d * 2.0)) * Float64(h * D))))));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(w0, M_m, D, h, l, d)
	tmp = 0.0;
	if (M_m <= 2e-133)
		tmp = w0 * sqrt((1.0 + ((h * (((D / ((d / (M_m * D)) / M_m)) / -4.0) / l)) / d)));
	else
		tmp = w0 * sqrt((1.0 - (((M_m / ((d * 2.0) / D)) / l) * ((M_m / (d * 2.0)) * (h * D)))));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[M$95$m, 2e-133], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(h * N[(N[(N[(D / N[(N[(d / N[(M$95$m * D), $MachinePrecision]), $MachinePrecision] / M$95$m), $MachinePrecision]), $MachinePrecision] / -4.0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(M$95$m / N[(N[(d * 2.0), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(M$95$m / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 2 \cdot 10^{-133}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{\frac{D}{\frac{\frac{d}{M\_m \cdot D}}{M\_m}}}{-4}}{\ell}}{d}}\\

\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M\_m}{\frac{d \cdot 2}{D}}}{\ell} \cdot \left(\frac{M\_m}{d \cdot 2} \cdot \left(h \cdot D\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 2.0000000000000001e-133

    1. Initial program 87.6%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified83.1%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{h \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{\ell}\right), d\right)\right)\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(h \cdot \frac{D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right), d\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(\frac{D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right)\right), d\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right), \ell\right)\right), d\right)\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\left(\frac{D \cdot \frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right), \ell\right)\right), d\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{M \cdot \left(M \cdot D\right)}{d}\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{1}{\frac{d}{M \cdot \left(M \cdot D\right)}}\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      8. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{D}{\frac{d}{M \cdot \left(M \cdot D\right)}}\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \left(\frac{d}{M \cdot \left(M \cdot D\right)}\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \left(\frac{d}{\left(M \cdot D\right) \cdot M}\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      11. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \left(\frac{\frac{d}{M \cdot D}}{M}\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\left(\frac{d}{M \cdot D}\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(M \cdot D\right)\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(D \cdot M\right)\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      15. *-lowering-*.f6488.3%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, M\right)\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
    5. Applied egg-rr88.3%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{h \cdot \frac{\frac{\frac{D}{\frac{\frac{d}{D \cdot M}}{M}}}{-4}}{\ell}}}{d}} \]

    if 2.0000000000000001e-133 < M

    1. Initial program 77.1%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{\frac{\ell}{h}}\right)\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \frac{1}{h}}\right)\right)\right)\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{D}{2 \cdot d}\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \frac{1}{\frac{2 \cdot d}{D}}\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      10. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M}{\frac{2 \cdot d}{D}}\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \left(\frac{2 \cdot d}{D}\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\left(2 \cdot d\right), D\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\left(d \cdot 2\right), D\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \left(\frac{1}{h}\right)\right)\right)\right)\right)\right) \]
    4. Applied egg-rr91.0%

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M}{\frac{d \cdot 2}{D}}}{\ell} \cdot \frac{\frac{M}{\frac{d \cdot 2}{D}}}{\frac{1}{h}}}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \left(\frac{\frac{M}{\frac{d \cdot 2}{D}}}{1} \cdot h\right)\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \left(\frac{M}{\frac{d \cdot 2}{D}} \cdot h\right)\right)\right)\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \left(\left(\frac{M}{d \cdot 2} \cdot D\right) \cdot h\right)\right)\right)\right)\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \left(\frac{M}{d \cdot 2} \cdot \left(D \cdot h\right)\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \mathsf{*.f64}\left(\left(\frac{M}{d \cdot 2}\right), \left(D \cdot h\right)\right)\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \left(d \cdot 2\right)\right), \left(D \cdot h\right)\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{*.f64}\left(d, 2\right)\right), \left(D \cdot h\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f6487.3%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), D\right)\right), \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{*.f64}\left(d, 2\right)\right), \mathsf{*.f64}\left(D, h\right)\right)\right)\right)\right)\right) \]
    6. Applied egg-rr87.3%

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M}{\frac{d \cdot 2}{D}}}{\ell} \cdot \color{blue}{\left(\frac{M}{d \cdot 2} \cdot \left(D \cdot h\right)\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.0%

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

Alternative 3: 84.5% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} t_0 := \frac{d}{M\_m \cdot D}\\ \mathbf{if}\;M\_m \leq 5 \cdot 10^{-242}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{\frac{D}{\frac{t\_0}{M\_m}}}{-4}}{\ell}}{d}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{M\_m}{t\_0}}{-4}}{\ell} \cdot \frac{D}{d}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (w0 M_m D h l d)
 :precision binary64
 (let* ((t_0 (/ d (* M_m D))))
   (if (<= M_m 5e-242)
     (* w0 (sqrt (+ 1.0 (/ (* h (/ (/ (/ D (/ t_0 M_m)) -4.0) l)) d))))
     (* w0 (sqrt (+ 1.0 (* (/ (* h (/ (/ M_m t_0) -4.0)) l) (/ D d))))))))
M_m = fabs(M);
double code(double w0, double M_m, double D, double h, double l, double d) {
	double t_0 = d / (M_m * D);
	double tmp;
	if (M_m <= 5e-242) {
		tmp = w0 * sqrt((1.0 + ((h * (((D / (t_0 / M_m)) / -4.0) / l)) / d)));
	} else {
		tmp = w0 * sqrt((1.0 + (((h * ((M_m / t_0) / -4.0)) / l) * (D / d))));
	}
	return tmp;
}
M_m = abs(m)
real(8) function code(w0, m_m, d, h, l, d_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = d_1 / (m_m * d)
    if (m_m <= 5d-242) then
        tmp = w0 * sqrt((1.0d0 + ((h * (((d / (t_0 / m_m)) / (-4.0d0)) / l)) / d_1)))
    else
        tmp = w0 * sqrt((1.0d0 + (((h * ((m_m / t_0) / (-4.0d0))) / l) * (d / d_1))))
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double w0, double M_m, double D, double h, double l, double d) {
	double t_0 = d / (M_m * D);
	double tmp;
	if (M_m <= 5e-242) {
		tmp = w0 * Math.sqrt((1.0 + ((h * (((D / (t_0 / M_m)) / -4.0) / l)) / d)));
	} else {
		tmp = w0 * Math.sqrt((1.0 + (((h * ((M_m / t_0) / -4.0)) / l) * (D / d))));
	}
	return tmp;
}
M_m = math.fabs(M)
def code(w0, M_m, D, h, l, d):
	t_0 = d / (M_m * D)
	tmp = 0
	if M_m <= 5e-242:
		tmp = w0 * math.sqrt((1.0 + ((h * (((D / (t_0 / M_m)) / -4.0) / l)) / d)))
	else:
		tmp = w0 * math.sqrt((1.0 + (((h * ((M_m / t_0) / -4.0)) / l) * (D / d))))
	return tmp
M_m = abs(M)
function code(w0, M_m, D, h, l, d)
	t_0 = Float64(d / Float64(M_m * D))
	tmp = 0.0
	if (M_m <= 5e-242)
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(h * Float64(Float64(Float64(D / Float64(t_0 / M_m)) / -4.0) / l)) / d))));
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(h * Float64(Float64(M_m / t_0) / -4.0)) / l) * Float64(D / d)))));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(w0, M_m, D, h, l, d)
	t_0 = d / (M_m * D);
	tmp = 0.0;
	if (M_m <= 5e-242)
		tmp = w0 * sqrt((1.0 + ((h * (((D / (t_0 / M_m)) / -4.0) / l)) / d)));
	else
		tmp = w0 * sqrt((1.0 + (((h * ((M_m / t_0) / -4.0)) / l) * (D / d))));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[w0_, M$95$m_, D_, h_, l_, d_] := Block[{t$95$0 = N[(d / N[(M$95$m * D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 5e-242], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(h * N[(N[(N[(D / N[(t$95$0 / M$95$m), $MachinePrecision]), $MachinePrecision] / -4.0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(h * N[(N[(M$95$m / t$95$0), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
t_0 := \frac{d}{M\_m \cdot D}\\
\mathbf{if}\;M\_m \leq 5 \cdot 10^{-242}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{\frac{D}{\frac{t\_0}{M\_m}}}{-4}}{\ell}}{d}}\\

\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{M\_m}{t\_0}}{-4}}{\ell} \cdot \frac{D}{d}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 4.9999999999999998e-242

    1. Initial program 87.2%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified82.1%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{h \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{\ell}\right), d\right)\right)\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(h \cdot \frac{D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right), d\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(\frac{D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right)\right), d\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right), \ell\right)\right), d\right)\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\left(\frac{D \cdot \frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right), \ell\right)\right), d\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{M \cdot \left(M \cdot D\right)}{d}\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{1}{\frac{d}{M \cdot \left(M \cdot D\right)}}\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      8. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{D}{\frac{d}{M \cdot \left(M \cdot D\right)}}\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \left(\frac{d}{M \cdot \left(M \cdot D\right)}\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \left(\frac{d}{\left(M \cdot D\right) \cdot M}\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      11. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \left(\frac{\frac{d}{M \cdot D}}{M}\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\left(\frac{d}{M \cdot D}\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(M \cdot D\right)\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \left(D \cdot M\right)\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
      15. *-lowering-*.f6488.0%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, M\right)\right), M\right)\right), -4\right), \ell\right)\right), d\right)\right)\right)\right) \]
    5. Applied egg-rr88.0%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{h \cdot \frac{\frac{\frac{D}{\frac{\frac{d}{D \cdot M}}{M}}}{-4}}{\ell}}}{d}} \]

    if 4.9999999999999998e-242 < M

    1. Initial program 79.8%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified71.2%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h}{\ell} \cdot \frac{D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{d}\right)\right)\right)\right) \]
      2. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{\ell \cdot d}\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \left(\frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4} \cdot D\right)}{\ell \cdot d}\right)\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\left(h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right) \cdot D}{\ell \cdot d}\right)\right)\right)\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell} \cdot \frac{D}{d}\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right), \left(\frac{D}{d}\right)\right)\right)\right)\right) \]
    5. Applied egg-rr82.9%

      \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{h \cdot \frac{\frac{M}{\frac{d}{D \cdot M}}}{-4}}{\ell} \cdot \frac{D}{d}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 5 \cdot 10^{-242}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{\frac{D}{\frac{\frac{d}{M \cdot D}}{M}}}{-4}}{\ell}}{d}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{M}{\frac{d}{M \cdot D}}}{-4}}{\ell} \cdot \frac{D}{d}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.5% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 3.95 \cdot 10^{-181}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{D}{d} \cdot \frac{-0.25 \cdot \left(D \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{d}\right)}{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
(FPCore (w0 M_m D h l d)
 :precision binary64
 (if (<= M_m 3.95e-181)
   w0
   (*
    w0
    (sqrt (+ 1.0 (* (/ D d) (/ (* -0.25 (* D (/ (* h (* M_m M_m)) d))) l)))))))
M_m = fabs(M);
double code(double w0, double M_m, double D, double h, double l, double d) {
	double tmp;
	if (M_m <= 3.95e-181) {
		tmp = w0;
	} else {
		tmp = w0 * sqrt((1.0 + ((D / d) * ((-0.25 * (D * ((h * (M_m * M_m)) / d))) / l))));
	}
	return tmp;
}
M_m = abs(m)
real(8) function code(w0, m_m, d, h, l, d_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (m_m <= 3.95d-181) then
        tmp = w0
    else
        tmp = w0 * sqrt((1.0d0 + ((d / d_1) * (((-0.25d0) * (d * ((h * (m_m * m_m)) / d_1))) / l))))
    end if
    code = tmp
end function
M_m = Math.abs(M);
public static double code(double w0, double M_m, double D, double h, double l, double d) {
	double tmp;
	if (M_m <= 3.95e-181) {
		tmp = w0;
	} else {
		tmp = w0 * Math.sqrt((1.0 + ((D / d) * ((-0.25 * (D * ((h * (M_m * M_m)) / d))) / l))));
	}
	return tmp;
}
M_m = math.fabs(M)
def code(w0, M_m, D, h, l, d):
	tmp = 0
	if M_m <= 3.95e-181:
		tmp = w0
	else:
		tmp = w0 * math.sqrt((1.0 + ((D / d) * ((-0.25 * (D * ((h * (M_m * M_m)) / d))) / l))))
	return tmp
M_m = abs(M)
function code(w0, M_m, D, h, l, d)
	tmp = 0.0
	if (M_m <= 3.95e-181)
		tmp = w0;
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(D / d) * Float64(Float64(-0.25 * Float64(D * Float64(Float64(h * Float64(M_m * M_m)) / d))) / l)))));
	end
	return tmp
end
M_m = abs(M);
function tmp_2 = code(w0, M_m, D, h, l, d)
	tmp = 0.0;
	if (M_m <= 3.95e-181)
		tmp = w0;
	else
		tmp = w0 * sqrt((1.0 + ((D / d) * ((-0.25 * (D * ((h * (M_m * M_m)) / d))) / l))));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[M$95$m, 3.95e-181], w0, N[(w0 * N[Sqrt[N[(1.0 + N[(N[(D / d), $MachinePrecision] * N[(N[(-0.25 * N[(D * N[(N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|

\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 3.95 \cdot 10^{-181}:\\
\;\;\;\;w0\\

\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{D}{d} \cdot \frac{-0.25 \cdot \left(D \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{d}\right)}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 3.95e-181

    1. Initial program 86.9%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified82.1%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
    3. Add Preprocessing
    4. Taylor expanded in h around 0

      \[\leadsto \color{blue}{w0} \]
    5. Step-by-step derivation
      1. Simplified74.6%

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

      if 3.95e-181 < M

      1. Initial program 79.5%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Simplified70.0%

        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
      3. Add Preprocessing
      4. Step-by-step derivation
        1. associate-/l*N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h}{\ell} \cdot \frac{D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{d}\right)\right)\right)\right) \]
        2. frac-timesN/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{\ell \cdot d}\right)\right)\right)\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \left(\frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4} \cdot D\right)}{\ell \cdot d}\right)\right)\right)\right) \]
        4. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\left(h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right) \cdot D}{\ell \cdot d}\right)\right)\right)\right) \]
        5. times-fracN/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell} \cdot \frac{D}{d}\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right), \left(\frac{D}{d}\right)\right)\right)\right)\right) \]
      5. Applied egg-rr80.8%

        \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{h \cdot \frac{\frac{M}{\frac{d}{D \cdot M}}}{-4}}{\ell} \cdot \frac{D}{d}}} \]
      6. Taylor expanded in h around 0

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{-1}{4} \cdot \frac{D \cdot \left({M}^{2} \cdot h\right)}{d}\right)}, \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
      7. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(\frac{D \cdot \left({M}^{2} \cdot h\right)}{d}\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(D \cdot \frac{{M}^{2} \cdot h}{d}\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(D, \left(\frac{{M}^{2} \cdot h}{d}\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\left({M}^{2} \cdot h\right), d\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\left(h \cdot {M}^{2}\right), d\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left({M}^{2}\right)\right), d\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), d\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        8. *-lowering-*.f6470.0%

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
      8. Simplified70.0%

        \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{-0.25 \cdot \left(D \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)}}{\ell} \cdot \frac{D}{d}} \]
    6. Recombined 2 regimes into one program.
    7. Final simplification72.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 3.95 \cdot 10^{-181}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{D}{d} \cdot \frac{-0.25 \cdot \left(D \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)}{\ell}}\\ \end{array} \]
    8. Add Preprocessing

    Alternative 5: 84.0% accurate, 1.8× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{M\_m}{\frac{d}{M\_m \cdot D}}}{-4}}{\ell} \cdot \frac{D}{d}} \end{array} \]
    M_m = (fabs.f64 M)
    (FPCore (w0 M_m D h l d)
     :precision binary64
     (*
      w0
      (sqrt (+ 1.0 (* (/ (* h (/ (/ M_m (/ d (* M_m D))) -4.0)) l) (/ D d))))))
    M_m = fabs(M);
    double code(double w0, double M_m, double D, double h, double l, double d) {
    	return w0 * sqrt((1.0 + (((h * ((M_m / (d / (M_m * D))) / -4.0)) / l) * (D / d))));
    }
    
    M_m = abs(m)
    real(8) function code(w0, m_m, d, h, l, d_1)
        real(8), intent (in) :: w0
        real(8), intent (in) :: m_m
        real(8), intent (in) :: d
        real(8), intent (in) :: h
        real(8), intent (in) :: l
        real(8), intent (in) :: d_1
        code = w0 * sqrt((1.0d0 + (((h * ((m_m / (d_1 / (m_m * d))) / (-4.0d0))) / l) * (d / d_1))))
    end function
    
    M_m = Math.abs(M);
    public static double code(double w0, double M_m, double D, double h, double l, double d) {
    	return w0 * Math.sqrt((1.0 + (((h * ((M_m / (d / (M_m * D))) / -4.0)) / l) * (D / d))));
    }
    
    M_m = math.fabs(M)
    def code(w0, M_m, D, h, l, d):
    	return w0 * math.sqrt((1.0 + (((h * ((M_m / (d / (M_m * D))) / -4.0)) / l) * (D / d))))
    
    M_m = abs(M)
    function code(w0, M_m, D, h, l, d)
    	return Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(h * Float64(Float64(M_m / Float64(d / Float64(M_m * D))) / -4.0)) / l) * Float64(D / d)))))
    end
    
    M_m = abs(M);
    function tmp = code(w0, M_m, D, h, l, d)
    	tmp = w0 * sqrt((1.0 + (((h * ((M_m / (d / (M_m * D))) / -4.0)) / l) * (D / d))));
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    code[w0_, M$95$m_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(h * N[(N[(M$95$m / N[(d / N[(M$95$m * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    M_m = \left|M\right|
    
    \\
    w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{M\_m}{\frac{d}{M\_m \cdot D}}}{-4}}{\ell} \cdot \frac{D}{d}}
    \end{array}
    
    Derivation
    1. Initial program 84.2%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified77.7%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h}{\ell} \cdot \frac{D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{d}\right)\right)\right)\right) \]
      2. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{\ell \cdot d}\right)\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \left(\frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4} \cdot D\right)}{\ell \cdot d}\right)\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\left(h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right) \cdot D}{\ell \cdot d}\right)\right)\right)\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell} \cdot \frac{D}{d}\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right), \left(\frac{D}{d}\right)\right)\right)\right)\right) \]
    5. Applied egg-rr84.4%

      \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{h \cdot \frac{\frac{M}{\frac{d}{D \cdot M}}}{-4}}{\ell} \cdot \frac{D}{d}}} \]
    6. Final simplification84.4%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{h \cdot \frac{\frac{M}{\frac{d}{M \cdot D}}}{-4}}{\ell} \cdot \frac{D}{d}} \]
    7. Add Preprocessing

    Alternative 6: 65.2% accurate, 8.3× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;D \leq 3.7 \cdot 10^{+115}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{h \cdot \left(M\_m \cdot M\_m\right)}{d} \cdot \frac{D \cdot D}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;w0 + \left(D \cdot -0.125\right) \cdot \frac{D \cdot \left(M\_m \cdot \left(M\_m \cdot \left(w0 \cdot h\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    (FPCore (w0 M_m D h l d)
     :precision binary64
     (if (<= D 3.7e+115)
       (* w0 (+ 1.0 (* (/ -0.125 l) (* (/ (* h (* M_m M_m)) d) (/ (* D D) d)))))
       (+ w0 (* (* D -0.125) (/ (* D (* M_m (* M_m (* w0 h)))) (* d (* d l)))))))
    M_m = fabs(M);
    double code(double w0, double M_m, double D, double h, double l, double d) {
    	double tmp;
    	if (D <= 3.7e+115) {
    		tmp = w0 * (1.0 + ((-0.125 / l) * (((h * (M_m * M_m)) / d) * ((D * D) / d))));
    	} else {
    		tmp = w0 + ((D * -0.125) * ((D * (M_m * (M_m * (w0 * h)))) / (d * (d * l))));
    	}
    	return tmp;
    }
    
    M_m = abs(m)
    real(8) function code(w0, m_m, d, h, l, d_1)
        real(8), intent (in) :: w0
        real(8), intent (in) :: m_m
        real(8), intent (in) :: d
        real(8), intent (in) :: h
        real(8), intent (in) :: l
        real(8), intent (in) :: d_1
        real(8) :: tmp
        if (d <= 3.7d+115) then
            tmp = w0 * (1.0d0 + (((-0.125d0) / l) * (((h * (m_m * m_m)) / d_1) * ((d * d) / d_1))))
        else
            tmp = w0 + ((d * (-0.125d0)) * ((d * (m_m * (m_m * (w0 * h)))) / (d_1 * (d_1 * l))))
        end if
        code = tmp
    end function
    
    M_m = Math.abs(M);
    public static double code(double w0, double M_m, double D, double h, double l, double d) {
    	double tmp;
    	if (D <= 3.7e+115) {
    		tmp = w0 * (1.0 + ((-0.125 / l) * (((h * (M_m * M_m)) / d) * ((D * D) / d))));
    	} else {
    		tmp = w0 + ((D * -0.125) * ((D * (M_m * (M_m * (w0 * h)))) / (d * (d * l))));
    	}
    	return tmp;
    }
    
    M_m = math.fabs(M)
    def code(w0, M_m, D, h, l, d):
    	tmp = 0
    	if D <= 3.7e+115:
    		tmp = w0 * (1.0 + ((-0.125 / l) * (((h * (M_m * M_m)) / d) * ((D * D) / d))))
    	else:
    		tmp = w0 + ((D * -0.125) * ((D * (M_m * (M_m * (w0 * h)))) / (d * (d * l))))
    	return tmp
    
    M_m = abs(M)
    function code(w0, M_m, D, h, l, d)
    	tmp = 0.0
    	if (D <= 3.7e+115)
    		tmp = Float64(w0 * Float64(1.0 + Float64(Float64(-0.125 / l) * Float64(Float64(Float64(h * Float64(M_m * M_m)) / d) * Float64(Float64(D * D) / d)))));
    	else
    		tmp = Float64(w0 + Float64(Float64(D * -0.125) * Float64(Float64(D * Float64(M_m * Float64(M_m * Float64(w0 * h)))) / Float64(d * Float64(d * l)))));
    	end
    	return tmp
    end
    
    M_m = abs(M);
    function tmp_2 = code(w0, M_m, D, h, l, d)
    	tmp = 0.0;
    	if (D <= 3.7e+115)
    		tmp = w0 * (1.0 + ((-0.125 / l) * (((h * (M_m * M_m)) / d) * ((D * D) / d))));
    	else
    		tmp = w0 + ((D * -0.125) * ((D * (M_m * (M_m * (w0 * h)))) / (d * (d * l))));
    	end
    	tmp_2 = tmp;
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[D, 3.7e+115], N[(w0 * N[(1.0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 + N[(N[(D * -0.125), $MachinePrecision] * N[(N[(D * N[(M$95$m * N[(M$95$m * N[(w0 * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;D \leq 3.7 \cdot 10^{+115}:\\
    \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{h \cdot \left(M\_m \cdot M\_m\right)}{d} \cdot \frac{D \cdot D}{d}\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;w0 + \left(D \cdot -0.125\right) \cdot \frac{D \cdot \left(M\_m \cdot \left(M\_m \cdot \left(w0 \cdot h\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if D < 3.70000000000000006e115

      1. Initial program 85.0%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Simplified78.2%

        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
      3. Add Preprocessing
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}} \cdot \color{blue}{w0} \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}\right), \color{blue}{w0}\right) \]
      5. Applied egg-rr82.7%

        \[\leadsto \color{blue}{\sqrt{1 + \frac{D}{\frac{\ell}{h}} \cdot \frac{\frac{\frac{M}{\frac{d}{D \cdot M}}}{-4}}{d}} \cdot w0} \]
      6. Taylor expanded in D around 0

        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}, w0\right) \]
      7. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)\right), w0\right) \]
        2. associate-*r/N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}\right)\right), w0\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot {d}^{2}}\right)\right), w0\right) \]
        4. times-fracN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{-1}{8}}{\ell} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}\right)\right), w0\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{-1}{8}}{\ell}\right), \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}\right)\right)\right), w0\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}\right)\right)\right), w0\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \left(\frac{\left({M}^{2} \cdot h\right) \cdot {D}^{2}}{{d}^{2}}\right)\right)\right), w0\right) \]
        8. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \left(\frac{\left({M}^{2} \cdot h\right) \cdot {D}^{2}}{d \cdot d}\right)\right)\right), w0\right) \]
        9. times-fracN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \left(\frac{{M}^{2} \cdot h}{d} \cdot \frac{{D}^{2}}{d}\right)\right)\right), w0\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\left(\frac{{M}^{2} \cdot h}{d}\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({M}^{2} \cdot h\right), d\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(h \cdot {M}^{2}\right), d\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
        13. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left({M}^{2}\right)\right), d\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
        14. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), d\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
        15. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
        16. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), \mathsf{/.f64}\left(\left({D}^{2}\right), d\right)\right)\right)\right), w0\right) \]
        17. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), \mathsf{/.f64}\left(\left(D \cdot D\right), d\right)\right)\right)\right), w0\right) \]
        18. *-lowering-*.f6466.1%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), d\right)\right)\right)\right), w0\right) \]
      8. Simplified66.1%

        \[\leadsto \color{blue}{\left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{h \cdot \left(M \cdot M\right)}{d} \cdot \frac{D \cdot D}{d}\right)\right)} \cdot w0 \]

      if 3.70000000000000006e115 < D

      1. Initial program 76.5%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Simplified72.3%

        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
      3. Add Preprocessing
      4. Taylor expanded in h around 0

        \[\leadsto \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
      5. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
        3. associate-/l*N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}}\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)}\right)\right)\right) \]
        5. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
        7. associate-/l*N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left({M}^{2} \cdot \color{blue}{\frac{h \cdot w0}{{d}^{2} \cdot \ell}}\right)\right)\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left({M}^{2}\right), \color{blue}{\left(\frac{h \cdot w0}{{d}^{2} \cdot \ell}\right)}\right)\right)\right)\right) \]
        9. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(h \cdot w0\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right)\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(w0 \cdot h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
        13. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
        14. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\left(d \cdot d\right) \cdot \ell\right)\right)\right)\right)\right)\right) \]
        15. associate-*l*N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(d \cdot \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
        16. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
        17. *-lowering-*.f6446.7%

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \color{blue}{\ell}\right)\right)\right)\right)\right)\right)\right) \]
      6. Simplified46.7%

        \[\leadsto \color{blue}{w0 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{w0 \cdot h}{d \cdot \left(d \cdot \ell\right)}\right)\right)} \]
      7. Step-by-step derivation
        1. associate-*l*N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \left(\frac{-1}{8} \cdot \left(D \cdot \color{blue}{\left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{w0 \cdot h}{d \cdot \left(d \cdot \ell\right)}\right)\right)}\right)\right)\right) \]
        2. associate-*r*N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \left(\left(\frac{-1}{8} \cdot D\right) \cdot \color{blue}{\left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{w0 \cdot h}{d \cdot \left(d \cdot \ell\right)}\right)\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\left(\frac{-1}{8} \cdot D\right), \color{blue}{\left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{w0 \cdot h}{d \cdot \left(d \cdot \ell\right)}\right)\right)}\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \left(\color{blue}{D} \cdot \left(\left(M \cdot M\right) \cdot \frac{w0 \cdot h}{d \cdot \left(d \cdot \ell\right)}\right)\right)\right)\right) \]
        5. associate-*r/N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \left(D \cdot \frac{\left(M \cdot M\right) \cdot \left(w0 \cdot h\right)}{\color{blue}{d \cdot \left(d \cdot \ell\right)}}\right)\right)\right) \]
        6. associate-*r/N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \left(\frac{D \cdot \left(\left(M \cdot M\right) \cdot \left(w0 \cdot h\right)\right)}{\color{blue}{d \cdot \left(d \cdot \ell\right)}}\right)\right)\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \mathsf{/.f64}\left(\left(D \cdot \left(\left(M \cdot M\right) \cdot \left(w0 \cdot h\right)\right)\right), \color{blue}{\left(d \cdot \left(d \cdot \ell\right)\right)}\right)\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \left(\left(M \cdot M\right) \cdot \left(w0 \cdot h\right)\right)\right), \left(\color{blue}{d} \cdot \left(d \cdot \ell\right)\right)\right)\right)\right) \]
        9. associate-*l*N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \left(M \cdot \left(M \cdot \left(w0 \cdot h\right)\right)\right)\right), \left(d \cdot \left(d \cdot \ell\right)\right)\right)\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \left(M \cdot \left(w0 \cdot h\right)\right)\right)\right), \left(d \cdot \left(d \cdot \ell\right)\right)\right)\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \left(w0 \cdot h\right)\right)\right)\right), \left(d \cdot \left(d \cdot \ell\right)\right)\right)\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \left(h \cdot w0\right)\right)\right)\right), \left(d \cdot \left(d \cdot \ell\right)\right)\right)\right)\right) \]
        13. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right)\right), \left(d \cdot \left(d \cdot \ell\right)\right)\right)\right)\right) \]
        14. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right)\right), \mathsf{*.f64}\left(d, \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right) \]
        15. *-lowering-*.f6472.1%

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right)\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \color{blue}{\ell}\right)\right)\right)\right)\right) \]
      8. Applied egg-rr72.1%

        \[\leadsto w0 + \color{blue}{\left(-0.125 \cdot D\right) \cdot \frac{D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification66.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 3.7 \cdot 10^{+115}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{h \cdot \left(M \cdot M\right)}{d} \cdot \frac{D \cdot D}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;w0 + \left(D \cdot -0.125\right) \cdot \frac{D \cdot \left(M \cdot \left(M \cdot \left(w0 \cdot h\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 67.5% accurate, 8.3× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;d \leq 1.3 \cdot 10^{-79}:\\ \;\;\;\;w0 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{\frac{\left(M\_m \cdot \left(w0 \cdot h\right)\right) \cdot \frac{M\_m}{d}}{\ell}}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    (FPCore (w0 M_m D h l d)
     :precision binary64
     (if (<= d 1.3e-79)
       (+ w0 (* -0.125 (* (* D D) (/ (/ (* (* M_m (* w0 h)) (/ M_m d)) l) d))))
       w0))
    M_m = fabs(M);
    double code(double w0, double M_m, double D, double h, double l, double d) {
    	double tmp;
    	if (d <= 1.3e-79) {
    		tmp = w0 + (-0.125 * ((D * D) * ((((M_m * (w0 * h)) * (M_m / d)) / l) / d)));
    	} else {
    		tmp = w0;
    	}
    	return tmp;
    }
    
    M_m = abs(m)
    real(8) function code(w0, m_m, d, h, l, d_1)
        real(8), intent (in) :: w0
        real(8), intent (in) :: m_m
        real(8), intent (in) :: d
        real(8), intent (in) :: h
        real(8), intent (in) :: l
        real(8), intent (in) :: d_1
        real(8) :: tmp
        if (d_1 <= 1.3d-79) then
            tmp = w0 + ((-0.125d0) * ((d * d) * ((((m_m * (w0 * h)) * (m_m / d_1)) / l) / d_1)))
        else
            tmp = w0
        end if
        code = tmp
    end function
    
    M_m = Math.abs(M);
    public static double code(double w0, double M_m, double D, double h, double l, double d) {
    	double tmp;
    	if (d <= 1.3e-79) {
    		tmp = w0 + (-0.125 * ((D * D) * ((((M_m * (w0 * h)) * (M_m / d)) / l) / d)));
    	} else {
    		tmp = w0;
    	}
    	return tmp;
    }
    
    M_m = math.fabs(M)
    def code(w0, M_m, D, h, l, d):
    	tmp = 0
    	if d <= 1.3e-79:
    		tmp = w0 + (-0.125 * ((D * D) * ((((M_m * (w0 * h)) * (M_m / d)) / l) / d)))
    	else:
    		tmp = w0
    	return tmp
    
    M_m = abs(M)
    function code(w0, M_m, D, h, l, d)
    	tmp = 0.0
    	if (d <= 1.3e-79)
    		tmp = Float64(w0 + Float64(-0.125 * Float64(Float64(D * D) * Float64(Float64(Float64(Float64(M_m * Float64(w0 * h)) * Float64(M_m / d)) / l) / d))));
    	else
    		tmp = w0;
    	end
    	return tmp
    end
    
    M_m = abs(M);
    function tmp_2 = code(w0, M_m, D, h, l, d)
    	tmp = 0.0;
    	if (d <= 1.3e-79)
    		tmp = w0 + (-0.125 * ((D * D) * ((((M_m * (w0 * h)) * (M_m / d)) / l) / d)));
    	else
    		tmp = w0;
    	end
    	tmp_2 = tmp;
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[d, 1.3e-79], N[(w0 + N[(-0.125 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(N[(M$95$m * N[(w0 * h), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
    
    \begin{array}{l}
    M_m = \left|M\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;d \leq 1.3 \cdot 10^{-79}:\\
    \;\;\;\;w0 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{\frac{\left(M\_m \cdot \left(w0 \cdot h\right)\right) \cdot \frac{M\_m}{d}}{\ell}}{d}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;w0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if d < 1.29999999999999997e-79

      1. Initial program 83.2%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Simplified78.2%

        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
      3. Add Preprocessing
      4. Taylor expanded in h around 0

        \[\leadsto \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
      5. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
        3. associate-/l*N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}}\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)}\right)\right)\right) \]
        5. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
        7. associate-/l*N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left({M}^{2} \cdot \color{blue}{\frac{h \cdot w0}{{d}^{2} \cdot \ell}}\right)\right)\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left({M}^{2}\right), \color{blue}{\left(\frac{h \cdot w0}{{d}^{2} \cdot \ell}\right)}\right)\right)\right)\right) \]
        9. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(h \cdot w0\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right)\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(w0 \cdot h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
        13. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
        14. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\left(d \cdot d\right) \cdot \ell\right)\right)\right)\right)\right)\right) \]
        15. associate-*l*N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(d \cdot \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
        16. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
        17. *-lowering-*.f6458.1%

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \color{blue}{\ell}\right)\right)\right)\right)\right)\right)\right) \]
      6. Simplified58.1%

        \[\leadsto \color{blue}{w0 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{w0 \cdot h}{d \cdot \left(d \cdot \ell\right)}\right)\right)} \]
      7. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\left(M \cdot M\right) \cdot \left(w0 \cdot h\right)}{\color{blue}{d \cdot \left(d \cdot \ell\right)}}\right)\right)\right)\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\left(M \cdot M\right) \cdot \left(w0 \cdot h\right)}{\left(d \cdot \ell\right) \cdot \color{blue}{d}}\right)\right)\right)\right) \]
        3. associate-/r*N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\frac{\left(M \cdot M\right) \cdot \left(w0 \cdot h\right)}{d \cdot \ell}}{\color{blue}{d}}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{\left(M \cdot M\right) \cdot \left(w0 \cdot h\right)}{d \cdot \ell}\right), \color{blue}{d}\right)\right)\right)\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(M \cdot M\right) \cdot \left(w0 \cdot h\right)\right), \left(d \cdot \ell\right)\right), d\right)\right)\right)\right) \]
        6. associate-*l*N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(M \cdot \left(M \cdot \left(w0 \cdot h\right)\right)\right), \left(d \cdot \ell\right)\right), d\right)\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \left(M \cdot \left(w0 \cdot h\right)\right)\right), \left(d \cdot \ell\right)\right), d\right)\right)\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \left(w0 \cdot h\right)\right)\right), \left(d \cdot \ell\right)\right), d\right)\right)\right)\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \left(h \cdot w0\right)\right)\right), \left(d \cdot \ell\right)\right), d\right)\right)\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right), \left(d \cdot \ell\right)\right), d\right)\right)\right)\right) \]
        11. *-lowering-*.f6462.3%

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right), \mathsf{*.f64}\left(d, \ell\right)\right), d\right)\right)\right)\right) \]
      8. Applied egg-rr62.3%

        \[\leadsto w0 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{M \cdot \left(M \cdot \left(h \cdot w0\right)\right)}{d \cdot \ell}}{d}}\right) \]
      9. Step-by-step derivation
        1. times-fracN/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{M}{d} \cdot \frac{M \cdot \left(h \cdot w0\right)}{\ell}\right), d\right)\right)\right)\right) \]
        2. associate-*r/N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{\frac{M}{d} \cdot \left(M \cdot \left(h \cdot w0\right)\right)}{\ell}\right), d\right)\right)\right)\right) \]
        3. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{M}{d} \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right), \ell\right), d\right)\right)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{M}{d}\right), \left(M \cdot \left(h \cdot w0\right)\right)\right), \ell\right), d\right)\right)\right)\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, d\right), \left(M \cdot \left(h \cdot w0\right)\right)\right), \ell\right), d\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, d\right), \mathsf{*.f64}\left(M, \left(h \cdot w0\right)\right)\right), \ell\right), d\right)\right)\right)\right) \]
        7. *-lowering-*.f6465.5%

          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, d\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right), \ell\right), d\right)\right)\right)\right) \]
      10. Applied egg-rr65.5%

        \[\leadsto w0 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{\color{blue}{\frac{\frac{M}{d} \cdot \left(M \cdot \left(h \cdot w0\right)\right)}{\ell}}}{d}\right) \]

      if 1.29999999999999997e-79 < d

      1. Initial program 85.9%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Simplified76.8%

        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
      3. Add Preprocessing
      4. Taylor expanded in h around 0

        \[\leadsto \color{blue}{w0} \]
      5. Step-by-step derivation
        1. Simplified81.6%

          \[\leadsto \color{blue}{w0} \]
      6. Recombined 2 regimes into one program.
      7. Final simplification71.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 1.3 \cdot 10^{-79}:\\ \;\;\;\;w0 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \frac{\frac{\left(M \cdot \left(w0 \cdot h\right)\right) \cdot \frac{M}{d}}{\ell}}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
      8. Add Preprocessing

      Alternative 8: 67.8% accurate, 8.3× speedup?

      \[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 3.3 \cdot 10^{-95}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{h \cdot \left(M\_m \cdot M\_m\right)}{d} \cdot \frac{D \cdot D}{d}\right)\right)\\ \end{array} \end{array} \]
      M_m = (fabs.f64 M)
      (FPCore (w0 M_m D h l d)
       :precision binary64
       (if (<= M_m 3.3e-95)
         w0
         (* w0 (+ 1.0 (* (/ -0.125 l) (* (/ (* h (* M_m M_m)) d) (/ (* D D) d)))))))
      M_m = fabs(M);
      double code(double w0, double M_m, double D, double h, double l, double d) {
      	double tmp;
      	if (M_m <= 3.3e-95) {
      		tmp = w0;
      	} else {
      		tmp = w0 * (1.0 + ((-0.125 / l) * (((h * (M_m * M_m)) / d) * ((D * D) / d))));
      	}
      	return tmp;
      }
      
      M_m = abs(m)
      real(8) function code(w0, m_m, d, h, l, d_1)
          real(8), intent (in) :: w0
          real(8), intent (in) :: m_m
          real(8), intent (in) :: d
          real(8), intent (in) :: h
          real(8), intent (in) :: l
          real(8), intent (in) :: d_1
          real(8) :: tmp
          if (m_m <= 3.3d-95) then
              tmp = w0
          else
              tmp = w0 * (1.0d0 + (((-0.125d0) / l) * (((h * (m_m * m_m)) / d_1) * ((d * d) / d_1))))
          end if
          code = tmp
      end function
      
      M_m = Math.abs(M);
      public static double code(double w0, double M_m, double D, double h, double l, double d) {
      	double tmp;
      	if (M_m <= 3.3e-95) {
      		tmp = w0;
      	} else {
      		tmp = w0 * (1.0 + ((-0.125 / l) * (((h * (M_m * M_m)) / d) * ((D * D) / d))));
      	}
      	return tmp;
      }
      
      M_m = math.fabs(M)
      def code(w0, M_m, D, h, l, d):
      	tmp = 0
      	if M_m <= 3.3e-95:
      		tmp = w0
      	else:
      		tmp = w0 * (1.0 + ((-0.125 / l) * (((h * (M_m * M_m)) / d) * ((D * D) / d))))
      	return tmp
      
      M_m = abs(M)
      function code(w0, M_m, D, h, l, d)
      	tmp = 0.0
      	if (M_m <= 3.3e-95)
      		tmp = w0;
      	else
      		tmp = Float64(w0 * Float64(1.0 + Float64(Float64(-0.125 / l) * Float64(Float64(Float64(h * Float64(M_m * M_m)) / d) * Float64(Float64(D * D) / d)))));
      	end
      	return tmp
      end
      
      M_m = abs(M);
      function tmp_2 = code(w0, M_m, D, h, l, d)
      	tmp = 0.0;
      	if (M_m <= 3.3e-95)
      		tmp = w0;
      	else
      		tmp = w0 * (1.0 + ((-0.125 / l) * (((h * (M_m * M_m)) / d) * ((D * D) / d))));
      	end
      	tmp_2 = tmp;
      end
      
      M_m = N[Abs[M], $MachinePrecision]
      code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[M$95$m, 3.3e-95], w0, N[(w0 * N[(1.0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      M_m = \left|M\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;M\_m \leq 3.3 \cdot 10^{-95}:\\
      \;\;\;\;w0\\
      
      \mathbf{else}:\\
      \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{h \cdot \left(M\_m \cdot M\_m\right)}{d} \cdot \frac{D \cdot D}{d}\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if M < 3.3e-95

        1. Initial program 87.9%

          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
        2. Simplified83.7%

          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
        3. Add Preprocessing
        4. Taylor expanded in h around 0

          \[\leadsto \color{blue}{w0} \]
        5. Step-by-step derivation
          1. Simplified76.6%

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

          if 3.3e-95 < M

          1. Initial program 74.6%

            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
          2. Simplified62.1%

            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
          3. Add Preprocessing
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}} \cdot \color{blue}{w0} \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}\right), \color{blue}{w0}\right) \]
          5. Applied egg-rr72.6%

            \[\leadsto \color{blue}{\sqrt{1 + \frac{D}{\frac{\ell}{h}} \cdot \frac{\frac{\frac{M}{\frac{d}{D \cdot M}}}{-4}}{d}} \cdot w0} \]
          6. Taylor expanded in D around 0

            \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}, w0\right) \]
          7. Step-by-step derivation
            1. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)\right), w0\right) \]
            2. associate-*r/N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}\right)\right), w0\right) \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{\ell \cdot {d}^{2}}\right)\right), w0\right) \]
            4. times-fracN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{-1}{8}}{\ell} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}\right)\right), w0\right) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{\frac{-1}{8}}{\ell}\right), \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}\right)\right)\right), w0\right) \]
            6. /-lowering-/.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}\right)\right)\right), w0\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \left(\frac{\left({M}^{2} \cdot h\right) \cdot {D}^{2}}{{d}^{2}}\right)\right)\right), w0\right) \]
            8. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \left(\frac{\left({M}^{2} \cdot h\right) \cdot {D}^{2}}{d \cdot d}\right)\right)\right), w0\right) \]
            9. times-fracN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \left(\frac{{M}^{2} \cdot h}{d} \cdot \frac{{D}^{2}}{d}\right)\right)\right), w0\right) \]
            10. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\left(\frac{{M}^{2} \cdot h}{d}\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
            11. /-lowering-/.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({M}^{2} \cdot h\right), d\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(h \cdot {M}^{2}\right), d\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
            13. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left({M}^{2}\right)\right), d\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
            14. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), d\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), \left(\frac{{D}^{2}}{d}\right)\right)\right)\right), w0\right) \]
            16. /-lowering-/.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), \mathsf{/.f64}\left(\left({D}^{2}\right), d\right)\right)\right)\right), w0\right) \]
            17. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), \mathsf{/.f64}\left(\left(D \cdot D\right), d\right)\right)\right)\right), w0\right) \]
            18. *-lowering-*.f6447.0%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), d\right)\right)\right)\right), w0\right) \]
          8. Simplified47.0%

            \[\leadsto \color{blue}{\left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{h \cdot \left(M \cdot M\right)}{d} \cdot \frac{D \cdot D}{d}\right)\right)} \cdot w0 \]
        6. Recombined 2 regimes into one program.
        7. Final simplification68.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 3.3 \cdot 10^{-95}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{h \cdot \left(M \cdot M\right)}{d} \cdot \frac{D \cdot D}{d}\right)\right)\\ \end{array} \]
        8. Add Preprocessing

        Alternative 9: 65.7% accurate, 8.3× speedup?

        \[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 3 \cdot 10^{-95}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \left(1 + \left(D \cdot D\right) \cdot \frac{\left(h \cdot \left(M\_m \cdot M\_m\right)\right) \cdot -0.125}{d \cdot \left(d \cdot \ell\right)}\right)\\ \end{array} \end{array} \]
        M_m = (fabs.f64 M)
        (FPCore (w0 M_m D h l d)
         :precision binary64
         (if (<= M_m 3e-95)
           w0
           (* w0 (+ 1.0 (* (* D D) (/ (* (* h (* M_m M_m)) -0.125) (* d (* d l))))))))
        M_m = fabs(M);
        double code(double w0, double M_m, double D, double h, double l, double d) {
        	double tmp;
        	if (M_m <= 3e-95) {
        		tmp = w0;
        	} else {
        		tmp = w0 * (1.0 + ((D * D) * (((h * (M_m * M_m)) * -0.125) / (d * (d * l)))));
        	}
        	return tmp;
        }
        
        M_m = abs(m)
        real(8) function code(w0, m_m, d, h, l, d_1)
            real(8), intent (in) :: w0
            real(8), intent (in) :: m_m
            real(8), intent (in) :: d
            real(8), intent (in) :: h
            real(8), intent (in) :: l
            real(8), intent (in) :: d_1
            real(8) :: tmp
            if (m_m <= 3d-95) then
                tmp = w0
            else
                tmp = w0 * (1.0d0 + ((d * d) * (((h * (m_m * m_m)) * (-0.125d0)) / (d_1 * (d_1 * l)))))
            end if
            code = tmp
        end function
        
        M_m = Math.abs(M);
        public static double code(double w0, double M_m, double D, double h, double l, double d) {
        	double tmp;
        	if (M_m <= 3e-95) {
        		tmp = w0;
        	} else {
        		tmp = w0 * (1.0 + ((D * D) * (((h * (M_m * M_m)) * -0.125) / (d * (d * l)))));
        	}
        	return tmp;
        }
        
        M_m = math.fabs(M)
        def code(w0, M_m, D, h, l, d):
        	tmp = 0
        	if M_m <= 3e-95:
        		tmp = w0
        	else:
        		tmp = w0 * (1.0 + ((D * D) * (((h * (M_m * M_m)) * -0.125) / (d * (d * l)))))
        	return tmp
        
        M_m = abs(M)
        function code(w0, M_m, D, h, l, d)
        	tmp = 0.0
        	if (M_m <= 3e-95)
        		tmp = w0;
        	else
        		tmp = Float64(w0 * Float64(1.0 + Float64(Float64(D * D) * Float64(Float64(Float64(h * Float64(M_m * M_m)) * -0.125) / Float64(d * Float64(d * l))))));
        	end
        	return tmp
        end
        
        M_m = abs(M);
        function tmp_2 = code(w0, M_m, D, h, l, d)
        	tmp = 0.0;
        	if (M_m <= 3e-95)
        		tmp = w0;
        	else
        		tmp = w0 * (1.0 + ((D * D) * (((h * (M_m * M_m)) * -0.125) / (d * (d * l)))));
        	end
        	tmp_2 = tmp;
        end
        
        M_m = N[Abs[M], $MachinePrecision]
        code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[M$95$m, 3e-95], w0, N[(w0 * N[(1.0 + N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        M_m = \left|M\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;M\_m \leq 3 \cdot 10^{-95}:\\
        \;\;\;\;w0\\
        
        \mathbf{else}:\\
        \;\;\;\;w0 \cdot \left(1 + \left(D \cdot D\right) \cdot \frac{\left(h \cdot \left(M\_m \cdot M\_m\right)\right) \cdot -0.125}{d \cdot \left(d \cdot \ell\right)}\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if M < 3e-95

          1. Initial program 87.9%

            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
          2. Simplified83.7%

            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
          3. Add Preprocessing
          4. Taylor expanded in h around 0

            \[\leadsto \color{blue}{w0} \]
          5. Step-by-step derivation
            1. Simplified76.6%

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

            if 3e-95 < M

            1. Initial program 74.6%

              \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
            2. Simplified62.1%

              \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
            3. Add Preprocessing
            4. Taylor expanded in h around 0

              \[\leadsto \mathsf{*.f64}\left(w0, \color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
            5. Step-by-step derivation
              1. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
              2. *-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right)\right) \]
              3. associate-/l*N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \left(\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right) \cdot \frac{-1}{8}\right)\right)\right) \]
              4. associate-*r*N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \color{blue}{\left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)}\right)\right)\right) \]
              5. *-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \left({D}^{2} \cdot \left(\frac{-1}{8} \cdot \color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}}\right)\right)\right)\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)}\right)\right)\right) \]
              7. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
              8. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
              9. associate-*r/N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\frac{-1}{8} \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right)\right)\right)\right) \]
              10. /-lowering-/.f64N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot h\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right)\right) \]
              11. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left({M}^{2} \cdot h\right)\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right) \]
              12. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left({M}^{2}\right), h\right)\right), \left({d}^{\color{blue}{2}} \cdot \ell\right)\right)\right)\right)\right) \]
              13. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right)\right)\right) \]
              14. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right)\right)\right) \]
              15. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left(\left(d \cdot d\right) \cdot \ell\right)\right)\right)\right)\right) \]
              16. associate-*l*N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left(d \cdot \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right) \]
              17. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right), \mathsf{*.f64}\left(d, \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right) \]
              18. *-lowering-*.f6445.3%

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \color{blue}{\ell}\right)\right)\right)\right)\right)\right) \]
            6. Simplified45.3%

              \[\leadsto w0 \cdot \color{blue}{\left(1 + \left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(\left(M \cdot M\right) \cdot h\right)}{d \cdot \left(d \cdot \ell\right)}\right)} \]
          6. Recombined 2 regimes into one program.
          7. Final simplification67.9%

            \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 3 \cdot 10^{-95}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \left(1 + \left(D \cdot D\right) \cdot \frac{\left(h \cdot \left(M \cdot M\right)\right) \cdot -0.125}{d \cdot \left(d \cdot \ell\right)}\right)\\ \end{array} \]
          8. Add Preprocessing

          Alternative 10: 60.6% accurate, 9.0× speedup?

          \[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 2.1 \cdot 10^{+33}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{h \cdot \left(-0.125 \cdot \left(D \cdot D\right)\right)}{d} \cdot \left(M\_m \cdot \frac{M\_m \cdot w0}{d}\right)}{\ell}\\ \end{array} \end{array} \]
          M_m = (fabs.f64 M)
          (FPCore (w0 M_m D h l d)
           :precision binary64
           (if (<= M_m 2.1e+33)
             w0
             (/ (* (/ (* h (* -0.125 (* D D))) d) (* M_m (/ (* M_m w0) d))) l)))
          M_m = fabs(M);
          double code(double w0, double M_m, double D, double h, double l, double d) {
          	double tmp;
          	if (M_m <= 2.1e+33) {
          		tmp = w0;
          	} else {
          		tmp = (((h * (-0.125 * (D * D))) / d) * (M_m * ((M_m * w0) / d))) / l;
          	}
          	return tmp;
          }
          
          M_m = abs(m)
          real(8) function code(w0, m_m, d, h, l, d_1)
              real(8), intent (in) :: w0
              real(8), intent (in) :: m_m
              real(8), intent (in) :: d
              real(8), intent (in) :: h
              real(8), intent (in) :: l
              real(8), intent (in) :: d_1
              real(8) :: tmp
              if (m_m <= 2.1d+33) then
                  tmp = w0
              else
                  tmp = (((h * ((-0.125d0) * (d * d))) / d_1) * (m_m * ((m_m * w0) / d_1))) / l
              end if
              code = tmp
          end function
          
          M_m = Math.abs(M);
          public static double code(double w0, double M_m, double D, double h, double l, double d) {
          	double tmp;
          	if (M_m <= 2.1e+33) {
          		tmp = w0;
          	} else {
          		tmp = (((h * (-0.125 * (D * D))) / d) * (M_m * ((M_m * w0) / d))) / l;
          	}
          	return tmp;
          }
          
          M_m = math.fabs(M)
          def code(w0, M_m, D, h, l, d):
          	tmp = 0
          	if M_m <= 2.1e+33:
          		tmp = w0
          	else:
          		tmp = (((h * (-0.125 * (D * D))) / d) * (M_m * ((M_m * w0) / d))) / l
          	return tmp
          
          M_m = abs(M)
          function code(w0, M_m, D, h, l, d)
          	tmp = 0.0
          	if (M_m <= 2.1e+33)
          		tmp = w0;
          	else
          		tmp = Float64(Float64(Float64(Float64(h * Float64(-0.125 * Float64(D * D))) / d) * Float64(M_m * Float64(Float64(M_m * w0) / d))) / l);
          	end
          	return tmp
          end
          
          M_m = abs(M);
          function tmp_2 = code(w0, M_m, D, h, l, d)
          	tmp = 0.0;
          	if (M_m <= 2.1e+33)
          		tmp = w0;
          	else
          		tmp = (((h * (-0.125 * (D * D))) / d) * (M_m * ((M_m * w0) / d))) / l;
          	end
          	tmp_2 = tmp;
          end
          
          M_m = N[Abs[M], $MachinePrecision]
          code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[M$95$m, 2.1e+33], w0, N[(N[(N[(N[(h * N[(-0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(M$95$m * N[(N[(M$95$m * w0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]]
          
          \begin{array}{l}
          M_m = \left|M\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;M\_m \leq 2.1 \cdot 10^{+33}:\\
          \;\;\;\;w0\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{h \cdot \left(-0.125 \cdot \left(D \cdot D\right)\right)}{d} \cdot \left(M\_m \cdot \frac{M\_m \cdot w0}{d}\right)}{\ell}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if M < 2.1000000000000001e33

            1. Initial program 87.0%

              \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
            2. Simplified83.2%

              \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
            3. Add Preprocessing
            4. Taylor expanded in h around 0

              \[\leadsto \color{blue}{w0} \]
            5. Step-by-step derivation
              1. Simplified74.8%

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

              if 2.1000000000000001e33 < M

              1. Initial program 72.0%

                \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
              2. Simplified53.7%

                \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
              3. Add Preprocessing
              4. Taylor expanded in h around 0

                \[\leadsto \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
              5. Step-by-step derivation
                1. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                2. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
                3. associate-/l*N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}}\right)\right)\right) \]
                4. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)}\right)\right)\right) \]
                5. unpow2N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
                7. associate-/l*N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left({M}^{2} \cdot \color{blue}{\frac{h \cdot w0}{{d}^{2} \cdot \ell}}\right)\right)\right)\right) \]
                8. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left({M}^{2}\right), \color{blue}{\left(\frac{h \cdot w0}{{d}^{2} \cdot \ell}\right)}\right)\right)\right)\right) \]
                9. unpow2N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
                11. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(h \cdot w0\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right)\right)\right) \]
                12. *-commutativeN/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(w0 \cdot h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
                13. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
                14. unpow2N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\left(d \cdot d\right) \cdot \ell\right)\right)\right)\right)\right)\right) \]
                15. associate-*l*N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(d \cdot \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
                16. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
                17. *-lowering-*.f6434.8%

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \color{blue}{\ell}\right)\right)\right)\right)\right)\right)\right) \]
              6. Simplified34.8%

                \[\leadsto \color{blue}{w0 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{w0 \cdot h}{d \cdot \left(d \cdot \ell\right)}\right)\right)} \]
              7. Taylor expanded in D around inf

                \[\leadsto \color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
              8. Step-by-step derivation
                1. associate-/r*N/A

                  \[\leadsto \frac{-1}{8} \cdot \frac{\frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}}{\color{blue}{\ell}} \]
                2. associate-*r/N/A

                  \[\leadsto \frac{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}}{\color{blue}{\ell}} \]
                3. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}\right), \color{blue}{\ell}\right) \]
                4. associate-*r/N/A

                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)}{{d}^{2}}\right), \ell\right) \]
                5. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                6. associate-*r*N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{-1}{8} \cdot {D}^{2}\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                8. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2}\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                9. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left(D \cdot D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                11. associate-*r*N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(\left({M}^{2} \cdot h\right) \cdot w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                12. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left({M}^{2} \cdot h\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                13. *-commutativeN/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(h \cdot {M}^{2}\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                14. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \left({M}^{2}\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                15. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                16. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                17. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \left(d \cdot d\right)\right), \ell\right) \]
                18. *-lowering-*.f6421.0%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
              9. Simplified21.0%

                \[\leadsto \color{blue}{\frac{\frac{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{d \cdot d}}{\ell}} \]
              10. Step-by-step derivation
                1. associate-*l*N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \left(h \cdot \left(\left(M \cdot M\right) \cdot w0\right)\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
                2. associate-*r*N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot h\right) \cdot \left(\left(M \cdot M\right) \cdot w0\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
                3. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot h\right), \left(\left(M \cdot M\right) \cdot w0\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
                4. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right), h\right), \left(\left(M \cdot M\right) \cdot w0\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left(D \cdot D\right)\right), h\right), \left(\left(M \cdot M\right) \cdot w0\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), h\right), \left(\left(M \cdot M\right) \cdot w0\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
                7. associate-*l*N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), h\right), \left(M \cdot \left(M \cdot w0\right)\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
                8. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), h\right), \mathsf{*.f64}\left(M, \left(M \cdot w0\right)\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
                9. *-lowering-*.f6421.7%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), h\right), \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, w0\right)\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
              11. Applied egg-rr21.7%

                \[\leadsto \frac{\frac{\color{blue}{\left(\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot h\right) \cdot \left(M \cdot \left(M \cdot w0\right)\right)}}{d \cdot d}}{\ell} \]
              12. Step-by-step derivation
                1. times-fracN/A

                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot h}{d} \cdot \frac{M \cdot \left(M \cdot w0\right)}{d}\right), \ell\right) \]
                2. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot h}{d}\right), \left(\frac{M \cdot \left(M \cdot w0\right)}{d}\right)\right), \ell\right) \]
                3. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot h\right), d\right), \left(\frac{M \cdot \left(M \cdot w0\right)}{d}\right)\right), \ell\right) \]
                4. *-commutativeN/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(h \cdot \left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right)\right), d\right), \left(\frac{M \cdot \left(M \cdot w0\right)}{d}\right)\right), \ell\right) \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right)\right), d\right), \left(\frac{M \cdot \left(M \cdot w0\right)}{d}\right)\right), \ell\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(\frac{-1}{8}, \left(D \cdot D\right)\right)\right), d\right), \left(\frac{M \cdot \left(M \cdot w0\right)}{d}\right)\right), \ell\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right)\right), d\right), \left(\frac{M \cdot \left(M \cdot w0\right)}{d}\right)\right), \ell\right) \]
                8. associate-/l*N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right)\right), d\right), \left(M \cdot \frac{M \cdot w0}{d}\right)\right), \ell\right) \]
                9. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right)\right), d\right), \mathsf{*.f64}\left(M, \left(\frac{M \cdot w0}{d}\right)\right)\right), \ell\right) \]
                10. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right)\right), d\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\left(M \cdot w0\right), d\right)\right)\right), \ell\right) \]
                11. *-lowering-*.f6422.3%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right)\right), d\right), \mathsf{*.f64}\left(M, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, w0\right), d\right)\right)\right), \ell\right) \]
              13. Applied egg-rr22.3%

                \[\leadsto \frac{\color{blue}{\frac{h \cdot \left(-0.125 \cdot \left(D \cdot D\right)\right)}{d} \cdot \left(M \cdot \frac{M \cdot w0}{d}\right)}}{\ell} \]
            6. Recombined 2 regimes into one program.
            7. Add Preprocessing

            Alternative 11: 61.8% accurate, 9.0× speedup?

            \[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 2.1 \cdot 10^{+33}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{D}{d} \cdot \left(\frac{-0.125}{\ell} \cdot \frac{D \cdot \left(M\_m \cdot \left(w0 \cdot \left(M\_m \cdot h\right)\right)\right)}{d}\right)\\ \end{array} \end{array} \]
            M_m = (fabs.f64 M)
            (FPCore (w0 M_m D h l d)
             :precision binary64
             (if (<= M_m 2.1e+33)
               w0
               (* (/ D d) (* (/ -0.125 l) (/ (* D (* M_m (* w0 (* M_m h)))) d)))))
            M_m = fabs(M);
            double code(double w0, double M_m, double D, double h, double l, double d) {
            	double tmp;
            	if (M_m <= 2.1e+33) {
            		tmp = w0;
            	} else {
            		tmp = (D / d) * ((-0.125 / l) * ((D * (M_m * (w0 * (M_m * h)))) / d));
            	}
            	return tmp;
            }
            
            M_m = abs(m)
            real(8) function code(w0, m_m, d, h, l, d_1)
                real(8), intent (in) :: w0
                real(8), intent (in) :: m_m
                real(8), intent (in) :: d
                real(8), intent (in) :: h
                real(8), intent (in) :: l
                real(8), intent (in) :: d_1
                real(8) :: tmp
                if (m_m <= 2.1d+33) then
                    tmp = w0
                else
                    tmp = (d / d_1) * (((-0.125d0) / l) * ((d * (m_m * (w0 * (m_m * h)))) / d_1))
                end if
                code = tmp
            end function
            
            M_m = Math.abs(M);
            public static double code(double w0, double M_m, double D, double h, double l, double d) {
            	double tmp;
            	if (M_m <= 2.1e+33) {
            		tmp = w0;
            	} else {
            		tmp = (D / d) * ((-0.125 / l) * ((D * (M_m * (w0 * (M_m * h)))) / d));
            	}
            	return tmp;
            }
            
            M_m = math.fabs(M)
            def code(w0, M_m, D, h, l, d):
            	tmp = 0
            	if M_m <= 2.1e+33:
            		tmp = w0
            	else:
            		tmp = (D / d) * ((-0.125 / l) * ((D * (M_m * (w0 * (M_m * h)))) / d))
            	return tmp
            
            M_m = abs(M)
            function code(w0, M_m, D, h, l, d)
            	tmp = 0.0
            	if (M_m <= 2.1e+33)
            		tmp = w0;
            	else
            		tmp = Float64(Float64(D / d) * Float64(Float64(-0.125 / l) * Float64(Float64(D * Float64(M_m * Float64(w0 * Float64(M_m * h)))) / d)));
            	end
            	return tmp
            end
            
            M_m = abs(M);
            function tmp_2 = code(w0, M_m, D, h, l, d)
            	tmp = 0.0;
            	if (M_m <= 2.1e+33)
            		tmp = w0;
            	else
            		tmp = (D / d) * ((-0.125 / l) * ((D * (M_m * (w0 * (M_m * h)))) / d));
            	end
            	tmp_2 = tmp;
            end
            
            M_m = N[Abs[M], $MachinePrecision]
            code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[M$95$m, 2.1e+33], w0, N[(N[(D / d), $MachinePrecision] * N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(D * N[(M$95$m * N[(w0 * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            M_m = \left|M\right|
            
            \\
            \begin{array}{l}
            \mathbf{if}\;M\_m \leq 2.1 \cdot 10^{+33}:\\
            \;\;\;\;w0\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{D}{d} \cdot \left(\frac{-0.125}{\ell} \cdot \frac{D \cdot \left(M\_m \cdot \left(w0 \cdot \left(M\_m \cdot h\right)\right)\right)}{d}\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if M < 2.1000000000000001e33

              1. Initial program 87.0%

                \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
              2. Simplified83.2%

                \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
              3. Add Preprocessing
              4. Taylor expanded in h around 0

                \[\leadsto \color{blue}{w0} \]
              5. Step-by-step derivation
                1. Simplified74.8%

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

                if 2.1000000000000001e33 < M

                1. Initial program 72.0%

                  \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                2. Simplified53.7%

                  \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
                3. Add Preprocessing
                4. Taylor expanded in h around 0

                  \[\leadsto \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                5. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
                  3. associate-/l*N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}}\right)\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)}\right)\right)\right) \]
                  5. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
                  7. associate-/l*N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left({M}^{2} \cdot \color{blue}{\frac{h \cdot w0}{{d}^{2} \cdot \ell}}\right)\right)\right)\right) \]
                  8. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left({M}^{2}\right), \color{blue}{\left(\frac{h \cdot w0}{{d}^{2} \cdot \ell}\right)}\right)\right)\right)\right) \]
                  9. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
                  11. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(h \cdot w0\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right)\right)\right) \]
                  12. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(w0 \cdot h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
                  13. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
                  14. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\left(d \cdot d\right) \cdot \ell\right)\right)\right)\right)\right)\right) \]
                  15. associate-*l*N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(d \cdot \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
                  16. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
                  17. *-lowering-*.f6434.8%

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \color{blue}{\ell}\right)\right)\right)\right)\right)\right)\right) \]
                6. Simplified34.8%

                  \[\leadsto \color{blue}{w0 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{w0 \cdot h}{d \cdot \left(d \cdot \ell\right)}\right)\right)} \]
                7. Taylor expanded in D around inf

                  \[\leadsto \color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                8. Step-by-step derivation
                  1. associate-/r*N/A

                    \[\leadsto \frac{-1}{8} \cdot \frac{\frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}}{\color{blue}{\ell}} \]
                  2. associate-*r/N/A

                    \[\leadsto \frac{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}}{\color{blue}{\ell}} \]
                  3. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}\right), \color{blue}{\ell}\right) \]
                  4. associate-*r/N/A

                    \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)}{{d}^{2}}\right), \ell\right) \]
                  5. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  6. associate-*r*N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{-1}{8} \cdot {D}^{2}\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  8. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2}\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  9. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left(D \cdot D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  11. associate-*r*N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(\left({M}^{2} \cdot h\right) \cdot w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  12. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left({M}^{2} \cdot h\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  13. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(h \cdot {M}^{2}\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  14. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \left({M}^{2}\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  15. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  16. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                  17. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \left(d \cdot d\right)\right), \ell\right) \]
                  18. *-lowering-*.f6421.0%

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
                9. Simplified21.0%

                  \[\leadsto \color{blue}{\frac{\frac{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{d \cdot d}}{\ell}} \]
                10. Step-by-step derivation
                  1. associate-/l/N/A

                    \[\leadsto \frac{\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{\color{blue}{\ell \cdot \left(d \cdot d\right)}} \]
                  2. associate-*l*N/A

                    \[\leadsto \frac{\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)\right)}{\color{blue}{\ell} \cdot \left(d \cdot d\right)} \]
                  3. times-fracN/A

                    \[\leadsto \frac{\frac{-1}{8}}{\ell} \cdot \color{blue}{\frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{d \cdot d}} \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{-1}{8}}{\ell}\right), \color{blue}{\left(\frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{d \cdot d}\right)}\right) \]
                  5. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \left(\frac{\color{blue}{\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}}{d \cdot d}\right)\right) \]
                  6. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)\right), \color{blue}{\left(d \cdot d\right)}\right)\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right)\right), \left(d \cdot d\right)\right)\right) \]
                  8. associate-*r*N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \left(h \cdot w0\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                  9. associate-*r*N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                  10. associate-*l*N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(D \cdot \left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(\color{blue}{d} \cdot d\right)\right)\right) \]
                  11. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(\color{blue}{d} \cdot d\right)\right)\right) \]
                  12. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                  13. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                  14. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \left(h \cdot w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                  15. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                  16. *-lowering-*.f6428.6%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right)\right)\right), \mathsf{*.f64}\left(d, \color{blue}{d}\right)\right)\right) \]
                11. Applied egg-rr28.6%

                  \[\leadsto \color{blue}{\frac{-0.125}{\ell} \cdot \frac{D \cdot \left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)}{d \cdot d}} \]
                12. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \frac{D \cdot \left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)}{d \cdot d} \cdot \color{blue}{\frac{\frac{-1}{8}}{\ell}} \]
                  2. times-fracN/A

                    \[\leadsto \left(\frac{D}{d} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)}{d}\right) \cdot \frac{\color{blue}{\frac{-1}{8}}}{\ell} \]
                  3. associate-*l*N/A

                    \[\leadsto \frac{D}{d} \cdot \color{blue}{\left(\frac{D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)}{d} \cdot \frac{\frac{-1}{8}}{\ell}\right)} \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\left(\frac{D}{d}\right), \color{blue}{\left(\frac{D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)}{d} \cdot \frac{\frac{-1}{8}}{\ell}\right)}\right) \]
                  5. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \left(\color{blue}{\frac{D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)}{d}} \cdot \frac{\frac{-1}{8}}{\ell}\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(\left(\frac{D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)}{d}\right), \color{blue}{\left(\frac{\frac{-1}{8}}{\ell}\right)}\right)\right) \]
                  7. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right), d\right), \left(\frac{\color{blue}{\frac{-1}{8}}}{\ell}\right)\right)\right) \]
                  8. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right), d\right), \left(\frac{\frac{-1}{8}}{\ell}\right)\right)\right) \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \left(M \cdot \left(h \cdot w0\right)\right)\right)\right), d\right), \left(\frac{\frac{-1}{8}}{\ell}\right)\right)\right) \]
                  10. associate-*r*N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \left(\left(M \cdot h\right) \cdot w0\right)\right)\right), d\right), \left(\frac{\frac{-1}{8}}{\ell}\right)\right)\right) \]
                  11. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \left(w0 \cdot \left(M \cdot h\right)\right)\right)\right), d\right), \left(\frac{\frac{-1}{8}}{\ell}\right)\right)\right) \]
                  12. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(w0, \left(M \cdot h\right)\right)\right)\right), d\right), \left(\frac{\frac{-1}{8}}{\ell}\right)\right)\right) \]
                  13. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(M, h\right)\right)\right)\right), d\right), \left(\frac{\frac{-1}{8}}{\ell}\right)\right)\right) \]
                  14. /-lowering-/.f6428.8%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(D, d\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(M, h\right)\right)\right)\right), d\right), \mathsf{/.f64}\left(\frac{-1}{8}, \color{blue}{\ell}\right)\right)\right) \]
                13. Applied egg-rr28.8%

                  \[\leadsto \color{blue}{\frac{D}{d} \cdot \left(\frac{D \cdot \left(M \cdot \left(w0 \cdot \left(M \cdot h\right)\right)\right)}{d} \cdot \frac{-0.125}{\ell}\right)} \]
              6. Recombined 2 regimes into one program.
              7. Final simplification66.1%

                \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 2.1 \cdot 10^{+33}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{D}{d} \cdot \left(\frac{-0.125}{\ell} \cdot \frac{D \cdot \left(M \cdot \left(w0 \cdot \left(M \cdot h\right)\right)\right)}{d}\right)\\ \end{array} \]
              8. Add Preprocessing

              Alternative 12: 60.8% accurate, 9.0× speedup?

              \[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 2.1 \cdot 10^{+33}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.125}{\ell} \cdot \frac{\left(M\_m \cdot D\right) \cdot \left(D \cdot \left(w0 \cdot \left(M\_m \cdot h\right)\right)\right)}{d \cdot d}\\ \end{array} \end{array} \]
              M_m = (fabs.f64 M)
              (FPCore (w0 M_m D h l d)
               :precision binary64
               (if (<= M_m 2.1e+33)
                 w0
                 (* (/ -0.125 l) (/ (* (* M_m D) (* D (* w0 (* M_m h)))) (* d d)))))
              M_m = fabs(M);
              double code(double w0, double M_m, double D, double h, double l, double d) {
              	double tmp;
              	if (M_m <= 2.1e+33) {
              		tmp = w0;
              	} else {
              		tmp = (-0.125 / l) * (((M_m * D) * (D * (w0 * (M_m * h)))) / (d * d));
              	}
              	return tmp;
              }
              
              M_m = abs(m)
              real(8) function code(w0, m_m, d, h, l, d_1)
                  real(8), intent (in) :: w0
                  real(8), intent (in) :: m_m
                  real(8), intent (in) :: d
                  real(8), intent (in) :: h
                  real(8), intent (in) :: l
                  real(8), intent (in) :: d_1
                  real(8) :: tmp
                  if (m_m <= 2.1d+33) then
                      tmp = w0
                  else
                      tmp = ((-0.125d0) / l) * (((m_m * d) * (d * (w0 * (m_m * h)))) / (d_1 * d_1))
                  end if
                  code = tmp
              end function
              
              M_m = Math.abs(M);
              public static double code(double w0, double M_m, double D, double h, double l, double d) {
              	double tmp;
              	if (M_m <= 2.1e+33) {
              		tmp = w0;
              	} else {
              		tmp = (-0.125 / l) * (((M_m * D) * (D * (w0 * (M_m * h)))) / (d * d));
              	}
              	return tmp;
              }
              
              M_m = math.fabs(M)
              def code(w0, M_m, D, h, l, d):
              	tmp = 0
              	if M_m <= 2.1e+33:
              		tmp = w0
              	else:
              		tmp = (-0.125 / l) * (((M_m * D) * (D * (w0 * (M_m * h)))) / (d * d))
              	return tmp
              
              M_m = abs(M)
              function code(w0, M_m, D, h, l, d)
              	tmp = 0.0
              	if (M_m <= 2.1e+33)
              		tmp = w0;
              	else
              		tmp = Float64(Float64(-0.125 / l) * Float64(Float64(Float64(M_m * D) * Float64(D * Float64(w0 * Float64(M_m * h)))) / Float64(d * d)));
              	end
              	return tmp
              end
              
              M_m = abs(M);
              function tmp_2 = code(w0, M_m, D, h, l, d)
              	tmp = 0.0;
              	if (M_m <= 2.1e+33)
              		tmp = w0;
              	else
              		tmp = (-0.125 / l) * (((M_m * D) * (D * (w0 * (M_m * h)))) / (d * d));
              	end
              	tmp_2 = tmp;
              end
              
              M_m = N[Abs[M], $MachinePrecision]
              code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[M$95$m, 2.1e+33], w0, N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(N[(M$95$m * D), $MachinePrecision] * N[(D * N[(w0 * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              M_m = \left|M\right|
              
              \\
              \begin{array}{l}
              \mathbf{if}\;M\_m \leq 2.1 \cdot 10^{+33}:\\
              \;\;\;\;w0\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{-0.125}{\ell} \cdot \frac{\left(M\_m \cdot D\right) \cdot \left(D \cdot \left(w0 \cdot \left(M\_m \cdot h\right)\right)\right)}{d \cdot d}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if M < 2.1000000000000001e33

                1. Initial program 87.0%

                  \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                2. Simplified83.2%

                  \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
                3. Add Preprocessing
                4. Taylor expanded in h around 0

                  \[\leadsto \color{blue}{w0} \]
                5. Step-by-step derivation
                  1. Simplified74.8%

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

                  if 2.1000000000000001e33 < M

                  1. Initial program 72.0%

                    \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                  2. Simplified53.7%

                    \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
                  3. Add Preprocessing
                  4. Taylor expanded in h around 0

                    \[\leadsto \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                  5. Step-by-step derivation
                    1. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
                    3. associate-/l*N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}}\right)\right)\right) \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)}\right)\right)\right) \]
                    5. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
                    6. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
                    7. associate-/l*N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left({M}^{2} \cdot \color{blue}{\frac{h \cdot w0}{{d}^{2} \cdot \ell}}\right)\right)\right)\right) \]
                    8. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left({M}^{2}\right), \color{blue}{\left(\frac{h \cdot w0}{{d}^{2} \cdot \ell}\right)}\right)\right)\right)\right) \]
                    9. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
                    10. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
                    11. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(h \cdot w0\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right)\right)\right) \]
                    12. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(w0 \cdot h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
                    13. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
                    14. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\left(d \cdot d\right) \cdot \ell\right)\right)\right)\right)\right)\right) \]
                    15. associate-*l*N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(d \cdot \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
                    16. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
                    17. *-lowering-*.f6434.8%

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \color{blue}{\ell}\right)\right)\right)\right)\right)\right)\right) \]
                  6. Simplified34.8%

                    \[\leadsto \color{blue}{w0 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{w0 \cdot h}{d \cdot \left(d \cdot \ell\right)}\right)\right)} \]
                  7. Taylor expanded in D around inf

                    \[\leadsto \color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                  8. Step-by-step derivation
                    1. associate-/r*N/A

                      \[\leadsto \frac{-1}{8} \cdot \frac{\frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}}{\color{blue}{\ell}} \]
                    2. associate-*r/N/A

                      \[\leadsto \frac{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}}{\color{blue}{\ell}} \]
                    3. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}\right), \color{blue}{\ell}\right) \]
                    4. associate-*r/N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)}{{d}^{2}}\right), \ell\right) \]
                    5. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    6. associate-*r*N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{-1}{8} \cdot {D}^{2}\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    8. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2}\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    9. unpow2N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left(D \cdot D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    10. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    11. associate-*r*N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(\left({M}^{2} \cdot h\right) \cdot w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    12. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left({M}^{2} \cdot h\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    13. *-commutativeN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(h \cdot {M}^{2}\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    14. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \left({M}^{2}\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    15. unpow2N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    16. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                    17. unpow2N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \left(d \cdot d\right)\right), \ell\right) \]
                    18. *-lowering-*.f6421.0%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
                  9. Simplified21.0%

                    \[\leadsto \color{blue}{\frac{\frac{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{d \cdot d}}{\ell}} \]
                  10. Step-by-step derivation
                    1. associate-/l/N/A

                      \[\leadsto \frac{\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{\color{blue}{\ell \cdot \left(d \cdot d\right)}} \]
                    2. associate-*l*N/A

                      \[\leadsto \frac{\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)\right)}{\color{blue}{\ell} \cdot \left(d \cdot d\right)} \]
                    3. times-fracN/A

                      \[\leadsto \frac{\frac{-1}{8}}{\ell} \cdot \color{blue}{\frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{d \cdot d}} \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{-1}{8}}{\ell}\right), \color{blue}{\left(\frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{d \cdot d}\right)}\right) \]
                    5. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \left(\frac{\color{blue}{\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}}{d \cdot d}\right)\right) \]
                    6. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)\right), \color{blue}{\left(d \cdot d\right)}\right)\right) \]
                    7. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right)\right), \left(d \cdot d\right)\right)\right) \]
                    8. associate-*r*N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \left(h \cdot w0\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                    9. associate-*r*N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                    10. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(D \cdot \left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(\color{blue}{d} \cdot d\right)\right)\right) \]
                    11. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(\color{blue}{d} \cdot d\right)\right)\right) \]
                    12. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                    13. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                    14. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \left(h \cdot w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                    15. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                    16. *-lowering-*.f6428.6%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right)\right)\right), \mathsf{*.f64}\left(d, \color{blue}{d}\right)\right)\right) \]
                  11. Applied egg-rr28.6%

                    \[\leadsto \color{blue}{\frac{-0.125}{\ell} \cdot \frac{D \cdot \left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)}{d \cdot d}} \]
                  12. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right) \cdot D\right), \mathsf{*.f64}\left(\color{blue}{d}, d\right)\right)\right) \]
                    2. associate-*r*N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(\left(D \cdot M\right) \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right) \cdot D\right), \mathsf{*.f64}\left(d, d\right)\right)\right) \]
                    3. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot M\right) \cdot \left(\left(M \cdot \left(h \cdot w0\right)\right) \cdot D\right)\right), \mathsf{*.f64}\left(\color{blue}{d}, d\right)\right)\right) \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(D \cdot M\right), \left(\left(M \cdot \left(h \cdot w0\right)\right) \cdot D\right)\right), \mathsf{*.f64}\left(\color{blue}{d}, d\right)\right)\right) \]
                    5. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot D\right), \left(\left(M \cdot \left(h \cdot w0\right)\right) \cdot D\right)\right), \mathsf{*.f64}\left(d, d\right)\right)\right) \]
                    6. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, D\right), \left(\left(M \cdot \left(h \cdot w0\right)\right) \cdot D\right)\right), \mathsf{*.f64}\left(d, d\right)\right)\right) \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(\left(M \cdot \left(h \cdot w0\right)\right), D\right)\right), \mathsf{*.f64}\left(d, d\right)\right)\right) \]
                    8. associate-*r*N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(\left(\left(M \cdot h\right) \cdot w0\right), D\right)\right), \mathsf{*.f64}\left(d, d\right)\right)\right) \]
                    9. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(\left(w0 \cdot \left(M \cdot h\right)\right), D\right)\right), \mathsf{*.f64}\left(d, d\right)\right)\right) \]
                    10. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w0, \left(M \cdot h\right)\right), D\right)\right), \mathsf{*.f64}\left(d, d\right)\right)\right) \]
                    11. *-lowering-*.f6428.4%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(M, h\right)\right), D\right)\right), \mathsf{*.f64}\left(d, d\right)\right)\right) \]
                  13. Applied egg-rr28.4%

                    \[\leadsto \frac{-0.125}{\ell} \cdot \frac{\color{blue}{\left(M \cdot D\right) \cdot \left(\left(w0 \cdot \left(M \cdot h\right)\right) \cdot D\right)}}{d \cdot d} \]
                6. Recombined 2 regimes into one program.
                7. Final simplification66.1%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 2.1 \cdot 10^{+33}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.125}{\ell} \cdot \frac{\left(M \cdot D\right) \cdot \left(D \cdot \left(w0 \cdot \left(M \cdot h\right)\right)\right)}{d \cdot d}\\ \end{array} \]
                8. Add Preprocessing

                Alternative 13: 60.4% accurate, 9.0× speedup?

                \[\begin{array}{l} M_m = \left|M\right| \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 4.4 \cdot 10^{+30}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.125}{\ell} \cdot \frac{D \cdot \left(D \cdot \left(M\_m \cdot \left(M\_m \cdot \left(w0 \cdot h\right)\right)\right)\right)}{d \cdot d}\\ \end{array} \end{array} \]
                M_m = (fabs.f64 M)
                (FPCore (w0 M_m D h l d)
                 :precision binary64
                 (if (<= M_m 4.4e+30)
                   w0
                   (* (/ -0.125 l) (/ (* D (* D (* M_m (* M_m (* w0 h))))) (* d d)))))
                M_m = fabs(M);
                double code(double w0, double M_m, double D, double h, double l, double d) {
                	double tmp;
                	if (M_m <= 4.4e+30) {
                		tmp = w0;
                	} else {
                		tmp = (-0.125 / l) * ((D * (D * (M_m * (M_m * (w0 * h))))) / (d * d));
                	}
                	return tmp;
                }
                
                M_m = abs(m)
                real(8) function code(w0, m_m, d, h, l, d_1)
                    real(8), intent (in) :: w0
                    real(8), intent (in) :: m_m
                    real(8), intent (in) :: d
                    real(8), intent (in) :: h
                    real(8), intent (in) :: l
                    real(8), intent (in) :: d_1
                    real(8) :: tmp
                    if (m_m <= 4.4d+30) then
                        tmp = w0
                    else
                        tmp = ((-0.125d0) / l) * ((d * (d * (m_m * (m_m * (w0 * h))))) / (d_1 * d_1))
                    end if
                    code = tmp
                end function
                
                M_m = Math.abs(M);
                public static double code(double w0, double M_m, double D, double h, double l, double d) {
                	double tmp;
                	if (M_m <= 4.4e+30) {
                		tmp = w0;
                	} else {
                		tmp = (-0.125 / l) * ((D * (D * (M_m * (M_m * (w0 * h))))) / (d * d));
                	}
                	return tmp;
                }
                
                M_m = math.fabs(M)
                def code(w0, M_m, D, h, l, d):
                	tmp = 0
                	if M_m <= 4.4e+30:
                		tmp = w0
                	else:
                		tmp = (-0.125 / l) * ((D * (D * (M_m * (M_m * (w0 * h))))) / (d * d))
                	return tmp
                
                M_m = abs(M)
                function code(w0, M_m, D, h, l, d)
                	tmp = 0.0
                	if (M_m <= 4.4e+30)
                		tmp = w0;
                	else
                		tmp = Float64(Float64(-0.125 / l) * Float64(Float64(D * Float64(D * Float64(M_m * Float64(M_m * Float64(w0 * h))))) / Float64(d * d)));
                	end
                	return tmp
                end
                
                M_m = abs(M);
                function tmp_2 = code(w0, M_m, D, h, l, d)
                	tmp = 0.0;
                	if (M_m <= 4.4e+30)
                		tmp = w0;
                	else
                		tmp = (-0.125 / l) * ((D * (D * (M_m * (M_m * (w0 * h))))) / (d * d));
                	end
                	tmp_2 = tmp;
                end
                
                M_m = N[Abs[M], $MachinePrecision]
                code[w0_, M$95$m_, D_, h_, l_, d_] := If[LessEqual[M$95$m, 4.4e+30], w0, N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(D * N[(D * N[(M$95$m * N[(M$95$m * N[(w0 * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                M_m = \left|M\right|
                
                \\
                \begin{array}{l}
                \mathbf{if}\;M\_m \leq 4.4 \cdot 10^{+30}:\\
                \;\;\;\;w0\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{-0.125}{\ell} \cdot \frac{D \cdot \left(D \cdot \left(M\_m \cdot \left(M\_m \cdot \left(w0 \cdot h\right)\right)\right)\right)}{d \cdot d}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if M < 4.4e30

                  1. Initial program 87.0%

                    \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                  2. Simplified83.2%

                    \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
                  3. Add Preprocessing
                  4. Taylor expanded in h around 0

                    \[\leadsto \color{blue}{w0} \]
                  5. Step-by-step derivation
                    1. Simplified74.8%

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

                    if 4.4e30 < M

                    1. Initial program 72.0%

                      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                    2. Simplified53.7%

                      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
                    3. Add Preprocessing
                    4. Taylor expanded in h around 0

                      \[\leadsto \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                    5. Step-by-step derivation
                      1. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right)\right) \]
                      3. associate-/l*N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}}\right)\right)\right) \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)}\right)\right)\right) \]
                      5. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
                      6. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell}\right)\right)\right)\right) \]
                      7. associate-/l*N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left({M}^{2} \cdot \color{blue}{\frac{h \cdot w0}{{d}^{2} \cdot \ell}}\right)\right)\right)\right) \]
                      8. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left({M}^{2}\right), \color{blue}{\left(\frac{h \cdot w0}{{d}^{2} \cdot \ell}\right)}\right)\right)\right)\right) \]
                      9. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \left(\frac{\color{blue}{h \cdot w0}}{{d}^{2} \cdot \ell}\right)\right)\right)\right)\right) \]
                      11. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(h \cdot w0\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right)\right)\right) \]
                      12. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\left(w0 \cdot h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
                      13. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right)\right)\right)\right) \]
                      14. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(\left(d \cdot d\right) \cdot \ell\right)\right)\right)\right)\right)\right) \]
                      15. associate-*l*N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \left(d \cdot \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
                      16. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \color{blue}{\left(d \cdot \ell\right)}\right)\right)\right)\right)\right)\right) \]
                      17. *-lowering-*.f6434.8%

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \color{blue}{\ell}\right)\right)\right)\right)\right)\right)\right) \]
                    6. Simplified34.8%

                      \[\leadsto \color{blue}{w0 + -0.125 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{w0 \cdot h}{d \cdot \left(d \cdot \ell\right)}\right)\right)} \]
                    7. Taylor expanded in D around inf

                      \[\leadsto \color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                    8. Step-by-step derivation
                      1. associate-/r*N/A

                        \[\leadsto \frac{-1}{8} \cdot \frac{\frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}}{\color{blue}{\ell}} \]
                      2. associate-*r/N/A

                        \[\leadsto \frac{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}}{\color{blue}{\ell}} \]
                      3. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2}}\right), \color{blue}{\ell}\right) \]
                      4. associate-*r/N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)}{{d}^{2}}\right), \ell\right) \]
                      5. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      6. associate-*r*N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      7. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{-1}{8} \cdot {D}^{2}\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      8. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2}\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      9. unpow2N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left(D \cdot D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      11. associate-*r*N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(\left({M}^{2} \cdot h\right) \cdot w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      12. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left({M}^{2} \cdot h\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      13. *-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(h \cdot {M}^{2}\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      14. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \left({M}^{2}\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      15. unpow2N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      16. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \left({d}^{2}\right)\right), \ell\right) \]
                      17. unpow2N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \left(d \cdot d\right)\right), \ell\right) \]
                      18. *-lowering-*.f6421.0%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), w0\right)\right), \mathsf{*.f64}\left(d, d\right)\right), \ell\right) \]
                    9. Simplified21.0%

                      \[\leadsto \color{blue}{\frac{\frac{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{d \cdot d}}{\ell}} \]
                    10. Step-by-step derivation
                      1. associate-/l/N/A

                        \[\leadsto \frac{\left(\frac{-1}{8} \cdot \left(D \cdot D\right)\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{\color{blue}{\ell \cdot \left(d \cdot d\right)}} \]
                      2. associate-*l*N/A

                        \[\leadsto \frac{\frac{-1}{8} \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)\right)}{\color{blue}{\ell} \cdot \left(d \cdot d\right)} \]
                      3. times-fracN/A

                        \[\leadsto \frac{\frac{-1}{8}}{\ell} \cdot \color{blue}{\frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{d \cdot d}} \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{-1}{8}}{\ell}\right), \color{blue}{\left(\frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}{d \cdot d}\right)}\right) \]
                      5. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \left(\frac{\color{blue}{\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)}}{d \cdot d}\right)\right) \]
                      6. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot w0\right)\right), \color{blue}{\left(d \cdot d\right)}\right)\right) \]
                      7. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right)\right), \left(d \cdot d\right)\right)\right) \]
                      8. associate-*r*N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \left(h \cdot w0\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                      9. associate-*r*N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                      10. associate-*l*N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\left(D \cdot \left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(\color{blue}{d} \cdot d\right)\right)\right) \]
                      11. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(\color{blue}{d} \cdot d\right)\right)\right) \]
                      12. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                      13. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                      14. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \left(h \cdot w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                      15. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right)\right)\right), \left(d \cdot d\right)\right)\right) \]
                      16. *-lowering-*.f6428.6%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(h, w0\right)\right)\right)\right)\right), \mathsf{*.f64}\left(d, \color{blue}{d}\right)\right)\right) \]
                    11. Applied egg-rr28.6%

                      \[\leadsto \color{blue}{\frac{-0.125}{\ell} \cdot \frac{D \cdot \left(D \cdot \left(M \cdot \left(M \cdot \left(h \cdot w0\right)\right)\right)\right)}{d \cdot d}} \]
                  6. Recombined 2 regimes into one program.
                  7. Final simplification66.1%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 4.4 \cdot 10^{+30}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.125}{\ell} \cdot \frac{D \cdot \left(D \cdot \left(M \cdot \left(M \cdot \left(w0 \cdot h\right)\right)\right)\right)}{d \cdot d}\\ \end{array} \]
                  8. Add Preprocessing

                  Alternative 14: 68.3% accurate, 216.0× speedup?

                  \[\begin{array}{l} M_m = \left|M\right| \\ w0 \end{array} \]
                  M_m = (fabs.f64 M)
                  (FPCore (w0 M_m D h l d) :precision binary64 w0)
                  M_m = fabs(M);
                  double code(double w0, double M_m, double D, double h, double l, double d) {
                  	return w0;
                  }
                  
                  M_m = abs(m)
                  real(8) function code(w0, m_m, d, h, l, d_1)
                      real(8), intent (in) :: w0
                      real(8), intent (in) :: m_m
                      real(8), intent (in) :: d
                      real(8), intent (in) :: h
                      real(8), intent (in) :: l
                      real(8), intent (in) :: d_1
                      code = w0
                  end function
                  
                  M_m = Math.abs(M);
                  public static double code(double w0, double M_m, double D, double h, double l, double d) {
                  	return w0;
                  }
                  
                  M_m = math.fabs(M)
                  def code(w0, M_m, D, h, l, d):
                  	return w0
                  
                  M_m = abs(M)
                  function code(w0, M_m, D, h, l, d)
                  	return w0
                  end
                  
                  M_m = abs(M);
                  function tmp = code(w0, M_m, D, h, l, d)
                  	tmp = w0;
                  end
                  
                  M_m = N[Abs[M], $MachinePrecision]
                  code[w0_, M$95$m_, D_, h_, l_, d_] := w0
                  
                  \begin{array}{l}
                  M_m = \left|M\right|
                  
                  \\
                  w0
                  \end{array}
                  
                  Derivation
                  1. Initial program 84.2%

                    \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                  2. Simplified77.7%

                    \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
                  3. Add Preprocessing
                  4. Taylor expanded in h around 0

                    \[\leadsto \color{blue}{w0} \]
                  5. Step-by-step derivation
                    1. Simplified70.3%

                      \[\leadsto \color{blue}{w0} \]
                    2. Add Preprocessing

                    Reproduce

                    ?
                    herbie shell --seed 2024288 
                    (FPCore (w0 M D h l d)
                      :name "Henrywood and Agarwal, Equation (9a)"
                      :precision binary64
                      (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))