Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.9% → 78.4%
Time: 27.3s
Alternatives: 24
Speedup: 3.6×

Specification

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

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

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

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

Alternative 1: 78.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(M \cdot D\right) \cdot 0.5\\ t_1 := h \cdot \frac{t\_0}{d}\\ t_2 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\\ t_3 := \sqrt{0 - d}\\ t_4 := \frac{M \cdot D}{d \cdot 2}\\ \mathbf{if}\;d \leq -2.35 \cdot 10^{-152}:\\ \;\;\;\;\left(\left(t\_3 \cdot \frac{1}{\sqrt{0 - h}}\right) \cdot t\_2\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({t\_4}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, t\_1, 1\right)}{\frac{\sqrt{0 - \ell}}{t\_3}}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{-67}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_1, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(t\_2 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 + \frac{\frac{t\_0}{d \cdot 2}}{\ell} \cdot \frac{t\_4}{\frac{-1}{h}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* (* M D) 0.5))
        (t_1 (* h (/ t_0 d)))
        (t_2 (pow (/ d l) (/ 1.0 2.0)))
        (t_3 (sqrt (- 0.0 d)))
        (t_4 (/ (* M D) (* d 2.0))))
   (if (<= d -2.35e-152)
     (*
      (* (* t_3 (/ 1.0 (sqrt (- 0.0 h)))) t_2)
      (+ 1.0 (* (/ h l) (* (pow t_4 2.0) (/ -1.0 2.0)))))
     (if (<= d -2.9e-303)
       (/
        (* (sqrt (/ d h)) (fma (/ (* (* M D) -0.5) (* l (* d 2.0))) t_1 1.0))
        (/ (sqrt (- 0.0 l)) t_3))
       (if (<= d 1.6e-67)
         (* (fma (/ (* (* M D) -0.25) (* d l)) t_1 1.0) (/ d (sqrt (* h l))))
         (*
          (* t_2 (/ (sqrt d) (sqrt h)))
          (+ 1.0 (* (/ (/ t_0 (* d 2.0)) l) (/ t_4 (/ -1.0 h))))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (M * D) * 0.5;
	double t_1 = h * (t_0 / d);
	double t_2 = pow((d / l), (1.0 / 2.0));
	double t_3 = sqrt((0.0 - d));
	double t_4 = (M * D) / (d * 2.0);
	double tmp;
	if (d <= -2.35e-152) {
		tmp = ((t_3 * (1.0 / sqrt((0.0 - h)))) * t_2) * (1.0 + ((h / l) * (pow(t_4, 2.0) * (-1.0 / 2.0))));
	} else if (d <= -2.9e-303) {
		tmp = (sqrt((d / h)) * fma((((M * D) * -0.5) / (l * (d * 2.0))), t_1, 1.0)) / (sqrt((0.0 - l)) / t_3);
	} else if (d <= 1.6e-67) {
		tmp = fma((((M * D) * -0.25) / (d * l)), t_1, 1.0) * (d / sqrt((h * l)));
	} else {
		tmp = (t_2 * (sqrt(d) / sqrt(h))) * (1.0 + (((t_0 / (d * 2.0)) / l) * (t_4 / (-1.0 / h))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(Float64(M * D) * 0.5)
	t_1 = Float64(h * Float64(t_0 / d))
	t_2 = Float64(d / l) ^ Float64(1.0 / 2.0)
	t_3 = sqrt(Float64(0.0 - d))
	t_4 = Float64(Float64(M * D) / Float64(d * 2.0))
	tmp = 0.0
	if (d <= -2.35e-152)
		tmp = Float64(Float64(Float64(t_3 * Float64(1.0 / sqrt(Float64(0.0 - h)))) * t_2) * Float64(1.0 + Float64(Float64(h / l) * Float64((t_4 ^ 2.0) * Float64(-1.0 / 2.0)))));
	elseif (d <= -2.9e-303)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * fma(Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0))), t_1, 1.0)) / Float64(sqrt(Float64(0.0 - l)) / t_3));
	elseif (d <= 1.6e-67)
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), t_1, 1.0) * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(Float64(t_2 * Float64(sqrt(d) / sqrt(h))) * Float64(1.0 + Float64(Float64(Float64(t_0 / Float64(d * 2.0)) / l) * Float64(t_4 / Float64(-1.0 / h)))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(h * N[(t$95$0 / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(0.0 - d), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.35e-152], N[(N[(N[(t$95$3 * N[(1.0 / N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[t$95$4, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.9e-303], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(0.0 - l), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.6e-67], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(t$95$0 / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$4 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(M \cdot D\right) \cdot 0.5\\
t_1 := h \cdot \frac{t\_0}{d}\\
t_2 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\\
t_3 := \sqrt{0 - d}\\
t_4 := \frac{M \cdot D}{d \cdot 2}\\
\mathbf{if}\;d \leq -2.35 \cdot 10^{-152}:\\
\;\;\;\;\left(\left(t\_3 \cdot \frac{1}{\sqrt{0 - h}}\right) \cdot t\_2\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({t\_4}^{2} \cdot \frac{-1}{2}\right)\right)\\

\mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, t\_1, 1\right)}{\frac{\sqrt{0 - \ell}}{t\_3}}\\

\mathbf{elif}\;d \leq 1.6 \cdot 10^{-67}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_1, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\left(t\_2 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 + \frac{\frac{t\_0}{d \cdot 2}}{\ell} \cdot \frac{t\_4}{\frac{-1}{h}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.35000000000000006e-152

    1. Initial program 72.3%

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

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

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

        \[\leadsto \left(\sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. sqrt-divN/A

        \[\leadsto \left(\color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. div-invN/A

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

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

        \[\leadsto \left(\left(\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}} \cdot \frac{1}{\sqrt{\mathsf{neg}\left(h\right)}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. neg-sub0N/A

        \[\leadsto \left(\left(\sqrt{\color{blue}{0 - d}} \cdot \frac{1}{\sqrt{\mathsf{neg}\left(h\right)}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \left(\left(\sqrt{\color{blue}{0 - d}} \cdot \frac{1}{\sqrt{\mathsf{neg}\left(h\right)}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \left(\left(\sqrt{0 - d} \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{neg}\left(h\right)}}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left(\left(\sqrt{0 - d} \cdot \frac{1}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. neg-sub0N/A

        \[\leadsto \left(\left(\sqrt{0 - d} \cdot \frac{1}{\sqrt{\color{blue}{0 - h}}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. --lowering--.f6490.3

        \[\leadsto \left(\left(\sqrt{0 - d} \cdot \frac{1}{\sqrt{\color{blue}{0 - h}}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Applied egg-rr90.3%

      \[\leadsto \left(\color{blue}{\left(\sqrt{0 - d} \cdot \frac{1}{\sqrt{0 - h}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]

    if -2.35000000000000006e-152 < d < -2.90000000000000014e-303

    1. Initial program 39.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr24.9%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr38.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(d\right)}}}} \]
      2. sqrt-divN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\color{blue}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{\mathsf{neg}\left(d\right)}}}} \]
      3. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{\color{blue}{0 - d}}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\color{blue}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{0 - d}}}} \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}{\sqrt{0 - d}}} \]
      6. neg-sub0N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\color{blue}{0 - \ell}}}{\sqrt{0 - d}}} \]
      7. --lowering--.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\color{blue}{0 - \ell}}}{\sqrt{0 - d}}} \]
      8. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{\mathsf{neg}\left(d\right)}}}} \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}} \]
      10. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{0 - d}}}} \]
      11. --lowering--.f6459.6

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{0 - d}}}} \]
    6. Applied egg-rr59.6%

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

    if -2.90000000000000014e-303 < d < 1.60000000000000011e-67

    1. Initial program 45.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr28.6%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr45.3%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval45.7

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr45.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr78.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

    if 1.60000000000000011e-67 < d

    1. Initial program 82.9%

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      2. un-div-invN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}\right) \]
      5. div-invN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr87.7%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. metadata-evalN/A

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

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

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. pow1/2N/A

        \[\leadsto \left(\frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      5. metadata-evalN/A

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

        \[\leadsto \left(\color{blue}{\frac{{d}^{\left(\frac{1}{2}\right)}}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      7. metadata-evalN/A

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

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

        \[\leadsto \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      10. sqrt-lowering-sqrt.f6493.1

        \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr93.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.35 \cdot 10^{-152}:\\ \;\;\;\;\left(\left(\sqrt{0 - d} \cdot \frac{1}{\sqrt{0 - h}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\ \mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{0 - d}}}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{-67}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 + \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 78.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\\ t_1 := \sqrt{0 - d}\\ t_2 := \frac{M \cdot D}{d \cdot 2}\\ t_3 := \left(M \cdot D\right) \cdot 0.5\\ t_4 := h \cdot \frac{t\_3}{d}\\ \mathbf{if}\;d \leq -1.85 \cdot 10^{-152}:\\ \;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left({t\_2}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left(t\_0 \cdot \left(t\_1 \cdot \sqrt{\frac{-1}{h}}\right)\right)\\ \mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, t\_4, 1\right)}{\frac{\sqrt{0 - \ell}}{t\_1}}\\ \mathbf{elif}\;d \leq 9.2 \cdot 10^{-72}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_4, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 + \frac{\frac{t\_3}{d \cdot 2}}{\ell} \cdot \frac{t\_2}{\frac{-1}{h}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (pow (/ d l) (/ 1.0 2.0)))
        (t_1 (sqrt (- 0.0 d)))
        (t_2 (/ (* M D) (* d 2.0)))
        (t_3 (* (* M D) 0.5))
        (t_4 (* h (/ t_3 d))))
   (if (<= d -1.85e-152)
     (*
      (+ 1.0 (* (/ h l) (* (pow t_2 2.0) (/ -1.0 2.0))))
      (* t_0 (* t_1 (sqrt (/ -1.0 h)))))
     (if (<= d -2.9e-303)
       (/
        (* (sqrt (/ d h)) (fma (/ (* (* M D) -0.5) (* l (* d 2.0))) t_4 1.0))
        (/ (sqrt (- 0.0 l)) t_1))
       (if (<= d 9.2e-72)
         (* (fma (/ (* (* M D) -0.25) (* d l)) t_4 1.0) (/ d (sqrt (* h l))))
         (*
          (* t_0 (/ (sqrt d) (sqrt h)))
          (+ 1.0 (* (/ (/ t_3 (* d 2.0)) l) (/ t_2 (/ -1.0 h))))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = pow((d / l), (1.0 / 2.0));
	double t_1 = sqrt((0.0 - d));
	double t_2 = (M * D) / (d * 2.0);
	double t_3 = (M * D) * 0.5;
	double t_4 = h * (t_3 / d);
	double tmp;
	if (d <= -1.85e-152) {
		tmp = (1.0 + ((h / l) * (pow(t_2, 2.0) * (-1.0 / 2.0)))) * (t_0 * (t_1 * sqrt((-1.0 / h))));
	} else if (d <= -2.9e-303) {
		tmp = (sqrt((d / h)) * fma((((M * D) * -0.5) / (l * (d * 2.0))), t_4, 1.0)) / (sqrt((0.0 - l)) / t_1);
	} else if (d <= 9.2e-72) {
		tmp = fma((((M * D) * -0.25) / (d * l)), t_4, 1.0) * (d / sqrt((h * l)));
	} else {
		tmp = (t_0 * (sqrt(d) / sqrt(h))) * (1.0 + (((t_3 / (d * 2.0)) / l) * (t_2 / (-1.0 / h))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(d / l) ^ Float64(1.0 / 2.0)
	t_1 = sqrt(Float64(0.0 - d))
	t_2 = Float64(Float64(M * D) / Float64(d * 2.0))
	t_3 = Float64(Float64(M * D) * 0.5)
	t_4 = Float64(h * Float64(t_3 / d))
	tmp = 0.0
	if (d <= -1.85e-152)
		tmp = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((t_2 ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64(t_0 * Float64(t_1 * sqrt(Float64(-1.0 / h)))));
	elseif (d <= -2.9e-303)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * fma(Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0))), t_4, 1.0)) / Float64(sqrt(Float64(0.0 - l)) / t_1));
	elseif (d <= 9.2e-72)
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), t_4, 1.0) * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(Float64(t_0 * Float64(sqrt(d) / sqrt(h))) * Float64(1.0 + Float64(Float64(Float64(t_3 / Float64(d * 2.0)) / l) * Float64(t_2 / Float64(-1.0 / h)))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(0.0 - d), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$4 = N[(h * N[(t$95$3 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.85e-152], N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[t$95$2, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(t$95$1 * N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.9e-303], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4 + 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(0.0 - l), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9.2e-72], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * t$95$4 + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(t$95$3 / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$2 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\\
t_1 := \sqrt{0 - d}\\
t_2 := \frac{M \cdot D}{d \cdot 2}\\
t_3 := \left(M \cdot D\right) \cdot 0.5\\
t_4 := h \cdot \frac{t\_3}{d}\\
\mathbf{if}\;d \leq -1.85 \cdot 10^{-152}:\\
\;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left({t\_2}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left(t\_0 \cdot \left(t\_1 \cdot \sqrt{\frac{-1}{h}}\right)\right)\\

\mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, t\_4, 1\right)}{\frac{\sqrt{0 - \ell}}{t\_1}}\\

\mathbf{elif}\;d \leq 9.2 \cdot 10^{-72}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_4, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 + \frac{\frac{t\_3}{d \cdot 2}}{\ell} \cdot \frac{t\_2}{\frac{-1}{h}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -1.8499999999999999e-152

    1. Initial program 72.3%

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

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

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

        \[\leadsto \left(\sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      4. div-invN/A

        \[\leadsto \left(\sqrt{\color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{1}{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      5. sqrt-prodN/A

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

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

        \[\leadsto \left(\left(\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      8. neg-sub0N/A

        \[\leadsto \left(\left(\sqrt{\color{blue}{0 - d}} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \left(\left(\sqrt{\color{blue}{0 - d}} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left(\left(\sqrt{0 - d} \cdot \color{blue}{\sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      11. frac-2negN/A

        \[\leadsto \left(\left(\sqrt{0 - d} \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(h\right)\right)\right)}}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      12. metadata-evalN/A

        \[\leadsto \left(\left(\sqrt{0 - d} \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\left(\mathsf{neg}\left(h\right)\right)\right)}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      13. remove-double-negN/A

        \[\leadsto \left(\left(\sqrt{0 - d} \cdot \sqrt{\frac{-1}{\color{blue}{h}}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      14. /-lowering-/.f6490.3

        \[\leadsto \left(\left(\sqrt{0 - d} \cdot \sqrt{\color{blue}{\frac{-1}{h}}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    4. Applied egg-rr90.3%

      \[\leadsto \left(\color{blue}{\left(\sqrt{0 - d} \cdot \sqrt{\frac{-1}{h}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]

    if -1.8499999999999999e-152 < d < -2.90000000000000014e-303

    1. Initial program 39.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr24.9%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr38.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(d\right)}}}} \]
      2. sqrt-divN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\color{blue}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{\mathsf{neg}\left(d\right)}}}} \]
      3. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{\color{blue}{0 - d}}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\color{blue}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{0 - d}}}} \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}{\sqrt{0 - d}}} \]
      6. neg-sub0N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\color{blue}{0 - \ell}}}{\sqrt{0 - d}}} \]
      7. --lowering--.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\color{blue}{0 - \ell}}}{\sqrt{0 - d}}} \]
      8. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{\mathsf{neg}\left(d\right)}}}} \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}} \]
      10. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{0 - d}}}} \]
      11. --lowering--.f6459.6

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{0 - d}}}} \]
    6. Applied egg-rr59.6%

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

    if -2.90000000000000014e-303 < d < 9.19999999999999978e-72

    1. Initial program 45.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr28.6%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr45.3%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval45.7

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr45.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr78.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

    if 9.19999999999999978e-72 < d

    1. Initial program 82.9%

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      2. un-div-invN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}\right) \]
      5. div-invN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr87.7%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. metadata-evalN/A

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

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

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. pow1/2N/A

        \[\leadsto \left(\frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      5. metadata-evalN/A

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

        \[\leadsto \left(\color{blue}{\frac{{d}^{\left(\frac{1}{2}\right)}}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      7. metadata-evalN/A

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

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

        \[\leadsto \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      10. sqrt-lowering-sqrt.f6493.1

        \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr93.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.85 \cdot 10^{-152}:\\ \;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(\sqrt{0 - d} \cdot \sqrt{\frac{-1}{h}}\right)\right)\\ \mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{0 - d}}}\\ \mathbf{elif}\;d \leq 9.2 \cdot 10^{-72}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 + \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(M \cdot D\right) \cdot 0.5\\ t_1 := 1 + \frac{\frac{t\_0}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\\ \mathbf{if}\;d \leq -8.5 \cdot 10^{+197}:\\ \;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\ \;\;\;\;t\_1 \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{0 - d}}{\sqrt{0 - \ell}}\right)\\ \mathbf{elif}\;d \leq 2 \cdot 10^{-68}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{t\_0}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot t\_1\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* (* M D) 0.5))
        (t_1
         (+
          1.0
          (* (/ (/ t_0 (* d 2.0)) l) (/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))))
   (if (<= d -8.5e+197)
     (fabs (* (sqrt (/ -1.0 h)) (* d (/ 1.0 (sqrt (fabs l))))))
     (if (<= d -5e-311)
       (*
        t_1
        (* (pow (/ d h) (/ 1.0 2.0)) (/ (sqrt (- 0.0 d)) (sqrt (- 0.0 l)))))
       (if (<= d 2e-68)
         (*
          (fma (/ (* (* M D) -0.25) (* d l)) (* h (/ t_0 d)) 1.0)
          (/ d (sqrt (* h l))))
         (* (* (pow (/ d l) (/ 1.0 2.0)) (/ (sqrt d) (sqrt h))) t_1))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (M * D) * 0.5;
	double t_1 = 1.0 + (((t_0 / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
	double tmp;
	if (d <= -8.5e+197) {
		tmp = fabs((sqrt((-1.0 / h)) * (d * (1.0 / sqrt(fabs(l))))));
	} else if (d <= -5e-311) {
		tmp = t_1 * (pow((d / h), (1.0 / 2.0)) * (sqrt((0.0 - d)) / sqrt((0.0 - l))));
	} else if (d <= 2e-68) {
		tmp = fma((((M * D) * -0.25) / (d * l)), (h * (t_0 / d)), 1.0) * (d / sqrt((h * l)));
	} else {
		tmp = (pow((d / l), (1.0 / 2.0)) * (sqrt(d) / sqrt(h))) * t_1;
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(Float64(M * D) * 0.5)
	t_1 = Float64(1.0 + Float64(Float64(Float64(t_0 / Float64(d * 2.0)) / l) * Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(-1.0 / h))))
	tmp = 0.0
	if (d <= -8.5e+197)
		tmp = abs(Float64(sqrt(Float64(-1.0 / h)) * Float64(d * Float64(1.0 / sqrt(abs(l))))));
	elseif (d <= -5e-311)
		tmp = Float64(t_1 * Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * Float64(sqrt(Float64(0.0 - d)) / sqrt(Float64(0.0 - l)))));
	elseif (d <= 2e-68)
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), Float64(h * Float64(t_0 / d)), 1.0) * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * Float64(sqrt(d) / sqrt(h))) * t_1);
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(N[(t$95$0 / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -8.5e+197], N[Abs[N[(N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision] * N[(d * N[(1.0 / N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -5e-311], N[(t$95$1 * N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(0.0 - d), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2e-68], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h * N[(t$95$0 / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(M \cdot D\right) \cdot 0.5\\
t_1 := 1 + \frac{\frac{t\_0}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\\
\mathbf{if}\;d \leq -8.5 \cdot 10^{+197}:\\
\;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\

\mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\
\;\;\;\;t\_1 \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{0 - d}}{\sqrt{0 - \ell}}\right)\\

\mathbf{elif}\;d \leq 2 \cdot 10^{-68}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{t\_0}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -8.5000000000000001e197

    1. Initial program 57.8%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f645.4

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified5.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6477.2

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr77.2%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \left|\color{blue}{\frac{1}{\frac{\sqrt{h \cdot \ell}}{d}}}\right| \]
      2. associate-/r/N/A

        \[\leadsto \left|\color{blue}{\frac{1}{\sqrt{h \cdot \ell}} \cdot d}\right| \]
      3. metadata-evalN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}} \cdot d\right| \]
      4. *-commutativeN/A

        \[\leadsto \left|\frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot d\right| \]
      5. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\ell \cdot h}}} \cdot d\right| \]
      6. frac-2negN/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}} \cdot d\right| \]
      7. metadata-evalN/A

        \[\leadsto \left|\sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}} \cdot d\right| \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \left|\sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}} \cdot d\right| \]
      9. sub0-negN/A

        \[\leadsto \left|\sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}} \cdot d\right| \]
      10. associate-/l/N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}} \cdot d\right| \]
      11. sqrt-undivN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}} \cdot d\right| \]
      12. div-invN/A

        \[\leadsto \left|\color{blue}{\left(\sqrt{\frac{-1}{h}} \cdot \frac{1}{\sqrt{0 - \ell}}\right)} \cdot d\right| \]
      13. associate-*l*N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
      14. *-lowering-*.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)\right| \]
      16. /-lowering-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{-1}{h}}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)\right| \]
      17. *-lowering-*.f64N/A

        \[\leadsto \left|\sqrt{\frac{-1}{h}} \cdot \color{blue}{\left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
    9. Applied egg-rr86.0%

      \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{\left|\ell\right|}} \cdot d\right)}\right| \]

    if -8.5000000000000001e197 < d < -5.00000000000023e-311

    1. Initial program 63.4%

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      2. un-div-invN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}\right) \]
      5. div-invN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr67.8%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. metadata-evalN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\ell\right)}}}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. sqrt-divN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      7. neg-sub0N/A

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{\color{blue}{0 - d}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{0 - d}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      10. neg-sub0N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{0 - d}}{\sqrt{\color{blue}{0 - \ell}}}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      11. --lowering--.f6475.3

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{0 - d}}{\sqrt{\color{blue}{0 - \ell}}}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr75.3%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{0 - d}}{\sqrt{0 - \ell}}}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]

    if -5.00000000000023e-311 < d < 2.00000000000000013e-68

    1. Initial program 46.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr29.4%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr46.4%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval46.8

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr46.8%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr80.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

    if 2.00000000000000013e-68 < d

    1. Initial program 82.9%

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      2. un-div-invN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}\right) \]
      5. div-invN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr87.7%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. metadata-evalN/A

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

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

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. pow1/2N/A

        \[\leadsto \left(\frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      5. metadata-evalN/A

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

        \[\leadsto \left(\color{blue}{\frac{{d}^{\left(\frac{1}{2}\right)}}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      7. metadata-evalN/A

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

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

        \[\leadsto \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      10. sqrt-lowering-sqrt.f6493.1

        \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr93.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -8.5 \cdot 10^{+197}:\\ \;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\left(1 + \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{0 - d}}{\sqrt{0 - \ell}}\right)\\ \mathbf{elif}\;d \leq 2 \cdot 10^{-68}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 + \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 77.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(M \cdot D\right) \cdot 0.5\\ t_1 := h \cdot \frac{t\_0}{d}\\ \mathbf{if}\;d \leq -3.8 \cdot 10^{+188}:\\ \;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\ \mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, t\_1, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{0 - d}}}\\ \mathbf{elif}\;d \leq 1.05 \cdot 10^{-69}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_1, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 + \frac{\frac{t\_0}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* (* M D) 0.5)) (t_1 (* h (/ t_0 d))))
   (if (<= d -3.8e+188)
     (fabs (* (sqrt (/ -1.0 h)) (* d (/ 1.0 (sqrt (fabs l))))))
     (if (<= d -2.9e-303)
       (/
        (* (sqrt (/ d h)) (fma (/ (* (* M D) -0.5) (* l (* d 2.0))) t_1 1.0))
        (/ (sqrt (- 0.0 l)) (sqrt (- 0.0 d))))
       (if (<= d 1.05e-69)
         (* (fma (/ (* (* M D) -0.25) (* d l)) t_1 1.0) (/ d (sqrt (* h l))))
         (*
          (* (pow (/ d l) (/ 1.0 2.0)) (/ (sqrt d) (sqrt h)))
          (+
           1.0
           (*
            (/ (/ t_0 (* d 2.0)) l)
            (/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (M * D) * 0.5;
	double t_1 = h * (t_0 / d);
	double tmp;
	if (d <= -3.8e+188) {
		tmp = fabs((sqrt((-1.0 / h)) * (d * (1.0 / sqrt(fabs(l))))));
	} else if (d <= -2.9e-303) {
		tmp = (sqrt((d / h)) * fma((((M * D) * -0.5) / (l * (d * 2.0))), t_1, 1.0)) / (sqrt((0.0 - l)) / sqrt((0.0 - d)));
	} else if (d <= 1.05e-69) {
		tmp = fma((((M * D) * -0.25) / (d * l)), t_1, 1.0) * (d / sqrt((h * l)));
	} else {
		tmp = (pow((d / l), (1.0 / 2.0)) * (sqrt(d) / sqrt(h))) * (1.0 + (((t_0 / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(Float64(M * D) * 0.5)
	t_1 = Float64(h * Float64(t_0 / d))
	tmp = 0.0
	if (d <= -3.8e+188)
		tmp = abs(Float64(sqrt(Float64(-1.0 / h)) * Float64(d * Float64(1.0 / sqrt(abs(l))))));
	elseif (d <= -2.9e-303)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * fma(Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0))), t_1, 1.0)) / Float64(sqrt(Float64(0.0 - l)) / sqrt(Float64(0.0 - d))));
	elseif (d <= 1.05e-69)
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), t_1, 1.0) * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * Float64(sqrt(d) / sqrt(h))) * Float64(1.0 + Float64(Float64(Float64(t_0 / Float64(d * 2.0)) / l) * Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(-1.0 / h)))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(h * N[(t$95$0 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.8e+188], N[Abs[N[(N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision] * N[(d * N[(1.0 / N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -2.9e-303], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(0.0 - l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.05e-69], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(t$95$0 / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(M \cdot D\right) \cdot 0.5\\
t_1 := h \cdot \frac{t\_0}{d}\\
\mathbf{if}\;d \leq -3.8 \cdot 10^{+188}:\\
\;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\

\mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, t\_1, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{0 - d}}}\\

\mathbf{elif}\;d \leq 1.05 \cdot 10^{-69}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_1, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 + \frac{\frac{t\_0}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -3.7999999999999998e188

    1. Initial program 61.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f645.1

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified5.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6475.0

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr75.0%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \left|\color{blue}{\frac{1}{\frac{\sqrt{h \cdot \ell}}{d}}}\right| \]
      2. associate-/r/N/A

        \[\leadsto \left|\color{blue}{\frac{1}{\sqrt{h \cdot \ell}} \cdot d}\right| \]
      3. metadata-evalN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}} \cdot d\right| \]
      4. *-commutativeN/A

        \[\leadsto \left|\frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot d\right| \]
      5. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\ell \cdot h}}} \cdot d\right| \]
      6. frac-2negN/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}} \cdot d\right| \]
      7. metadata-evalN/A

        \[\leadsto \left|\sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}} \cdot d\right| \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \left|\sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}} \cdot d\right| \]
      9. sub0-negN/A

        \[\leadsto \left|\sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}} \cdot d\right| \]
      10. associate-/l/N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}} \cdot d\right| \]
      11. sqrt-undivN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}} \cdot d\right| \]
      12. div-invN/A

        \[\leadsto \left|\color{blue}{\left(\sqrt{\frac{-1}{h}} \cdot \frac{1}{\sqrt{0 - \ell}}\right)} \cdot d\right| \]
      13. associate-*l*N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
      14. *-lowering-*.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)\right| \]
      16. /-lowering-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{-1}{h}}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)\right| \]
      17. *-lowering-*.f64N/A

        \[\leadsto \left|\sqrt{\frac{-1}{h}} \cdot \color{blue}{\left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
    9. Applied egg-rr83.0%

      \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{\left|\ell\right|}} \cdot d\right)}\right| \]

    if -3.7999999999999998e188 < d < -2.90000000000000014e-303

    1. Initial program 63.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr54.5%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr65.8%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(d\right)}}}} \]
      2. sqrt-divN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\color{blue}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{\mathsf{neg}\left(d\right)}}}} \]
      3. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{\color{blue}{0 - d}}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\color{blue}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{0 - d}}}} \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}{\sqrt{0 - d}}} \]
      6. neg-sub0N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\color{blue}{0 - \ell}}}{\sqrt{0 - d}}} \]
      7. --lowering--.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\color{blue}{0 - \ell}}}{\sqrt{0 - d}}} \]
      8. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{\mathsf{neg}\left(d\right)}}}} \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}} \]
      10. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{0 - d}}}} \]
      11. --lowering--.f6475.6

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{0 - d}}}} \]
    6. Applied egg-rr75.6%

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

    if -2.90000000000000014e-303 < d < 1.05e-69

    1. Initial program 45.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr28.6%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr45.3%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval45.7

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr45.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr78.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

    if 1.05e-69 < d

    1. Initial program 82.9%

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      2. un-div-invN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\color{blue}{\left(\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}\right) \]
      5. div-invN/A

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

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{1}{2} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}\right) \]
    4. Applied egg-rr87.7%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}}\right) \]
    5. Step-by-step derivation
      1. metadata-evalN/A

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

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

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      4. pow1/2N/A

        \[\leadsto \left(\frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      5. metadata-evalN/A

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

        \[\leadsto \left(\color{blue}{\frac{{d}^{\left(\frac{1}{2}\right)}}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      7. metadata-evalN/A

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

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

        \[\leadsto \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
      10. sqrt-lowering-sqrt.f6493.1

        \[\leadsto \left(\frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}\right) \]
    6. Applied egg-rr93.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3.8 \cdot 10^{+188}:\\ \;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\ \mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{0 - d}}}\\ \mathbf{elif}\;d \leq 1.05 \cdot 10^{-69}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \left(1 + \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 77.0% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{0 - \ell}\\ t_1 := h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}\\ t_2 := \sqrt{0 - d}\\ t_3 := \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, t\_1, 1\right)\\ \mathbf{if}\;h \leq -9.8 \cdot 10^{+67}:\\ \;\;\;\;\frac{t\_2 \cdot \left(\frac{t\_2}{t\_0} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)}{\sqrt{0 - h}}\\ \mathbf{elif}\;h \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot t\_3}{\frac{t\_0}{t\_2}}\\ \mathbf{elif}\;h \leq 5 \cdot 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_1, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_3 \cdot \frac{\sqrt{d}}{\sqrt{h}}}{\sqrt{\frac{\ell}{d}}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (- 0.0 l)))
        (t_1 (* h (/ (* (* M D) 0.5) d)))
        (t_2 (sqrt (- 0.0 d)))
        (t_3 (fma (/ (* (* M D) -0.5) (* l (* d 2.0))) t_1 1.0)))
   (if (<= h -9.8e+67)
     (/
      (*
       t_2
       (*
        (/ t_2 t_0)
        (fma (/ (* M (* D (* M D))) (* (* d d) 4.0)) (* (/ h l) -0.5) 1.0)))
      (sqrt (- 0.0 h)))
     (if (<= h -2e-311)
       (/ (* (sqrt (/ d h)) t_3) (/ t_0 t_2))
       (if (<= h 5e+21)
         (* (fma (/ (* (* M D) -0.25) (* d l)) t_1 1.0) (/ d (sqrt (* h l))))
         (/ (* t_3 (/ (sqrt d) (sqrt h))) (sqrt (/ l d))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = sqrt((0.0 - l));
	double t_1 = h * (((M * D) * 0.5) / d);
	double t_2 = sqrt((0.0 - d));
	double t_3 = fma((((M * D) * -0.5) / (l * (d * 2.0))), t_1, 1.0);
	double tmp;
	if (h <= -9.8e+67) {
		tmp = (t_2 * ((t_2 / t_0) * fma(((M * (D * (M * D))) / ((d * d) * 4.0)), ((h / l) * -0.5), 1.0))) / sqrt((0.0 - h));
	} else if (h <= -2e-311) {
		tmp = (sqrt((d / h)) * t_3) / (t_0 / t_2);
	} else if (h <= 5e+21) {
		tmp = fma((((M * D) * -0.25) / (d * l)), t_1, 1.0) * (d / sqrt((h * l)));
	} else {
		tmp = (t_3 * (sqrt(d) / sqrt(h))) / sqrt((l / d));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = sqrt(Float64(0.0 - l))
	t_1 = Float64(h * Float64(Float64(Float64(M * D) * 0.5) / d))
	t_2 = sqrt(Float64(0.0 - d))
	t_3 = fma(Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0))), t_1, 1.0)
	tmp = 0.0
	if (h <= -9.8e+67)
		tmp = Float64(Float64(t_2 * Float64(Float64(t_2 / t_0) * fma(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(Float64(d * d) * 4.0)), Float64(Float64(h / l) * -0.5), 1.0))) / sqrt(Float64(0.0 - h)));
	elseif (h <= -2e-311)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * t_3) / Float64(t_0 / t_2));
	elseif (h <= 5e+21)
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), t_1, 1.0) * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(Float64(t_3 * Float64(sqrt(d) / sqrt(h))) / sqrt(Float64(l / d)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(0.0 - l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(h * N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(0.0 - d), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision]}, If[LessEqual[h, -9.8e+67], N[(N[(t$95$2 * N[(N[(t$95$2 / t$95$0), $MachinePrecision] * N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -2e-311], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision] / N[(t$95$0 / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 5e+21], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{0 - \ell}\\
t_1 := h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}\\
t_2 := \sqrt{0 - d}\\
t_3 := \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, t\_1, 1\right)\\
\mathbf{if}\;h \leq -9.8 \cdot 10^{+67}:\\
\;\;\;\;\frac{t\_2 \cdot \left(\frac{t\_2}{t\_0} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)}{\sqrt{0 - h}}\\

\mathbf{elif}\;h \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot t\_3}{\frac{t\_0}{t\_2}}\\

\mathbf{elif}\;h \leq 5 \cdot 10^{+21}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_1, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_3 \cdot \frac{\sqrt{d}}{\sqrt{h}}}{\sqrt{\frac{\ell}{d}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if h < -9.7999999999999998e67

    1. Initial program 55.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr59.8%

      \[\leadsto \color{blue}{\frac{\left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}}} \]
    4. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\left(\sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\ell\right)}}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{-1}{2} \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      2. sqrt-divN/A

        \[\leadsto \frac{\left(\color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{-1}{2} \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      3. sub0-negN/A

        \[\leadsto \frac{\left(\frac{\sqrt{\color{blue}{0 - d}}}{\sqrt{\mathsf{neg}\left(\ell\right)}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{-1}{2} \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{\left(\color{blue}{\frac{\sqrt{0 - d}}{\sqrt{\mathsf{neg}\left(\ell\right)}}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{-1}{2} \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      5. sub0-negN/A

        \[\leadsto \frac{\left(\frac{\sqrt{\color{blue}{\mathsf{neg}\left(d\right)}}}{\sqrt{\mathsf{neg}\left(\ell\right)}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{-1}{2} \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\left(\frac{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}{\sqrt{\mathsf{neg}\left(\ell\right)}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{-1}{2} \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      7. sub0-negN/A

        \[\leadsto \frac{\left(\frac{\sqrt{\color{blue}{0 - d}}}{\sqrt{\mathsf{neg}\left(\ell\right)}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{-1}{2} \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      8. --lowering--.f64N/A

        \[\leadsto \frac{\left(\frac{\sqrt{\color{blue}{0 - d}}}{\sqrt{\mathsf{neg}\left(\ell\right)}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{-1}{2} \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\left(\frac{\sqrt{0 - d}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{-1}{2} \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      10. neg-sub0N/A

        \[\leadsto \frac{\left(\frac{\sqrt{0 - d}}{\sqrt{\color{blue}{0 - \ell}}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{-1}{2} \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      11. --lowering--.f6472.3

        \[\leadsto \frac{\left(\frac{\sqrt{0 - d}}{\sqrt{\color{blue}{0 - \ell}}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
    5. Applied egg-rr72.3%

      \[\leadsto \frac{\left(\color{blue}{\frac{\sqrt{0 - d}}{\sqrt{0 - \ell}}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right) \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]

    if -9.7999999999999998e67 < h < -1.9999999999999e-311

    1. Initial program 66.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr51.2%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr66.3%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(d\right)}}}} \]
      2. sqrt-divN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\color{blue}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{\mathsf{neg}\left(d\right)}}}} \]
      3. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{\color{blue}{0 - d}}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\color{blue}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{0 - d}}}} \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}{\sqrt{0 - d}}} \]
      6. neg-sub0N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\color{blue}{0 - \ell}}}{\sqrt{0 - d}}} \]
      7. --lowering--.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\color{blue}{0 - \ell}}}{\sqrt{0 - d}}} \]
      8. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{\mathsf{neg}\left(d\right)}}}} \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}} \]
      10. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{0 - d}}}} \]
      11. --lowering--.f6478.9

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{0 - d}}}} \]
    6. Applied egg-rr78.9%

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

    if -1.9999999999999e-311 < h < 5e21

    1. Initial program 74.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr58.6%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr74.4%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval74.4

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr74.4%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr91.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

    if 5e21 < h

    1. Initial program 67.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr49.4%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr70.8%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. sqrt-divN/A

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

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      4. sqrt-lowering-sqrt.f6481.6

        \[\leadsto \frac{\frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr81.6%

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification81.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -9.8 \cdot 10^{+67}:\\ \;\;\;\;\frac{\sqrt{0 - d} \cdot \left(\frac{\sqrt{0 - d}}{\sqrt{0 - \ell}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)}{\sqrt{0 - h}}\\ \mathbf{elif}\;h \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{0 - d}}}\\ \mathbf{elif}\;h \leq 5 \cdot 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}}{\sqrt{\frac{\ell}{d}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 76.9% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}\\ t_1 := \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, t\_0, 1\right)\\ \mathbf{if}\;d \leq -3 \cdot 10^{+189}:\\ \;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\ \mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot t\_1}{\frac{\sqrt{0 - \ell}}{\sqrt{0 - d}}}\\ \mathbf{elif}\;d \leq 1.66 \cdot 10^{-65}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_0, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_1 \cdot \frac{\sqrt{d}}{\sqrt{h}}}{\sqrt{\frac{\ell}{d}}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* h (/ (* (* M D) 0.5) d)))
        (t_1 (fma (/ (* (* M D) -0.5) (* l (* d 2.0))) t_0 1.0)))
   (if (<= d -3e+189)
     (fabs (* (sqrt (/ -1.0 h)) (* d (/ 1.0 (sqrt (fabs l))))))
     (if (<= d -2.9e-303)
       (/ (* (sqrt (/ d h)) t_1) (/ (sqrt (- 0.0 l)) (sqrt (- 0.0 d))))
       (if (<= d 1.66e-65)
         (* (fma (/ (* (* M D) -0.25) (* d l)) t_0 1.0) (/ d (sqrt (* h l))))
         (/ (* t_1 (/ (sqrt d) (sqrt h))) (sqrt (/ l d))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = h * (((M * D) * 0.5) / d);
	double t_1 = fma((((M * D) * -0.5) / (l * (d * 2.0))), t_0, 1.0);
	double tmp;
	if (d <= -3e+189) {
		tmp = fabs((sqrt((-1.0 / h)) * (d * (1.0 / sqrt(fabs(l))))));
	} else if (d <= -2.9e-303) {
		tmp = (sqrt((d / h)) * t_1) / (sqrt((0.0 - l)) / sqrt((0.0 - d)));
	} else if (d <= 1.66e-65) {
		tmp = fma((((M * D) * -0.25) / (d * l)), t_0, 1.0) * (d / sqrt((h * l)));
	} else {
		tmp = (t_1 * (sqrt(d) / sqrt(h))) / sqrt((l / d));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(h * Float64(Float64(Float64(M * D) * 0.5) / d))
	t_1 = fma(Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0))), t_0, 1.0)
	tmp = 0.0
	if (d <= -3e+189)
		tmp = abs(Float64(sqrt(Float64(-1.0 / h)) * Float64(d * Float64(1.0 / sqrt(abs(l))))));
	elseif (d <= -2.9e-303)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * t_1) / Float64(sqrt(Float64(0.0 - l)) / sqrt(Float64(0.0 - d))));
	elseif (d <= 1.66e-65)
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), t_0, 1.0) * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(Float64(t_1 * Float64(sqrt(d) / sqrt(h))) / sqrt(Float64(l / d)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(h * N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]}, If[LessEqual[d, -3e+189], N[Abs[N[(N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision] * N[(d * N[(1.0 / N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -2.9e-303], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] / N[(N[Sqrt[N[(0.0 - l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.66e-65], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}\\
t_1 := \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, t\_0, 1\right)\\
\mathbf{if}\;d \leq -3 \cdot 10^{+189}:\\
\;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\

\mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot t\_1}{\frac{\sqrt{0 - \ell}}{\sqrt{0 - d}}}\\

\mathbf{elif}\;d \leq 1.66 \cdot 10^{-65}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_0, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_1 \cdot \frac{\sqrt{d}}{\sqrt{h}}}{\sqrt{\frac{\ell}{d}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.9999999999999998e189

    1. Initial program 61.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f645.1

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified5.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6475.0

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr75.0%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \left|\color{blue}{\frac{1}{\frac{\sqrt{h \cdot \ell}}{d}}}\right| \]
      2. associate-/r/N/A

        \[\leadsto \left|\color{blue}{\frac{1}{\sqrt{h \cdot \ell}} \cdot d}\right| \]
      3. metadata-evalN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}} \cdot d\right| \]
      4. *-commutativeN/A

        \[\leadsto \left|\frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot d\right| \]
      5. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\ell \cdot h}}} \cdot d\right| \]
      6. frac-2negN/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}} \cdot d\right| \]
      7. metadata-evalN/A

        \[\leadsto \left|\sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}} \cdot d\right| \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \left|\sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}} \cdot d\right| \]
      9. sub0-negN/A

        \[\leadsto \left|\sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}} \cdot d\right| \]
      10. associate-/l/N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}} \cdot d\right| \]
      11. sqrt-undivN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}} \cdot d\right| \]
      12. div-invN/A

        \[\leadsto \left|\color{blue}{\left(\sqrt{\frac{-1}{h}} \cdot \frac{1}{\sqrt{0 - \ell}}\right)} \cdot d\right| \]
      13. associate-*l*N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
      14. *-lowering-*.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)\right| \]
      16. /-lowering-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{-1}{h}}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)\right| \]
      17. *-lowering-*.f64N/A

        \[\leadsto \left|\sqrt{\frac{-1}{h}} \cdot \color{blue}{\left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
    9. Applied egg-rr83.0%

      \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{\left|\ell\right|}} \cdot d\right)}\right| \]

    if -2.9999999999999998e189 < d < -2.90000000000000014e-303

    1. Initial program 63.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr54.5%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr65.8%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(\ell\right)}{\mathsf{neg}\left(d\right)}}}} \]
      2. sqrt-divN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\color{blue}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{\mathsf{neg}\left(d\right)}}}} \]
      3. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{\color{blue}{0 - d}}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\color{blue}{\frac{\sqrt{\mathsf{neg}\left(\ell\right)}}{\sqrt{0 - d}}}} \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}{\sqrt{0 - d}}} \]
      6. neg-sub0N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\color{blue}{0 - \ell}}}{\sqrt{0 - d}}} \]
      7. --lowering--.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{\color{blue}{0 - \ell}}}{\sqrt{0 - d}}} \]
      8. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{\mathsf{neg}\left(d\right)}}}} \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}} \]
      10. sub0-negN/A

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{0 - d}}}} \]
      11. --lowering--.f6475.6

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{\color{blue}{0 - d}}}} \]
    6. Applied egg-rr75.6%

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

    if -2.90000000000000014e-303 < d < 1.6599999999999999e-65

    1. Initial program 45.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr28.6%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr45.3%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval45.7

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr45.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr78.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

    if 1.6599999999999999e-65 < d

    1. Initial program 82.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr66.5%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr85.3%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. sqrt-divN/A

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

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      4. sqrt-lowering-sqrt.f6490.6

        \[\leadsto \frac{\frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr90.6%

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification81.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3 \cdot 10^{+189}:\\ \;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\ \mathbf{elif}\;d \leq -2.9 \cdot 10^{-303}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right)}{\frac{\sqrt{0 - \ell}}{\sqrt{0 - d}}}\\ \mathbf{elif}\;d \leq 1.66 \cdot 10^{-65}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}}{\sqrt{\frac{\ell}{d}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.8% accurate, 3.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}\\ \mathbf{if}\;\ell \leq -9.5 \cdot 10^{+150}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq 3 \cdot 10^{-306}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}, t\_0, 1\right)}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{elif}\;\ell \leq 9.5 \cdot 10^{+179}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_0, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* h (/ (* (* M D) 0.5) d))))
   (if (<= l -9.5e+150)
     (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
     (if (<= l 3e-306)
       (/
        (* (sqrt (/ d h)) (fma (/ (* (* M D) (/ -0.25 d)) l) t_0 1.0))
        (sqrt (/ l d)))
       (if (<= l 9.5e+179)
         (* (fma (/ (* (* M D) -0.25) (* d l)) t_0 1.0) (/ d (sqrt (* h l))))
         (/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = h * (((M * D) * 0.5) / d);
	double tmp;
	if (l <= -9.5e+150) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (l <= 3e-306) {
		tmp = (sqrt((d / h)) * fma((((M * D) * (-0.25 / d)) / l), t_0, 1.0)) / sqrt((l / d));
	} else if (l <= 9.5e+179) {
		tmp = fma((((M * D) * -0.25) / (d * l)), t_0, 1.0) * (d / sqrt((h * l)));
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(h * Float64(Float64(Float64(M * D) * 0.5) / d))
	tmp = 0.0
	if (l <= -9.5e+150)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (l <= 3e-306)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * fma(Float64(Float64(Float64(M * D) * Float64(-0.25 / d)) / l), t_0, 1.0)) / sqrt(Float64(l / d)));
	elseif (l <= 9.5e+179)
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), t_0, 1.0) * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(h * N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -9.5e+150], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 3e-306], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(-0.25 / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.5e+179], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}\\
\mathbf{if}\;\ell \leq -9.5 \cdot 10^{+150}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;\ell \leq 3 \cdot 10^{-306}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}, t\_0, 1\right)}{\sqrt{\frac{\ell}{d}}}\\

\mathbf{elif}\;\ell \leq 9.5 \cdot 10^{+179}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, t\_0, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -9.5000000000000001e150

    1. Initial program 37.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f645.5

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified5.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6463.3

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr63.3%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr69.2%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -9.5000000000000001e150 < l < 3.00000000000000024e-306

    1. Initial program 70.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr54.6%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr71.3%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval75.3

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr75.3%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]

    if 3.00000000000000024e-306 < l < 9.5e179

    1. Initial program 76.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr66.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr79.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval79.8

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr79.8%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr90.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

    if 9.5e179 < l

    1. Initial program 57.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6454.9

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified54.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6454.8

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr54.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. sqrt-lowering-sqrt.f6481.4

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr81.4%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -9.5 \cdot 10^{+150}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq 3 \cdot 10^{-306}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{elif}\;\ell \leq 9.5 \cdot 10^{+179}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 74.4% accurate, 3.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\left(M \cdot D\right) \cdot 0.5}{d}\\ \mathbf{if}\;\ell \leq -5.6 \cdot 10^{+149}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(t\_0, h \cdot \left(-0.25 \cdot \frac{M \cdot D}{d \cdot \ell}\right), 1\right)}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{elif}\;\ell \leq 6.8 \cdot 10^{+180}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot t\_0, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (/ (* (* M D) 0.5) d)))
   (if (<= l -5.6e+149)
     (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
     (if (<= l -5e-310)
       (/
        (* (sqrt (/ d h)) (fma t_0 (* h (* -0.25 (/ (* M D) (* d l)))) 1.0))
        (sqrt (/ l d)))
       (if (<= l 6.8e+180)
         (*
          (fma (/ (* (* M D) -0.25) (* d l)) (* h t_0) 1.0)
          (/ d (sqrt (* h l))))
         (/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = ((M * D) * 0.5) / d;
	double tmp;
	if (l <= -5.6e+149) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (l <= -5e-310) {
		tmp = (sqrt((d / h)) * fma(t_0, (h * (-0.25 * ((M * D) / (d * l)))), 1.0)) / sqrt((l / d));
	} else if (l <= 6.8e+180) {
		tmp = fma((((M * D) * -0.25) / (d * l)), (h * t_0), 1.0) * (d / sqrt((h * l)));
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(Float64(Float64(M * D) * 0.5) / d)
	tmp = 0.0
	if (l <= -5.6e+149)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (l <= -5e-310)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * fma(t_0, Float64(h * Float64(-0.25 * Float64(Float64(M * D) / Float64(d * l)))), 1.0)) / sqrt(Float64(l / d)));
	elseif (l <= 6.8e+180)
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), Float64(h * t_0), 1.0) * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / d), $MachinePrecision]}, If[LessEqual[l, -5.6e+149], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[(h * N[(-0.25 * N[(N[(M * D), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.8e+180], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h * t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\left(M \cdot D\right) \cdot 0.5}{d}\\
\mathbf{if}\;\ell \leq -5.6 \cdot 10^{+149}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(t\_0, h \cdot \left(-0.25 \cdot \frac{M \cdot D}{d \cdot \ell}\right), 1\right)}{\sqrt{\frac{\ell}{d}}}\\

\mathbf{elif}\;\ell \leq 6.8 \cdot 10^{+180}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot t\_0, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -5.5999999999999998e149

    1. Initial program 37.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f645.5

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified5.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6463.3

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr63.3%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr69.2%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -5.5999999999999998e149 < l < -4.999999999999985e-310

    1. Initial program 70.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr55.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr71.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d}, \frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\color{blue}{\left(d \cdot \ell\right)} \cdot 2} \cdot h, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      11. times-fracN/A

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d}, \color{blue}{\left(\frac{M \cdot D}{d \cdot \ell} \cdot \frac{\frac{-1}{2}}{2}\right)} \cdot h, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      13. /-lowering-/.f64N/A

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{1}{2}}{d}, \left(\frac{M \cdot D}{\color{blue}{\ell \cdot d}} \cdot \frac{\frac{-1}{2}}{2}\right) \cdot h, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      17. metadata-eval72.8

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot 0.5}{d}, \left(\frac{M \cdot D}{\ell \cdot d} \cdot \color{blue}{-0.25}\right) \cdot h, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr72.8%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot 0.5}{d}, \left(\frac{M \cdot D}{\ell \cdot d} \cdot -0.25\right) \cdot h, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]

    if -4.999999999999985e-310 < l < 6.79999999999999969e180

    1. Initial program 75.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr79.0%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval79.2

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr79.2%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr89.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

    if 6.79999999999999969e180 < l

    1. Initial program 57.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6454.9

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified54.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6454.8

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr54.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. sqrt-lowering-sqrt.f6481.4

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr81.4%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification79.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5.6 \cdot 10^{+149}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot 0.5}{d}, h \cdot \left(-0.25 \cdot \frac{M \cdot D}{d \cdot \ell}\right), 1\right)}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{elif}\;\ell \leq 6.8 \cdot 10^{+180}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 70.4% accurate, 3.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -6.2 \cdot 10^{+142}:\\ \;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\ \mathbf{elif}\;d \leq -6.5 \cdot 10^{-136}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)\right)\\ \mathbf{elif}\;d \leq 9 \cdot 10^{-301}:\\ \;\;\;\;\mathsf{fma}\left(-0.125 \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot M}{d}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -6.2e+142)
   (fabs (* (sqrt (/ -1.0 h)) (* d (/ 1.0 (sqrt (fabs l))))))
   (if (<= d -6.5e-136)
     (*
      (sqrt (/ d h))
      (*
       (sqrt (/ d l))
       (+ 1.0 (/ (* h (* -0.5 (* M (* D (* M D))))) (* l (* (* d d) 4.0))))))
     (if (<= d 9e-301)
       (fma
        (* -0.125 (* (* (sqrt (/ h l)) (* D D)) (/ (* M M) d)))
        (/ 1.0 l)
        (sqrt (/ (* d d) (* h l))))
       (*
        (fma (/ (* (* M D) -0.25) (* d l)) (* h (/ (* (* M D) 0.5) d)) 1.0)
        (/ d (sqrt (* h l))))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -6.2e+142) {
		tmp = fabs((sqrt((-1.0 / h)) * (d * (1.0 / sqrt(fabs(l))))));
	} else if (d <= -6.5e-136) {
		tmp = sqrt((d / h)) * (sqrt((d / l)) * (1.0 + ((h * (-0.5 * (M * (D * (M * D))))) / (l * ((d * d) * 4.0)))));
	} else if (d <= 9e-301) {
		tmp = fma((-0.125 * ((sqrt((h / l)) * (D * D)) * ((M * M) / d))), (1.0 / l), sqrt(((d * d) / (h * l))));
	} else {
		tmp = fma((((M * D) * -0.25) / (d * l)), (h * (((M * D) * 0.5) / d)), 1.0) * (d / sqrt((h * l)));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -6.2e+142)
		tmp = abs(Float64(sqrt(Float64(-1.0 / h)) * Float64(d * Float64(1.0 / sqrt(abs(l))))));
	elseif (d <= -6.5e-136)
		tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * Float64(1.0 + Float64(Float64(h * Float64(-0.5 * Float64(M * Float64(D * Float64(M * D))))) / Float64(l * Float64(Float64(d * d) * 4.0))))));
	elseif (d <= 9e-301)
		tmp = fma(Float64(-0.125 * Float64(Float64(sqrt(Float64(h / l)) * Float64(D * D)) * Float64(Float64(M * M) / d))), Float64(1.0 / l), sqrt(Float64(Float64(d * d) / Float64(h * l))));
	else
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), Float64(h * Float64(Float64(Float64(M * D) * 0.5) / d)), 1.0) * Float64(d / sqrt(Float64(h * l))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -6.2e+142], N[Abs[N[(N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision] * N[(d * N[(1.0 / N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -6.5e-136], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(h * N[(-0.5 * N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9e-301], N[(N[(-0.125 * N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision] + N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -6.2 \cdot 10^{+142}:\\
\;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\

\mathbf{elif}\;d \leq -6.5 \cdot 10^{-136}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)\right)\\

\mathbf{elif}\;d \leq 9 \cdot 10^{-301}:\\
\;\;\;\;\mathsf{fma}\left(-0.125 \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot M}{d}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -6.1999999999999998e142

    1. Initial program 61.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f647.0

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified7.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6466.9

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr66.9%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \left|\color{blue}{\frac{1}{\frac{\sqrt{h \cdot \ell}}{d}}}\right| \]
      2. associate-/r/N/A

        \[\leadsto \left|\color{blue}{\frac{1}{\sqrt{h \cdot \ell}} \cdot d}\right| \]
      3. metadata-evalN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}} \cdot d\right| \]
      4. *-commutativeN/A

        \[\leadsto \left|\frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot d\right| \]
      5. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\ell \cdot h}}} \cdot d\right| \]
      6. frac-2negN/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}} \cdot d\right| \]
      7. metadata-evalN/A

        \[\leadsto \left|\sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}} \cdot d\right| \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \left|\sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}} \cdot d\right| \]
      9. sub0-negN/A

        \[\leadsto \left|\sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}} \cdot d\right| \]
      10. associate-/l/N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}} \cdot d\right| \]
      11. sqrt-undivN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}} \cdot d\right| \]
      12. div-invN/A

        \[\leadsto \left|\color{blue}{\left(\sqrt{\frac{-1}{h}} \cdot \frac{1}{\sqrt{0 - \ell}}\right)} \cdot d\right| \]
      13. associate-*l*N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
      14. *-lowering-*.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)\right| \]
      16. /-lowering-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{-1}{h}}} \cdot \left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)\right| \]
      17. *-lowering-*.f64N/A

        \[\leadsto \left|\sqrt{\frac{-1}{h}} \cdot \color{blue}{\left(\frac{1}{\sqrt{0 - \ell}} \cdot d\right)}\right| \]
    9. Applied egg-rr77.4%

      \[\leadsto \left|\color{blue}{\sqrt{\frac{-1}{h}} \cdot \left(\frac{1}{\sqrt{\left|\ell\right|}} \cdot d\right)}\right| \]

    if -6.1999999999999998e142 < d < -6.50000000000000011e-136

    1. Initial program 81.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr79.8%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr81.2%

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

    if -6.50000000000000011e-136 < d < 9.00000000000000039e-301

    1. Initial program 37.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr5.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \left(h \cdot \frac{-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{\left(d \cdot d\right) \cdot 4}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
    4. Taylor expanded in d around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{8} \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \color{blue}{\frac{{M}^{2}}{d}}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{8} \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{\color{blue}{M \cdot M}}{d}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      13. *-lowering-*.f6452.0

        \[\leadsto \mathsf{fma}\left(-0.125 \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{\color{blue}{M \cdot M}}{d}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    6. Simplified52.0%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-0.125 \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot M}{d}\right)}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]

    if 9.00000000000000039e-301 < d

    1. Initial program 72.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr55.5%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr74.0%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval74.9

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr74.9%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr83.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification76.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -6.2 \cdot 10^{+142}:\\ \;\;\;\;\left|\sqrt{\frac{-1}{h}} \cdot \left(d \cdot \frac{1}{\sqrt{\left|\ell\right|}}\right)\right|\\ \mathbf{elif}\;d \leq -6.5 \cdot 10^{-136}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h \cdot \left(-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)\right)}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)\right)\\ \mathbf{elif}\;d \leq 9 \cdot 10^{-301}:\\ \;\;\;\;\mathsf{fma}\left(-0.125 \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot M}{d}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 69.0% accurate, 3.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(M \cdot D\right) \cdot 0.5\\ \mathbf{if}\;d \leq -1.25 \cdot 10^{+58}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;d \leq -1.02 \cdot 10^{-102}:\\ \;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot -0.5\right)\right) \cdot \left(h \cdot t\_0\right)}{d \cdot \left(2 \cdot \left(d \cdot \ell\right)\right)}\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 5.6 \cdot 10^{-299}:\\ \;\;\;\;\mathsf{fma}\left(-0.125 \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot M}{d}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{t\_0}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* (* M D) 0.5)))
   (if (<= d -1.25e+58)
     (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
     (if (<= d -1.02e-102)
       (*
        (+ 1.0 (/ (* (* M (* D -0.5)) (* h t_0)) (* d (* 2.0 (* d l)))))
        (sqrt (/ (fma d d 0.0) (* h l))))
       (if (<= d 5.6e-299)
         (fma
          (* -0.125 (* (* (sqrt (/ h l)) (* D D)) (/ (* M M) d)))
          (/ 1.0 l)
          (sqrt (/ (* d d) (* h l))))
         (*
          (fma (/ (* (* M D) -0.25) (* d l)) (* h (/ t_0 d)) 1.0)
          (/ d (sqrt (* h l)))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (M * D) * 0.5;
	double tmp;
	if (d <= -1.25e+58) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (d <= -1.02e-102) {
		tmp = (1.0 + (((M * (D * -0.5)) * (h * t_0)) / (d * (2.0 * (d * l))))) * sqrt((fma(d, d, 0.0) / (h * l)));
	} else if (d <= 5.6e-299) {
		tmp = fma((-0.125 * ((sqrt((h / l)) * (D * D)) * ((M * M) / d))), (1.0 / l), sqrt(((d * d) / (h * l))));
	} else {
		tmp = fma((((M * D) * -0.25) / (d * l)), (h * (t_0 / d)), 1.0) * (d / sqrt((h * l)));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(Float64(M * D) * 0.5)
	tmp = 0.0
	if (d <= -1.25e+58)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (d <= -1.02e-102)
		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(M * Float64(D * -0.5)) * Float64(h * t_0)) / Float64(d * Float64(2.0 * Float64(d * l))))) * sqrt(Float64(fma(d, d, 0.0) / Float64(h * l))));
	elseif (d <= 5.6e-299)
		tmp = fma(Float64(-0.125 * Float64(Float64(sqrt(Float64(h / l)) * Float64(D * D)) * Float64(Float64(M * M) / d))), Float64(1.0 / l), sqrt(Float64(Float64(d * d) / Float64(h * l))));
	else
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), Float64(h * Float64(t_0 / d)), 1.0) * Float64(d / sqrt(Float64(h * l))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[d, -1.25e+58], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -1.02e-102], N[(N[(1.0 + N[(N[(N[(M * N[(D * -0.5), $MachinePrecision]), $MachinePrecision] * N[(h * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(d * N[(2.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * d + 0.0), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.6e-299], N[(N[(-0.125 * N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision] + N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h * N[(t$95$0 / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(M \cdot D\right) \cdot 0.5\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{+58}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;d \leq -1.02 \cdot 10^{-102}:\\
\;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot -0.5\right)\right) \cdot \left(h \cdot t\_0\right)}{d \cdot \left(2 \cdot \left(d \cdot \ell\right)\right)}\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{h \cdot \ell}}\\

\mathbf{elif}\;d \leq 5.6 \cdot 10^{-299}:\\
\;\;\;\;\mathsf{fma}\left(-0.125 \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot M}{d}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{t\_0}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -1.24999999999999996e58

    1. Initial program 65.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f645.6

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified5.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6466.9

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr66.9%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr76.9%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -1.24999999999999996e58 < d < -1.01999999999999996e-102

    1. Initial program 85.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr82.5%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr91.1%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. div-invN/A

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

        \[\leadsto \color{blue}{\left(\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)} \cdot \left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) + 1\right) \cdot \sqrt{\frac{d}{h}}\right)} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}} \]
      3. metadata-evalN/A

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

        \[\leadsto \left(\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)} \cdot \left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) + 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\sqrt{\frac{1}{\frac{\ell}{d}}}} \]
      5. clear-numN/A

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

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

        \[\leadsto \color{blue}{\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)} \cdot \left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) + 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
    6. Applied egg-rr73.5%

      \[\leadsto \color{blue}{\left(\frac{\left(M \cdot \left(D \cdot -0.5\right)\right) \cdot \left(h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)\right)}{\left(2 \cdot \left(\ell \cdot d\right)\right) \cdot d} + 1\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{\ell \cdot h}}} \]

    if -1.01999999999999996e-102 < d < 5.6000000000000003e-299

    1. Initial program 42.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr10.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \left(h \cdot \frac{-0.5 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{\left(d \cdot d\right) \cdot 4}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)} \]
    4. Taylor expanded in d around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{8} \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \color{blue}{\frac{{M}^{2}}{d}}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{8} \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{\color{blue}{M \cdot M}}{d}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
      13. *-lowering-*.f6453.0

        \[\leadsto \mathsf{fma}\left(-0.125 \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{\color{blue}{M \cdot M}}{d}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]
    6. Simplified53.0%

      \[\leadsto \mathsf{fma}\left(\color{blue}{-0.125 \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot M}{d}\right)}, \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right) \]

    if 5.6000000000000003e-299 < d

    1. Initial program 72.3%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr55.5%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr74.0%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval74.9

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr74.9%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr83.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification74.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.25 \cdot 10^{+58}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;d \leq -1.02 \cdot 10^{-102}:\\ \;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot -0.5\right)\right) \cdot \left(h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)\right)}{d \cdot \left(2 \cdot \left(d \cdot \ell\right)\right)}\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq 5.6 \cdot 10^{-299}:\\ \;\;\;\;\mathsf{fma}\left(-0.125 \cdot \left(\left(\sqrt{\frac{h}{\ell}} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot M}{d}\right), \frac{1}{\ell}, \sqrt{\frac{d \cdot d}{h \cdot \ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 74.3% accurate, 3.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right)\\ \mathbf{if}\;\ell \leq -6.2 \cdot 10^{+149}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;\ell \leq 3.1 \cdot 10^{+180}:\\ \;\;\;\;t\_0 \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0
         (fma (/ (* (* M D) -0.25) (* d l)) (* h (/ (* (* M D) 0.5) d)) 1.0)))
   (if (<= l -6.2e+149)
     (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
     (if (<= l -5e-310)
       (* (sqrt (/ d h)) (* t_0 (sqrt (/ d l))))
       (if (<= l 3.1e+180)
         (* t_0 (/ d (sqrt (* h l))))
         (/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = fma((((M * D) * -0.25) / (d * l)), (h * (((M * D) * 0.5) / d)), 1.0);
	double tmp;
	if (l <= -6.2e+149) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (l <= -5e-310) {
		tmp = sqrt((d / h)) * (t_0 * sqrt((d / l)));
	} else if (l <= 3.1e+180) {
		tmp = t_0 * (d / sqrt((h * l)));
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), Float64(h * Float64(Float64(Float64(M * D) * 0.5) / d)), 1.0)
	tmp = 0.0
	if (l <= -6.2e+149)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (l <= -5e-310)
		tmp = Float64(sqrt(Float64(d / h)) * Float64(t_0 * sqrt(Float64(d / l))));
	elseif (l <= 3.1e+180)
		tmp = Float64(t_0 * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[l, -6.2e+149], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.1e+180], N[(t$95$0 * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right)\\
\mathbf{if}\;\ell \leq -6.2 \cdot 10^{+149}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t\_0 \cdot \sqrt{\frac{d}{\ell}}\right)\\

\mathbf{elif}\;\ell \leq 3.1 \cdot 10^{+180}:\\
\;\;\;\;t\_0 \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -6.19999999999999974e149

    1. Initial program 37.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f645.5

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified5.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6463.3

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr63.3%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr69.2%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -6.19999999999999974e149 < l < -4.999999999999985e-310

    1. Initial program 70.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr55.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr71.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval75.8

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr75.8%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Step-by-step derivation
      1. associate-/l*N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{\left(M \cdot D\right) \cdot \frac{\frac{-1}{4}}{d}}{\ell} \cdot \left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) + 1}{\sqrt{\frac{\ell}{d}}} \cdot \sqrt{\frac{d}{h}}} \]
    8. Applied egg-rr71.3%

      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]

    if -4.999999999999985e-310 < l < 3.09999999999999998e180

    1. Initial program 75.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr79.0%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval79.2

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr79.2%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr89.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

    if 3.09999999999999998e180 < l

    1. Initial program 57.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6454.9

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified54.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6454.8

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr54.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. sqrt-lowering-sqrt.f6481.4

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr81.4%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification78.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -6.2 \cdot 10^{+149}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;\ell \leq 3.1 \cdot 10^{+180}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 69.1% accurate, 3.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(M \cdot D\right) \cdot 0.5\\ t_1 := \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{if}\;d \leq -1.15 \cdot 10^{+60}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;d \leq -9.5 \cdot 10^{-84}:\\ \;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot -0.5\right)\right) \cdot \left(h \cdot t\_0\right)}{d \cdot \left(2 \cdot \left(d \cdot \ell\right)\right)}\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -5.4 \cdot 10^{-209}:\\ \;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(h \cdot -0.125\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \left|t\_1\right|\\ \mathbf{elif}\;d \leq -6.6 \cdot 10^{-301}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{t\_0}{d}, 1\right) \cdot t\_1\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (* (* M D) 0.5)) (t_1 (/ d (sqrt (* h l)))))
   (if (<= d -1.15e+60)
     (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
     (if (<= d -9.5e-84)
       (*
        (+ 1.0 (/ (* (* M (* D -0.5)) (* h t_0)) (* d (* 2.0 (* d l)))))
        (sqrt (/ (fma d d 0.0) (* h l))))
       (if (<= d -5.4e-209)
         (*
          (fma (* D D) (/ (* (* M M) (* h -0.125)) (* d (* d l))) 1.0)
          (fabs t_1))
         (if (<= d -6.6e-301)
           (* (sqrt (/ h (* l (* l l)))) (* (* D (* D (* M M))) (/ 0.125 d)))
           (*
            (fma (/ (* (* M D) -0.25) (* d l)) (* h (/ t_0 d)) 1.0)
            t_1)))))))
double code(double d, double h, double l, double M, double D) {
	double t_0 = (M * D) * 0.5;
	double t_1 = d / sqrt((h * l));
	double tmp;
	if (d <= -1.15e+60) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (d <= -9.5e-84) {
		tmp = (1.0 + (((M * (D * -0.5)) * (h * t_0)) / (d * (2.0 * (d * l))))) * sqrt((fma(d, d, 0.0) / (h * l)));
	} else if (d <= -5.4e-209) {
		tmp = fma((D * D), (((M * M) * (h * -0.125)) / (d * (d * l))), 1.0) * fabs(t_1);
	} else if (d <= -6.6e-301) {
		tmp = sqrt((h / (l * (l * l)))) * ((D * (D * (M * M))) * (0.125 / d));
	} else {
		tmp = fma((((M * D) * -0.25) / (d * l)), (h * (t_0 / d)), 1.0) * t_1;
	}
	return tmp;
}
function code(d, h, l, M, D)
	t_0 = Float64(Float64(M * D) * 0.5)
	t_1 = Float64(d / sqrt(Float64(h * l)))
	tmp = 0.0
	if (d <= -1.15e+60)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (d <= -9.5e-84)
		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(M * Float64(D * -0.5)) * Float64(h * t_0)) / Float64(d * Float64(2.0 * Float64(d * l))))) * sqrt(Float64(fma(d, d, 0.0) / Float64(h * l))));
	elseif (d <= -5.4e-209)
		tmp = Float64(fma(Float64(D * D), Float64(Float64(Float64(M * M) * Float64(h * -0.125)) / Float64(d * Float64(d * l))), 1.0) * abs(t_1));
	elseif (d <= -6.6e-301)
		tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(0.125 / d)));
	else
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), Float64(h * Float64(t_0 / d)), 1.0) * t_1);
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.15e+60], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[d, -9.5e-84], N[(N[(1.0 + N[(N[(N[(M * N[(D * -0.5), $MachinePrecision]), $MachinePrecision] * N[(h * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(d * N[(2.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * d + 0.0), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5.4e-209], N[(N[(N[(D * D), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] * N[(h * -0.125), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -6.6e-301], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h * N[(t$95$0 / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(M \cdot D\right) \cdot 0.5\\
t_1 := \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{if}\;d \leq -1.15 \cdot 10^{+60}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;d \leq -9.5 \cdot 10^{-84}:\\
\;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot -0.5\right)\right) \cdot \left(h \cdot t\_0\right)}{d \cdot \left(2 \cdot \left(d \cdot \ell\right)\right)}\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{h \cdot \ell}}\\

\mathbf{elif}\;d \leq -5.4 \cdot 10^{-209}:\\
\;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(h \cdot -0.125\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \left|t\_1\right|\\

\mathbf{elif}\;d \leq -6.6 \cdot 10^{-301}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{t\_0}{d}, 1\right) \cdot t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -1.15000000000000008e60

    1. Initial program 65.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f645.6

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified5.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6466.9

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr66.9%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr76.9%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -1.15000000000000008e60 < d < -9.49999999999999941e-84

    1. Initial program 85.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr82.0%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr90.8%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. div-invN/A

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

        \[\leadsto \color{blue}{\left(\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)} \cdot \left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) + 1\right) \cdot \sqrt{\frac{d}{h}}\right)} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}} \]
      3. metadata-evalN/A

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

        \[\leadsto \left(\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)} \cdot \left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) + 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\sqrt{\frac{1}{\frac{\ell}{d}}}} \]
      5. clear-numN/A

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

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

        \[\leadsto \color{blue}{\left(\frac{\left(M \cdot D\right) \cdot \frac{-1}{2}}{\ell \cdot \left(d \cdot 2\right)} \cdot \left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) + 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
    6. Applied egg-rr72.7%

      \[\leadsto \color{blue}{\left(\frac{\left(M \cdot \left(D \cdot -0.5\right)\right) \cdot \left(h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)\right)}{\left(2 \cdot \left(\ell \cdot d\right)\right) \cdot d} + 1\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{\ell \cdot h}}} \]

    if -9.49999999999999941e-84 < d < -5.39999999999999997e-209

    1. Initial program 54.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr48.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Taylor expanded in M around 0

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left({D}^{2}, \frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    6. Simplified36.1%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    7. Step-by-step derivation
      1. div-invN/A

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

        \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right)} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}} \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{\ell}{d}}} \]
      4. sqrt-divN/A

        \[\leadsto \left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\sqrt{\frac{1}{\frac{\ell}{d}}}} \]
      5. clear-numN/A

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

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

        \[\leadsto \color{blue}{\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
    8. Applied egg-rr23.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(-0.125 \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{\ell \cdot h}}} \]
    9. Applied egg-rr57.6%

      \[\leadsto \mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(-0.125 \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \]

    if -5.39999999999999997e-209 < d < -6.6000000000000001e-301

    1. Initial program 40.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in h around -inf

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}}} \cdot \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
      11. metadata-evalN/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{8}\right)\right)} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right) \]
      12. distribute-lft-neg-inN/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right)} \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \color{blue}{\left(\frac{1}{8} \cdot \left(\mathsf{neg}\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)}{d}\right)\right)\right)} \]
      14. distribute-neg-fracN/A

        \[\leadsto \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\frac{1}{8} \cdot \color{blue}{\frac{\mathsf{neg}\left({D}^{2} \cdot \left({M}^{2} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)}{d}}\right) \]
    5. Simplified49.1%

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

    if -6.6000000000000001e-301 < d

    1. Initial program 70.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr53.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr71.7%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval72.6

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr72.6%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr80.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification73.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.15 \cdot 10^{+60}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;d \leq -9.5 \cdot 10^{-84}:\\ \;\;\;\;\left(1 + \frac{\left(M \cdot \left(D \cdot -0.5\right)\right) \cdot \left(h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)\right)}{d \cdot \left(2 \cdot \left(d \cdot \ell\right)\right)}\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -5.4 \cdot 10^{-209}:\\ \;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(h \cdot -0.125\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \mathbf{elif}\;d \leq -6.6 \cdot 10^{-301}:\\ \;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 66.3% accurate, 3.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.55 \cdot 10^{-178}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\ \mathbf{elif}\;\ell \leq 2.5 \cdot 10^{+181}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -1.55e-178)
   (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
   (if (<= l -5e-310)
     (fma d (* (fabs l) (sqrt (/ (/ 1.0 h) (* l (fma l l 0.0))))) 0.0)
     (if (<= l 2.5e+181)
       (*
        (fma (/ (* (* M D) -0.25) (* d l)) (* h (/ (* (* M D) 0.5) d)) 1.0)
        (/ d (sqrt (* h l))))
       (/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.55e-178) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (l <= -5e-310) {
		tmp = fma(d, (fabs(l) * sqrt(((1.0 / h) / (l * fma(l, l, 0.0))))), 0.0);
	} else if (l <= 2.5e+181) {
		tmp = fma((((M * D) * -0.25) / (d * l)), (h * (((M * D) * 0.5) / d)), 1.0) * (d / sqrt((h * l)));
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.55e-178)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (l <= -5e-310)
		tmp = fma(d, Float64(abs(l) * sqrt(Float64(Float64(1.0 / h) / Float64(l * fma(l, l, 0.0))))), 0.0);
	elseif (l <= 2.5e+181)
		tmp = Float64(fma(Float64(Float64(Float64(M * D) * -0.25) / Float64(d * l)), Float64(h * Float64(Float64(Float64(M * D) * 0.5) / d)), 1.0) * Float64(d / sqrt(Float64(h * l))));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.55e-178], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / N[(l * N[(l * l + 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision], If[LessEqual[l, 2.5e+181], N[(N[(N[(N[(N[(M * D), $MachinePrecision] * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.55 \cdot 10^{-178}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\

\mathbf{elif}\;\ell \leq 2.5 \cdot 10^{+181}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1.55e-178

    1. Initial program 60.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f644.4

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified4.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6447.1

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr47.1%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr54.0%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -1.55e-178 < l < -4.999999999999985e-310

    1. Initial program 71.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6427.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified27.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}}, 0\right) \]
      2. frac-2negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\mathsf{neg}\left(\frac{1}{h}\right)}{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\color{blue}{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{h}}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{\color{blue}{-1}}{h}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\color{blue}{\frac{-1}{h}}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\sqrt{\color{blue}{0 - \ell}}}, 0\right) \]
      11. --lowering--.f6415.3

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\sqrt{\color{blue}{0 - \ell}}}, 0\right) \]
    7. Applied egg-rr15.3%

      \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}, 0\right) \]
    8. Step-by-step derivation
      1. sqrt-undivN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{0 - \ell}}}, 0\right) \]
      2. flip3--N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{\color{blue}{\frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}}}, 0\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}} \cdot \left(0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)\right)}}, 0\right) \]
      4. sqrt-prodN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}, 0\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{0} + \left(\ell \cdot \ell + 0 \cdot \ell\right)}, 0\right) \]
      6. +-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\ell \cdot \ell + 0 \cdot \ell}}, 0\right) \]
      7. distribute-rgt-outN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\ell \cdot \left(\ell + 0\right)}}, 0\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\ell \cdot \color{blue}{\left(0 + \ell\right)}}, 0\right) \]
      9. +-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\ell \cdot \color{blue}{\ell}}, 0\right) \]
      10. sqr-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot \left(\mathsf{neg}\left(\ell\right)\right)}}, 0\right) \]
      11. sub0-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\left(0 - \ell\right)} \cdot \left(\mathsf{neg}\left(\ell\right)\right)}, 0\right) \]
      12. sub0-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\left(0 - \ell\right) \cdot \color{blue}{\left(0 - \ell\right)}}, 0\right) \]
      13. sqrt-unprodN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \color{blue}{\left(\sqrt{0 - \ell} \cdot \sqrt{0 - \ell}\right)}, 0\right) \]
      14. rem-square-sqrtN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \color{blue}{\left(0 - \ell\right)}, 0\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \left(0 - \ell\right)}, 0\right) \]
    9. Applied egg-rr74.1%

      \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{0 - \ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}} \cdot \left|\ell\right|}, 0\right) \]

    if -4.999999999999985e-310 < l < 2.5000000000000002e181

    1. Initial program 75.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Applied egg-rr79.0%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    5. Step-by-step derivation
      1. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \color{blue}{\frac{\frac{\frac{-1}{2}}{2}}{d}}}{\ell}, h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
      9. metadata-eval79.2

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \frac{\color{blue}{-0.25}}{d}}{\ell}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    6. Applied egg-rr79.2%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot D\right) \cdot \frac{-0.25}{d}}{\ell}}, h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}, 1\right)}{\sqrt{\frac{\ell}{d}}} \]
    7. Applied egg-rr89.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

    if 2.5000000000000002e181 < l

    1. Initial program 57.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6454.9

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified54.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6454.8

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr54.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. sqrt-lowering-sqrt.f6481.4

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr81.4%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification72.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.55 \cdot 10^{-178}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\ \mathbf{elif}\;\ell \leq 2.5 \cdot 10^{+181}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot -0.25}{d \cdot \ell}, h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 58.1% accurate, 4.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -5.2 \cdot 10^{-175}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\ \mathbf{elif}\;\ell \leq 8.2 \cdot 10^{+179}:\\ \;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot D, \frac{M \cdot \left(M \cdot \left(h \cdot -0.125\right)\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -5.2e-175)
   (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
   (if (<= l -5e-310)
     (fma d (* (fabs l) (sqrt (/ (/ 1.0 h) (* l (fma l l 0.0))))) 0.0)
     (if (<= l 8.2e+179)
       (/
        (* d (fma (* D D) (/ (* M (* M (* h -0.125))) (* d (* d l))) 1.0))
        (sqrt (* h l)))
       (/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -5.2e-175) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (l <= -5e-310) {
		tmp = fma(d, (fabs(l) * sqrt(((1.0 / h) / (l * fma(l, l, 0.0))))), 0.0);
	} else if (l <= 8.2e+179) {
		tmp = (d * fma((D * D), ((M * (M * (h * -0.125))) / (d * (d * l))), 1.0)) / sqrt((h * l));
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -5.2e-175)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (l <= -5e-310)
		tmp = fma(d, Float64(abs(l) * sqrt(Float64(Float64(1.0 / h) / Float64(l * fma(l, l, 0.0))))), 0.0);
	elseif (l <= 8.2e+179)
		tmp = Float64(Float64(d * fma(Float64(D * D), Float64(Float64(M * Float64(M * Float64(h * -0.125))) / Float64(d * Float64(d * l))), 1.0)) / sqrt(Float64(h * l)));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.2e-175], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / N[(l * N[(l * l + 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision], If[LessEqual[l, 8.2e+179], N[(N[(d * N[(N[(D * D), $MachinePrecision] * N[(N[(M * N[(M * N[(h * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.2 \cdot 10^{-175}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\

\mathbf{elif}\;\ell \leq 8.2 \cdot 10^{+179}:\\
\;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot D, \frac{M \cdot \left(M \cdot \left(h \cdot -0.125\right)\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -5.2e-175

    1. Initial program 60.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f644.4

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified4.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6447.1

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr47.1%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr54.0%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -5.2e-175 < l < -4.999999999999985e-310

    1. Initial program 71.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6427.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified27.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}}, 0\right) \]
      2. frac-2negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\mathsf{neg}\left(\frac{1}{h}\right)}{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\color{blue}{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{h}}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{\color{blue}{-1}}{h}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\color{blue}{\frac{-1}{h}}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\sqrt{\color{blue}{0 - \ell}}}, 0\right) \]
      11. --lowering--.f6415.3

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\sqrt{\color{blue}{0 - \ell}}}, 0\right) \]
    7. Applied egg-rr15.3%

      \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}, 0\right) \]
    8. Step-by-step derivation
      1. sqrt-undivN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{0 - \ell}}}, 0\right) \]
      2. flip3--N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{\color{blue}{\frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}}}, 0\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}} \cdot \left(0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)\right)}}, 0\right) \]
      4. sqrt-prodN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}, 0\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{0} + \left(\ell \cdot \ell + 0 \cdot \ell\right)}, 0\right) \]
      6. +-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\ell \cdot \ell + 0 \cdot \ell}}, 0\right) \]
      7. distribute-rgt-outN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\ell \cdot \left(\ell + 0\right)}}, 0\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\ell \cdot \color{blue}{\left(0 + \ell\right)}}, 0\right) \]
      9. +-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\ell \cdot \color{blue}{\ell}}, 0\right) \]
      10. sqr-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot \left(\mathsf{neg}\left(\ell\right)\right)}}, 0\right) \]
      11. sub0-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\left(0 - \ell\right)} \cdot \left(\mathsf{neg}\left(\ell\right)\right)}, 0\right) \]
      12. sub0-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\left(0 - \ell\right) \cdot \color{blue}{\left(0 - \ell\right)}}, 0\right) \]
      13. sqrt-unprodN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \color{blue}{\left(\sqrt{0 - \ell} \cdot \sqrt{0 - \ell}\right)}, 0\right) \]
      14. rem-square-sqrtN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \color{blue}{\left(0 - \ell\right)}, 0\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \left(0 - \ell\right)}, 0\right) \]
    9. Applied egg-rr74.1%

      \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{0 - \ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}} \cdot \left|\ell\right|}, 0\right) \]

    if -4.999999999999985e-310 < l < 8.20000000000000021e179

    1. Initial program 75.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Taylor expanded in M around 0

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left({D}^{2}, \frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    6. Simplified52.2%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    7. Step-by-step derivation
      1. div-invN/A

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

        \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right)} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}} \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{\ell}{d}}} \]
      4. sqrt-divN/A

        \[\leadsto \left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\sqrt{\frac{1}{\frac{\ell}{d}}}} \]
      5. clear-numN/A

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

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

        \[\leadsto \color{blue}{\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
    8. Applied egg-rr41.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(-0.125 \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{\ell \cdot h}}} \]
    9. Applied egg-rr63.9%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(D \cdot D, \frac{M \cdot \left(M \cdot \left(h \cdot -0.125\right)\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right) \cdot d}{\sqrt{\ell \cdot h}}} \]

    if 8.20000000000000021e179 < l

    1. Initial program 57.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6454.9

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified54.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6454.8

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr54.8%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. sqrt-lowering-sqrt.f6481.4

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr81.4%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification62.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5.2 \cdot 10^{-175}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\ \mathbf{elif}\;\ell \leq 8.2 \cdot 10^{+179}:\\ \;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot D, \frac{M \cdot \left(M \cdot \left(h \cdot -0.125\right)\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 56.7% accurate, 4.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -4.05 \cdot 10^{-178}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\ \mathbf{elif}\;\ell \leq 2.45 \cdot 10^{+163}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}} \cdot \mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(h \cdot -0.125\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -4.05e-178)
   (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
   (if (<= l -5e-310)
     (fma d (* (fabs l) (sqrt (/ (/ 1.0 h) (* l (fma l l 0.0))))) 0.0)
     (if (<= l 2.45e+163)
       (*
        (/ d (sqrt (* h l)))
        (fma (* D D) (/ (* (* M M) (* h -0.125)) (* d (* d l))) 1.0))
       (/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -4.05e-178) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (l <= -5e-310) {
		tmp = fma(d, (fabs(l) * sqrt(((1.0 / h) / (l * fma(l, l, 0.0))))), 0.0);
	} else if (l <= 2.45e+163) {
		tmp = (d / sqrt((h * l))) * fma((D * D), (((M * M) * (h * -0.125)) / (d * (d * l))), 1.0);
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -4.05e-178)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (l <= -5e-310)
		tmp = fma(d, Float64(abs(l) * sqrt(Float64(Float64(1.0 / h) / Float64(l * fma(l, l, 0.0))))), 0.0);
	elseif (l <= 2.45e+163)
		tmp = Float64(Float64(d / sqrt(Float64(h * l))) * fma(Float64(D * D), Float64(Float64(Float64(M * M) * Float64(h * -0.125)) / Float64(d * Float64(d * l))), 1.0));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.05e-178], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / N[(l * N[(l * l + 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision], If[LessEqual[l, 2.45e+163], N[(N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] * N[(h * -0.125), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.05 \cdot 10^{-178}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\

\mathbf{elif}\;\ell \leq 2.45 \cdot 10^{+163}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}} \cdot \mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(h \cdot -0.125\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -4.0499999999999999e-178

    1. Initial program 60.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f644.4

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified4.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6447.1

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr47.1%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr54.0%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -4.0499999999999999e-178 < l < -4.999999999999985e-310

    1. Initial program 71.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6427.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified27.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}}, 0\right) \]
      2. frac-2negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\mathsf{neg}\left(\frac{1}{h}\right)}{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\color{blue}{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{h}}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{\color{blue}{-1}}{h}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\color{blue}{\frac{-1}{h}}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\sqrt{\color{blue}{0 - \ell}}}, 0\right) \]
      11. --lowering--.f6415.3

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\sqrt{\color{blue}{0 - \ell}}}, 0\right) \]
    7. Applied egg-rr15.3%

      \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}, 0\right) \]
    8. Step-by-step derivation
      1. sqrt-undivN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{0 - \ell}}}, 0\right) \]
      2. flip3--N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{\color{blue}{\frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}}}, 0\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}} \cdot \left(0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)\right)}}, 0\right) \]
      4. sqrt-prodN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}, 0\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{0} + \left(\ell \cdot \ell + 0 \cdot \ell\right)}, 0\right) \]
      6. +-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\ell \cdot \ell + 0 \cdot \ell}}, 0\right) \]
      7. distribute-rgt-outN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\ell \cdot \left(\ell + 0\right)}}, 0\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\ell \cdot \color{blue}{\left(0 + \ell\right)}}, 0\right) \]
      9. +-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\ell \cdot \color{blue}{\ell}}, 0\right) \]
      10. sqr-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot \left(\mathsf{neg}\left(\ell\right)\right)}}, 0\right) \]
      11. sub0-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\left(0 - \ell\right)} \cdot \left(\mathsf{neg}\left(\ell\right)\right)}, 0\right) \]
      12. sub0-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\left(0 - \ell\right) \cdot \color{blue}{\left(0 - \ell\right)}}, 0\right) \]
      13. sqrt-unprodN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \color{blue}{\left(\sqrt{0 - \ell} \cdot \sqrt{0 - \ell}\right)}, 0\right) \]
      14. rem-square-sqrtN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \color{blue}{\left(0 - \ell\right)}, 0\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \left(0 - \ell\right)}, 0\right) \]
    9. Applied egg-rr74.1%

      \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{0 - \ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}} \cdot \left|\ell\right|}, 0\right) \]

    if -4.999999999999985e-310 < l < 2.45e163

    1. Initial program 77.9%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr67.9%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Taylor expanded in M around 0

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left({D}^{2}, \frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    6. Simplified55.1%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    7. Step-by-step derivation
      1. div-invN/A

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

        \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right)} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}} \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{\ell}{d}}} \]
      4. sqrt-divN/A

        \[\leadsto \left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\sqrt{\frac{1}{\frac{\ell}{d}}}} \]
      5. clear-numN/A

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

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

        \[\leadsto \color{blue}{\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
    8. Applied egg-rr44.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(-0.125 \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{\ell \cdot h}}} \]
    9. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(\frac{-1}{8} \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \color{blue}{\frac{\sqrt{d \cdot d + 0}}{\sqrt{\ell \cdot h}}} \]
      2. +-rgt-identityN/A

        \[\leadsto \mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(\frac{-1}{8} \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \frac{\sqrt{\color{blue}{d \cdot d}}}{\sqrt{\ell \cdot h}} \]
      3. sqrt-prodN/A

        \[\leadsto \mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(\frac{-1}{8} \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{\ell \cdot h}} \]
      4. rem-square-sqrtN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(\frac{-1}{8} \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \]
      9. *-lowering-*.f6460.7

        \[\leadsto \mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(-0.125 \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
    10. Applied egg-rr60.7%

      \[\leadsto \mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(-0.125 \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]

    if 2.45e163 < l

    1. Initial program 55.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6453.0

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified53.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6452.9

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr52.9%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. sqrt-lowering-sqrt.f6475.8

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr75.8%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification61.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4.05 \cdot 10^{-178}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\ \mathbf{elif}\;\ell \leq 2.45 \cdot 10^{+163}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}} \cdot \mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(h \cdot -0.125\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 50.0% accurate, 4.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 6.6 \cdot 10^{-90}:\\ \;\;\;\;\left|d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right|\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(h \cdot -0.125\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= M 6.6e-90)
   (fabs (* d (sqrt (/ 1.0 (* h l)))))
   (*
    (fma (* D D) (/ (* (* M M) (* h -0.125)) (* d (* d l))) 1.0)
    (fabs (/ d (sqrt (* h l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (M <= 6.6e-90) {
		tmp = fabs((d * sqrt((1.0 / (h * l)))));
	} else {
		tmp = fma((D * D), (((M * M) * (h * -0.125)) / (d * (d * l))), 1.0) * fabs((d / sqrt((h * l))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (M <= 6.6e-90)
		tmp = abs(Float64(d * sqrt(Float64(1.0 / Float64(h * l)))));
	else
		tmp = Float64(fma(Float64(D * D), Float64(Float64(Float64(M * M) * Float64(h * -0.125)) / Float64(d * Float64(d * l))), 1.0) * abs(Float64(d / sqrt(Float64(h * l)))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[M, 6.6e-90], N[Abs[N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(D * D), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] * N[(h * -0.125), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;M \leq 6.6 \cdot 10^{-90}:\\
\;\;\;\;\left|d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right|\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(h \cdot -0.125\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\


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

    1. Initial program 68.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6428.9

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified28.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6448.8

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr48.8%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \left|\color{blue}{\frac{1}{\frac{\sqrt{h \cdot \ell}}{d}}}\right| \]
      2. associate-/r/N/A

        \[\leadsto \left|\color{blue}{\frac{1}{\sqrt{h \cdot \ell}} \cdot d}\right| \]
      3. metadata-evalN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}} \cdot d\right| \]
      4. *-commutativeN/A

        \[\leadsto \left|\frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}} \cdot d\right| \]
      5. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\ell \cdot h}}} \cdot d\right| \]
      6. frac-2negN/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}} \cdot d\right| \]
      7. metadata-evalN/A

        \[\leadsto \left|\sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}} \cdot d\right| \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \left|\sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}} \cdot d\right| \]
      9. sub0-negN/A

        \[\leadsto \left|\sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}} \cdot d\right| \]
      10. associate-/l/N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}} \cdot d\right| \]
      11. sqrt-undivN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}} \cdot d\right| \]
      12. *-lowering-*.f64N/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}} \cdot d}\right| \]
      13. sqrt-undivN/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{\frac{-1}{h}}{0 - \ell}}} \cdot d\right| \]
      14. associate-/l/N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{-1}{\left(0 - \ell\right) \cdot h}}} \cdot d\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\sqrt{\frac{\color{blue}{\mathsf{neg}\left(1\right)}}{\left(0 - \ell\right) \cdot h}} \cdot d\right| \]
      16. sub0-negN/A

        \[\leadsto \left|\sqrt{\frac{\mathsf{neg}\left(1\right)}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)} \cdot h}} \cdot d\right| \]
      17. distribute-lft-neg-inN/A

        \[\leadsto \left|\sqrt{\frac{\mathsf{neg}\left(1\right)}{\color{blue}{\mathsf{neg}\left(\ell \cdot h\right)}}} \cdot d\right| \]
      18. frac-2negN/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{1}{\ell \cdot h}}} \cdot d\right| \]
      19. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\ell \cdot h}}} \cdot d\right| \]
      20. /-lowering-/.f64N/A

        \[\leadsto \left|\sqrt{\color{blue}{\frac{1}{\ell \cdot h}}} \cdot d\right| \]
      21. *-lowering-*.f6448.8

        \[\leadsto \left|\sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d\right| \]
    9. Applied egg-rr48.8%

      \[\leadsto \left|\color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d}\right| \]

    if 6.6e-90 < M

    1. Initial program 63.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr49.3%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Taylor expanded in M around 0

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left({D}^{2}, \frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    6. Simplified42.4%

      \[\leadsto \frac{\sqrt{\frac{d}{h}} \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)}, 1\right)}}{\sqrt{\frac{\ell}{d}}} \]
    7. Step-by-step derivation
      1. div-invN/A

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

        \[\leadsto \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right)} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}} \]
      3. metadata-evalN/A

        \[\leadsto \left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{\ell}{d}}} \]
      4. sqrt-divN/A

        \[\leadsto \left(\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\sqrt{\frac{1}{\frac{\ell}{d}}}} \]
      5. clear-numN/A

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

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

        \[\leadsto \color{blue}{\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{d \cdot \left(d \cdot \ell\right)} + 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)} \]
    8. Applied egg-rr33.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(-0.125 \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{\ell \cdot h}}} \]
    9. Applied egg-rr54.8%

      \[\leadsto \mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(-0.125 \cdot h\right)}{d \cdot \left(\ell \cdot d\right)}, 1\right) \cdot \color{blue}{\left|\frac{d}{\sqrt{\ell \cdot h}}\right|} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification50.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 6.6 \cdot 10^{-90}:\\ \;\;\;\;\left|d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right|\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot M\right) \cdot \left(h \cdot -0.125\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 53.4% accurate, 4.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -5.1 \cdot 10^{-175}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\ \mathbf{elif}\;\ell \leq 6 \cdot 10^{-187}:\\ \;\;\;\;\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right) \cdot \frac{-0.125}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -5.1e-175)
   (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
   (if (<= l -5e-310)
     (fma d (* (fabs l) (sqrt (/ (/ 1.0 h) (* l (fma l l 0.0))))) 0.0)
     (if (<= l 6e-187)
       (* (* (* D D) (* (* M M) (sqrt (/ h (* l (* l l)))))) (/ -0.125 d))
       (/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -5.1e-175) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (l <= -5e-310) {
		tmp = fma(d, (fabs(l) * sqrt(((1.0 / h) / (l * fma(l, l, 0.0))))), 0.0);
	} else if (l <= 6e-187) {
		tmp = ((D * D) * ((M * M) * sqrt((h / (l * (l * l)))))) * (-0.125 / d);
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -5.1e-175)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (l <= -5e-310)
		tmp = fma(d, Float64(abs(l) * sqrt(Float64(Float64(1.0 / h) / Float64(l * fma(l, l, 0.0))))), 0.0);
	elseif (l <= 6e-187)
		tmp = Float64(Float64(Float64(D * D) * Float64(Float64(M * M) * sqrt(Float64(h / Float64(l * Float64(l * l)))))) * Float64(-0.125 / d));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.1e-175], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / N[(l * N[(l * l + 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision], If[LessEqual[l, 6e-187], N[(N[(N[(D * D), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] * N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.1 \cdot 10^{-175}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\

\mathbf{elif}\;\ell \leq 6 \cdot 10^{-187}:\\
\;\;\;\;\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right) \cdot \frac{-0.125}{d}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -5.10000000000000054e-175

    1. Initial program 60.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f644.4

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified4.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6447.1

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr47.1%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr54.0%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -5.10000000000000054e-175 < l < -4.999999999999985e-310

    1. Initial program 71.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6427.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified27.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}}, 0\right) \]
      2. frac-2negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\mathsf{neg}\left(\frac{1}{h}\right)}{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\color{blue}{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{h}}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{\color{blue}{-1}}{h}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\color{blue}{\frac{-1}{h}}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\sqrt{\color{blue}{0 - \ell}}}, 0\right) \]
      11. --lowering--.f6415.3

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\sqrt{\color{blue}{0 - \ell}}}, 0\right) \]
    7. Applied egg-rr15.3%

      \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}, 0\right) \]
    8. Step-by-step derivation
      1. sqrt-undivN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{0 - \ell}}}, 0\right) \]
      2. flip3--N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{\color{blue}{\frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}}}, 0\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}} \cdot \left(0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)\right)}}, 0\right) \]
      4. sqrt-prodN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}, 0\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{0} + \left(\ell \cdot \ell + 0 \cdot \ell\right)}, 0\right) \]
      6. +-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\ell \cdot \ell + 0 \cdot \ell}}, 0\right) \]
      7. distribute-rgt-outN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\ell \cdot \left(\ell + 0\right)}}, 0\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\ell \cdot \color{blue}{\left(0 + \ell\right)}}, 0\right) \]
      9. +-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\ell \cdot \color{blue}{\ell}}, 0\right) \]
      10. sqr-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot \left(\mathsf{neg}\left(\ell\right)\right)}}, 0\right) \]
      11. sub0-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\left(0 - \ell\right)} \cdot \left(\mathsf{neg}\left(\ell\right)\right)}, 0\right) \]
      12. sub0-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\left(0 - \ell\right) \cdot \color{blue}{\left(0 - \ell\right)}}, 0\right) \]
      13. sqrt-unprodN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \color{blue}{\left(\sqrt{0 - \ell} \cdot \sqrt{0 - \ell}\right)}, 0\right) \]
      14. rem-square-sqrtN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \color{blue}{\left(0 - \ell\right)}, 0\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \left(0 - \ell\right)}, 0\right) \]
    9. Applied egg-rr74.1%

      \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{0 - \ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}} \cdot \left|\ell\right|}, 0\right) \]

    if -4.999999999999985e-310 < l < 6.00000000000000008e-187

    1. Initial program 75.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied egg-rr56.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\frac{\ell}{d}}}} \]
    4. Taylor expanded in d around 0

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) \cdot \frac{\frac{-1}{8}}{d}} \]
    6. Simplified48.7%

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

    if 6.00000000000000008e-187 < l

    1. Initial program 70.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6452.9

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified52.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6452.9

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr52.9%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. sqrt-lowering-sqrt.f6464.3

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr64.3%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification59.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5.1 \cdot 10^{-175}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\ \mathbf{elif}\;\ell \leq 6 \cdot 10^{-187}:\\ \;\;\;\;\left(\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right) \cdot \frac{-0.125}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 52.0% accurate, 6.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.12 \cdot 10^{-175}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -1.12e-175)
   (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
   (if (<= l -5e-310)
     (fma d (* (fabs l) (sqrt (/ (/ 1.0 h) (* l (fma l l 0.0))))) 0.0)
     (/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -1.12e-175) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (l <= -5e-310) {
		tmp = fma(d, (fabs(l) * sqrt(((1.0 / h) / (l * fma(l, l, 0.0))))), 0.0);
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -1.12e-175)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (l <= -5e-310)
		tmp = fma(d, Float64(abs(l) * sqrt(Float64(Float64(1.0 / h) / Float64(l * fma(l, l, 0.0))))), 0.0);
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.12e-175], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[(N[Abs[l], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / h), $MachinePrecision] / N[(l * N[(l * l + 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.12 \cdot 10^{-175}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -1.1200000000000001e-175

    1. Initial program 60.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f644.4

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified4.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6447.1

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr47.1%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr54.0%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -1.1200000000000001e-175 < l < -4.999999999999985e-310

    1. Initial program 71.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6427.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified27.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}}, 0\right) \]
      2. frac-2negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\mathsf{neg}\left(\frac{1}{h}\right)}{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\color{blue}{\sqrt{\mathsf{neg}\left(\frac{1}{h}\right)}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      6. distribute-neg-fracN/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{h}}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{\color{blue}{-1}}{h}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\color{blue}{\frac{-1}{h}}}}{\sqrt{\mathsf{neg}\left(\ell\right)}}, 0\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}, 0\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\sqrt{\color{blue}{0 - \ell}}}, 0\right) \]
      11. --lowering--.f6415.3

        \[\leadsto \mathsf{fma}\left(d, \frac{\sqrt{\frac{-1}{h}}}{\sqrt{\color{blue}{0 - \ell}}}, 0\right) \]
    7. Applied egg-rr15.3%

      \[\leadsto \mathsf{fma}\left(d, \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}, 0\right) \]
    8. Step-by-step derivation
      1. sqrt-undivN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{0 - \ell}}}, 0\right) \]
      2. flip3--N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{\color{blue}{\frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}}}, 0\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}} \cdot \left(0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)\right)}}, 0\right) \]
      4. sqrt-prodN/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}, 0\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{0} + \left(\ell \cdot \ell + 0 \cdot \ell\right)}, 0\right) \]
      6. +-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\ell \cdot \ell + 0 \cdot \ell}}, 0\right) \]
      7. distribute-rgt-outN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\ell \cdot \left(\ell + 0\right)}}, 0\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\ell \cdot \color{blue}{\left(0 + \ell\right)}}, 0\right) \]
      9. +-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\ell \cdot \color{blue}{\ell}}, 0\right) \]
      10. sqr-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot \left(\mathsf{neg}\left(\ell\right)\right)}}, 0\right) \]
      11. sub0-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\color{blue}{\left(0 - \ell\right)} \cdot \left(\mathsf{neg}\left(\ell\right)\right)}, 0\right) \]
      12. sub0-negN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \sqrt{\left(0 - \ell\right) \cdot \color{blue}{\left(0 - \ell\right)}}, 0\right) \]
      13. sqrt-unprodN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \color{blue}{\left(\sqrt{0 - \ell} \cdot \sqrt{0 - \ell}\right)}, 0\right) \]
      14. rem-square-sqrtN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \color{blue}{\left(0 - \ell\right)}, 0\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{{0}^{3} - {\ell}^{3}}} \cdot \left(0 - \ell\right)}, 0\right) \]
    9. Applied egg-rr74.1%

      \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{\frac{-1}{h}}{0 - \ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}} \cdot \left|\ell\right|}, 0\right) \]

    if -4.999999999999985e-310 < l

    1. Initial program 71.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6448.0

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified48.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6447.9

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr47.9%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. sqrt-lowering-sqrt.f6456.9

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr56.9%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.12 \cdot 10^{-175}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(d, \left|\ell\right| \cdot \sqrt{\frac{\frac{1}{h}}{\ell \cdot \mathsf{fma}\left(\ell, \ell, 0\right)}}, 0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 49.9% accurate, 6.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -4.6 \cdot 10^{-179}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq 2.8 \cdot 10^{-308}:\\ \;\;\;\;\mathsf{fma}\left(d, \sqrt{\frac{1}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}, 0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -4.6e-179)
   (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
   (if (<= l 2.8e-308)
     (fma d (sqrt (/ 1.0 (sqrt (* (* h l) (* h l))))) 0.0)
     (/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -4.6e-179) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (l <= 2.8e-308) {
		tmp = fma(d, sqrt((1.0 / sqrt(((h * l) * (h * l))))), 0.0);
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -4.6e-179)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (l <= 2.8e-308)
		tmp = fma(d, sqrt(Float64(1.0 / sqrt(Float64(Float64(h * l) * Float64(h * l))))), 0.0);
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -4.6e-179], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.8e-308], N[(d * N[Sqrt[N[(1.0 / N[Sqrt[N[(N[(h * l), $MachinePrecision] * N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.0), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.6 \cdot 10^{-179}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;\ell \leq 2.8 \cdot 10^{-308}:\\
\;\;\;\;\mathsf{fma}\left(d, \sqrt{\frac{1}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}, 0\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -4.59999999999999975e-179

    1. Initial program 60.6%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f644.4

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified4.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6447.1

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr47.1%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr54.0%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -4.59999999999999975e-179 < l < 2.79999999999999984e-308

    1. Initial program 72.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6426.7

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified26.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{\sqrt{h \cdot \ell} \cdot \sqrt{h \cdot \ell}}}}, 0\right) \]
      2. sqrt-unprodN/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}}, 0\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}}, 0\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\sqrt{\color{blue}{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}}, 0\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\sqrt{\color{blue}{\left(h \cdot \ell\right)} \cdot \left(h \cdot \ell\right)}}}, 0\right) \]
      6. *-lowering-*.f6446.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\sqrt{\left(h \cdot \ell\right) \cdot \color{blue}{\left(h \cdot \ell\right)}}}}, 0\right) \]
    7. Applied egg-rr46.8%

      \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}}, 0\right) \]

    if 2.79999999999999984e-308 < l

    1. Initial program 71.0%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6448.4

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified48.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6448.3

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr48.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. sqrt-lowering-sqrt.f6457.3

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr57.3%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4.6 \cdot 10^{-179}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq 2.8 \cdot 10^{-308}:\\ \;\;\;\;\mathsf{fma}\left(d, \sqrt{\frac{1}{\sqrt{\left(h \cdot \ell\right) \cdot \left(h \cdot \ell\right)}}}, 0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 50.0% accurate, 8.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -5.2 \cdot 10^{-274}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l -5.2e-274)
   (fabs (/ d (* (sqrt (fabs l)) (sqrt (- 0.0 h)))))
   (if (<= l -5e-310) (/ d (sqrt (* h l))) (/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -5.2e-274) {
		tmp = fabs((d / (sqrt(fabs(l)) * sqrt((0.0 - h)))));
	} else if (l <= -5e-310) {
		tmp = d / sqrt((h * l));
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= (-5.2d-274)) then
        tmp = abs((d / (sqrt(abs(l)) * sqrt((0.0d0 - h)))))
    else if (l <= (-5d-310)) then
        tmp = d / sqrt((h * l))
    else
        tmp = d / (sqrt(h) * sqrt(l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= -5.2e-274) {
		tmp = Math.abs((d / (Math.sqrt(Math.abs(l)) * Math.sqrt((0.0 - h)))));
	} else if (l <= -5e-310) {
		tmp = d / Math.sqrt((h * l));
	} else {
		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= -5.2e-274:
		tmp = math.fabs((d / (math.sqrt(math.fabs(l)) * math.sqrt((0.0 - h)))))
	elif l <= -5e-310:
		tmp = d / math.sqrt((h * l))
	else:
		tmp = d / (math.sqrt(h) * math.sqrt(l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= -5.2e-274)
		tmp = abs(Float64(d / Float64(sqrt(abs(l)) * sqrt(Float64(0.0 - h)))));
	elseif (l <= -5e-310)
		tmp = Float64(d / sqrt(Float64(h * l)));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= -5.2e-274)
		tmp = abs((d / (sqrt(abs(l)) * sqrt((0.0 - h)))));
	elseif (l <= -5e-310)
		tmp = d / sqrt((h * l));
	else
		tmp = d / (sqrt(h) * sqrt(l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.2e-274], N[Abs[N[(d / N[(N[Sqrt[N[Abs[l], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, -5e-310], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.2 \cdot 10^{-274}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\

\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -5.2e-274

    1. Initial program 61.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f645.6

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified5.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6441.8

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr41.8%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left|\color{blue}{d \cdot \frac{1}{\sqrt{h \cdot \ell}}}\right| \]
      2. metadata-evalN/A

        \[\leadsto \left|d \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{h \cdot \ell}}\right| \]
      3. *-commutativeN/A

        \[\leadsto \left|d \cdot \frac{\sqrt{1}}{\sqrt{\color{blue}{\ell \cdot h}}}\right| \]
      4. sqrt-divN/A

        \[\leadsto \left|d \cdot \color{blue}{\sqrt{\frac{1}{\ell \cdot h}}}\right| \]
      5. frac-2negN/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\ell \cdot h\right)}}}\right| \]
      6. metadata-evalN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{\color{blue}{-1}}{\mathsf{neg}\left(\ell \cdot h\right)}}\right| \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right) \cdot h}}}\right| \]
      8. sub0-negN/A

        \[\leadsto \left|d \cdot \sqrt{\frac{-1}{\color{blue}{\left(0 - \ell\right)} \cdot h}}\right| \]
      9. associate-/l/N/A

        \[\leadsto \left|d \cdot \sqrt{\color{blue}{\frac{\frac{-1}{h}}{0 - \ell}}}\right| \]
      10. sqrt-undivN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{\sqrt{\frac{-1}{h}}}{\sqrt{0 - \ell}}}\right| \]
      11. clear-numN/A

        \[\leadsto \left|d \cdot \color{blue}{\frac{1}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      12. un-div-invN/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      13. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\frac{\sqrt{0 - \ell}}{\sqrt{\frac{-1}{h}}}}}\right| \]
      14. div-invN/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \frac{1}{\sqrt{\frac{-1}{h}}}}}\right| \]
      15. metadata-evalN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{-1}{h}}}}\right| \]
      16. sqrt-divN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \color{blue}{\sqrt{\frac{1}{\frac{-1}{h}}}}}\right| \]
      17. clear-numN/A

        \[\leadsto \left|\frac{d}{\sqrt{0 - \ell} \cdot \sqrt{\color{blue}{\frac{h}{-1}}}}\right| \]
      18. *-lowering-*.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{0 - \ell} \cdot \sqrt{\frac{h}{-1}}}}\right| \]
    9. Applied egg-rr50.1%

      \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{h \cdot -1}}}\right| \]

    if -5.2e-274 < l < -4.999999999999985e-310

    1. Initial program 83.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6468.2

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified68.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6468.2

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr68.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]

    if -4.999999999999985e-310 < l

    1. Initial program 71.2%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6448.0

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified48.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6447.9

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr47.9%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. sqrt-lowering-sqrt.f6456.9

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr56.9%

      \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5.2 \cdot 10^{-274}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\left|\ell\right|} \cdot \sqrt{0 - h}}\right|\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 45.3% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 7 \cdot 10^{-201}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= l 7e-201)
   (* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
   (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 7e-201) {
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: tmp
    if (l <= 7d-201) then
        tmp = (0.0d0 - d) * sqrt((1.0d0 / (h * l)))
    else
        tmp = d / (sqrt(h) * sqrt(l))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (l <= 7e-201) {
		tmp = (0.0 - d) * Math.sqrt((1.0 / (h * l)));
	} else {
		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
	}
	return tmp;
}
def code(d, h, l, M, D):
	tmp = 0
	if l <= 7e-201:
		tmp = (0.0 - d) * math.sqrt((1.0 / (h * l)))
	else:
		tmp = d / (math.sqrt(h) * math.sqrt(l))
	return tmp
function code(d, h, l, M, D)
	tmp = 0.0
	if (l <= 7e-201)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l))));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
function tmp_2 = code(d, h, l, M, D)
	tmp = 0.0;
	if (l <= 7e-201)
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	else
		tmp = d / (sqrt(h) * sqrt(l));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 7e-201], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 7 \cdot 10^{-201}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 7.00000000000000016e-201

    1. Initial program 64.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6411.7

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified11.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Taylor expanded in h around -inf

      \[\leadsto \color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    7. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \color{blue}{d \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      2. *-commutativeN/A

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

        \[\leadsto \color{blue}{d \cdot \left(\sqrt{\frac{1}{h \cdot \ell}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      4. *-commutativeN/A

        \[\leadsto d \cdot \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      5. unpow2N/A

        \[\leadsto d \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      6. rem-square-sqrtN/A

        \[\leadsto d \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{1}{h \cdot \ell}}\right) \]
      7. neg-mul-1N/A

        \[\leadsto d \cdot \color{blue}{\left(\mathsf{neg}\left(\sqrt{\frac{1}{h \cdot \ell}}\right)\right)} \]
      8. neg-sub0N/A

        \[\leadsto d \cdot \color{blue}{\left(0 - \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      9. --lowering--.f64N/A

        \[\leadsto d \cdot \color{blue}{\left(0 - \sqrt{\frac{1}{h \cdot \ell}}\right)} \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto d \cdot \left(0 - \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto d \cdot \left(0 - \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}\right) \]
      12. *-lowering-*.f6439.2

        \[\leadsto d \cdot \left(0 - \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}\right) \]
    8. Simplified39.2%

      \[\leadsto \color{blue}{d \cdot \left(0 - \sqrt{\frac{1}{h \cdot \ell}}\right)} \]

    if 7.00000000000000016e-201 < l

    1. Initial program 70.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6452.4

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified52.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6452.3

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr52.3%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{d}{\sqrt{\color{blue}{\ell \cdot h}}} \]
      2. sqrt-prodN/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell} \cdot \sqrt{h}}} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell}} \cdot \sqrt{h}} \]
      5. sqrt-lowering-sqrt.f6463.4

        \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
    9. Applied egg-rr63.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 7 \cdot 10^{-201}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 42.6% accurate, 10.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.9 \cdot 10^{-230}:\\
\;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\

\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -2.90000000000000005e-230

    1. Initial program 61.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f645.0

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified5.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6444.1

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr44.1%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]

    if -2.90000000000000005e-230 < l

    1. Initial program 71.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6447.2

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified47.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
      5. /-lowering-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
      6. *-lowering-*.f6447.2

        \[\leadsto \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}} \cdot d \]
    7. Applied egg-rr47.2%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification45.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.9 \cdot 10^{-230}:\\ \;\;\;\;\left|\frac{d}{\sqrt{h \cdot \ell}}\right|\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 42.7% accurate, 11.8× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{if}\;\ell \leq -9.5 \cdot 10^{-232}:\\
\;\;\;\;\left|t\_0\right|\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -9.50000000000000033e-232

    1. Initial program 61.5%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f645.0

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified5.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. rem-square-sqrtN/A

        \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \sqrt{d}\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      3. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
      4. sqrt-prodN/A

        \[\leadsto \color{blue}{\sqrt{\left(d \cdot d\right) \cdot \frac{1}{h \cdot \ell}}} \]
      5. div-invN/A

        \[\leadsto \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \]
      6. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}}} \]
      7. rem-sqrt-squareN/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      8. fabs-lowering-fabs.f64N/A

        \[\leadsto \color{blue}{\left|\sqrt{\frac{d \cdot d}{h \cdot \ell}}\right|} \]
      9. sqrt-divN/A

        \[\leadsto \left|\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \ell}}}\right| \]
      10. sqrt-prodN/A

        \[\leadsto \left|\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h \cdot \ell}}\right| \]
      11. rem-square-sqrtN/A

        \[\leadsto \left|\frac{\color{blue}{d}}{\sqrt{h \cdot \ell}}\right| \]
      12. /-lowering-/.f64N/A

        \[\leadsto \left|\color{blue}{\frac{d}{\sqrt{h \cdot \ell}}}\right| \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \left|\frac{d}{\color{blue}{\sqrt{h \cdot \ell}}}\right| \]
      14. *-lowering-*.f6444.1

        \[\leadsto \left|\frac{d}{\sqrt{\color{blue}{h \cdot \ell}}}\right| \]
    7. Applied egg-rr44.1%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{h \cdot \ell}}\right|} \]

    if -9.50000000000000033e-232 < l

    1. Initial program 71.1%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in d around inf

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
      5. *-lowering-*.f6447.2

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified47.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      2. sqrt-divN/A

        \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
      3. metadata-evalN/A

        \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
      4. un-div-invN/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
      7. *-lowering-*.f6447.2

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr47.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 24: 25.3% accurate, 15.3× speedup?

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

\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Derivation
  1. Initial program 66.7%

    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in d around inf

    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
  4. Step-by-step derivation
    1. +-rgt-identityN/A

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}} + 0} \]
    2. accelerator-lowering-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
    3. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{fma}\left(d, \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}}, 0\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{fma}\left(d, \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}}, 0\right) \]
    5. *-lowering-*.f6427.8

      \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
  5. Simplified27.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \ell}}, 0\right)} \]
  6. Step-by-step derivation
    1. +-rgt-identityN/A

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
    2. sqrt-divN/A

      \[\leadsto d \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{h \cdot \ell}}} \]
    3. metadata-evalN/A

      \[\leadsto d \cdot \frac{\color{blue}{1}}{\sqrt{h \cdot \ell}} \]
    4. un-div-invN/A

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    5. /-lowering-/.f64N/A

      \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
    6. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \frac{d}{\color{blue}{\sqrt{h \cdot \ell}}} \]
    7. *-lowering-*.f6427.7

      \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
  7. Applied egg-rr27.7%

    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  8. Add Preprocessing

Reproduce

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