Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.5% → 83.7%
Time: 21.7s
Alternatives: 18
Speedup: 3.7×

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 18 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.5% 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: 83.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := 1 - \frac{h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\\
\mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 10^{+230}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.0000000000000001e230

    1. Initial program 88.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)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{\frac{1}{2}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{1}{\frac{\ell}{d}}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\ell}{d}}}}\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. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{\ell}{d}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell}{d}}}}\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. /-lowering-/.f6488.2

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\ell}{d}}}}\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-rr88.2%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e230 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 15.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. 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 - \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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{1}{\frac{\ell}{d}}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\ell}{d}}}}\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. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{\ell}{d}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell}{d}}}}\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. /-lowering-/.f6417.4

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\ell}{d}}}}\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-rr17.4%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - \frac{\left(h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
    9. Step-by-step derivation
      1. un-div-invN/A

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \cdot \left(1 - \frac{\left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
      9. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \cdot \left(1 - \frac{\left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
      10. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \cdot \left(1 - \frac{\left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
      13. +-rgt-identityN/A

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 10^{+230}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \cdot \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 72.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-44}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{d \cdot \ell}, \frac{M \cdot D}{d} \cdot \left(0 - 0.25\right), 1\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 10^{+230}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.99999999999999991e-44

    1. Initial program 85.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. 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 - \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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{1}{\frac{\ell}{d}}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\ell}{d}}}}\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. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{\ell}{d}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell}{d}}}}\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. /-lowering-/.f6485.2

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\ell}{d}}}}\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-rr85.2%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999991e-44 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 or 1.0000000000000001e230 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 21.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-*.f6433.9

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified33.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-*.f6433.9

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6430.1

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

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

        \[\leadsto \frac{d}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      6. *-lft-identityN/A

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d\right)}} \]
      9. +-rgt-identityN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \]
      10. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \]
      11. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \]
      14. +-rgt-identityN/A

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

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

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

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|} \]

    if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.0000000000000001e230

    1. Initial program 98.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-*.f6436.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified36.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-*.f6437.0

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6436.8

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{d}{\mathsf{neg}\left(\left(0 - \sqrt{h \cdot \ell}\right)\right)}} \]
      2. rem-square-sqrtN/A

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      5. remove-double-negN/A

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      14. /-lowering-/.f6498.1

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
    11. Applied egg-rr98.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -2 \cdot 10^{-44}:\\ \;\;\;\;\mathsf{fma}\left(\frac{h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{d \cdot \ell}, \frac{M \cdot D}{d} \cdot \left(0 - 0.25\right), 1\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 10^{+230}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 67.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+189}:\\
\;\;\;\;\frac{t\_1 \cdot \left(t\_2 \cdot \left(\left(M \cdot M\right) \cdot \left(-0.125 \cdot \left(h \cdot \left(D \cdot D\right)\right)\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\\

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_3 \leq 10^{+230}:\\
\;\;\;\;t\_2 \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2e189

    1. Initial program 84.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-rr34.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{d}}{\sqrt{h}}} \]
    4. Taylor expanded in M around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\sqrt{\frac{d}{\ell}} \cdot \frac{\left(\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h\right) \cdot \left(D \cdot D\right)}{\color{blue}{d \cdot \left(d \cdot \ell\right)}}\right) \cdot \sqrt{d}}{\sqrt{h}} \]
      16. *-lowering-*.f6438.3

        \[\leadsto \frac{\left(\sqrt{\frac{d}{\ell}} \cdot \frac{\left(\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h\right) \cdot \left(D \cdot D\right)}{d \cdot \color{blue}{\left(d \cdot \ell\right)}}\right) \cdot \sqrt{d}}{\sqrt{h}} \]
    6. Simplified38.3%

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

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

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

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

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

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

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

    if -2e189 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 or 1.0000000000000001e230 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 25.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-*.f6432.3

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

      \[\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-*.f6432.3

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6428.7

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

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

        \[\leadsto \frac{d}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      6. *-lft-identityN/A

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d\right)}} \]
      9. +-rgt-identityN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \]
      10. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \]
      11. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \]
      14. +-rgt-identityN/A

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

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

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

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|} \]

    if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.0000000000000001e230

    1. Initial program 98.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-*.f6436.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified36.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-*.f6437.0

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6436.8

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{d}{\mathsf{neg}\left(\left(0 - \sqrt{h \cdot \ell}\right)\right)}} \]
      2. rem-square-sqrtN/A

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      5. remove-double-negN/A

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      14. /-lowering-/.f6498.1

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
    11. Applied egg-rr98.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -2 \cdot 10^{+189}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(M \cdot M\right) \cdot \left(-0.125 \cdot \left(h \cdot \left(D \cdot D\right)\right)\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 10^{+230}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 62.8% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+105}:\\
\;\;\;\;\frac{\sqrt{\frac{h \cdot \left(h \cdot h\right)}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{-0.125 \cdot \left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right)}{d}}{h}\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 10^{+230}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -9.9999999999999994e104

    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. Taylor expanded in h around 0

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
    5. Simplified36.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999994e104 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 or 1.0000000000000001e230 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 23.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-*.f6433.1

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified33.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. 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-*.f6433.1

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6429.4

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

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

        \[\leadsto \frac{d}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      6. *-lft-identityN/A

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d\right)}} \]
      9. +-rgt-identityN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \]
      10. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \]
      11. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \]
      14. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}} \]
    11. Applied egg-rr51.2%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|} \]

    if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.0000000000000001e230

    1. Initial program 98.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-*.f6436.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified36.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-*.f6437.0

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6436.8

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{d}{\mathsf{neg}\left(\left(0 - \sqrt{h \cdot \ell}\right)\right)}} \]
      2. rem-square-sqrtN/A

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      5. remove-double-negN/A

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      14. /-lowering-/.f6498.1

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
    11. Applied egg-rr98.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -1 \cdot 10^{+105}:\\ \;\;\;\;\frac{\sqrt{\frac{h \cdot \left(h \cdot h\right)}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{-0.125 \cdot \left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right)}{d}}{h}\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 10^{+230}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 58.8% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+189}:\\
\;\;\;\;\frac{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(\left(M \cdot M\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)}{d}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 10^{+230}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2e189

    1. Initial program 84.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-rr34.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{d}}{\sqrt{h}}} \]
    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. /-lowering-/.f64N/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}} \]
    6. Simplified37.5%

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

    if -2e189 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 or 1.0000000000000001e230 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 25.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-*.f6432.3

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

      \[\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-*.f6432.3

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6428.7

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

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

        \[\leadsto \frac{d}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      6. *-lft-identityN/A

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d\right)}} \]
      9. +-rgt-identityN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \]
      10. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \]
      11. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \]
      14. +-rgt-identityN/A

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

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

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

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|} \]

    if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.0000000000000001e230

    1. Initial program 98.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-*.f6436.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified36.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-*.f6437.0

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6436.8

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{d}{\mathsf{neg}\left(\left(0 - \sqrt{h \cdot \ell}\right)\right)}} \]
      2. rem-square-sqrtN/A

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      5. remove-double-negN/A

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      14. /-lowering-/.f6498.1

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
    11. Applied egg-rr98.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -2 \cdot 10^{+189}:\\ \;\;\;\;\frac{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(\left(M \cdot M\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)}{d}\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 10^{+230}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 58.7% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+189}:\\
\;\;\;\;\left(D \cdot D\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 10^{+230}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2e189

    1. Initial program 84.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 h around 0

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
    5. Simplified37.6%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(d, \sqrt{\frac{h}{\ell}}, \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right) \cdot \left(-0.125 \cdot \sqrt{\frac{h \cdot \left(h \cdot h\right)}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right)}{h}} \]
    6. 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)} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e189 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 or 1.0000000000000001e230 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 25.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-*.f6432.3

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

      \[\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-*.f6432.3

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6428.7

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

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

        \[\leadsto \frac{d}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      6. *-lft-identityN/A

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d\right)}} \]
      9. +-rgt-identityN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \]
      10. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \]
      11. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \]
      14. +-rgt-identityN/A

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

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

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

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|} \]

    if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.0000000000000001e230

    1. Initial program 98.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-*.f6436.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified36.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-*.f6437.0

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6436.8

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{d}{\mathsf{neg}\left(\left(0 - \sqrt{h \cdot \ell}\right)\right)}} \]
      2. rem-square-sqrtN/A

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      5. remove-double-negN/A

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      14. /-lowering-/.f6498.1

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
    11. Applied egg-rr98.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -2 \cdot 10^{+189}:\\ \;\;\;\;\left(D \cdot D\right) \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 10^{+230}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 58.7% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+259}:\\
\;\;\;\;\left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 10^{+230}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2e259

    1. Initial program 83.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. 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. Simplified30.4%

      \[\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 -2e259 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 or 1.0000000000000001e230 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 27.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-*.f6431.4

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified31.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-*.f6431.4

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6427.9

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

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

        \[\leadsto \frac{d}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      6. *-lft-identityN/A

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d\right)}} \]
      9. +-rgt-identityN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \]
      10. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \]
      11. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \]
      14. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}} \]
    11. Applied egg-rr48.5%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|} \]

    if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.0000000000000001e230

    1. Initial program 98.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-*.f6436.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified36.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-*.f6437.0

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6436.8

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{d}{\mathsf{neg}\left(\left(0 - \sqrt{h \cdot \ell}\right)\right)}} \]
      2. rem-square-sqrtN/A

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      5. remove-double-negN/A

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      14. /-lowering-/.f6498.1

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
    11. Applied egg-rr98.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -2 \cdot 10^{+259}:\\ \;\;\;\;\left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right) \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 10^{+230}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 56.0% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-64}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left(0 - d\right)}{h}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 10^{+230}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -5.00000000000000033e-64

    1. Initial program 85.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 h around 0

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
    5. Simplified34.5%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(d, \sqrt{\frac{h}{\ell}}, \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right) \cdot \left(-0.125 \cdot \sqrt{\frac{h \cdot \left(h \cdot h\right)}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right)}{h}} \]
    6. Taylor expanded in l around -inf

      \[\leadsto \frac{\color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}}{h} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right)}{h} \]
      4. rem-square-sqrtN/A

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(0 - d\right)}}{h} \]
      10. --lowering--.f6423.3

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(0 - d\right)}}{h} \]
    8. Simplified23.3%

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

    if -5.00000000000000033e-64 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 or 1.0000000000000001e230 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 20.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-*.f6434.3

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

      \[\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-*.f6434.3

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6430.4

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

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

        \[\leadsto \frac{d}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      6. *-lft-identityN/A

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d\right)}} \]
      9. +-rgt-identityN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \]
      10. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \]
      11. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \]
      14. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}} \]
    11. Applied egg-rr53.2%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|} \]

    if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.0000000000000001e230

    1. Initial program 98.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-*.f6436.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified36.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-*.f6437.0

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6436.8

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{d}{\mathsf{neg}\left(\left(0 - \sqrt{h \cdot \ell}\right)\right)}} \]
      2. rem-square-sqrtN/A

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      5. remove-double-negN/A

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      14. /-lowering-/.f6498.1

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
    11. Applied egg-rr98.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -5 \cdot 10^{-64}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left(0 - d\right)}{h}\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 10^{+230}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 83.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := \left(1 - \frac{h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \cdot \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 10^{+230}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0 or 1.0000000000000001e230 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 49.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. 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 - \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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{1}{\frac{\ell}{d}}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\ell}{d}}}}\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. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{\ell}{d}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell}{d}}}}\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. /-lowering-/.f6450.3

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\ell}{d}}}}\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-rr50.3%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - \frac{\left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
      4. /-lowering-/.f6454.8

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

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - \frac{\left(h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
    9. Step-by-step derivation
      1. un-div-invN/A

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \cdot \left(1 - \frac{\left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
      9. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \cdot \left(1 - \frac{\left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
      10. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \cdot \left(1 - \frac{\left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
      13. +-rgt-identityN/A

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

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

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

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

    if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.0000000000000001e230

    1. Initial program 98.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-*.f6436.8

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified36.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-*.f6437.0

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6436.8

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{d}{\mathsf{neg}\left(\left(0 - \sqrt{h \cdot \ell}\right)\right)}} \]
      2. rem-square-sqrtN/A

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

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

        \[\leadsto \frac{\sqrt{d \cdot d}}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      5. remove-double-negN/A

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}} \]
      9. *-commutativeN/A

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

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

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

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

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
      14. /-lowering-/.f6498.1

        \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
    11. Applied egg-rr98.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 0:\\ \;\;\;\;\left(1 - \frac{h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \cdot \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \mathbf{elif}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 10^{+230}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \cdot \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 49.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -5 \cdot 10^{-64}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left(0 - d\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<=
      (*
       (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
       (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))
      -5e-64)
   (/ (* (sqrt (/ h l)) (- 0.0 d)) h)
   (fabs (/ d (sqrt (fma h l 0.0))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -5e-64) {
		tmp = (sqrt((h / l)) * (0.0 - d)) / h;
	} else {
		tmp = fabs((d / sqrt(fma(h, l, 0.0))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) <= -5e-64)
		tmp = Float64(Float64(sqrt(Float64(h / l)) * Float64(0.0 - d)) / h);
	else
		tmp = abs(Float64(d / sqrt(fma(h, l, 0.0))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-64], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[(0.0 - d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(h * l + 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -5 \cdot 10^{-64}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left(0 - d\right)}{h}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -5.00000000000000033e-64

    1. Initial program 85.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 h around 0

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
    5. Simplified34.5%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(d, \sqrt{\frac{h}{\ell}}, \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right) \cdot \left(-0.125 \cdot \sqrt{\frac{h \cdot \left(h \cdot h\right)}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right)}{h}} \]
    6. Taylor expanded in l around -inf

      \[\leadsto \frac{\color{blue}{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}}{h} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right)}{h} \]
      4. rem-square-sqrtN/A

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(0 - d\right)}}{h} \]
      10. --lowering--.f6423.3

        \[\leadsto \frac{\sqrt{\frac{h}{\ell}} \cdot \color{blue}{\left(0 - d\right)}}{h} \]
    8. Simplified23.3%

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

    if -5.00000000000000033e-64 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    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. 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-*.f6435.4

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified35.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-*.f6435.5

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6433.2

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

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

        \[\leadsto \frac{d}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      6. *-lft-identityN/A

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d\right)}} \]
      9. +-rgt-identityN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \]
      10. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \]
      11. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \]
      14. +-rgt-identityN/A

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

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

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

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification50.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -5 \cdot 10^{-64}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left(0 - d\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 46.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -1 \cdot 10^{+105}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<=
      (*
       (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
       (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))
      -1e+105)
   (* (- 0.0 d) (sqrt (/ 1.0 (* h l))))
   (fabs (/ d (sqrt (fma h l 0.0))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -1e+105) {
		tmp = (0.0 - d) * sqrt((1.0 / (h * l)));
	} else {
		tmp = fabs((d / sqrt(fma(h, l, 0.0))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) <= -1e+105)
		tmp = Float64(Float64(0.0 - d) * sqrt(Float64(1.0 / Float64(h * l))));
	else
		tmp = abs(Float64(d / sqrt(fma(h, l, 0.0))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e+105], N[(N[(0.0 - d), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(h * l + 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -1 \cdot 10^{+105}:\\
\;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -9.9999999999999994e104

    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. 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-*.f6410.8

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

      \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(0 - d\right)} \]
      11. --lowering--.f6414.1

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(0 - d\right)} \]
    8. Simplified14.1%

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

    if -9.9999999999999994e104 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 55.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-*.f6434.7

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

      \[\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-*.f6434.8

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6432.6

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

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

        \[\leadsto \frac{d}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      6. *-lft-identityN/A

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d\right)}} \]
      9. +-rgt-identityN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \]
      10. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \]
      11. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \]
      14. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}} \]
    11. Applied egg-rr61.6%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification47.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -1 \cdot 10^{+105}:\\ \;\;\;\;\left(0 - d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 45.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -2 \cdot 10^{-44}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<=
      (*
       (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
       (+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))
      -2e-44)
   (/ d (sqrt (* h l)))
   (fabs (/ d (sqrt (fma h l 0.0))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -2e-44) {
		tmp = d / sqrt((h * l));
	} else {
		tmp = fabs((d / sqrt(fma(h, l, 0.0))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) <= -2e-44)
		tmp = Float64(d / sqrt(Float64(h * l)));
	else
		tmp = abs(Float64(d / sqrt(fma(h, l, 0.0))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[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[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-44], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(h * l + 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -2 \cdot 10^{-44}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.99999999999999991e-44

    1. Initial program 85.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-*.f6410.6

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified10.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. 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-*.f649.4

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6410.6

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]

    if -1.99999999999999991e-44 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

    1. Initial program 54.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-*.f6435.2

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified35.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-*.f6435.3

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{d}{\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)}}\right) \]
      5. neg-sub0N/A

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

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

        \[\leadsto \mathsf{neg}\left(\frac{d}{0 - \color{blue}{\sqrt{h \cdot \ell}}}\right) \]
      8. *-lowering-*.f6433.0

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

      \[\leadsto \color{blue}{-\frac{d}{0 - \sqrt{h \cdot \ell}}} \]
    10. Step-by-step derivation
      1. distribute-neg-frac2N/A

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

        \[\leadsto \frac{d}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sqrt{h \cdot \ell}\right)\right)}\right)} \]
      3. remove-double-negN/A

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{d \cdot d}}}{\sqrt{h \cdot \ell}} \]
      6. *-lft-identityN/A

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d\right)}} \]
      9. +-rgt-identityN/A

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \]
      10. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \]
      11. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \]
      14. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\frac{d \cdot d}{h \cdot \ell}} \cdot \sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}}} \]
    11. Applied egg-rr62.6%

      \[\leadsto \color{blue}{\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -2 \cdot 10^{-44}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 79.1% accurate, 3.3× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell}}\\
t_1 := 1 - \frac{h \cdot \frac{\left(M \cdot D\right) \cdot 0.5}{d}}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\\
\mathbf{if}\;d \leq -6 \cdot 10^{-155}:\\
\;\;\;\;t\_1 \cdot \left|\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}}\right|\\

\mathbf{elif}\;d \leq 5.2 \cdot 10^{-197}:\\
\;\;\;\;\frac{\mathsf{fma}\left(d, t\_0, \frac{\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \left(-0.125 \cdot \left(\frac{h}{\ell} \cdot t\_0\right)\right)}{d}\right)}{h}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -5.99999999999999967e-155

    1. Initial program 70.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. 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 - \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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{1}{\frac{\ell}{d}}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\ell}{d}}}}\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. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{\ell}{d}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell}{d}}}}\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. /-lowering-/.f6471.8

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\ell}{d}}}}\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-rr71.8%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - \frac{\left(h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
    9. Step-by-step derivation
      1. un-div-invN/A

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell} \cdot \color{blue}{\left(d \cdot d + 0\right)}} \cdot \left(1 - \frac{\left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
      9. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}}} \cdot \left(1 - \frac{\left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
      10. +-rgt-identityN/A

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\frac{d \cdot d}{h \cdot \ell}}} \cdot \sqrt{\frac{1}{h \cdot \ell} \cdot \left(d \cdot d + 0\right)}} \cdot \left(1 - \frac{\left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
      13. +-rgt-identityN/A

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

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

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

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

    if -5.99999999999999967e-155 < d < 5.2000000000000003e-197

    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. Taylor expanded in h around 0

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
    5. Simplified29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(d, \sqrt{\frac{h}{\ell}}, \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right) \cdot \left(-0.125 \cdot {\left(\frac{h}{\ell}\right)}^{\color{blue}{1.5}}\right)\right)}{h} \]
    7. Applied egg-rr54.6%

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

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

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

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

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

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

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

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

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

    if 5.2000000000000003e-197 < d

    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. 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 - \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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{1}{\frac{\ell}{d}}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\ell}{d}}}}\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. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{\ell}{d}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell}{d}}}}\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. /-lowering-/.f6471.4

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\ell}{d}}}}\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-rr71.4%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - \frac{\left(h \cdot \frac{0.5 \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
    9. Step-by-step derivation
      1. un-div-invN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h}}}{\sqrt{\ell}} \cdot \left(1 - \frac{\left(h \cdot \frac{\frac{1}{2} \cdot \left(M \cdot D\right)}{d}\right) \cdot 1}{\ell \cdot \left(4 \cdot \frac{d}{M \cdot D}\right)}\right) \]
      11. rem-square-sqrtN/A

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

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

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

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

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

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

Alternative 14: 67.5% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -2.8 \cdot 10^{+117}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}}\\ \mathbf{elif}\;d \leq -9 \cdot 10^{-148}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \frac{\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(4 \cdot \left(d \cdot d\right)\right)}\right)\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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}:\\ \;\;\;\;\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}} \cdot \left(1 - \frac{h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{d \cdot \frac{\ell \cdot \left(d \cdot 4\right)}{M \cdot D}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -2.8e+117)
   (/ (* (sqrt (/ d l)) (sqrt (- 0.0 d))) (sqrt (- 0.0 h)))
   (if (<= d -9e-148)
     (*
      (sqrt (* (/ d h) (/ d l)))
      (+ 1.0 (/ (* (* D (* M (* M D))) (* h -0.5)) (* l (* 4.0 (* d d))))))
     (if (<= d -2e-310)
       (*
        (* (sqrt (/ h l)) (sqrt (/ 1.0 (* l l))))
        (* (* D (* D (* M M))) (/ 0.125 d)))
       (*
        (/ d (sqrt (fma h l 0.0)))
        (-
         1.0
         (/ (* h (* (* M D) 0.5)) (* d (/ (* l (* d 4.0)) (* M D))))))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -2.8e+117) {
		tmp = (sqrt((d / l)) * sqrt((0.0 - d))) / sqrt((0.0 - h));
	} else if (d <= -9e-148) {
		tmp = sqrt(((d / h) * (d / l))) * (1.0 + (((D * (M * (M * D))) * (h * -0.5)) / (l * (4.0 * (d * d)))));
	} else if (d <= -2e-310) {
		tmp = (sqrt((h / l)) * sqrt((1.0 / (l * l)))) * ((D * (D * (M * M))) * (0.125 / d));
	} else {
		tmp = (d / sqrt(fma(h, l, 0.0))) * (1.0 - ((h * ((M * D) * 0.5)) / (d * ((l * (d * 4.0)) / (M * D)))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -2.8e+117)
		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(0.0 - d))) / sqrt(Float64(0.0 - h)));
	elseif (d <= -9e-148)
		tmp = Float64(sqrt(Float64(Float64(d / h) * Float64(d / l))) * Float64(1.0 + Float64(Float64(Float64(D * Float64(M * Float64(M * D))) * Float64(h * -0.5)) / Float64(l * Float64(4.0 * Float64(d * d))))));
	elseif (d <= -2e-310)
		tmp = Float64(Float64(sqrt(Float64(h / l)) * sqrt(Float64(1.0 / Float64(l * l)))) * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(0.125 / d)));
	else
		tmp = Float64(Float64(d / sqrt(fma(h, l, 0.0))) * Float64(1.0 - Float64(Float64(h * Float64(Float64(M * D) * 0.5)) / Float64(d * Float64(Float64(l * Float64(d * 4.0)) / Float64(M * D))))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.8e+117], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -9e-148], N[(N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(4.0 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / 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[(d / N[Sqrt[N[(h * l + 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * N[(N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision] / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.8 \cdot 10^{+117}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}}\\

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

\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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}:\\
\;\;\;\;\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}} \cdot \left(1 - \frac{h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{d \cdot \frac{\ell \cdot \left(d \cdot 4\right)}{M \cdot D}}\right)\\


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

    1. Initial program 66.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-rr62.1%

      \[\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. Taylor expanded in d around inf

      \[\leadsto \frac{\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
    5. Step-by-step derivation
      1. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      2. /-lowering-/.f6474.1

        \[\leadsto \frac{\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
    6. Simplified74.1%

      \[\leadsto \frac{\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]

    if -2.79999999999999997e117 < d < -9.00000000000000029e-148

    1. Initial program 75.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-rr0.0%

      \[\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{d}}{\sqrt{h}}} \]
    4. Applied egg-rr64.0%

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

    if -9.00000000000000029e-148 < d < -1.999999999999994e-310

    1. Initial program 40.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 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. Simplified53.8%

      \[\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)} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot \ell}}}\right) \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{\frac{1}{8}}{d}\right) \]
      9. *-lowering-*.f6459.2

        \[\leadsto \left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\color{blue}{\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) \]
    7. Applied egg-rr59.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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 -1.999999999999994e-310 < d

    1. Initial program 64.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. 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 - \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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{1}{\frac{\ell}{d}}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\ell}{d}}}}\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. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{\ell}{d}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell}{d}}}}\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. /-lowering-/.f6465.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\ell}{d}}}}\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-rr65.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.8 \cdot 10^{+117}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}}\\ \mathbf{elif}\;d \leq -9 \cdot 10^{-148}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 + \frac{\left(D \cdot \left(M \cdot \left(M \cdot D\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(4 \cdot \left(d \cdot d\right)\right)}\right)\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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}:\\ \;\;\;\;\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}} \cdot \left(1 - \frac{h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{d \cdot \frac{\ell \cdot \left(d \cdot 4\right)}{M \cdot D}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 66.8% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -2.5 \cdot 10^{+113}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}}\\ \mathbf{elif}\;d \leq -7.5 \cdot 10^{-148}:\\ \;\;\;\;\mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{4 \cdot \left(d \cdot d\right)}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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}:\\ \;\;\;\;\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}} \cdot \left(1 - \frac{h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{d \cdot \frac{\ell \cdot \left(d \cdot 4\right)}{M \cdot D}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -2.5e+113)
   (/ (* (sqrt (/ d l)) (sqrt (- 0.0 d))) (sqrt (- 0.0 h)))
   (if (<= d -7.5e-148)
     (*
      (fma (/ (* M (* D (* M D))) (* 4.0 (* d d))) (* (/ h l) -0.5) 1.0)
      (sqrt (/ (* d d) (* h l))))
     (if (<= d -2e-310)
       (*
        (* (sqrt (/ h l)) (sqrt (/ 1.0 (* l l))))
        (* (* D (* D (* M M))) (/ 0.125 d)))
       (*
        (/ d (sqrt (fma h l 0.0)))
        (-
         1.0
         (/ (* h (* (* M D) 0.5)) (* d (/ (* l (* d 4.0)) (* M D))))))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -2.5e+113) {
		tmp = (sqrt((d / l)) * sqrt((0.0 - d))) / sqrt((0.0 - h));
	} else if (d <= -7.5e-148) {
		tmp = fma(((M * (D * (M * D))) / (4.0 * (d * d))), ((h / l) * -0.5), 1.0) * sqrt(((d * d) / (h * l)));
	} else if (d <= -2e-310) {
		tmp = (sqrt((h / l)) * sqrt((1.0 / (l * l)))) * ((D * (D * (M * M))) * (0.125 / d));
	} else {
		tmp = (d / sqrt(fma(h, l, 0.0))) * (1.0 - ((h * ((M * D) * 0.5)) / (d * ((l * (d * 4.0)) / (M * D)))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -2.5e+113)
		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(0.0 - d))) / sqrt(Float64(0.0 - h)));
	elseif (d <= -7.5e-148)
		tmp = Float64(fma(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(4.0 * Float64(d * d))), Float64(Float64(h / l) * -0.5), 1.0) * sqrt(Float64(Float64(d * d) / Float64(h * l))));
	elseif (d <= -2e-310)
		tmp = Float64(Float64(sqrt(Float64(h / l)) * sqrt(Float64(1.0 / Float64(l * l)))) * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(0.125 / d)));
	else
		tmp = Float64(Float64(d / sqrt(fma(h, l, 0.0))) * Float64(1.0 - Float64(Float64(h * Float64(Float64(M * D) * 0.5)) / Float64(d * Float64(Float64(l * Float64(d * 4.0)) / Float64(M * D))))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.5e+113], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -7.5e-148], N[(N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(4.0 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / 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[(d / N[Sqrt[N[(h * l + 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * N[(N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision] / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.5 \cdot 10^{+113}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}}\\

\mathbf{elif}\;d \leq -7.5 \cdot 10^{-148}:\\
\;\;\;\;\mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{4 \cdot \left(d \cdot d\right)}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}\\

\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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}:\\
\;\;\;\;\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}} \cdot \left(1 - \frac{h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{d \cdot \frac{\ell \cdot \left(d \cdot 4\right)}{M \cdot D}}\right)\\


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

    1. Initial program 66.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-rr62.1%

      \[\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. Taylor expanded in d around inf

      \[\leadsto \frac{\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
    5. Step-by-step derivation
      1. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      2. /-lowering-/.f6474.1

        \[\leadsto \frac{\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
    6. Simplified74.1%

      \[\leadsto \frac{\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]

    if -2.5e113 < d < -7.5000000000000005e-148

    1. Initial program 75.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. Step-by-step derivation
      1. *-commutativeN/A

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

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

      \[\leadsto \color{blue}{\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) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}} \]

    if -7.5000000000000005e-148 < d < -1.999999999999994e-310

    1. Initial program 40.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 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. Simplified53.8%

      \[\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)} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot \ell}}}\right) \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{\frac{1}{8}}{d}\right) \]
      9. *-lowering-*.f6459.2

        \[\leadsto \left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\color{blue}{\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) \]
    7. Applied egg-rr59.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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 -1.999999999999994e-310 < d

    1. Initial program 64.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. 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 - \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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{1}{\frac{\ell}{d}}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\ell}{d}}}}\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. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{\ell}{d}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell}{d}}}}\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. /-lowering-/.f6465.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\ell}{d}}}}\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-rr65.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.5 \cdot 10^{+113}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}}\\ \mathbf{elif}\;d \leq -7.5 \cdot 10^{-148}:\\ \;\;\;\;\mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{4 \cdot \left(d \cdot d\right)}, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot \sqrt{\frac{d \cdot d}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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}:\\ \;\;\;\;\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}} \cdot \left(1 - \frac{h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{d \cdot \frac{\ell \cdot \left(d \cdot 4\right)}{M \cdot D}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 66.4% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -2.7 \cdot 10^{+47}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}}\\ \mathbf{elif}\;d \leq -4.3 \cdot 10^{-148}:\\ \;\;\;\;\left(1 + \frac{\left(h \cdot -0.5\right) \cdot \left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\ \;\;\;\;\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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}:\\ \;\;\;\;\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}} \cdot \left(1 - \frac{h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{d \cdot \frac{\ell \cdot \left(d \cdot 4\right)}{M \cdot D}}\right)\\ \end{array} \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -2.7e+47)
   (/ (* (sqrt (/ d l)) (sqrt (- 0.0 d))) (sqrt (- 0.0 h)))
   (if (<= d -4.3e-148)
     (*
      (+ 1.0 (/ (* (* h -0.5) (* M (* M (* D D)))) (* l (* d (* d 4.0)))))
      (sqrt (/ (fma d d 0.0) (* h l))))
     (if (<= d -1e-309)
       (*
        (* (sqrt (/ h l)) (sqrt (/ 1.0 (* l l))))
        (* (* D (* D (* M M))) (/ 0.125 d)))
       (*
        (/ d (sqrt (fma h l 0.0)))
        (-
         1.0
         (/ (* h (* (* M D) 0.5)) (* d (/ (* l (* d 4.0)) (* M D))))))))))
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -2.7e+47) {
		tmp = (sqrt((d / l)) * sqrt((0.0 - d))) / sqrt((0.0 - h));
	} else if (d <= -4.3e-148) {
		tmp = (1.0 + (((h * -0.5) * (M * (M * (D * D)))) / (l * (d * (d * 4.0))))) * sqrt((fma(d, d, 0.0) / (h * l)));
	} else if (d <= -1e-309) {
		tmp = (sqrt((h / l)) * sqrt((1.0 / (l * l)))) * ((D * (D * (M * M))) * (0.125 / d));
	} else {
		tmp = (d / sqrt(fma(h, l, 0.0))) * (1.0 - ((h * ((M * D) * 0.5)) / (d * ((l * (d * 4.0)) / (M * D)))));
	}
	return tmp;
}
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -2.7e+47)
		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(0.0 - d))) / sqrt(Float64(0.0 - h)));
	elseif (d <= -4.3e-148)
		tmp = Float64(Float64(1.0 + Float64(Float64(Float64(h * -0.5) * Float64(M * Float64(M * Float64(D * D)))) / Float64(l * Float64(d * Float64(d * 4.0))))) * sqrt(Float64(fma(d, d, 0.0) / Float64(h * l))));
	elseif (d <= -1e-309)
		tmp = Float64(Float64(sqrt(Float64(h / l)) * sqrt(Float64(1.0 / Float64(l * l)))) * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(0.125 / d)));
	else
		tmp = Float64(Float64(d / sqrt(fma(h, l, 0.0))) * Float64(1.0 - Float64(Float64(h * Float64(Float64(M * D) * 0.5)) / Float64(d * Float64(Float64(l * Float64(d * 4.0)) / Float64(M * D))))));
	end
	return tmp
end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.7e+47], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(0.0 - h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4.3e-148], N[(N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * d + 0.0), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-309], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / 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[(d / N[Sqrt[N[(h * l + 0.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h * N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * N[(N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision] / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.7 \cdot 10^{+47}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}}\\

\mathbf{elif}\;d \leq -4.3 \cdot 10^{-148}:\\
\;\;\;\;\left(1 + \frac{\left(h \cdot -0.5\right) \cdot \left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{h \cdot \ell}}\\

\mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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}:\\
\;\;\;\;\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}} \cdot \left(1 - \frac{h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{d \cdot \frac{\ell \cdot \left(d \cdot 4\right)}{M \cdot D}}\right)\\


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

    1. Initial program 66.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-rr64.9%

      \[\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. Taylor expanded in d around inf

      \[\leadsto \frac{\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
    5. Step-by-step derivation
      1. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
      2. /-lowering-/.f6469.5

        \[\leadsto \frac{\sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]
    6. Simplified69.5%

      \[\leadsto \frac{\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}} \]

    if -2.69999999999999996e47 < d < -4.2999999999999998e-148

    1. Initial program 78.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-rr82.9%

      \[\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. Applied egg-rr68.0%

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

    if -4.2999999999999998e-148 < d < -1.000000000000002e-309

    1. Initial program 40.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 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. Simplified53.8%

      \[\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)} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\color{blue}{\frac{1}{\ell \cdot \ell}}}\right) \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{\frac{1}{8}}{d}\right) \]
      9. *-lowering-*.f6459.2

        \[\leadsto \left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\color{blue}{\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) \]
    7. Applied egg-rr59.2%

      \[\leadsto \color{blue}{\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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 -1.000000000000002e-309 < d

    1. Initial program 64.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. 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 - \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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\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. clear-numN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{1}{\frac{\ell}{d}}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{\ell}{d}}}}\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. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{1}}{\sqrt{\frac{\ell}{d}}}\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({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell}{d}}}}\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. /-lowering-/.f6465.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{1}{\sqrt{\color{blue}{\frac{\ell}{d}}}}\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-rr65.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\sqrt{\frac{\ell}{d}}}}\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. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.7 \cdot 10^{+47}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{0 - d}}{\sqrt{0 - h}}\\ \mathbf{elif}\;d \leq -4.3 \cdot 10^{-148}:\\ \;\;\;\;\left(1 + \frac{\left(h \cdot -0.5\right) \cdot \left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right) \cdot \sqrt{\frac{\mathsf{fma}\left(d, d, 0\right)}{h \cdot \ell}}\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-309}:\\ \;\;\;\;\left(\sqrt{\frac{h}{\ell}} \cdot \sqrt{\frac{1}{\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}:\\ \;\;\;\;\frac{d}{\sqrt{\mathsf{fma}\left(h, \ell, 0\right)}} \cdot \left(1 - \frac{h \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{d \cdot \frac{\ell \cdot \left(d \cdot 4\right)}{M \cdot D}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 46.2% accurate, 9.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq 5 \cdot 10^{-197}:\\ \;\;\;\;\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 (<= d 5e-197)
   (* (- 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 (d <= 5e-197) {
		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 (d <= 5d-197) 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 (d <= 5e-197) {
		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 d <= 5e-197:
		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 (d <= 5e-197)
		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 (d <= 5e-197)
		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[d, 5e-197], 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}\;d \leq 5 \cdot 10^{-197}:\\
\;\;\;\;\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 d < 5.0000000000000002e-197

    1. Initial program 58.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-*.f6413.0

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

      \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(0 - d\right)} \]
      11. --lowering--.f6442.4

        \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot \color{blue}{\left(0 - d\right)} \]
    8. Simplified42.4%

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

    if 5.0000000000000002e-197 < d

    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-*.f6446.6

        \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
    5. Simplified46.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. 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-*.f6446.8

        \[\leadsto \frac{d}{\sqrt{\color{blue}{h \cdot \ell}}} \]
    7. Applied egg-rr46.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.f6456.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 5 \cdot 10^{-197}:\\ \;\;\;\;\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 18: 26.6% 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 63.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. 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.6

      \[\leadsto \mathsf{fma}\left(d, \sqrt{\frac{1}{\color{blue}{h \cdot \ell}}}, 0\right) \]
  5. Simplified27.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. 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.3

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

    \[\leadsto \color{blue}{\frac{d}{\sqrt{h \cdot \ell}}} \]
  8. Add Preprocessing

Reproduce

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