
(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:
Herbie found 31 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(+
1.0
(*
(/ (/ (* M (* D 0.5)) (* d 2.0)) l)
(/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))))
(if (<= d -1.25e-271)
(* (* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l)))) t_0)
(if (<= d 1.7e-227)
(/
(fma
(/ (* M (* M D)) d)
(* D (* -0.125 (pow (/ h l) 1.5)))
(* d (sqrt (/ h l))))
h)
(* t_0 (* (/ (sqrt d) (sqrt h)) (sqrt (/ d l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (d <= -1.25e-271) {
tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * t_0;
} else if (d <= 1.7e-227) {
tmp = fma(((M * (M * D)) / d), (D * (-0.125 * pow((h / l), 1.5))), (d * sqrt((h / l)))) / h;
} else {
tmp = t_0 * ((sqrt(d) / sqrt(h)) * sqrt((d / l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(-1.0 / h)))) tmp = 0.0 if (d <= -1.25e-271) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * t_0); elseif (d <= 1.7e-227) tmp = Float64(fma(Float64(Float64(M * Float64(M * D)) / d), Float64(D * Float64(-0.125 * (Float64(h / l) ^ 1.5))), Float64(d * sqrt(Float64(h / l)))) / h); else tmp = Float64(t_0 * Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.25e-271], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, 1.7e-227], N[(N[(N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(D * N[(-0.125 * N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(t$95$0 * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{-271}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\
\mathbf{elif}\;d \leq 1.7 \cdot 10^{-227}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{M \cdot \left(M \cdot D\right)}{d}, D \cdot \left(-0.125 \cdot {\left(\frac{h}{\ell}\right)}^{1.5}\right), d \cdot \sqrt{\frac{h}{\ell}}\right)}{h}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\end{array}
\end{array}
if d < -1.2500000000000001e-271Initial program 76.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites79.4%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6479.4
Applied rewrites79.4%
lift-/.f64N/A
metadata-eval79.4
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6479.4
Applied rewrites79.4%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6486.6
Applied rewrites86.6%
if -1.2500000000000001e-271 < d < 1.69999999999999989e-227Initial program 34.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites18.7%
Applied rewrites19.5%
Applied rewrites58.0%
if 1.69999999999999989e-227 < d Initial program 80.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites82.6%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6482.6
Applied rewrites82.6%
lift-/.f64N/A
metadata-eval82.6
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
pow1/2N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
pow1/2N/A
lower-sqrt.f6490.9
Applied rewrites90.9%
Final simplification84.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h l)))
(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))))))
(t_2 (sqrt (/ h (* l (* l l))))))
(if (<= t_1 -5e+275)
(/ (* (* -0.125 (* D D)) (* (* M M) t_2)) d)
(if (<= t_1 0.0)
(* t_2 (* (* M D) (* M (/ D (* d 8.0)))))
(if (<= t_1 5e+170)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= t_1 INFINITY) (/ (* d t_0) h) (/ (* (- d) t_0) h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / l));
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 t_2 = sqrt((h / (l * (l * l))));
double tmp;
if (t_1 <= -5e+275) {
tmp = ((-0.125 * (D * D)) * ((M * M) * t_2)) / d;
} else if (t_1 <= 0.0) {
tmp = t_2 * ((M * D) * (M * (D / (d * 8.0))));
} else if (t_1 <= 5e+170) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (d * t_0) / h;
} else {
tmp = (-d * t_0) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((h / l));
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_2 = Math.sqrt((h / (l * (l * l))));
double tmp;
if (t_1 <= -5e+275) {
tmp = ((-0.125 * (D * D)) * ((M * M) * t_2)) / d;
} else if (t_1 <= 0.0) {
tmp = t_2 * ((M * D) * (M * (D / (d * 8.0))));
} else if (t_1 <= 5e+170) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (d * t_0) / h;
} else {
tmp = (-d * t_0) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / l)) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_2 = math.sqrt((h / (l * (l * l)))) tmp = 0 if t_1 <= -5e+275: tmp = ((-0.125 * (D * D)) * ((M * M) * t_2)) / d elif t_1 <= 0.0: tmp = t_2 * ((M * D) * (M * (D / (d * 8.0)))) elif t_1 <= 5e+170: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif t_1 <= math.inf: tmp = (d * t_0) / h else: tmp = (-d * t_0) / h return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / l)) 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))))) t_2 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (t_1 <= -5e+275) tmp = Float64(Float64(Float64(-0.125 * Float64(D * D)) * Float64(Float64(M * M) * t_2)) / d); elseif (t_1 <= 0.0) tmp = Float64(t_2 * Float64(Float64(M * D) * Float64(M * Float64(D / Float64(d * 8.0))))); elseif (t_1 <= 5e+170) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (t_1 <= Inf) tmp = Float64(Float64(d * t_0) / h); else tmp = Float64(Float64(Float64(-d) * t_0) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / l)); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_2 = sqrt((h / (l * (l * l)))); tmp = 0.0; if (t_1 <= -5e+275) tmp = ((-0.125 * (D * D)) * ((M * M) * t_2)) / d; elseif (t_1 <= 0.0) tmp = t_2 * ((M * D) * (M * (D / (d * 8.0)))); elseif (t_1 <= 5e+170) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (t_1 <= Inf) tmp = (d * t_0) / h; else tmp = (-d * t_0) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $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]}, Block[{t$95$2 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -5e+275], N[(N[(N[(-0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t$95$2 * N[(N[(M * D), $MachinePrecision] * N[(M * N[(D / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell}}\\
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)\\
t_2 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\
\;\;\;\;\frac{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(\left(M \cdot M\right) \cdot t\_2\right)}{d}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_2 \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot \frac{D}{d \cdot 8}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_0}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\
\end{array}
\end{array}
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.0000000000000003e275Initial program 84.3%
Applied rewrites17.3%
Taylor expanded in M around inf
associate-*l/N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites40.7%
if -5.0000000000000003e275 < (*.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.0Initial program 80.3%
Applied rewrites25.9%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites19.1%
Applied rewrites31.0%
Applied rewrites39.7%
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)))) < 4.99999999999999977e170Initial program 99.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.4
Applied rewrites43.4%
Applied rewrites98.9%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites3.2%
Taylor expanded in l around -inf
Applied rewrites22.1%
Final simplification59.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l)))))
(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))))))
(t_2 (sqrt (/ h l))))
(if (<= t_1 -5e+275)
(* t_0 (* (* D D) (/ (* -0.125 (* M M)) d)))
(if (<= t_1 0.0)
(* t_0 (* (* M D) (* M (/ D (* d 8.0)))))
(if (<= t_1 5e+170)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= t_1 INFINITY) (/ (* d t_2) h) (/ (* (- d) t_2) h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
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 t_2 = sqrt((h / l));
double tmp;
if (t_1 <= -5e+275) {
tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
} else if (t_1 <= 0.0) {
tmp = t_0 * ((M * D) * (M * (D / (d * 8.0))));
} else if (t_1 <= 5e+170) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (d * t_2) / h;
} else {
tmp = (-d * t_2) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((h / (l * (l * l))));
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_2 = Math.sqrt((h / l));
double tmp;
if (t_1 <= -5e+275) {
tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
} else if (t_1 <= 0.0) {
tmp = t_0 * ((M * D) * (M * (D / (d * 8.0))));
} else if (t_1 <= 5e+170) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (d * t_2) / h;
} else {
tmp = (-d * t_2) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / (l * (l * l)))) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_2 = math.sqrt((h / l)) tmp = 0 if t_1 <= -5e+275: tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d)) elif t_1 <= 0.0: tmp = t_0 * ((M * D) * (M * (D / (d * 8.0)))) elif t_1 <= 5e+170: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif t_1 <= math.inf: tmp = (d * t_2) / h else: tmp = (-d * t_2) / h return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) 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))))) t_2 = sqrt(Float64(h / l)) tmp = 0.0 if (t_1 <= -5e+275) tmp = Float64(t_0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d))); elseif (t_1 <= 0.0) tmp = Float64(t_0 * Float64(Float64(M * D) * Float64(M * Float64(D / Float64(d * 8.0))))); elseif (t_1 <= 5e+170) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (t_1 <= Inf) tmp = Float64(Float64(d * t_2) / h); else tmp = Float64(Float64(Float64(-d) * t_2) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / (l * (l * l)))); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_2 = sqrt((h / l)); tmp = 0.0; if (t_1 <= -5e+275) tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d)); elseif (t_1 <= 0.0) tmp = t_0 * ((M * D) * (M * (D / (d * 8.0)))); elseif (t_1 <= 5e+170) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (t_1 <= Inf) tmp = (d * t_2) / h; else tmp = (-d * t_2) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $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]}, Block[{t$95$2 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -5e+275], N[(t$95$0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t$95$0 * N[(N[(M * D), $MachinePrecision] * N[(M * N[(D / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$2), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$2), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\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)\\
t_2 := \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\
\;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_0 \cdot \left(\left(M \cdot D\right) \cdot \left(M \cdot \frac{D}{d \cdot 8}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_2}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\
\end{array}
\end{array}
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.0000000000000003e275Initial program 84.3%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites39.4%
if -5.0000000000000003e275 < (*.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.0Initial program 80.3%
Applied rewrites25.9%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites19.1%
Applied rewrites31.0%
Applied rewrites39.7%
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)))) < 4.99999999999999977e170Initial program 99.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.4
Applied rewrites43.4%
Applied rewrites98.9%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites3.2%
Taylor expanded in l around -inf
Applied rewrites22.1%
Final simplification59.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l)))))
(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))))))
(t_2 (sqrt (/ h l))))
(if (<= t_1 -5e+275)
(* t_0 (* (* D D) (/ (* -0.125 (* M M)) d)))
(if (<= t_1 0.0)
(* t_0 (* M (/ (* M (* D D)) (* d 8.0))))
(if (<= t_1 5e+170)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= t_1 INFINITY) (/ (* d t_2) h) (/ (* (- d) t_2) h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
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 t_2 = sqrt((h / l));
double tmp;
if (t_1 <= -5e+275) {
tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
} else if (t_1 <= 0.0) {
tmp = t_0 * (M * ((M * (D * D)) / (d * 8.0)));
} else if (t_1 <= 5e+170) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (d * t_2) / h;
} else {
tmp = (-d * t_2) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((h / (l * (l * l))));
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_2 = Math.sqrt((h / l));
double tmp;
if (t_1 <= -5e+275) {
tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
} else if (t_1 <= 0.0) {
tmp = t_0 * (M * ((M * (D * D)) / (d * 8.0)));
} else if (t_1 <= 5e+170) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (d * t_2) / h;
} else {
tmp = (-d * t_2) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / (l * (l * l)))) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_2 = math.sqrt((h / l)) tmp = 0 if t_1 <= -5e+275: tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d)) elif t_1 <= 0.0: tmp = t_0 * (M * ((M * (D * D)) / (d * 8.0))) elif t_1 <= 5e+170: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif t_1 <= math.inf: tmp = (d * t_2) / h else: tmp = (-d * t_2) / h return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) 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))))) t_2 = sqrt(Float64(h / l)) tmp = 0.0 if (t_1 <= -5e+275) tmp = Float64(t_0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d))); elseif (t_1 <= 0.0) tmp = Float64(t_0 * Float64(M * Float64(Float64(M * Float64(D * D)) / Float64(d * 8.0)))); elseif (t_1 <= 5e+170) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (t_1 <= Inf) tmp = Float64(Float64(d * t_2) / h); else tmp = Float64(Float64(Float64(-d) * t_2) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / (l * (l * l)))); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_2 = sqrt((h / l)); tmp = 0.0; if (t_1 <= -5e+275) tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d)); elseif (t_1 <= 0.0) tmp = t_0 * (M * ((M * (D * D)) / (d * 8.0))); elseif (t_1 <= 5e+170) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (t_1 <= Inf) tmp = (d * t_2) / h; else tmp = (-d * t_2) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $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]}, Block[{t$95$2 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -5e+275], N[(t$95$0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t$95$0 * N[(M * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$2), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$2), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\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)\\
t_2 := \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\
\;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_0 \cdot \left(M \cdot \frac{M \cdot \left(D \cdot D\right)}{d \cdot 8}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_2}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\
\end{array}
\end{array}
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.0000000000000003e275Initial program 84.3%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites39.4%
if -5.0000000000000003e275 < (*.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.0Initial program 80.3%
Applied rewrites25.9%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites19.1%
Applied rewrites27.6%
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)))) < 4.99999999999999977e170Initial program 99.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.4
Applied rewrites43.4%
Applied rewrites98.9%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites3.2%
Taylor expanded in l around -inf
Applied rewrites22.1%
Final simplification57.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l)))))
(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))))))
(t_2 (sqrt (/ h l))))
(if (<= t_1 -5e+275)
(* t_0 (* (* D D) (/ (* -0.125 (* M M)) d)))
(if (<= t_1 0.0)
(* t_0 (* (* M (* D D)) (* M (/ 0.125 d))))
(if (<= t_1 5e+170)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= t_1 INFINITY) (/ (* d t_2) h) (/ (* (- d) t_2) h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
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 t_2 = sqrt((h / l));
double tmp;
if (t_1 <= -5e+275) {
tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
} else if (t_1 <= 0.0) {
tmp = t_0 * ((M * (D * D)) * (M * (0.125 / d)));
} else if (t_1 <= 5e+170) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (d * t_2) / h;
} else {
tmp = (-d * t_2) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((h / (l * (l * l))));
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_2 = Math.sqrt((h / l));
double tmp;
if (t_1 <= -5e+275) {
tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d));
} else if (t_1 <= 0.0) {
tmp = t_0 * ((M * (D * D)) * (M * (0.125 / d)));
} else if (t_1 <= 5e+170) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (d * t_2) / h;
} else {
tmp = (-d * t_2) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / (l * (l * l)))) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_2 = math.sqrt((h / l)) tmp = 0 if t_1 <= -5e+275: tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d)) elif t_1 <= 0.0: tmp = t_0 * ((M * (D * D)) * (M * (0.125 / d))) elif t_1 <= 5e+170: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif t_1 <= math.inf: tmp = (d * t_2) / h else: tmp = (-d * t_2) / h return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) 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))))) t_2 = sqrt(Float64(h / l)) tmp = 0.0 if (t_1 <= -5e+275) tmp = Float64(t_0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d))); elseif (t_1 <= 0.0) tmp = Float64(t_0 * Float64(Float64(M * Float64(D * D)) * Float64(M * Float64(0.125 / d)))); elseif (t_1 <= 5e+170) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (t_1 <= Inf) tmp = Float64(Float64(d * t_2) / h); else tmp = Float64(Float64(Float64(-d) * t_2) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / (l * (l * l)))); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_2 = sqrt((h / l)); tmp = 0.0; if (t_1 <= -5e+275) tmp = t_0 * ((D * D) * ((-0.125 * (M * M)) / d)); elseif (t_1 <= 0.0) tmp = t_0 * ((M * (D * D)) * (M * (0.125 / d))); elseif (t_1 <= 5e+170) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (t_1 <= Inf) tmp = (d * t_2) / h; else tmp = (-d * t_2) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $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]}, Block[{t$95$2 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -5e+275], N[(t$95$0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t$95$0 * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(M * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$2), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$2), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\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)\\
t_2 := \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+275}:\\
\;\;\;\;t\_0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_0 \cdot \left(\left(M \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot \frac{0.125}{d}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_2}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\
\end{array}
\end{array}
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.0000000000000003e275Initial program 84.3%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites39.4%
if -5.0000000000000003e275 < (*.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.0Initial program 80.3%
Applied rewrites25.9%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites19.1%
Applied rewrites27.5%
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)))) < 4.99999999999999977e170Initial program 99.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.4
Applied rewrites43.4%
Applied rewrites98.9%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites3.2%
Taylor expanded in l around -inf
Applied rewrites22.1%
Final simplification57.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (/ d l)))
(t_2 (sqrt (/ h 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 -5e-91)
(*
t_0
(* t_1 (fma (/ (* M D) (* d d)) (* (/ (- h) l) (* (* M D) 0.125)) 1.0)))
(if (<= t_3 5e+170)
(* t_0 t_1)
(if (<= t_3 INFINITY) (/ (* d t_2) h) (/ (* (- d) t_2) h))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double t_2 = sqrt((h / 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 <= -5e-91) {
tmp = t_0 * (t_1 * fma(((M * D) / (d * d)), ((-h / l) * ((M * D) * 0.125)), 1.0));
} else if (t_3 <= 5e+170) {
tmp = t_0 * t_1;
} else if (t_3 <= ((double) INFINITY)) {
tmp = (d * t_2) / h;
} else {
tmp = (-d * t_2) / h;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) t_2 = sqrt(Float64(h / 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 <= -5e-91) tmp = Float64(t_0 * Float64(t_1 * fma(Float64(Float64(M * D) / Float64(d * d)), Float64(Float64(Float64(-h) / l) * Float64(Float64(M * D) * 0.125)), 1.0))); elseif (t_3 <= 5e+170) tmp = Float64(t_0 * t_1); elseif (t_3 <= Inf) tmp = Float64(Float64(d * t_2) / h); else tmp = Float64(Float64(Float64(-d) * t_2) / h); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / 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, -5e-91], N[(t$95$0 * N[(t$95$1 * N[(N[(N[(M * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[((-h) / l), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+170], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(d * t$95$2), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$2), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \sqrt{\frac{h}{\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 -5 \cdot 10^{-91}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(\frac{M \cdot D}{d \cdot d}, \frac{-h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot 0.125\right), 1\right)\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_2}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\
\end{array}
\end{array}
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)))) < -4.99999999999999997e-91Initial program 87.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites88.2%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6488.2
Applied rewrites88.2%
Applied rewrites59.3%
Applied rewrites64.1%
if -4.99999999999999997e-91 < (*.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)))) < 4.99999999999999977e170Initial program 91.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.5
Applied rewrites46.5%
Applied rewrites90.3%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites3.2%
Taylor expanded in l around -inf
Applied rewrites22.1%
Final simplification68.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (/ d l)))
(t_2
(*
(* (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_3 (sqrt (/ h l))))
(if (<= t_2 -5e-91)
(*
t_0
(* t_1 (fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0)))
(if (<= t_2 5e+170)
(* t_0 t_1)
(if (<= t_2 INFINITY) (/ (* d t_3) h) (/ (* (- d) t_3) h))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double t_2 = (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_3 = sqrt((h / l));
double tmp;
if (t_2 <= -5e-91) {
tmp = t_0 * (t_1 * fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0));
} else if (t_2 <= 5e+170) {
tmp = t_0 * t_1;
} else if (t_2 <= ((double) INFINITY)) {
tmp = (d * t_3) / h;
} else {
tmp = (-d * t_3) / h;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) t_2 = 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_3 = sqrt(Float64(h / l)) tmp = 0.0 if (t_2 <= -5e-91) tmp = Float64(t_0 * Float64(t_1 * fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0))); elseif (t_2 <= 5e+170) tmp = Float64(t_0 * t_1); elseif (t_2 <= Inf) tmp = Float64(Float64(d * t_3) / h); else tmp = Float64(Float64(Float64(-d) * t_3) / h); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, -5e-91], N[(t$95$0 * N[(t$95$1 * N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+170], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(d * t$95$3), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$3), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_3 := \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-91}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_3}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-d\right) \cdot t\_3}{h}\\
\end{array}
\end{array}
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)))) < -4.99999999999999997e-91Initial program 87.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites88.2%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6488.2
Applied rewrites88.2%
Applied rewrites59.3%
if -4.99999999999999997e-91 < (*.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)))) < 4.99999999999999977e170Initial program 91.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.5
Applied rewrites46.5%
Applied rewrites90.3%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites3.2%
Taylor expanded in l around -inf
Applied rewrites22.1%
Final simplification66.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1 (sqrt (/ d h)))
(t_2 (sqrt (/ h 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 -5e-91)
(*
t_0
(* t_1 (- 1.0 (* (/ h l) (* (* M D) (* 0.125 (* M (/ D (* d d)))))))))
(if (<= t_3 5e+170)
(* t_1 t_0)
(if (<= t_3 INFINITY) (/ (* d t_2) h) (/ (* (- d) t_2) h))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = sqrt((d / h));
double t_2 = sqrt((h / 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 <= -5e-91) {
tmp = t_0 * (t_1 * (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))));
} else if (t_3 <= 5e+170) {
tmp = t_1 * t_0;
} else if (t_3 <= ((double) INFINITY)) {
tmp = (d * t_2) / h;
} else {
tmp = (-d * t_2) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = Math.sqrt((d / h));
double t_2 = Math.sqrt((h / l));
double t_3 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_3 <= -5e-91) {
tmp = t_0 * (t_1 * (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))));
} else if (t_3 <= 5e+170) {
tmp = t_1 * t_0;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = (d * t_2) / h;
} else {
tmp = (-d * t_2) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = math.sqrt((d / h)) t_2 = math.sqrt((h / l)) t_3 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) tmp = 0 if t_3 <= -5e-91: tmp = t_0 * (t_1 * (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d)))))))) elif t_3 <= 5e+170: tmp = t_1 * t_0 elif t_3 <= math.inf: tmp = (d * t_2) / h else: tmp = (-d * t_2) / h return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = sqrt(Float64(d / h)) t_2 = sqrt(Float64(h / 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 <= -5e-91) tmp = Float64(t_0 * Float64(t_1 * Float64(1.0 - Float64(Float64(h / l) * Float64(Float64(M * D) * Float64(0.125 * Float64(M * Float64(D / Float64(d * d))))))))); elseif (t_3 <= 5e+170) tmp = Float64(t_1 * t_0); elseif (t_3 <= Inf) tmp = Float64(Float64(d * t_2) / h); else tmp = Float64(Float64(Float64(-d) * t_2) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = sqrt((d / h)); t_2 = sqrt((h / l)); t_3 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_3 <= -5e-91) tmp = t_0 * (t_1 * (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d)))))))); elseif (t_3 <= 5e+170) tmp = t_1 * t_0; elseif (t_3 <= Inf) tmp = (d * t_2) / h; else tmp = (-d * t_2) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h / 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, -5e-91], N[(t$95$0 * N[(t$95$1 * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(0.125 * N[(M * N[(D / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+170], N[(t$95$1 * t$95$0), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(d * t$95$2), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$2), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \sqrt{\frac{h}{\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 -5 \cdot 10^{-91}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \left(1 - \frac{h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot \left(0.125 \cdot \left(M \cdot \frac{D}{d \cdot d}\right)\right)\right)\right)\right)\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_2}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-d\right) \cdot t\_2}{h}\\
\end{array}
\end{array}
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)))) < -4.99999999999999997e-91Initial program 87.3%
Applied rewrites21.7%
Applied rewrites62.1%
if -4.99999999999999997e-91 < (*.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)))) < 4.99999999999999977e170Initial program 91.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.5
Applied rewrites46.5%
Applied rewrites90.3%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites3.2%
Taylor expanded in l around -inf
Applied rewrites22.1%
Final simplification67.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h l)))
(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-166)
(* (sqrt (/ h (* l (* l l)))) (* (* D D) (/ (* -0.125 (* M M)) d)))
(if (<= t_1 5e+170)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= t_1 INFINITY) (/ (* d t_0) h) (/ (* (- d) t_0) h))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / l));
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-166) {
tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
} else if (t_1 <= 5e+170) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (d * t_0) / h;
} else {
tmp = (-d * t_0) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((h / l));
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= -2e-166) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
} else if (t_1 <= 5e+170) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (d * t_0) / h;
} else {
tmp = (-d * t_0) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / l)) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) tmp = 0 if t_1 <= -2e-166: tmp = math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d)) elif t_1 <= 5e+170: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif t_1 <= math.inf: tmp = (d * t_0) / h else: tmp = (-d * t_0) / h return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / l)) 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-166) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d))); elseif (t_1 <= 5e+170) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (t_1 <= Inf) tmp = Float64(Float64(d * t_0) / h); else tmp = Float64(Float64(Float64(-d) * t_0) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / l)); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_1 <= -2e-166) tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d)); elseif (t_1 <= 5e+170) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (t_1 <= Inf) tmp = (d * t_0) / h; else tmp = (-d * t_0) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $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-166], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell}}\\
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^{-166}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_0}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\
\end{array}
\end{array}
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)))) < -2.00000000000000008e-166Initial program 87.4%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites32.8%
if -2.00000000000000008e-166 < (*.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)))) < 4.99999999999999977e170Initial program 91.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6447.1
Applied rewrites47.1%
Applied rewrites91.4%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites3.2%
Taylor expanded in l around -inf
Applied rewrites22.1%
Final simplification56.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (/ d l)))
(t_2
(*
(* (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_3 (sqrt (/ h l))))
(if (<= t_2 -2e-166)
(* t_0 (- t_1))
(if (<= t_2 5e+170)
(* t_0 t_1)
(if (<= t_2 INFINITY) (/ (* d t_3) h) (/ (* (- d) t_3) h))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double t_2 = (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_3 = sqrt((h / l));
double tmp;
if (t_2 <= -2e-166) {
tmp = t_0 * -t_1;
} else if (t_2 <= 5e+170) {
tmp = t_0 * t_1;
} else if (t_2 <= ((double) INFINITY)) {
tmp = (d * t_3) / h;
} else {
tmp = (-d * t_3) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double t_1 = Math.sqrt((d / l));
double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_3 = Math.sqrt((h / l));
double tmp;
if (t_2 <= -2e-166) {
tmp = t_0 * -t_1;
} else if (t_2 <= 5e+170) {
tmp = t_0 * t_1;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (d * t_3) / h;
} else {
tmp = (-d * t_3) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = math.sqrt((d / l)) t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_3 = math.sqrt((h / l)) tmp = 0 if t_2 <= -2e-166: tmp = t_0 * -t_1 elif t_2 <= 5e+170: tmp = t_0 * t_1 elif t_2 <= math.inf: tmp = (d * t_3) / h else: tmp = (-d * t_3) / h return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) t_2 = 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_3 = sqrt(Float64(h / l)) tmp = 0.0 if (t_2 <= -2e-166) tmp = Float64(t_0 * Float64(-t_1)); elseif (t_2 <= 5e+170) tmp = Float64(t_0 * t_1); elseif (t_2 <= Inf) tmp = Float64(Float64(d * t_3) / h); else tmp = Float64(Float64(Float64(-d) * t_3) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); t_1 = sqrt((d / l)); t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_3 = sqrt((h / l)); tmp = 0.0; if (t_2 <= -2e-166) tmp = t_0 * -t_1; elseif (t_2 <= 5e+170) tmp = t_0 * t_1; elseif (t_2 <= Inf) tmp = (d * t_3) / h; else tmp = (-d * t_3) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, -2e-166], N[(t$95$0 * (-t$95$1)), $MachinePrecision], If[LessEqual[t$95$2, 5e+170], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(d * t$95$3), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$3), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_3 := \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-166}:\\
\;\;\;\;t\_0 \cdot \left(-t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_3}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-d\right) \cdot t\_3}{h}\\
\end{array}
\end{array}
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)))) < -2.00000000000000008e-166Initial program 87.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites88.3%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6488.3
Applied rewrites88.3%
Applied rewrites58.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f6419.4
Applied rewrites19.4%
if -2.00000000000000008e-166 < (*.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)))) < 4.99999999999999977e170Initial program 91.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6447.1
Applied rewrites47.1%
Applied rewrites91.4%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites3.2%
Taylor expanded in l around -inf
Applied rewrites22.1%
Final simplification51.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h l)))
(t_1 (/ (* (- d) t_0) h))
(t_2
(*
(* (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_2 -2e-166)
t_1
(if (<= t_2 5e+170)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= t_2 INFINITY) (/ (* d t_0) h) t_1)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / l));
double t_1 = (-d * t_0) / h;
double t_2 = (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_2 <= -2e-166) {
tmp = t_1;
} else if (t_2 <= 5e+170) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (t_2 <= ((double) INFINITY)) {
tmp = (d * t_0) / h;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((h / l));
double t_1 = (-d * t_0) / h;
double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_2 <= -2e-166) {
tmp = t_1;
} else if (t_2 <= 5e+170) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (d * t_0) / h;
} else {
tmp = t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / l)) t_1 = (-d * t_0) / h t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) tmp = 0 if t_2 <= -2e-166: tmp = t_1 elif t_2 <= 5e+170: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif t_2 <= math.inf: tmp = (d * t_0) / h else: tmp = t_1 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / l)) t_1 = Float64(Float64(Float64(-d) * t_0) / h) t_2 = 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_2 <= -2e-166) tmp = t_1; elseif (t_2 <= 5e+170) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (t_2 <= Inf) tmp = Float64(Float64(d * t_0) / h); else tmp = t_1; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / l)); t_1 = (-d * t_0) / h; t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_2 <= -2e-166) tmp = t_1; elseif (t_2 <= 5e+170) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (t_2 <= Inf) tmp = (d * t_0) / h; else tmp = t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]}, Block[{t$95$2 = 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$2, -2e-166], t$95$1, If[LessEqual[t$95$2, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell}}\\
t_1 := \frac{\left(-d\right) \cdot t\_0}{h}\\
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-166}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_0}{h}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
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)))) < -2.00000000000000008e-166 or +inf.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)))) Initial program 62.7%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites23.2%
Taylor expanded in l around -inf
Applied rewrites18.9%
if -2.00000000000000008e-166 < (*.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)))) < 4.99999999999999977e170Initial program 91.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6447.1
Applied rewrites47.1%
Applied rewrites91.4%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
Final simplification50.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* M D) (* d 2.0)))
(t_1
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+ 1.0 (* (/ h l) (* (pow t_0 2.0) (/ -1.0 2.0)))))))
(if (<= t_1 5e+170)
(*
(+ 1.0 (* (/ (/ (* M (* D 0.5)) (* d 2.0)) l) (/ t_0 (/ -1.0 h))))
(* (sqrt (/ d h)) (sqrt (/ d l))))
(if (<= t_1 INFINITY)
(/ (* d (sqrt (/ h l))) h)
(*
h
(fma
d
(sqrt (/ 1.0 (* l (* h (* h h)))))
(*
(* -0.125 (/ (* M (* M (* D D))) d))
(sqrt (/ 1.0 (* l (* h (* l l))))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) / (d * 2.0);
double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(t_0, 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= 5e+170) {
tmp = (1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (t_0 / (-1.0 / h)))) * (sqrt((d / h)) * sqrt((d / l)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = h * fma(d, sqrt((1.0 / (l * (h * (h * h))))), ((-0.125 * ((M * (M * (D * D))) / d)) * sqrt((1.0 / (l * (h * (l * l)))))));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) / Float64(d * 2.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((t_0 ^ 2.0) * Float64(-1.0 / 2.0))))) tmp = 0.0 if (t_1 <= 5e+170) tmp = Float64(Float64(1.0 + Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(t_0 / Float64(-1.0 / h)))) * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)))); elseif (t_1 <= Inf) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(h * fma(d, sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(h * h))))), Float64(Float64(-0.125 * Float64(Float64(M * Float64(M * Float64(D * D))) / d)) * sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(l * l)))))))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $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[t$95$0, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+170], N[(N[(1.0 + N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(h * N[(d * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d \cdot 2}\\
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({t\_0}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;\left(1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{t\_0}{\frac{-1}{h}}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(h \cdot h\right)\right)}}, \left(-0.125 \cdot \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{d}\right) \cdot \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}\right)\\
\end{array}
\end{array}
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)))) < 4.99999999999999977e170Initial program 89.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.7%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6489.7
Applied rewrites89.7%
lift-/.f64N/A
metadata-eval89.7
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6489.7
Applied rewrites89.7%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Applied rewrites5.2%
Taylor expanded in h around inf
Applied rewrites27.8%
Final simplification79.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* M D) (* d 2.0)))
(t_1
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+ 1.0 (* (/ h l) (* (pow t_0 2.0) (/ -1.0 2.0)))))))
(if (<= t_1 5e+170)
(*
(* (sqrt (/ d h)) (sqrt (/ d l)))
(- 1.0 (* (/ (/ (* M (* D 0.5)) (* d 2.0)) l) (* h t_0))))
(if (<= t_1 INFINITY)
(/ (* d (sqrt (/ h l))) h)
(*
h
(fma
d
(sqrt (/ 1.0 (* l (* h (* h h)))))
(*
(* -0.125 (/ (* M (* M (* D D))) d))
(sqrt (/ 1.0 (* l (* h (* l l))))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (M * D) / (d * 2.0);
double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(t_0, 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= 5e+170) {
tmp = (sqrt((d / h)) * sqrt((d / l))) * (1.0 - ((((M * (D * 0.5)) / (d * 2.0)) / l) * (h * t_0)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = h * fma(d, sqrt((1.0 / (l * (h * (h * h))))), ((-0.125 * ((M * (M * (D * D))) / d)) * sqrt((1.0 / (l * (h * (l * l)))))));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(M * D) / Float64(d * 2.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((t_0 ^ 2.0) * Float64(-1.0 / 2.0))))) tmp = 0.0 if (t_1 <= 5e+170) tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * Float64(1.0 - Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(h * t_0)))); elseif (t_1 <= Inf) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(h * fma(d, sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(h * h))))), Float64(Float64(-0.125 * Float64(Float64(M * Float64(M * Float64(D * D))) / d)) * sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(l * l)))))))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $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[t$95$0, 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+170], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(h * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(h * N[(d * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d \cdot 2}\\
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({t\_0}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \left(h \cdot t\_0\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(h \cdot h\right)\right)}}, \left(-0.125 \cdot \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{d}\right) \cdot \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}\right)\\
\end{array}
\end{array}
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)))) < 4.99999999999999977e170Initial program 89.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.7%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6489.7
Applied rewrites89.7%
lift-/.f64N/A
metadata-eval89.7
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6489.7
Applied rewrites89.7%
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
remove-double-divN/A
lower-*.f6489.7
Applied rewrites89.7%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Applied rewrites5.2%
Taylor expanded in h around inf
Applied rewrites27.8%
Final simplification79.1%
(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)))))))
(if (<= t_0 5e+170)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(fma (/ (* (* (/ (* M D) d) 0.25) (* 0.5 (* M D))) d) (/ (- h) l) 1.0)))
(if (<= t_0 INFINITY)
(/ (* d (sqrt (/ h l))) h)
(*
h
(fma
d
(sqrt (/ 1.0 (* l (* h (* h h)))))
(*
(* -0.125 (/ (* M (* M (* D D))) d))
(sqrt (/ 1.0 (* l (* h (* l l))))))))))))
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 tmp;
if (t_0 <= 5e+170) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * fma((((((M * D) / d) * 0.25) * (0.5 * (M * D))) / d), (-h / l), 1.0));
} else if (t_0 <= ((double) INFINITY)) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = h * fma(d, sqrt((1.0 / (l * (h * (h * h))))), ((-0.125 * ((M * (M * (D * D))) / d)) * sqrt((1.0 / (l * (h * (l * l)))))));
}
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))))) tmp = 0.0 if (t_0 <= 5e+170) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(Float64(Float64(Float64(M * D) / d) * 0.25) * Float64(0.5 * Float64(M * D))) / d), Float64(Float64(-h) / l), 1.0))); elseif (t_0 <= Inf) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(h * fma(d, sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(h * h))))), Float64(Float64(-0.125 * Float64(Float64(M * Float64(M * Float64(D * D))) / d)) * sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(l * l)))))))); 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]}, If[LessEqual[t$95$0, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision] * N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(h * N[(d * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(l * N[(h * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\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)\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(0.5 \cdot \left(M \cdot D\right)\right)}{d}, \frac{-h}{\ell}, 1\right)\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(h \cdot h\right)\right)}}, \left(-0.125 \cdot \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{d}\right) \cdot \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}}\right)\\
\end{array}
\end{array}
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)))) < 4.99999999999999977e170Initial program 89.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.7%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6489.7
Applied rewrites89.7%
Applied rewrites65.5%
Applied rewrites88.2%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Applied rewrites5.2%
Taylor expanded in h around inf
Applied rewrites27.8%
Final simplification78.0%
(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)))))))
(if (<= t_0 5e+170)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(fma (/ (* (* (/ (* M D) d) 0.25) (* 0.5 (* M D))) d) (/ (- h) l) 1.0)))
(if (<= t_0 INFINITY)
(/ (* d (sqrt (/ h l))) h)
(*
h
(fma
d
(sqrt (/ 1.0 (* h (* l (* h h)))))
(*
(sqrt (/ 1.0 (* l (* h (* l l)))))
(* (* D (* D (* M M))) (/ -0.125 d)))))))))
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 tmp;
if (t_0 <= 5e+170) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * fma((((((M * D) / d) * 0.25) * (0.5 * (M * D))) / d), (-h / l), 1.0));
} else if (t_0 <= ((double) INFINITY)) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = h * fma(d, sqrt((1.0 / (h * (l * (h * h))))), (sqrt((1.0 / (l * (h * (l * l))))) * ((D * (D * (M * M))) * (-0.125 / d))));
}
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))))) tmp = 0.0 if (t_0 <= 5e+170) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(Float64(Float64(Float64(M * D) / d) * 0.25) * Float64(0.5 * Float64(M * D))) / d), Float64(Float64(-h) / l), 1.0))); elseif (t_0 <= Inf) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(h * fma(d, sqrt(Float64(1.0 / Float64(h * Float64(l * Float64(h * h))))), Float64(sqrt(Float64(1.0 / Float64(l * Float64(h * Float64(l * l))))) * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(-0.125 / d))))); 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]}, If[LessEqual[t$95$0, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision] * N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(h * N[(d * N[Sqrt[N[(1.0 / N[(h * N[(l * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / N[(l * N[(h * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\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)\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(0.5 \cdot \left(M \cdot D\right)\right)}{d}, \frac{-h}{\ell}, 1\right)\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;h \cdot \mathsf{fma}\left(d, \sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(h \cdot h\right)\right)}}, \sqrt{\frac{1}{\ell \cdot \left(h \cdot \left(\ell \cdot \ell\right)\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\right)\\
\end{array}
\end{array}
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)))) < 4.99999999999999977e170Initial program 89.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.7%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6489.7
Applied rewrites89.7%
Applied rewrites65.5%
Applied rewrites88.2%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Applied rewrites5.2%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites11.2%
Taylor expanded in h around inf
Applied rewrites25.1%
Final simplification77.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h l)))
(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 5e+170)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(fma (/ (* (* (/ (* M D) d) 0.25) (* 0.5 (* M D))) d) (/ (- h) l) 1.0)))
(if (<= t_1 INFINITY) (/ (* d t_0) h) (/ (* (- d) t_0) h)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / l));
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 <= 5e+170) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * fma((((((M * D) / d) * 0.25) * (0.5 * (M * D))) / d), (-h / l), 1.0));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (d * t_0) / h;
} else {
tmp = (-d * t_0) / h;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / l)) 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 <= 5e+170) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(Float64(Float64(Float64(M * D) / d) * 0.25) * Float64(0.5 * Float64(M * D))) / d), Float64(Float64(-h) / l), 1.0))); elseif (t_1 <= Inf) tmp = Float64(Float64(d * t_0) / h); else tmp = Float64(Float64(Float64(-d) * t_0) / h); 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[(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, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.25), $MachinePrecision] * N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell}}\\
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 5 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(\frac{M \cdot D}{d} \cdot 0.25\right) \cdot \left(0.5 \cdot \left(M \cdot D\right)\right)}{d}, \frac{-h}{\ell}, 1\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_0}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\
\end{array}
\end{array}
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)))) < 4.99999999999999977e170Initial program 89.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.7%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6489.7
Applied rewrites89.7%
Applied rewrites65.5%
Applied rewrites88.2%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites3.2%
Taylor expanded in l around -inf
Applied rewrites22.1%
Final simplification77.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h l)))
(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 5e+170)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(fma (* D (* M (* (/ (* D (/ M d)) d) 0.125))) (/ (- h) l) 1.0)))
(if (<= t_1 INFINITY) (/ (* d t_0) h) (/ (* (- d) t_0) h)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / l));
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 <= 5e+170) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * fma((D * (M * (((D * (M / d)) / d) * 0.125))), (-h / l), 1.0));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (d * t_0) / h;
} else {
tmp = (-d * t_0) / h;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / l)) 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 <= 5e+170) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * fma(Float64(D * Float64(M * Float64(Float64(Float64(D * Float64(M / d)) / d) * 0.125))), Float64(Float64(-h) / l), 1.0))); elseif (t_1 <= Inf) tmp = Float64(Float64(d * t_0) / h); else tmp = Float64(Float64(Float64(-d) * t_0) / h); 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[(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, 5e+170], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(M * N[(N[(N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell}}\\
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 5 \cdot 10^{+170}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(\frac{D \cdot \frac{M}{d}}{d} \cdot 0.125\right)\right), \frac{-h}{\ell}, 1\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_0}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-d\right) \cdot t\_0}{h}\\
\end{array}
\end{array}
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)))) < 4.99999999999999977e170Initial program 89.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.7%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6489.7
Applied rewrites89.7%
Applied rewrites65.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6483.8
Applied rewrites83.8%
if 4.99999999999999977e170 < (*.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)))) < +inf.0Initial program 70.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites15.9%
Taylor expanded in d around inf
Applied rewrites81.7%
if +inf.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)))) Initial program 0.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites3.2%
Taylor expanded in l around -inf
Applied rewrites22.1%
Final simplification74.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h l)))
(t_1 (/ (* (- d) t_0) h))
(t_2
(*
(* (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_2 -2e-166) t_1 (if (<= t_2 INFINITY) (/ (* d t_0) h) t_1))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / l));
double t_1 = (-d * t_0) / h;
double t_2 = (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_2 <= -2e-166) {
tmp = t_1;
} else if (t_2 <= ((double) INFINITY)) {
tmp = (d * t_0) / h;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((h / l));
double t_1 = (-d * t_0) / h;
double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_2 <= -2e-166) {
tmp = t_1;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = (d * t_0) / h;
} else {
tmp = t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / l)) t_1 = (-d * t_0) / h t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) tmp = 0 if t_2 <= -2e-166: tmp = t_1 elif t_2 <= math.inf: tmp = (d * t_0) / h else: tmp = t_1 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / l)) t_1 = Float64(Float64(Float64(-d) * t_0) / h) t_2 = 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_2 <= -2e-166) tmp = t_1; elseif (t_2 <= Inf) tmp = Float64(Float64(d * t_0) / h); else tmp = t_1; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / l)); t_1 = (-d * t_0) / h; t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_2 <= -2e-166) tmp = t_1; elseif (t_2 <= Inf) tmp = (d * t_0) / h; else tmp = t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[((-d) * t$95$0), $MachinePrecision] / h), $MachinePrecision]}, Block[{t$95$2 = 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$2, -2e-166], t$95$1, If[LessEqual[t$95$2, Infinity], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell}}\\
t_1 := \frac{\left(-d\right) \cdot t\_0}{h}\\
t_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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-166}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{d \cdot t\_0}{h}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
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)))) < -2.00000000000000008e-166 or +inf.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)))) Initial program 62.7%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites23.2%
Taylor expanded in l around -inf
Applied rewrites18.9%
if -2.00000000000000008e-166 < (*.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)))) < +inf.0Initial program 84.7%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites29.4%
Taylor expanded in d around inf
Applied rewrites83.5%
Final simplification48.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(+
1.0
(*
(/ (/ (* M (* D 0.5)) (* d 2.0)) l)
(/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))))
(if (<= d -1.25e-271)
(* (* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l)))) t_0)
(if (<= d 1.5e-227)
(/
(fma
d
(sqrt (/ h l))
(* (* -0.125 (pow (/ h l) 1.5)) (* D (/ (* D (* M M)) d))))
h)
(* t_0 (* (/ (sqrt d) (sqrt h)) (sqrt (/ d l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (d <= -1.25e-271) {
tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * t_0;
} else if (d <= 1.5e-227) {
tmp = fma(d, sqrt((h / l)), ((-0.125 * pow((h / l), 1.5)) * (D * ((D * (M * M)) / d)))) / h;
} else {
tmp = t_0 * ((sqrt(d) / sqrt(h)) * sqrt((d / l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(-1.0 / h)))) tmp = 0.0 if (d <= -1.25e-271) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * t_0); elseif (d <= 1.5e-227) tmp = Float64(fma(d, sqrt(Float64(h / l)), Float64(Float64(-0.125 * (Float64(h / l) ^ 1.5)) * Float64(D * Float64(Float64(D * Float64(M * M)) / d)))) / h); else tmp = Float64(t_0 * Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.25e-271], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, 1.5e-227], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision] * N[(D * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(t$95$0 * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{-271}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\
\mathbf{elif}\;d \leq 1.5 \cdot 10^{-227}:\\
\;\;\;\;\frac{\mathsf{fma}\left(d, \sqrt{\frac{h}{\ell}}, \left(-0.125 \cdot {\left(\frac{h}{\ell}\right)}^{1.5}\right) \cdot \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right)\right)}{h}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\end{array}
\end{array}
if d < -1.2500000000000001e-271Initial program 76.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites79.4%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6479.4
Applied rewrites79.4%
lift-/.f64N/A
metadata-eval79.4
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6479.4
Applied rewrites79.4%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6486.6
Applied rewrites86.6%
if -1.2500000000000001e-271 < d < 1.5e-227Initial program 34.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites18.7%
Applied rewrites57.3%
if 1.5e-227 < d Initial program 80.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites82.6%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6482.6
Applied rewrites82.6%
lift-/.f64N/A
metadata-eval82.6
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
pow1/2N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
pow1/2N/A
lower-sqrt.f6490.9
Applied rewrites90.9%
Final simplification84.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(+
1.0
(*
(/ (/ (* M (* D 0.5)) (* d 2.0)) l)
(/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))))
(if (<= l -2e-310)
(* (* (sqrt (/ d h)) (/ (sqrt (- d)) (sqrt (- l)))) t_0)
(* t_0 (* (/ (sqrt d) (sqrt h)) (sqrt (/ d l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (l <= -2e-310) {
tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * t_0;
} else {
tmp = t_0 * ((sqrt(d) / sqrt(h)) * sqrt((d / 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) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + ((((m * (d_1 * 0.5d0)) / (d * 2.0d0)) / l) * (((m * d_1) / (d * 2.0d0)) / ((-1.0d0) / h)))
if (l <= (-2d-310)) then
tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * t_0
else
tmp = t_0 * ((sqrt(d) / sqrt(h)) * sqrt((d / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (l <= -2e-310) {
tmp = (Math.sqrt((d / h)) * (Math.sqrt(-d) / Math.sqrt(-l))) * t_0;
} else {
tmp = t_0 * ((Math.sqrt(d) / Math.sqrt(h)) * Math.sqrt((d / l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h))) tmp = 0 if l <= -2e-310: tmp = (math.sqrt((d / h)) * (math.sqrt(-d) / math.sqrt(-l))) * t_0 else: tmp = t_0 * ((math.sqrt(d) / math.sqrt(h)) * math.sqrt((d / l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(-1.0 / h)))) tmp = 0.0 if (l <= -2e-310) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * t_0); else tmp = Float64(t_0 * Float64(Float64(sqrt(d) / sqrt(h)) * sqrt(Float64(d / l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h))); tmp = 0.0; if (l <= -2e-310) tmp = (sqrt((d / h)) * (sqrt(-d) / sqrt(-l))) * t_0; else tmp = t_0 * ((sqrt(d) / sqrt(h)) * sqrt((d / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e-310], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell} \cdot \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{-1}{h}}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 73.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites75.3%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6475.3
Applied rewrites75.3%
lift-/.f64N/A
metadata-eval75.3
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6475.3
Applied rewrites75.3%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6482.1
Applied rewrites82.1%
if -1.999999999999994e-310 < l Initial program 72.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites73.8%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6473.8
Applied rewrites73.8%
lift-/.f64N/A
metadata-eval73.8
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
pow1/2N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
pow1/2N/A
lower-sqrt.f6481.3
Applied rewrites81.3%
Final simplification81.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (/ (* M (* D 0.5)) (* d 2.0)) l))
(t_1 (sqrt (/ d l)))
(t_2 (/ (* M D) (* d 2.0))))
(if (<= d 3.7e-296)
(* (* (sqrt (/ d h)) t_1) (- 1.0 (* t_0 (* h t_2))))
(* (+ 1.0 (* t_0 (/ t_2 (/ -1.0 h)))) (* (/ (sqrt d) (sqrt h)) t_1)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * (D * 0.5)) / (d * 2.0)) / l;
double t_1 = sqrt((d / l));
double t_2 = (M * D) / (d * 2.0);
double tmp;
if (d <= 3.7e-296) {
tmp = (sqrt((d / h)) * t_1) * (1.0 - (t_0 * (h * t_2)));
} else {
tmp = (1.0 + (t_0 * (t_2 / (-1.0 / h)))) * ((sqrt(d) / sqrt(h)) * t_1);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ((m * (d_1 * 0.5d0)) / (d * 2.0d0)) / l
t_1 = sqrt((d / l))
t_2 = (m * d_1) / (d * 2.0d0)
if (d <= 3.7d-296) then
tmp = (sqrt((d / h)) * t_1) * (1.0d0 - (t_0 * (h * t_2)))
else
tmp = (1.0d0 + (t_0 * (t_2 / ((-1.0d0) / h)))) * ((sqrt(d) / sqrt(h)) * t_1)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * (D * 0.5)) / (d * 2.0)) / l;
double t_1 = Math.sqrt((d / l));
double t_2 = (M * D) / (d * 2.0);
double tmp;
if (d <= 3.7e-296) {
tmp = (Math.sqrt((d / h)) * t_1) * (1.0 - (t_0 * (h * t_2)));
} else {
tmp = (1.0 + (t_0 * (t_2 / (-1.0 / h)))) * ((Math.sqrt(d) / Math.sqrt(h)) * t_1);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = ((M * (D * 0.5)) / (d * 2.0)) / l t_1 = math.sqrt((d / l)) t_2 = (M * D) / (d * 2.0) tmp = 0 if d <= 3.7e-296: tmp = (math.sqrt((d / h)) * t_1) * (1.0 - (t_0 * (h * t_2))) else: tmp = (1.0 + (t_0 * (t_2 / (-1.0 / h)))) * ((math.sqrt(d) / math.sqrt(h)) * t_1) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(M * Float64(D * 0.5)) / Float64(d * 2.0)) / l) t_1 = sqrt(Float64(d / l)) t_2 = Float64(Float64(M * D) / Float64(d * 2.0)) tmp = 0.0 if (d <= 3.7e-296) tmp = Float64(Float64(sqrt(Float64(d / h)) * t_1) * Float64(1.0 - Float64(t_0 * Float64(h * t_2)))); else tmp = Float64(Float64(1.0 + Float64(t_0 * Float64(t_2 / Float64(-1.0 / h)))) * Float64(Float64(sqrt(d) / sqrt(h)) * t_1)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = ((M * (D * 0.5)) / (d * 2.0)) / l; t_1 = sqrt((d / l)); t_2 = (M * D) / (d * 2.0); tmp = 0.0; if (d <= 3.7e-296) tmp = (sqrt((d / h)) * t_1) * (1.0 - (t_0 * (h * t_2))); else tmp = (1.0 + (t_0 * (t_2 / (-1.0 / h)))) * ((sqrt(d) / sqrt(h)) * t_1); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 3.7e-296], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] * N[(1.0 - N[(t$95$0 * N[(h * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(t$95$0 * N[(t$95$2 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{M \cdot \left(D \cdot 0.5\right)}{d \cdot 2}}{\ell}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \frac{M \cdot D}{d \cdot 2}\\
\mathbf{if}\;d \leq 3.7 \cdot 10^{-296}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot t\_1\right) \cdot \left(1 - t\_0 \cdot \left(h \cdot t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t\_0 \cdot \frac{t\_2}{\frac{-1}{h}}\right) \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_1\right)\\
\end{array}
\end{array}
if d < 3.70000000000000027e-296Initial program 72.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites73.9%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6473.9
Applied rewrites73.9%
lift-/.f64N/A
metadata-eval73.9
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6473.9
Applied rewrites73.9%
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
remove-double-divN/A
lower-*.f6473.9
Applied rewrites73.9%
if 3.70000000000000027e-296 < d Initial program 73.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites75.2%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6475.2
Applied rewrites75.2%
lift-/.f64N/A
metadata-eval75.2
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
pow1/2N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
pow1/2N/A
lower-sqrt.f6483.0
Applied rewrites83.0%
Final simplification78.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -6.2e-58)
(fma
d
(- (sqrt (/ 1.0 (* h l))))
(* (* D (/ (* D (* M M)) d)) (* 0.125 (sqrt (/ h (* l (* l l)))))))
(if (<= l -4.3e-290)
(* (/ (sqrt (/ h l)) (sqrt (* l l))) (* (* M (* M (* D D))) (/ 0.125 d)))
(if (<= l 1.2e+207)
(/
(* d (fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0))
(sqrt (* h l)))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6.2e-58) {
tmp = fma(d, -sqrt((1.0 / (h * l))), ((D * ((D * (M * M)) / d)) * (0.125 * sqrt((h / (l * (l * l)))))));
} else if (l <= -4.3e-290) {
tmp = (sqrt((h / l)) / sqrt((l * l))) * ((M * (M * (D * D))) * (0.125 / d));
} else if (l <= 1.2e+207) {
tmp = (d * fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0)) / sqrt((h * l));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6.2e-58) tmp = fma(d, Float64(-sqrt(Float64(1.0 / Float64(h * l)))), Float64(Float64(D * Float64(Float64(D * Float64(M * M)) / d)) * Float64(0.125 * sqrt(Float64(h / Float64(l * Float64(l * l))))))); elseif (l <= -4.3e-290) tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(M * Float64(M * Float64(D * D))) * Float64(0.125 / d))); elseif (l <= 1.2e+207) tmp = Float64(Float64(d * fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0)) / sqrt(Float64(h * l))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6.2e-58], N[(d * (-N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) + N[(N[(D * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(0.125 * N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.3e-290], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.2e+207], N[(N[(d * N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.2 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(d, -\sqrt{\frac{1}{h \cdot \ell}}, \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{d}\right) \cdot \left(0.125 \cdot \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\right)\right)\\
\mathbf{elif}\;\ell \leq -4.3 \cdot 10^{-290}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\
\mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+207}:\\
\;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -6.1999999999999998e-58Initial program 70.9%
Applied rewrites27.8%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites12.7%
Taylor expanded in l around -inf
Applied rewrites64.7%
if -6.1999999999999998e-58 < l < -4.3000000000000002e-290Initial program 75.7%
Applied rewrites17.6%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites42.6%
Applied rewrites46.0%
if -4.3000000000000002e-290 < l < 1.2e207Initial program 77.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites79.1%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6479.1
Applied rewrites79.1%
Applied rewrites67.0%
if 1.2e207 < l Initial program 51.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6462.1
Applied rewrites62.1%
Applied rewrites62.3%
Applied rewrites79.2%
Final simplification62.9%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.3e-57)
(-
(* (sqrt (/ h (* l (* l l)))) (* (* D (* D (* M M))) (/ 0.125 d)))
(* d (sqrt (/ 1.0 (* h l)))))
(if (<= l -4.3e-290)
(* (/ (sqrt (/ h l)) (sqrt (* l l))) (* (* M (* M (* D D))) (/ 0.125 d)))
(if (<= l 1.2e+207)
(/
(* d (fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0))
(sqrt (* h l)))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.3e-57) {
tmp = (sqrt((h / (l * (l * l)))) * ((D * (D * (M * M))) * (0.125 / d))) - (d * sqrt((1.0 / (h * l))));
} else if (l <= -4.3e-290) {
tmp = (sqrt((h / l)) / sqrt((l * l))) * ((M * (M * (D * D))) * (0.125 / d));
} else if (l <= 1.2e+207) {
tmp = (d * fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0)) / sqrt((h * l));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.3e-57) tmp = Float64(Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(0.125 / d))) - Float64(d * sqrt(Float64(1.0 / Float64(h * l))))); elseif (l <= -4.3e-290) tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(M * Float64(M * Float64(D * D))) * Float64(0.125 / d))); elseif (l <= 1.2e+207) tmp = Float64(Float64(d * fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0)) / sqrt(Float64(h * l))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.3e-57], N[(N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -4.3e-290], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.2e+207], N[(N[(d * N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.3 \cdot 10^{-57}:\\
\;\;\;\;\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) - d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq -4.3 \cdot 10^{-290}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\
\mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+207}:\\
\;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.29999999999999993e-57Initial program 70.5%
Taylor expanded in l around -inf
Applied rewrites62.7%
if -1.29999999999999993e-57 < l < -4.3000000000000002e-290Initial program 76.1%
Applied rewrites17.3%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites42.0%
Applied rewrites45.4%
if -4.3000000000000002e-290 < l < 1.2e207Initial program 77.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites79.1%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6479.1
Applied rewrites79.1%
Applied rewrites67.0%
if 1.2e207 < l Initial program 51.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6462.1
Applied rewrites62.1%
Applied rewrites62.3%
Applied rewrites79.2%
Final simplification62.1%
(FPCore (d h l M D)
:precision binary64
(if (<= d -4.5e+38)
(* (- d) (sqrt (/ 1.0 (* h l))))
(if (<= d -5.1e-133)
(*
(fma (/ (* M (* D (* M D))) (* 4.0 (* d d))) (* (/ h l) -0.5) 1.0)
(sqrt (/ (* d d) (* h l))))
(if (<= d -5e-310)
(*
(/ (sqrt (/ h l)) (sqrt (* l l)))
(* (* M (* M (* D D))) (/ 0.125 d)))
(/
(* d (fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0))
(sqrt (* h l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4.5e+38) {
tmp = -d * sqrt((1.0 / (h * l)));
} else if (d <= -5.1e-133) {
tmp = fma(((M * (D * (M * D))) / (4.0 * (d * d))), ((h / l) * -0.5), 1.0) * sqrt(((d * d) / (h * l)));
} else if (d <= -5e-310) {
tmp = (sqrt((h / l)) / sqrt((l * l))) * ((M * (M * (D * D))) * (0.125 / d));
} else {
tmp = (d * fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0)) / sqrt((h * l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -4.5e+38) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (d <= -5.1e-133) 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 <= -5e-310) tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(M * Float64(M * Float64(D * D))) * Float64(0.125 / d))); else tmp = Float64(Float64(d * fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0)) / sqrt(Float64(h * l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4.5e+38], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5.1e-133], 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, -5e-310], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4.5 \cdot 10^{+38}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq -5.1 \cdot 10^{-133}:\\
\;\;\;\;\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 -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \left(\left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{0.125}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -4.4999999999999998e38Initial program 76.5%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6463.5
Applied rewrites63.5%
if -4.4999999999999998e38 < d < -5.0999999999999999e-133Initial program 83.6%
Applied rewrites63.0%
if -5.0999999999999999e-133 < d < -4.999999999999985e-310Initial program 61.0%
Applied rewrites8.0%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites41.7%
Applied rewrites51.9%
if -4.999999999999985e-310 < d Initial program 72.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites73.8%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6473.8
Applied rewrites73.8%
Applied rewrites61.8%
Final simplification60.9%
(FPCore (d h l M D)
:precision binary64
(if (<= d -1.02e-71)
(* (- d) (sqrt (/ 1.0 (* h l))))
(if (<= d -5e-310)
(* (/ (sqrt (/ h l)) (sqrt (* l l))) (/ (* D (* M (* M D))) (* d 8.0)))
(if (<= d 2.55e-172)
(* (sqrt (/ h (* l (* l l)))) (* (* D D) (/ (* -0.125 (* M M)) d)))
(*
(fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0)
(/ d (sqrt (* h l))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.02e-71) {
tmp = -d * sqrt((1.0 / (h * l)));
} else if (d <= -5e-310) {
tmp = (sqrt((h / l)) / sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0));
} else if (d <= 2.55e-172) {
tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
} else {
tmp = fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0) * (d / sqrt((h * l)));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.02e-71) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(D * Float64(M * Float64(M * D))) / Float64(d * 8.0))); elseif (d <= 2.55e-172) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d))); else tmp = Float64(fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0) * Float64(d / sqrt(Float64(h * l)))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.02e-71], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.55e-172], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\
\mathbf{elif}\;d \leq 2.55 \cdot 10^{-172}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -1.0200000000000001e-71Initial program 78.7%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6460.2
Applied rewrites60.2%
if -1.0200000000000001e-71 < d < -4.999999999999985e-310Initial program 65.5%
Applied rewrites20.5%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites40.8%
Applied rewrites49.2%
Applied rewrites57.2%
if -4.999999999999985e-310 < d < 2.5499999999999999e-172Initial program 46.1%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites43.7%
if 2.5499999999999999e-172 < d Initial program 84.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites86.8%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6486.8
Applied rewrites86.8%
Applied rewrites74.8%
Final simplification61.9%
(FPCore (d h l M D)
:precision binary64
(if (<= d -1.02e-71)
(* (- d) (sqrt (/ 1.0 (* h l))))
(if (<= d -5e-310)
(* (/ (sqrt (/ h l)) (sqrt (* l l))) (/ (* D (* M (* M D))) (* d 8.0)))
(if (<= d 2.55e-172)
(* (sqrt (/ h (* l (* l l)))) (* (* D D) (/ (* -0.125 (* M M)) d)))
(*
(- 1.0 (* (/ h l) (* (* M D) (* 0.125 (* M (/ D (* d d)))))))
(/ d (sqrt (* h l))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.02e-71) {
tmp = -d * sqrt((1.0 / (h * l)));
} else if (d <= -5e-310) {
tmp = (sqrt((h / l)) / sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0));
} else if (d <= 2.55e-172) {
tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
} else {
tmp = (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))) * (d / sqrt((h * l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-1.02d-71)) then
tmp = -d * sqrt((1.0d0 / (h * l)))
else if (d <= (-5d-310)) then
tmp = (sqrt((h / l)) / sqrt((l * l))) * ((d_1 * (m * (m * d_1))) / (d * 8.0d0))
else if (d <= 2.55d-172) then
tmp = sqrt((h / (l * (l * l)))) * ((d_1 * d_1) * (((-0.125d0) * (m * m)) / d))
else
tmp = (1.0d0 - ((h / l) * ((m * d_1) * (0.125d0 * (m * (d_1 / (d * d))))))) * (d / sqrt((h * l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.02e-71) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else if (d <= -5e-310) {
tmp = (Math.sqrt((h / l)) / Math.sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0));
} else if (d <= 2.55e-172) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d));
} else {
tmp = (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))) * (d / Math.sqrt((h * l)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -1.02e-71: tmp = -d * math.sqrt((1.0 / (h * l))) elif d <= -5e-310: tmp = (math.sqrt((h / l)) / math.sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0)) elif d <= 2.55e-172: tmp = math.sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d)) else: tmp = (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))) * (d / math.sqrt((h * l))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.02e-71) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(D * Float64(M * Float64(M * D))) / Float64(d * 8.0))); elseif (d <= 2.55e-172) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * M)) / d))); else tmp = Float64(Float64(1.0 - Float64(Float64(h / l) * Float64(Float64(M * D) * Float64(0.125 * Float64(M * Float64(D / Float64(d * d))))))) * Float64(d / sqrt(Float64(h * l)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -1.02e-71) tmp = -d * sqrt((1.0 / (h * l))); elseif (d <= -5e-310) tmp = (sqrt((h / l)) / sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0)); elseif (d <= 2.55e-172) tmp = sqrt((h / (l * (l * l)))) * ((D * D) * ((-0.125 * (M * M)) / d)); else tmp = (1.0 - ((h / l) * ((M * D) * (0.125 * (M * (D / (d * d))))))) * (d / sqrt((h * l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.02e-71], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.55e-172], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(0.125 * N[(M * N[(D / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\
\mathbf{elif}\;d \leq 2.55 \cdot 10^{-172}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(M \cdot M\right)}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot \left(0.125 \cdot \left(M \cdot \frac{D}{d \cdot d}\right)\right)\right)\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -1.0200000000000001e-71Initial program 78.7%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6460.2
Applied rewrites60.2%
if -1.0200000000000001e-71 < d < -4.999999999999985e-310Initial program 65.5%
Applied rewrites20.5%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites40.8%
Applied rewrites49.2%
Applied rewrites57.2%
if -4.999999999999985e-310 < d < 2.5499999999999999e-172Initial program 46.1%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r/N/A
associate-*r/N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites43.7%
if 2.5499999999999999e-172 < d Initial program 84.5%
Applied rewrites31.9%
Applied rewrites75.8%
Final simplification62.3%
(FPCore (d h l M D)
:precision binary64
(if (<= d -1.02e-71)
(* (- d) (sqrt (/ 1.0 (* h l))))
(if (<= d -5e-310)
(* (/ (sqrt (/ h l)) (sqrt (* l l))) (/ (* D (* M (* M D))) (* d 8.0)))
(/
(* d (fma (* D (* M (* 0.125 (* D (/ M (* d d)))))) (/ (- h) l) 1.0))
(sqrt (* h l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.02e-71) {
tmp = -d * sqrt((1.0 / (h * l)));
} else if (d <= -5e-310) {
tmp = (sqrt((h / l)) / sqrt((l * l))) * ((D * (M * (M * D))) / (d * 8.0));
} else {
tmp = (d * fma((D * (M * (0.125 * (D * (M / (d * d)))))), (-h / l), 1.0)) / sqrt((h * l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.02e-71) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); elseif (d <= -5e-310) tmp = Float64(Float64(sqrt(Float64(h / l)) / sqrt(Float64(l * l))) * Float64(Float64(D * Float64(M * Float64(M * D))) / Float64(d * 8.0))); else tmp = Float64(Float64(d * fma(Float64(D * Float64(M * Float64(0.125 * Float64(D * Float64(M / Float64(d * d)))))), Float64(Float64(-h) / l), 1.0)) / sqrt(Float64(h * l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.02e-71], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-310], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * N[(N[(D * N[(M * N[(0.125 * N[(D * N[(M / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-h) / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.02 \cdot 10^{-71}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\sqrt{\ell \cdot \ell}} \cdot \frac{D \cdot \left(M \cdot \left(M \cdot D\right)\right)}{d \cdot 8}\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot \mathsf{fma}\left(D \cdot \left(M \cdot \left(0.125 \cdot \left(D \cdot \frac{M}{d \cdot d}\right)\right)\right), \frac{-h}{\ell}, 1\right)}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -1.0200000000000001e-71Initial program 78.7%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6460.2
Applied rewrites60.2%
if -1.0200000000000001e-71 < d < -4.999999999999985e-310Initial program 65.5%
Applied rewrites20.5%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
Applied rewrites40.8%
Applied rewrites49.2%
Applied rewrites57.2%
if -4.999999999999985e-310 < d Initial program 72.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites73.8%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6473.8
Applied rewrites73.8%
Applied rewrites61.8%
Final simplification60.4%
(FPCore (d h l M D) :precision binary64 (if (<= l 6.7e-249) (* (- d) (sqrt (/ 1.0 (* h l)))) (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 6.7e-249) {
tmp = -d * sqrt((1.0 / (h * l)));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 6.7d-249) then
tmp = -d * sqrt((1.0d0 / (h * l)))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 6.7e-249) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 6.7e-249: tmp = -d * math.sqrt((1.0 / (h * l))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 6.7e-249) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 6.7e-249) tmp = -d * sqrt((1.0 / (h * l))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 6.7e-249], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.7 \cdot 10^{-249}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < 6.6999999999999998e-249Initial program 75.2%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6446.4
Applied rewrites46.4%
if 6.6999999999999998e-249 < l Initial program 70.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.5
Applied rewrites43.5%
Applied rewrites43.6%
Applied rewrites47.7%
Final simplification47.0%
(FPCore (d h l M D) :precision binary64 (if (<= l 6.7e-249) (* (- d) (sqrt (/ 1.0 (* h l)))) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 6.7e-249) {
tmp = -d * sqrt((1.0 / (h * l)));
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 6.7d-249) then
tmp = -d * sqrt((1.0d0 / (h * l)))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 6.7e-249) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 6.7e-249: tmp = -d * math.sqrt((1.0 / (h * l))) else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 6.7e-249) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 6.7e-249) tmp = -d * sqrt((1.0 / (h * l))); else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 6.7e-249], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.7 \cdot 10^{-249}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if l < 6.6999999999999998e-249Initial program 75.2%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6446.4
Applied rewrites46.4%
if 6.6999999999999998e-249 < l Initial program 70.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.5
Applied rewrites43.5%
Applied rewrites43.6%
Final simplification45.1%
(FPCore (d h l M D) :precision binary64 (if (<= d -1.65e-193) (sqrt (* d (/ d (* h l)))) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.65e-193) {
tmp = sqrt((d * (d / (h * l))));
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-1.65d-193)) then
tmp = sqrt((d * (d / (h * l))))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.65e-193) {
tmp = Math.sqrt((d * (d / (h * l))));
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -1.65e-193: tmp = math.sqrt((d * (d / (h * l)))) else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.65e-193) tmp = sqrt(Float64(d * Float64(d / Float64(h * l)))); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -1.65e-193) tmp = sqrt((d * (d / (h * l)))); else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.65e-193], N[Sqrt[N[(d * N[(d / N[(h * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.65 \cdot 10^{-193}:\\
\;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -1.6499999999999999e-193Initial program 79.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f645.2
Applied rewrites5.2%
Applied rewrites34.4%
Applied rewrites40.2%
if -1.6499999999999999e-193 < d Initial program 68.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6437.1
Applied rewrites37.1%
Applied rewrites37.1%
Final simplification38.3%
(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}
Initial program 72.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6424.8
Applied rewrites24.8%
Applied rewrites24.8%
herbie shell --seed 2024232
(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)))))