
(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 35 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 (sqrt (- d)))
(t_1
(+
1.0
(*
(/ (/ (* M (* D 0.5)) (* d 2.0)) l)
(/ (/ (* M D) (* d 2.0)) (/ -1.0 h)))))
(t_2 (pow (/ d l) (/ 1.0 2.0))))
(if (<= l -1.15e+122)
(* (* (sqrt (/ d h)) (/ t_0 (sqrt (- l)))) t_1)
(if (<= l -5e-310)
(* t_1 (* (* t_0 (sqrt (/ -1.0 h))) t_2))
(* t_1 (* t_2 (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double t_1 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
double t_2 = pow((d / l), (1.0 / 2.0));
double tmp;
if (l <= -1.15e+122) {
tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * t_1;
} else if (l <= -5e-310) {
tmp = t_1 * ((t_0 * sqrt((-1.0 / h))) * t_2);
} else {
tmp = t_1 * (t_2 * (sqrt(d) / sqrt(h)));
}
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 = sqrt(-d)
t_1 = 1.0d0 + ((((m * (d_1 * 0.5d0)) / (d * 2.0d0)) / l) * (((m * d_1) / (d * 2.0d0)) / ((-1.0d0) / h)))
t_2 = (d / l) ** (1.0d0 / 2.0d0)
if (l <= (-1.15d+122)) then
tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * t_1
else if (l <= (-5d-310)) then
tmp = t_1 * ((t_0 * sqrt(((-1.0d0) / h))) * t_2)
else
tmp = t_1 * (t_2 * (sqrt(d) / sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(-d);
double t_1 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
double t_2 = Math.pow((d / l), (1.0 / 2.0));
double tmp;
if (l <= -1.15e+122) {
tmp = (Math.sqrt((d / h)) * (t_0 / Math.sqrt(-l))) * t_1;
} else if (l <= -5e-310) {
tmp = t_1 * ((t_0 * Math.sqrt((-1.0 / h))) * t_2);
} else {
tmp = t_1 * (t_2 * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) t_1 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h))) t_2 = math.pow((d / l), (1.0 / 2.0)) tmp = 0 if l <= -1.15e+122: tmp = (math.sqrt((d / h)) * (t_0 / math.sqrt(-l))) * t_1 elif l <= -5e-310: tmp = t_1 * ((t_0 * math.sqrt((-1.0 / h))) * t_2) else: tmp = t_1 * (t_2 * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) t_1 = 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)))) t_2 = Float64(d / l) ^ Float64(1.0 / 2.0) tmp = 0.0 if (l <= -1.15e+122) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(t_0 / sqrt(Float64(-l)))) * t_1); elseif (l <= -5e-310) tmp = Float64(t_1 * Float64(Float64(t_0 * sqrt(Float64(-1.0 / h))) * t_2)); else tmp = Float64(t_1 * Float64(t_2 * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); t_1 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h))); t_2 = (d / l) ^ (1.0 / 2.0); tmp = 0.0; if (l <= -1.15e+122) tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * t_1; elseif (l <= -5e-310) tmp = t_1 * ((t_0 * sqrt((-1.0 / h))) * t_2); else tmp = t_1 * (t_2 * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.15e+122], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, -5e-310], N[(t$95$1 * N[(N[(t$95$0 * N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$2 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := 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}}\\
t_2 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\\
\mathbf{if}\;\ell \leq -1.15 \cdot 10^{+122}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{t\_0}{\sqrt{-\ell}}\right) \cdot t\_1\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot \left(\left(t\_0 \cdot \sqrt{\frac{-1}{h}}\right) \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if l < -1.15e122Initial program 37.0%
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 rewrites49.4%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f6449.4
Applied rewrites49.4%
lift-/.f64N/A
metadata-eval49.4
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6449.4
Applied rewrites49.4%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6472.9
Applied rewrites72.9%
if -1.15e122 < l < -4.999999999999985e-310Initial program 71.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.6%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
div-invN/A
distribute-neg-frac2N/A
lift-/.f64N/A
sqrt-prodN/A
lift-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6485.9
Applied rewrites85.9%
if -4.999999999999985e-310 < l Initial program 61.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 rewrites65.4%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lower-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f6478.5
Applied rewrites78.5%
Final simplification80.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
(t_1 (sqrt (/ d l))))
(if (<= t_0 -1e-157)
(*
(fma
(/ (* h (* M D)) (* d 2.0))
(/ (* (* M D) -0.5) (* l (* d 2.0)))
1.0)
(* (sqrt (/ d h)) t_1))
(if (<= t_0 0.0)
(/ 1.0 (/ (sqrt (* l h)) d))
(if (<= t_0 INFINITY)
(/ t_1 (sqrt (/ h d)))
(/
(*
(sqrt (- d))
(*
(/ (* (* M (* D (* M D))) (- -0.125)) l)
(sqrt (/ h (* d (* d d))))))
(sqrt (- l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = sqrt((d / l));
double tmp;
if (t_0 <= -1e-157) {
tmp = fma(((h * (M * D)) / (d * 2.0)), (((M * D) * -0.5) / (l * (d * 2.0))), 1.0) * (sqrt((d / h)) * t_1);
} else if (t_0 <= 0.0) {
tmp = 1.0 / (sqrt((l * h)) / d);
} else if (t_0 <= ((double) INFINITY)) {
tmp = t_1 / sqrt((h / d));
} else {
tmp = (sqrt(-d) * ((((M * (D * (M * D))) * -(-0.125)) / l) * sqrt((h / (d * (d * d)))))) / sqrt(-l);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (t_0 <= -1e-157) tmp = Float64(fma(Float64(Float64(h * Float64(M * D)) / Float64(d * 2.0)), Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0))), 1.0) * Float64(sqrt(Float64(d / h)) * t_1)); elseif (t_0 <= 0.0) tmp = Float64(1.0 / Float64(sqrt(Float64(l * h)) / d)); elseif (t_0 <= Inf) tmp = Float64(t_1 / sqrt(Float64(h / d))); else tmp = Float64(Float64(sqrt(Float64(-d)) * Float64(Float64(Float64(Float64(M * Float64(D * Float64(M * D))) * Float64(-(-0.125))) / l) * sqrt(Float64(h / Float64(d * Float64(d * d)))))) / sqrt(Float64(-l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -1e-157], N[(N[(N[(N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(1.0 / N[(N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(t$95$1 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[(N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (--0.125)), $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(h / N[(d * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-157}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}, \frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_1\right)\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot h}}{d}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{t\_1}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \left(\frac{\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot \left(--0.125\right)}{\ell} \cdot \sqrt{\frac{h}{d \cdot \left(d \cdot d\right)}}\right)}{\sqrt{-\ell}}\\
\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)))) < -9.99999999999999943e-158Initial program 81.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.6%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f6486.6
Applied rewrites86.6%
lift-/.f64N/A
metadata-eval86.6
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6486.6
Applied rewrites86.6%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites82.1%
if -9.99999999999999943e-158 < (*.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 20.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6450.8
Applied rewrites50.8%
Applied rewrites50.8%
Applied rewrites50.9%
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)))) < +inf.0Initial program 84.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6436.5
Applied rewrites36.5%
Applied rewrites85.6%
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%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites0.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites14.2%
Applied rewrites18.3%
Final simplification67.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_1 -1e-62)
(*
t_0
(*
(sqrt (/ d h))
(-
1.0
(* h (/ (* (* M (* D 0.5)) (* M D)) (* (* d 2.0) (* l (* d 2.0))))))))
(if (<= t_1 2e-208)
(fma
-0.125
(* M (* (/ M d) (* D (* (sqrt (/ h (* l (* l l)))) (- D)))))
(* (- d) (sqrt (/ 1.0 (* l h)))))
(if (<= t_1 INFINITY)
(/ t_0 (sqrt (/ h d)))
(/
(*
(sqrt (- d))
(*
(/ (* (* M (* D (* M D))) (- -0.125)) l)
(sqrt (/ h (* d (* d d))))))
(sqrt (- l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= -1e-62) {
tmp = t_0 * (sqrt((d / h)) * (1.0 - (h * (((M * (D * 0.5)) * (M * D)) / ((d * 2.0) * (l * (d * 2.0)))))));
} else if (t_1 <= 2e-208) {
tmp = fma(-0.125, (M * ((M / d) * (D * (sqrt((h / (l * (l * l)))) * -D)))), (-d * sqrt((1.0 / (l * h)))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_0 / sqrt((h / d));
} else {
tmp = (sqrt(-d) * ((((M * (D * (M * D))) * -(-0.125)) / l) * sqrt((h / (d * (d * d)))))) / sqrt(-l);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) tmp = 0.0 if (t_1 <= -1e-62) tmp = Float64(t_0 * Float64(sqrt(Float64(d / h)) * Float64(1.0 - Float64(h * Float64(Float64(Float64(M * Float64(D * 0.5)) * Float64(M * D)) / Float64(Float64(d * 2.0) * Float64(l * Float64(d * 2.0)))))))); elseif (t_1 <= 2e-208) tmp = fma(-0.125, Float64(M * Float64(Float64(M / d) * Float64(D * Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(-D))))), Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h))))); elseif (t_1 <= Inf) tmp = Float64(t_0 / sqrt(Float64(h / d))); else tmp = Float64(Float64(sqrt(Float64(-d)) * Float64(Float64(Float64(Float64(M * Float64(D * Float64(M * D))) * Float64(-(-0.125))) / l) * sqrt(Float64(h / Float64(d * Float64(d * d)))))) / sqrt(Float64(-l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-62], N[(t$95$0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(h * N[(N[(N[(M * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(N[(d * 2.0), $MachinePrecision] * N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-208], N[(-0.125 * N[(M * N[(N[(M / d), $MachinePrecision] * N[(D * N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-D)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(t$95$0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[(N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (--0.125)), $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(h / N[(d * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-62}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - h \cdot \frac{\left(M \cdot \left(D \cdot 0.5\right)\right) \cdot \left(M \cdot D\right)}{\left(d \cdot 2\right) \cdot \left(\ell \cdot \left(d \cdot 2\right)\right)}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-208}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, M \cdot \left(\frac{M}{d} \cdot \left(D \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(-D\right)\right)\right)\right), \left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \left(\frac{\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot \left(--0.125\right)}{\ell} \cdot \sqrt{\frac{h}{d \cdot \left(d \cdot d\right)}}\right)}{\sqrt{-\ell}}\\
\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)))) < -1e-62Initial program 80.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites71.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
metadata-evalN/A
frac-timesN/A
associate-/r*N/A
lift-*.f64N/A
times-fracN/A
div-invN/A
lift-*.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l*N/A
Applied rewrites79.7%
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
Applied rewrites75.9%
if -1e-62 < (*.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.0000000000000002e-208Initial program 40.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites25.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites0.7%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites41.8%
Applied rewrites50.0%
if 2.0000000000000002e-208 < (*.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 83.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6437.5
Applied rewrites37.5%
Applied rewrites85.8%
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%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites0.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites14.2%
Applied rewrites18.3%
Final simplification64.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_1 -2e-100)
(*
t_0
(*
(sqrt (/ d h))
(fma (* (* M D) (* (* M D) (/ 0.25 (* d d)))) (* -0.5 (/ h l)) 1.0)))
(if (<= t_1 2e-208)
(fma
-0.125
(* M (* (/ M d) (* D (* (sqrt (/ h (* l (* l l)))) (- D)))))
(* (- d) (sqrt (/ 1.0 (* l h)))))
(if (<= t_1 INFINITY)
(/ t_0 (sqrt (/ h d)))
(/
(*
(sqrt (- d))
(*
(/ (* (* M (* D (* M D))) (- -0.125)) l)
(sqrt (/ h (* d (* d d))))))
(sqrt (- l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (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-100) {
tmp = t_0 * (sqrt((d / h)) * fma(((M * D) * ((M * D) * (0.25 / (d * d)))), (-0.5 * (h / l)), 1.0));
} else if (t_1 <= 2e-208) {
tmp = fma(-0.125, (M * ((M / d) * (D * (sqrt((h / (l * (l * l)))) * -D)))), (-d * sqrt((1.0 / (l * h)))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_0 / sqrt((h / d));
} else {
tmp = (sqrt(-d) * ((((M * (D * (M * D))) * -(-0.125)) / l) * sqrt((h / (d * (d * d)))))) / sqrt(-l);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ 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-100) tmp = Float64(t_0 * Float64(sqrt(Float64(d / h)) * fma(Float64(Float64(M * D) * Float64(Float64(M * D) * Float64(0.25 / Float64(d * d)))), Float64(-0.5 * Float64(h / l)), 1.0))); elseif (t_1 <= 2e-208) tmp = fma(-0.125, Float64(M * Float64(Float64(M / d) * Float64(D * Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(-D))))), Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h))))); elseif (t_1 <= Inf) tmp = Float64(t_0 / sqrt(Float64(h / d))); else tmp = Float64(Float64(sqrt(Float64(-d)) * Float64(Float64(Float64(Float64(M * Float64(D * Float64(M * D))) * Float64(-(-0.125))) / l) * sqrt(Float64(h / Float64(d * Float64(d * d)))))) / sqrt(Float64(-l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $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-100], N[(t$95$0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(0.25 / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-208], N[(-0.125 * N[(M * N[(N[(M / d), $MachinePrecision] * N[(D * N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-D)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(t$95$0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[(N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (--0.125)), $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(h / N[(d * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\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^{-100}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\left(M \cdot D\right) \cdot \left(\left(M \cdot D\right) \cdot \frac{0.25}{d \cdot d}\right), -0.5 \cdot \frac{h}{\ell}, 1\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-208}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, M \cdot \left(\frac{M}{d} \cdot \left(D \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(-D\right)\right)\right)\right), \left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \left(\frac{\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot \left(--0.125\right)}{\ell} \cdot \sqrt{\frac{h}{d \cdot \left(d \cdot d\right)}}\right)}{\sqrt{-\ell}}\\
\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)))) < -2e-100Initial program 81.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites71.9%
lift-/.f64N/A
div-invN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
lower-/.f6474.2
Applied rewrites74.2%
if -2e-100 < (*.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.0000000000000002e-208Initial program 37.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites26.4%
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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites0.7%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites43.6%
Applied rewrites52.0%
if 2.0000000000000002e-208 < (*.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 83.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6437.5
Applied rewrites37.5%
Applied rewrites85.8%
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%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites0.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites14.2%
Applied rewrites18.3%
Final simplification64.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
(t_2 (* M (* D (* M D)))))
(if (<= t_1 -1e-62)
(*
t_0
(* (sqrt (/ d h)) (- 1.0 (* (* t_2 0.25) (/ (* h 0.5) (* l (* d d)))))))
(if (<= t_1 2e-208)
(fma
-0.125
(* M (* (/ M d) (* D (* (sqrt (/ h (* l (* l l)))) (- D)))))
(* (- d) (sqrt (/ 1.0 (* l h)))))
(if (<= t_1 INFINITY)
(/ t_0 (sqrt (/ h d)))
(/
(*
(sqrt (- d))
(* (/ (* t_2 (- -0.125)) l) (sqrt (/ h (* d (* d d))))))
(sqrt (- l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_2 = M * (D * (M * D));
double tmp;
if (t_1 <= -1e-62) {
tmp = t_0 * (sqrt((d / h)) * (1.0 - ((t_2 * 0.25) * ((h * 0.5) / (l * (d * d))))));
} else if (t_1 <= 2e-208) {
tmp = fma(-0.125, (M * ((M / d) * (D * (sqrt((h / (l * (l * l)))) * -D)))), (-d * sqrt((1.0 / (l * h)))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_0 / sqrt((h / d));
} else {
tmp = (sqrt(-d) * (((t_2 * -(-0.125)) / l) * sqrt((h / (d * (d * d)))))) / sqrt(-l);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ 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 = Float64(M * Float64(D * Float64(M * D))) tmp = 0.0 if (t_1 <= -1e-62) tmp = Float64(t_0 * Float64(sqrt(Float64(d / h)) * Float64(1.0 - Float64(Float64(t_2 * 0.25) * Float64(Float64(h * 0.5) / Float64(l * Float64(d * d))))))); elseif (t_1 <= 2e-208) tmp = fma(-0.125, Float64(M * Float64(Float64(M / d) * Float64(D * Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(-D))))), Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h))))); elseif (t_1 <= Inf) tmp = Float64(t_0 / sqrt(Float64(h / d))); else tmp = Float64(Float64(sqrt(Float64(-d)) * Float64(Float64(Float64(t_2 * Float64(-(-0.125))) / l) * sqrt(Float64(h / Float64(d * Float64(d * d)))))) / sqrt(Float64(-l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $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[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-62], N[(t$95$0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[(t$95$2 * 0.25), $MachinePrecision] * N[(N[(h * 0.5), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-208], N[(-0.125 * N[(M * N[(N[(M / d), $MachinePrecision] * N[(D * N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-D)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(t$95$0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[(N[(N[(t$95$2 * (--0.125)), $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(h / N[(d * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\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 := M \cdot \left(D \cdot \left(M \cdot D\right)\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-62}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - \left(t\_2 \cdot 0.25\right) \cdot \frac{h \cdot 0.5}{\ell \cdot \left(d \cdot d\right)}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-208}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, M \cdot \left(\frac{M}{d} \cdot \left(D \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(-D\right)\right)\right)\right), \left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \left(\frac{t\_2 \cdot \left(--0.125\right)}{\ell} \cdot \sqrt{\frac{h}{d \cdot \left(d \cdot d\right)}}\right)}{\sqrt{-\ell}}\\
\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)))) < -1e-62Initial program 80.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites71.6%
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
pow2N/A
metadata-evalN/A
Applied rewrites69.6%
if -1e-62 < (*.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.0000000000000002e-208Initial program 40.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites25.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites0.7%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites41.8%
Applied rewrites50.0%
if 2.0000000000000002e-208 < (*.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 83.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6437.5
Applied rewrites37.5%
Applied rewrites85.8%
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%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites0.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites14.2%
Applied rewrites18.3%
Final simplification62.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_1 -1e-62)
(*
t_0
(*
(sqrt (/ d h))
(- 1.0 (* (* (* M (* D (* M D))) 0.25) (/ (* h 0.5) (* l (* d d)))))))
(if (<= t_1 2e-208)
(fma
-0.125
(* M (* (/ M d) (* D (* (sqrt (/ h (* l (* l l)))) (- D)))))
(* (- d) (sqrt (/ 1.0 (* l h)))))
(if (<= t_1 INFINITY)
(/ t_0 (sqrt (/ h d)))
(/
(*
d
(+
1.0
(/ (* (* h -0.5) (* M (* M (* D D)))) (* l (* d (* d 4.0))))))
(sqrt (* l h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= -1e-62) {
tmp = t_0 * (sqrt((d / h)) * (1.0 - (((M * (D * (M * D))) * 0.25) * ((h * 0.5) / (l * (d * d))))));
} else if (t_1 <= 2e-208) {
tmp = fma(-0.125, (M * ((M / d) * (D * (sqrt((h / (l * (l * l)))) * -D)))), (-d * sqrt((1.0 / (l * h)))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_0 / sqrt((h / d));
} else {
tmp = (d * (1.0 + (((h * -0.5) * (M * (M * (D * D)))) / (l * (d * (d * 4.0)))))) / sqrt((l * h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) tmp = 0.0 if (t_1 <= -1e-62) tmp = Float64(t_0 * Float64(sqrt(Float64(d / h)) * Float64(1.0 - Float64(Float64(Float64(M * Float64(D * Float64(M * D))) * 0.25) * Float64(Float64(h * 0.5) / Float64(l * Float64(d * d))))))); elseif (t_1 <= 2e-208) tmp = fma(-0.125, Float64(M * Float64(Float64(M / d) * Float64(D * Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(-D))))), Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h))))); elseif (t_1 <= Inf) tmp = Float64(t_0 / sqrt(Float64(h / d))); else tmp = Float64(Float64(d * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * Float64(M * Float64(M * Float64(D * D)))) / Float64(l * Float64(d * Float64(d * 4.0)))))) / sqrt(Float64(l * h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-62], N[(t$95$0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision] * N[(N[(h * 0.5), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-208], N[(-0.125 * N[(M * N[(N[(M / d), $MachinePrecision] * N[(D * N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-D)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(t$95$0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(d * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-62}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - \left(\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot 0.25\right) \cdot \frac{h \cdot 0.5}{\ell \cdot \left(d \cdot d\right)}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-208}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, M \cdot \left(\frac{M}{d} \cdot \left(D \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(-D\right)\right)\right)\right), \left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot \left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right)}{\sqrt{\ell \cdot 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)))) < -1e-62Initial program 80.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites71.6%
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
pow2N/A
metadata-evalN/A
Applied rewrites69.6%
if -1e-62 < (*.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.0000000000000002e-208Initial program 40.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites25.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites0.7%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites41.8%
Applied rewrites50.0%
if 2.0000000000000002e-208 < (*.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 83.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6437.5
Applied rewrites37.5%
Applied rewrites85.8%
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%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites0.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
metadata-evalN/A
frac-timesN/A
associate-/r*N/A
lift-*.f64N/A
times-fracN/A
div-invN/A
lift-*.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l*N/A
Applied rewrites0.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
Applied rewrites17.1%
Final simplification62.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_1 -1e-62)
(*
(sqrt (/ d h))
(*
t_0
(fma (* M (* D (* M D))) (/ (* h -0.5) (* l (* (* d d) 4.0))) 1.0)))
(if (<= t_1 2e-208)
(fma
-0.125
(* M (* (/ M d) (* D (* (sqrt (/ h (* l (* l l)))) (- D)))))
(* (- d) (sqrt (/ 1.0 (* l h)))))
(if (<= t_1 INFINITY)
(/ t_0 (sqrt (/ h d)))
(/
(*
d
(+
1.0
(/ (* (* h -0.5) (* M (* M (* D D)))) (* l (* d (* d 4.0))))))
(sqrt (* l h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= -1e-62) {
tmp = sqrt((d / h)) * (t_0 * fma((M * (D * (M * D))), ((h * -0.5) / (l * ((d * d) * 4.0))), 1.0));
} else if (t_1 <= 2e-208) {
tmp = fma(-0.125, (M * ((M / d) * (D * (sqrt((h / (l * (l * l)))) * -D)))), (-d * sqrt((1.0 / (l * h)))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_0 / sqrt((h / d));
} else {
tmp = (d * (1.0 + (((h * -0.5) * (M * (M * (D * D)))) / (l * (d * (d * 4.0)))))) / sqrt((l * h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) tmp = 0.0 if (t_1 <= -1e-62) tmp = Float64(sqrt(Float64(d / h)) * Float64(t_0 * fma(Float64(M * Float64(D * Float64(M * D))), Float64(Float64(h * -0.5) / Float64(l * Float64(Float64(d * d) * 4.0))), 1.0))); elseif (t_1 <= 2e-208) tmp = fma(-0.125, Float64(M * Float64(Float64(M / d) * Float64(D * Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(-D))))), Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h))))); elseif (t_1 <= Inf) tmp = Float64(t_0 / sqrt(Float64(h / d))); else tmp = Float64(Float64(d * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * Float64(M * Float64(M * Float64(D * D)))) / Float64(l * Float64(d * Float64(d * 4.0)))))) / sqrt(Float64(l * h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-62], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-208], N[(-0.125 * N[(M * N[(N[(M / d), $MachinePrecision] * N[(D * N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-D)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(t$95$0 / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(d * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-62}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t\_0 \cdot \mathsf{fma}\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right), \frac{h \cdot -0.5}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}, 1\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-208}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, M \cdot \left(\frac{M}{d} \cdot \left(D \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(-D\right)\right)\right)\right), \left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot \left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right)}{\sqrt{\ell \cdot 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)))) < -1e-62Initial program 80.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites71.6%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
div-invN/A
associate-*l*N/A
Applied rewrites30.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6430.4
Applied rewrites69.6%
if -1e-62 < (*.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.0000000000000002e-208Initial program 40.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites25.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites0.7%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites41.8%
Applied rewrites50.0%
if 2.0000000000000002e-208 < (*.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 83.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6437.5
Applied rewrites37.5%
Applied rewrites85.8%
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%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites0.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
metadata-evalN/A
frac-timesN/A
associate-/r*N/A
lift-*.f64N/A
times-fracN/A
div-invN/A
lift-*.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l*N/A
Applied rewrites0.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
Applied rewrites17.1%
Final simplification62.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_0 0.0)
(* d (sqrt (sqrt (/ 1.0 (* h (* l (* l h)))))))
(if (<= t_0 INFINITY)
(/ (sqrt (/ d l)) (sqrt (/ h d)))
(* (- d) (sqrt (/ 1.0 (* l h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (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 <= 0.0) {
tmp = d * sqrt(sqrt((1.0 / (h * (l * (l * h))))));
} else if (t_0 <= ((double) INFINITY)) {
tmp = sqrt((d / l)) / sqrt((h / d));
} else {
tmp = -d * sqrt((1.0 / (l * h)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (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_0 <= 0.0) {
tmp = d * Math.sqrt(Math.sqrt((1.0 / (h * (l * (l * h))))));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
} else {
tmp = -d * Math.sqrt((1.0 / (l * h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (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_0 <= 0.0: tmp = d * math.sqrt(math.sqrt((1.0 / (h * (l * (l * h)))))) elif t_0 <= math.inf: tmp = math.sqrt((d / l)) / math.sqrt((h / d)) else: tmp = -d * math.sqrt((1.0 / (l * h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ 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 <= 0.0) tmp = Float64(d * sqrt(sqrt(Float64(1.0 / Float64(h * Float64(l * Float64(l * h))))))); elseif (t_0 <= Inf) tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d))); else tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_0 <= 0.0) tmp = d * sqrt(sqrt((1.0 / (h * (l * (l * h)))))); elseif (t_0 <= Inf) tmp = sqrt((d / l)) / sqrt((h / d)); else tmp = -d * sqrt((1.0 / (l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $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, 0.0], N[(d * N[Sqrt[N[Sqrt[N[(1.0 / N[(h * N[(l * N[(l * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\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 0:\\
\;\;\;\;d \cdot \sqrt{\sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(\ell \cdot h\right)\right)}}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\
\mathbf{else}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot 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)))) < 0.0Initial program 71.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6423.3
Applied rewrites23.3%
Applied rewrites27.8%
Applied rewrites27.8%
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)))) < +inf.0Initial program 84.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6436.5
Applied rewrites36.5%
Applied rewrites85.6%
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 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.f6414.7
Applied rewrites14.7%
Final simplification46.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_0 0.0)
(* d (sqrt (sqrt (/ 1.0 (* h (* l (* l h)))))))
(if (<= t_0 INFINITY)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(* (- d) (sqrt (/ 1.0 (* l h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (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 <= 0.0) {
tmp = d * sqrt(sqrt((1.0 / (h * (l * (l * h))))));
} else if (t_0 <= ((double) INFINITY)) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = -d * sqrt((1.0 / (l * h)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (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_0 <= 0.0) {
tmp = d * Math.sqrt(Math.sqrt((1.0 / (h * (l * (l * h))))));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = -d * Math.sqrt((1.0 / (l * h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (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_0 <= 0.0: tmp = d * math.sqrt(math.sqrt((1.0 / (h * (l * (l * h)))))) elif t_0 <= math.inf: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = -d * math.sqrt((1.0 / (l * h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ 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 <= 0.0) tmp = Float64(d * sqrt(sqrt(Float64(1.0 / Float64(h * Float64(l * Float64(l * h))))))); elseif (t_0 <= Inf) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_0 <= 0.0) tmp = d * sqrt(sqrt((1.0 / (h * (l * (l * h)))))); elseif (t_0 <= Inf) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = -d * sqrt((1.0 / (l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $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, 0.0], N[(d * N[Sqrt[N[Sqrt[N[(1.0 / N[(h * N[(l * N[(l * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\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 0:\\
\;\;\;\;d \cdot \sqrt{\sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(\ell \cdot h\right)\right)}}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot 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)))) < 0.0Initial program 71.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6423.3
Applied rewrites23.3%
Applied rewrites27.8%
Applied rewrites27.8%
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)))) < +inf.0Initial program 84.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites68.5%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6483.4
Applied rewrites83.4%
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 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.f6414.7
Applied rewrites14.7%
Final simplification45.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_0 0.0)
(* d (sqrt (sqrt (/ 1.0 (* l (* l (* h h)))))))
(if (<= t_0 INFINITY)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(* (- d) (sqrt (/ 1.0 (* l h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (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 <= 0.0) {
tmp = d * sqrt(sqrt((1.0 / (l * (l * (h * h))))));
} else if (t_0 <= ((double) INFINITY)) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = -d * sqrt((1.0 / (l * h)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (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_0 <= 0.0) {
tmp = d * Math.sqrt(Math.sqrt((1.0 / (l * (l * (h * h))))));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = -d * Math.sqrt((1.0 / (l * h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (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_0 <= 0.0: tmp = d * math.sqrt(math.sqrt((1.0 / (l * (l * (h * h)))))) elif t_0 <= math.inf: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = -d * math.sqrt((1.0 / (l * h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ 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 <= 0.0) tmp = Float64(d * sqrt(sqrt(Float64(1.0 / Float64(l * Float64(l * Float64(h * h))))))); elseif (t_0 <= Inf) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_0 <= 0.0) tmp = d * sqrt(sqrt((1.0 / (l * (l * (h * h)))))); elseif (t_0 <= Inf) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = -d * sqrt((1.0 / (l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $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, 0.0], N[(d * N[Sqrt[N[Sqrt[N[(1.0 / N[(l * N[(l * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\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 0:\\
\;\;\;\;d \cdot \sqrt{\sqrt{\frac{1}{\ell \cdot \left(\ell \cdot \left(h \cdot h\right)\right)}}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot 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)))) < 0.0Initial program 71.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6423.3
Applied rewrites23.3%
Applied rewrites27.8%
Taylor expanded in h around 0
Applied rewrites27.8%
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)))) < +inf.0Initial program 84.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites68.5%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6483.4
Applied rewrites83.4%
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 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.f6414.7
Applied rewrites14.7%
Final simplification45.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d)))
(t_1
(+
1.0
(*
(/ (/ (* M (* D 0.5)) (* d 2.0)) l)
(/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))))
(if (<= l -4.4e+136)
(* (* (sqrt (/ d h)) (/ t_0 (sqrt (- l)))) t_1)
(if (<= l -5e-310)
(* t_1 (* (/ t_0 (sqrt (- h))) (sqrt (/ d l))))
(* t_1 (* (pow (/ d l) (/ 1.0 2.0)) (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double t_1 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (l <= -4.4e+136) {
tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * t_1;
} else if (l <= -5e-310) {
tmp = t_1 * ((t_0 / sqrt(-h)) * sqrt((d / l)));
} else {
tmp = t_1 * (pow((d / l), (1.0 / 2.0)) * (sqrt(d) / sqrt(h)));
}
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) :: tmp
t_0 = sqrt(-d)
t_1 = 1.0d0 + ((((m * (d_1 * 0.5d0)) / (d * 2.0d0)) / l) * (((m * d_1) / (d * 2.0d0)) / ((-1.0d0) / h)))
if (l <= (-4.4d+136)) then
tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * t_1
else if (l <= (-5d-310)) then
tmp = t_1 * ((t_0 / sqrt(-h)) * sqrt((d / l)))
else
tmp = t_1 * (((d / l) ** (1.0d0 / 2.0d0)) * (sqrt(d) / sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(-d);
double t_1 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (l <= -4.4e+136) {
tmp = (Math.sqrt((d / h)) * (t_0 / Math.sqrt(-l))) * t_1;
} else if (l <= -5e-310) {
tmp = t_1 * ((t_0 / Math.sqrt(-h)) * Math.sqrt((d / l)));
} else {
tmp = t_1 * (Math.pow((d / l), (1.0 / 2.0)) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) t_1 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h))) tmp = 0 if l <= -4.4e+136: tmp = (math.sqrt((d / h)) * (t_0 / math.sqrt(-l))) * t_1 elif l <= -5e-310: tmp = t_1 * ((t_0 / math.sqrt(-h)) * math.sqrt((d / l))) else: tmp = t_1 * (math.pow((d / l), (1.0 / 2.0)) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) t_1 = 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 <= -4.4e+136) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(t_0 / sqrt(Float64(-l)))) * t_1); elseif (l <= -5e-310) tmp = Float64(t_1 * Float64(Float64(t_0 / sqrt(Float64(-h))) * sqrt(Float64(d / l)))); else tmp = Float64(t_1 * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); t_1 = 1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h))); tmp = 0.0; if (l <= -4.4e+136) tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * t_1; elseif (l <= -5e-310) tmp = t_1 * ((t_0 / sqrt(-h)) * sqrt((d / l))); else tmp = t_1 * (((d / l) ^ (1.0 / 2.0)) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = 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, -4.4e+136], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, -5e-310], N[(t$95$1 * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := 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 -4.4 \cdot 10^{+136}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{t\_0}{\sqrt{-\ell}}\right) \cdot t\_1\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot \left(\frac{t\_0}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if l < -4.3999999999999999e136Initial program 37.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 rewrites50.4%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f6450.4
Applied rewrites50.4%
lift-/.f64N/A
metadata-eval50.4
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6450.4
Applied rewrites50.4%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6475.8
Applied rewrites75.8%
if -4.3999999999999999e136 < l < -4.999999999999985e-310Initial program 69.9%
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 rewrites72.4%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f6472.4
Applied rewrites72.4%
lift-/.f64N/A
metadata-eval72.4
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f6484.3
Applied rewrites84.3%
if -4.999999999999985e-310 < l Initial program 61.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 rewrites65.4%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lower-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f6478.5
Applied rewrites78.5%
Final simplification80.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- l)))
(t_1
(fma (/ (* M (* D (* M D))) (* (* d d) 4.0)) (* -0.5 (/ h l)) 1.0))
(t_2 (sqrt (/ d h)))
(t_3 (sqrt (- d))))
(if (<= h -1.8e+148)
(/ (* t_3 (* (* t_3 (sqrt (/ -1.0 h))) t_1)) t_0)
(if (<= h -1e-310)
(/
(*
t_3
(*
t_2
(fma
(/ (* h (* M D)) (* d 2.0))
(/ (* (* M D) -0.5) (* l (* d 2.0)))
1.0)))
t_0)
(if (<= h 3.45e+168)
(*
(+
1.0
(*
(/ (/ (* M (* D 0.5)) (* d 2.0)) l)
(/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))
(* t_2 (/ (sqrt d) (sqrt l))))
(/ (* (sqrt d) (* (sqrt (/ d l)) t_1)) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-l);
double t_1 = fma(((M * (D * (M * D))) / ((d * d) * 4.0)), (-0.5 * (h / l)), 1.0);
double t_2 = sqrt((d / h));
double t_3 = sqrt(-d);
double tmp;
if (h <= -1.8e+148) {
tmp = (t_3 * ((t_3 * sqrt((-1.0 / h))) * t_1)) / t_0;
} else if (h <= -1e-310) {
tmp = (t_3 * (t_2 * fma(((h * (M * D)) / (d * 2.0)), (((M * D) * -0.5) / (l * (d * 2.0))), 1.0))) / t_0;
} else if (h <= 3.45e+168) {
tmp = (1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)))) * (t_2 * (sqrt(d) / sqrt(l)));
} else {
tmp = (sqrt(d) * (sqrt((d / l)) * t_1)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(-l)) t_1 = fma(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(Float64(d * d) * 4.0)), Float64(-0.5 * Float64(h / l)), 1.0) t_2 = sqrt(Float64(d / h)) t_3 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -1.8e+148) tmp = Float64(Float64(t_3 * Float64(Float64(t_3 * sqrt(Float64(-1.0 / h))) * t_1)) / t_0); elseif (h <= -1e-310) tmp = Float64(Float64(t_3 * Float64(t_2 * fma(Float64(Float64(h * Float64(M * D)) / Float64(d * 2.0)), Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0))), 1.0))) / t_0); elseif (h <= 3.45e+168) tmp = Float64(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)))) * Float64(t_2 * Float64(sqrt(d) / sqrt(l)))); else tmp = Float64(Float64(sqrt(d) * Float64(sqrt(Float64(d / l)) * t_1)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-l)], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -1.8e+148], N[(N[(t$95$3 * N[(N[(t$95$3 * N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[h, -1e-310], N[(N[(t$95$3 * N[(t$95$2 * N[(N[(N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[h, 3.45e+168], N[(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] * N[(t$95$2 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-\ell}\\
t_1 := \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)\\
t_2 := \sqrt{\frac{d}{h}}\\
t_3 := \sqrt{-d}\\
\mathbf{if}\;h \leq -1.8 \cdot 10^{+148}:\\
\;\;\;\;\frac{t\_3 \cdot \left(\left(t\_3 \cdot \sqrt{\frac{-1}{h}}\right) \cdot t\_1\right)}{t\_0}\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{t\_3 \cdot \left(t\_2 \cdot \mathsf{fma}\left(\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}, \frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, 1\right)\right)}{t\_0}\\
\mathbf{elif}\;h \leq 3.45 \cdot 10^{+168}:\\
\;\;\;\;\left(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}}\right) \cdot \left(t\_2 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot t\_1\right)}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -1.80000000000000003e148Initial program 38.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites30.4%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
div-invN/A
distribute-neg-frac2N/A
lift-/.f64N/A
sqrt-prodN/A
lift-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6459.3
Applied rewrites59.3%
if -1.80000000000000003e148 < h < -9.999999999999969e-311Initial program 65.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites57.0%
lift-fma.f64N/A
*-commutativeN/A
Applied rewrites79.0%
if -9.999999999999969e-311 < h < 3.4499999999999999e168Initial program 62.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 rewrites68.7%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f6468.7
Applied rewrites68.7%
lift-/.f64N/A
metadata-eval68.7
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6468.7
Applied rewrites68.7%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f6479.6
Applied rewrites79.6%
if 3.4499999999999999e168 < h Initial program 57.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
associate-*r/N/A
Applied rewrites76.6%
Final simplification77.1%
(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)))))
(t_1 (sqrt (/ d h))))
(if (<= h -1e-310)
(* (* t_1 (/ (sqrt (- d)) (sqrt (- l)))) t_0)
(if (<= h 3.45e+168)
(* t_0 (* t_1 (/ (sqrt d) (sqrt l))))
(/
(*
(sqrt d)
(*
(sqrt (/ d l))
(fma (/ (* M (* D (* M D))) (* (* d d) 4.0)) (* -0.5 (/ h l)) 1.0)))
(sqrt h))))))
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 t_1 = sqrt((d / h));
double tmp;
if (h <= -1e-310) {
tmp = (t_1 * (sqrt(-d) / sqrt(-l))) * t_0;
} else if (h <= 3.45e+168) {
tmp = t_0 * (t_1 * (sqrt(d) / sqrt(l)));
} else {
tmp = (sqrt(d) * (sqrt((d / l)) * fma(((M * (D * (M * D))) / ((d * d) * 4.0)), (-0.5 * (h / l)), 1.0))) / sqrt(h);
}
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)))) t_1 = sqrt(Float64(d / h)) tmp = 0.0 if (h <= -1e-310) tmp = Float64(Float64(t_1 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * t_0); elseif (h <= 3.45e+168) tmp = Float64(t_0 * Float64(t_1 * Float64(sqrt(d) / sqrt(l)))); else tmp = Float64(Float64(sqrt(d) * Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(Float64(d * d) * 4.0)), Float64(-0.5 * Float64(h / l)), 1.0))) / sqrt(h)); 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]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -1e-310], N[(N[(t$95$1 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[h, 3.45e+168], N[(t$95$0 * N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $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}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(t\_1 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\
\mathbf{elif}\;h \leq 3.45 \cdot 10^{+168}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -9.999999999999969e-311Initial program 60.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 rewrites66.3%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f6466.3
Applied rewrites66.3%
lift-/.f64N/A
metadata-eval66.3
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6466.3
Applied rewrites66.3%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6477.1
Applied rewrites77.1%
if -9.999999999999969e-311 < h < 3.4499999999999999e168Initial program 62.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 rewrites68.7%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f6468.7
Applied rewrites68.7%
lift-/.f64N/A
metadata-eval68.7
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6468.7
Applied rewrites68.7%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f6479.6
Applied rewrites79.6%
if 3.4499999999999999e168 < h Initial program 57.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
associate-*r/N/A
Applied rewrites76.6%
Final simplification78.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(fma (/ (* M (* D (* M D))) (* (* d d) 4.0)) (* -0.5 (/ h l)) 1.0))
(t_1 (sqrt (/ d h)))
(t_2 (sqrt (- d)))
(t_3 (sqrt (- l)))
(t_4 (sqrt (/ d l))))
(if (<= h -1.8e+148)
(/ (* t_2 (* (* t_2 (sqrt (/ -1.0 h))) t_0)) t_3)
(if (<= h -6.4e-298)
(/
(*
t_2
(*
t_1
(fma
(/ (* h (* M D)) (* d 2.0))
(/ (* (* M D) -0.5) (* l (* d 2.0)))
1.0)))
t_3)
(if (<= h 1.82e+168)
(*
(+
1.0
(*
(/ (/ (* M (* D 0.5)) (* d 2.0)) l)
(/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))
(* t_1 t_4))
(/ (* (sqrt d) (* t_4 t_0)) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = fma(((M * (D * (M * D))) / ((d * d) * 4.0)), (-0.5 * (h / l)), 1.0);
double t_1 = sqrt((d / h));
double t_2 = sqrt(-d);
double t_3 = sqrt(-l);
double t_4 = sqrt((d / l));
double tmp;
if (h <= -1.8e+148) {
tmp = (t_2 * ((t_2 * sqrt((-1.0 / h))) * t_0)) / t_3;
} else if (h <= -6.4e-298) {
tmp = (t_2 * (t_1 * fma(((h * (M * D)) / (d * 2.0)), (((M * D) * -0.5) / (l * (d * 2.0))), 1.0))) / t_3;
} else if (h <= 1.82e+168) {
tmp = (1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)))) * (t_1 * t_4);
} else {
tmp = (sqrt(d) * (t_4 * t_0)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = fma(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(Float64(d * d) * 4.0)), Float64(-0.5 * Float64(h / l)), 1.0) t_1 = sqrt(Float64(d / h)) t_2 = sqrt(Float64(-d)) t_3 = sqrt(Float64(-l)) t_4 = sqrt(Float64(d / l)) tmp = 0.0 if (h <= -1.8e+148) tmp = Float64(Float64(t_2 * Float64(Float64(t_2 * sqrt(Float64(-1.0 / h))) * t_0)) / t_3); elseif (h <= -6.4e-298) tmp = Float64(Float64(t_2 * Float64(t_1 * fma(Float64(Float64(h * Float64(M * D)) / Float64(d * 2.0)), Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0))), 1.0))) / t_3); elseif (h <= 1.82e+168) tmp = Float64(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)))) * Float64(t_1 * t_4)); else tmp = Float64(Float64(sqrt(d) * Float64(t_4 * t_0)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[(-l)], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -1.8e+148], N[(N[(t$95$2 * N[(N[(t$95$2 * N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[h, -6.4e-298], N[(N[(t$95$2 * N[(t$95$1 * N[(N[(N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[h, 1.82e+168], N[(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] * N[(t$95$1 * t$95$4), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] * N[(t$95$4 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \sqrt{-d}\\
t_3 := \sqrt{-\ell}\\
t_4 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;h \leq -1.8 \cdot 10^{+148}:\\
\;\;\;\;\frac{t\_2 \cdot \left(\left(t\_2 \cdot \sqrt{\frac{-1}{h}}\right) \cdot t\_0\right)}{t\_3}\\
\mathbf{elif}\;h \leq -6.4 \cdot 10^{-298}:\\
\;\;\;\;\frac{t\_2 \cdot \left(t\_1 \cdot \mathsf{fma}\left(\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}, \frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, 1\right)\right)}{t\_3}\\
\mathbf{elif}\;h \leq 1.82 \cdot 10^{+168}:\\
\;\;\;\;\left(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}}\right) \cdot \left(t\_1 \cdot t\_4\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d} \cdot \left(t\_4 \cdot t\_0\right)}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -1.80000000000000003e148Initial program 38.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites30.4%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
div-invN/A
distribute-neg-frac2N/A
lift-/.f64N/A
sqrt-prodN/A
lift-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6459.3
Applied rewrites59.3%
if -1.80000000000000003e148 < h < -6.39999999999999995e-298Initial program 65.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites56.6%
lift-fma.f64N/A
*-commutativeN/A
Applied rewrites78.8%
if -6.39999999999999995e-298 < h < 1.82000000000000004e168Initial program 62.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 rewrites69.1%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f6469.1
Applied rewrites69.1%
lift-/.f64N/A
metadata-eval69.1
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6469.1
Applied rewrites69.1%
if 1.82000000000000004e168 < h Initial program 57.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
associate-*r/N/A
Applied rewrites76.6%
Final simplification73.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- l)))
(t_1
(fma (/ (* M (* D (* M D))) (* (* d d) 4.0)) (* -0.5 (/ h l)) 1.0))
(t_2 (sqrt (/ d l)))
(t_3 (sqrt (/ d h)))
(t_4 (sqrt (- d))))
(if (<= h -3.3e+173)
(/ (* t_4 (* (/ t_4 (sqrt (- h))) t_1)) t_0)
(if (<= h -6.4e-298)
(/
(*
t_4
(*
t_3
(fma
(/ (* h (* M D)) (* d 2.0))
(/ (* (* M D) -0.5) (* l (* d 2.0)))
1.0)))
t_0)
(if (<= h 1.82e+168)
(*
(+
1.0
(*
(/ (/ (* M (* D 0.5)) (* d 2.0)) l)
(/ (/ (* M D) (* d 2.0)) (/ -1.0 h))))
(* t_3 t_2))
(/ (* (sqrt d) (* t_2 t_1)) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-l);
double t_1 = fma(((M * (D * (M * D))) / ((d * d) * 4.0)), (-0.5 * (h / l)), 1.0);
double t_2 = sqrt((d / l));
double t_3 = sqrt((d / h));
double t_4 = sqrt(-d);
double tmp;
if (h <= -3.3e+173) {
tmp = (t_4 * ((t_4 / sqrt(-h)) * t_1)) / t_0;
} else if (h <= -6.4e-298) {
tmp = (t_4 * (t_3 * fma(((h * (M * D)) / (d * 2.0)), (((M * D) * -0.5) / (l * (d * 2.0))), 1.0))) / t_0;
} else if (h <= 1.82e+168) {
tmp = (1.0 + ((((M * (D * 0.5)) / (d * 2.0)) / l) * (((M * D) / (d * 2.0)) / (-1.0 / h)))) * (t_3 * t_2);
} else {
tmp = (sqrt(d) * (t_2 * t_1)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(-l)) t_1 = fma(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(Float64(d * d) * 4.0)), Float64(-0.5 * Float64(h / l)), 1.0) t_2 = sqrt(Float64(d / l)) t_3 = sqrt(Float64(d / h)) t_4 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -3.3e+173) tmp = Float64(Float64(t_4 * Float64(Float64(t_4 / sqrt(Float64(-h))) * t_1)) / t_0); elseif (h <= -6.4e-298) tmp = Float64(Float64(t_4 * Float64(t_3 * fma(Float64(Float64(h * Float64(M * D)) / Float64(d * 2.0)), Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0))), 1.0))) / t_0); elseif (h <= 1.82e+168) tmp = Float64(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)))) * Float64(t_3 * t_2)); else tmp = Float64(Float64(sqrt(d) * Float64(t_2 * t_1)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-l)], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -3.3e+173], N[(N[(t$95$4 * N[(N[(t$95$4 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[h, -6.4e-298], N[(N[(t$95$4 * N[(t$95$3 * N[(N[(N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[h, 1.82e+168], N[(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] * N[(t$95$3 * t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] * N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-\ell}\\
t_1 := \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)\\
t_2 := \sqrt{\frac{d}{\ell}}\\
t_3 := \sqrt{\frac{d}{h}}\\
t_4 := \sqrt{-d}\\
\mathbf{if}\;h \leq -3.3 \cdot 10^{+173}:\\
\;\;\;\;\frac{t\_4 \cdot \left(\frac{t\_4}{\sqrt{-h}} \cdot t\_1\right)}{t\_0}\\
\mathbf{elif}\;h \leq -6.4 \cdot 10^{-298}:\\
\;\;\;\;\frac{t\_4 \cdot \left(t\_3 \cdot \mathsf{fma}\left(\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}, \frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, 1\right)\right)}{t\_0}\\
\mathbf{elif}\;h \leq 1.82 \cdot 10^{+168}:\\
\;\;\;\;\left(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}}\right) \cdot \left(t\_3 \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d} \cdot \left(t\_2 \cdot t\_1\right)}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -3.29999999999999996e173Initial program 41.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites28.6%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f6460.1
Applied rewrites60.1%
if -3.29999999999999996e173 < h < -6.39999999999999995e-298Initial program 64.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites56.5%
lift-fma.f64N/A
*-commutativeN/A
Applied rewrites78.3%
if -6.39999999999999995e-298 < h < 1.82000000000000004e168Initial program 62.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 rewrites69.1%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f6469.1
Applied rewrites69.1%
lift-/.f64N/A
metadata-eval69.1
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6469.1
Applied rewrites69.1%
if 1.82000000000000004e168 < h Initial program 57.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
associate-*r/N/A
Applied rewrites76.6%
Final simplification73.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l)))))
(t_1
(*
(sqrt (/ d l))
(*
(sqrt (/ d h))
(fma
(* (/ (* M D) (* d 2.0)) (/ (* (* M D) -0.5) (* l (* d 2.0))))
h
1.0))))
(t_2 (sqrt (/ 1.0 (* l h)))))
(if (<= d -7e-212)
t_1
(if (<= d -4e-310)
(fma -0.125 (* M (* (/ M d) (* D (* t_0 (- D))))) (* (- d) t_2))
(if (<= d 8.2e-265)
(fma d t_2 (* t_0 (* (* D (* D (* M M))) (/ -0.125 d))))
(if (<= d 3.9e-53)
(*
(/ d (sqrt (* l h)))
(+
1.0
(/ (* (* M (* D (* M D))) (* h -0.5)) (* l (* d (* d 4.0))))))
(if (<= d 7e+133) t_1 (/ d (* (sqrt h) (sqrt l))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
double t_1 = sqrt((d / l)) * (sqrt((d / h)) * fma((((M * D) / (d * 2.0)) * (((M * D) * -0.5) / (l * (d * 2.0)))), h, 1.0));
double t_2 = sqrt((1.0 / (l * h)));
double tmp;
if (d <= -7e-212) {
tmp = t_1;
} else if (d <= -4e-310) {
tmp = fma(-0.125, (M * ((M / d) * (D * (t_0 * -D)))), (-d * t_2));
} else if (d <= 8.2e-265) {
tmp = fma(d, t_2, (t_0 * ((D * (D * (M * M))) * (-0.125 / d))));
} else if (d <= 3.9e-53) {
tmp = (d / sqrt((l * h))) * (1.0 + (((M * (D * (M * D))) * (h * -0.5)) / (l * (d * (d * 4.0)))));
} else if (d <= 7e+133) {
tmp = t_1;
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) t_1 = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * fma(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) * Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0)))), h, 1.0))) t_2 = sqrt(Float64(1.0 / Float64(l * h))) tmp = 0.0 if (d <= -7e-212) tmp = t_1; elseif (d <= -4e-310) tmp = fma(-0.125, Float64(M * Float64(Float64(M / d) * Float64(D * Float64(t_0 * Float64(-D))))), Float64(Float64(-d) * t_2)); elseif (d <= 8.2e-265) tmp = fma(d, t_2, Float64(t_0 * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(-0.125 / d)))); elseif (d <= 3.9e-53) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(M * D))) * Float64(h * -0.5)) / Float64(l * Float64(d * Float64(d * 4.0)))))); elseif (d <= 7e+133) tmp = t_1; else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return 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[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -7e-212], t$95$1, If[LessEqual[d, -4e-310], N[(-0.125 * N[(M * N[(N[(M / d), $MachinePrecision] * N[(D * N[(t$95$0 * (-D)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-d) * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.2e-265], N[(d * t$95$2 + N[(t$95$0 * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.9e-53], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7e+133], t$95$1, N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
t_1 := \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot D}{d \cdot 2} \cdot \frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h, 1\right)\right)\\
t_2 := \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{if}\;d \leq -7 \cdot 10^{-212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, M \cdot \left(\frac{M}{d} \cdot \left(D \cdot \left(t\_0 \cdot \left(-D\right)\right)\right)\right), \left(-d\right) \cdot t\_2\right)\\
\mathbf{elif}\;d \leq 8.2 \cdot 10^{-265}:\\
\;\;\;\;\mathsf{fma}\left(d, t\_2, t\_0 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\right)\\
\mathbf{elif}\;d \leq 3.9 \cdot 10^{-53}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right)\\
\mathbf{elif}\;d \leq 7 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -6.9999999999999995e-212 or 3.9000000000000002e-53 < d < 6.9999999999999997e133Initial program 70.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites61.6%
lift-fma.f64N/A
Applied rewrites75.4%
if -6.9999999999999995e-212 < d < -3.999999999999988e-310Initial program 27.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites9.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites29.1%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites29.0%
Applied rewrites52.9%
if -3.999999999999988e-310 < d < 8.2e-265Initial program 27.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites0.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites0.0%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites12.7%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites45.9%
if 8.2e-265 < d < 3.9000000000000002e-53Initial program 57.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites50.6%
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f6450.6
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f64N/A
Applied rewrites66.5%
if 6.9999999999999997e133 < d Initial program 64.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6467.2
Applied rewrites67.2%
Applied rewrites67.3%
Applied rewrites88.6%
Final simplification71.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (* l h)))) (t_1 (sqrt (/ h (* l (* l l))))))
(if (<= d -9e-213)
(/
(*
(sqrt (- d))
(*
(sqrt (/ d h))
(fma
(/ (* h (* M D)) (* d 2.0))
(/ (* (* M D) -0.5) (* l (* d 2.0)))
1.0)))
(sqrt (- l)))
(if (<= d -4e-310)
(fma -0.125 (* M (* (/ M d) (* D (* t_1 (- D))))) (* (- d) t_0))
(if (<= d 1.32e-269)
(fma d t_0 (* t_1 (* (* D (* D (* M M))) (/ -0.125 d))))
(if (<= d 8.5e+133)
(/
(*
(sqrt d)
(*
(sqrt (/ d l))
(fma
(/ (* M (* D (* M D))) (* (* d d) 4.0))
(* -0.5 (/ h l))
1.0)))
(sqrt h))
(/ d (* (sqrt h) (sqrt l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h)));
double t_1 = sqrt((h / (l * (l * l))));
double tmp;
if (d <= -9e-213) {
tmp = (sqrt(-d) * (sqrt((d / h)) * fma(((h * (M * D)) / (d * 2.0)), (((M * D) * -0.5) / (l * (d * 2.0))), 1.0))) / sqrt(-l);
} else if (d <= -4e-310) {
tmp = fma(-0.125, (M * ((M / d) * (D * (t_1 * -D)))), (-d * t_0));
} else if (d <= 1.32e-269) {
tmp = fma(d, t_0, (t_1 * ((D * (D * (M * M))) * (-0.125 / d))));
} else if (d <= 8.5e+133) {
tmp = (sqrt(d) * (sqrt((d / l)) * fma(((M * (D * (M * D))) / ((d * d) * 4.0)), (-0.5 * (h / l)), 1.0))) / sqrt(h);
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(l * h))) t_1 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (d <= -9e-213) tmp = Float64(Float64(sqrt(Float64(-d)) * Float64(sqrt(Float64(d / h)) * fma(Float64(Float64(h * Float64(M * D)) / Float64(d * 2.0)), Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0))), 1.0))) / sqrt(Float64(-l))); elseif (d <= -4e-310) tmp = fma(-0.125, Float64(M * Float64(Float64(M / d) * Float64(D * Float64(t_1 * Float64(-D))))), Float64(Float64(-d) * t_0)); elseif (d <= 1.32e-269) tmp = fma(d, t_0, Float64(t_1 * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(-0.125 / d)))); elseif (d <= 8.5e+133) tmp = Float64(Float64(sqrt(d) * Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(Float64(d * d) * 4.0)), Float64(-0.5 * Float64(h / l)), 1.0))) / sqrt(h)); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -9e-213], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4e-310], N[(-0.125 * N[(M * N[(N[(M / d), $MachinePrecision] * N[(D * N[(t$95$1 * (-D)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-d) * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.32e-269], N[(d * t$95$0 + N[(t$95$1 * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.5e+133], N[(N[(N[Sqrt[d], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
t_1 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;d \leq -9 \cdot 10^{-213}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}, \frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, 1\right)\right)}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, M \cdot \left(\frac{M}{d} \cdot \left(D \cdot \left(t\_1 \cdot \left(-D\right)\right)\right)\right), \left(-d\right) \cdot t\_0\right)\\
\mathbf{elif}\;d \leq 1.32 \cdot 10^{-269}:\\
\;\;\;\;\mathsf{fma}\left(d, t\_0, t\_1 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\right)\\
\mathbf{elif}\;d \leq 8.5 \cdot 10^{+133}:\\
\;\;\;\;\frac{\sqrt{d} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)}{\sqrt{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -9.0000000000000002e-213Initial program 67.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites60.2%
lift-fma.f64N/A
*-commutativeN/A
Applied rewrites81.5%
if -9.0000000000000002e-213 < d < -3.999999999999988e-310Initial program 27.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites9.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites29.1%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites29.0%
Applied rewrites52.9%
if -3.999999999999988e-310 < d < 1.32000000000000007e-269Initial program 29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites0.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites0.0%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites13.4%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites48.5%
if 1.32000000000000007e-269 < d < 8.50000000000000044e133Initial program 67.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
associate-*r/N/A
Applied rewrites73.4%
if 8.50000000000000044e133 < d Initial program 64.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6467.2
Applied rewrites67.2%
Applied rewrites67.3%
Applied rewrites88.6%
Final simplification75.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l)))))
(t_1 (sqrt (/ d l)))
(t_2 (sqrt (/ 1.0 (* l h)))))
(if (<= d -7e-212)
(*
t_1
(*
(sqrt (/ d h))
(fma
(* (/ (* M D) (* d 2.0)) (/ (* (* M D) -0.5) (* l (* d 2.0))))
h
1.0)))
(if (<= d -4e-310)
(fma -0.125 (* M (* (/ M d) (* D (* t_0 (- D))))) (* (- d) t_2))
(if (<= d 1.32e-269)
(fma d t_2 (* t_0 (* (* D (* D (* M M))) (/ -0.125 d))))
(if (<= d 8.5e+133)
(/
(*
(sqrt d)
(*
t_1
(fma
(/ (* M (* D (* M D))) (* (* d d) 4.0))
(* -0.5 (/ h l))
1.0)))
(sqrt h))
(/ d (* (sqrt h) (sqrt l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
double t_1 = sqrt((d / l));
double t_2 = sqrt((1.0 / (l * h)));
double tmp;
if (d <= -7e-212) {
tmp = t_1 * (sqrt((d / h)) * fma((((M * D) / (d * 2.0)) * (((M * D) * -0.5) / (l * (d * 2.0)))), h, 1.0));
} else if (d <= -4e-310) {
tmp = fma(-0.125, (M * ((M / d) * (D * (t_0 * -D)))), (-d * t_2));
} else if (d <= 1.32e-269) {
tmp = fma(d, t_2, (t_0 * ((D * (D * (M * M))) * (-0.125 / d))));
} else if (d <= 8.5e+133) {
tmp = (sqrt(d) * (t_1 * fma(((M * (D * (M * D))) / ((d * d) * 4.0)), (-0.5 * (h / l)), 1.0))) / sqrt(h);
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) t_1 = sqrt(Float64(d / l)) t_2 = sqrt(Float64(1.0 / Float64(l * h))) tmp = 0.0 if (d <= -7e-212) tmp = Float64(t_1 * Float64(sqrt(Float64(d / h)) * fma(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) * Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0)))), h, 1.0))); elseif (d <= -4e-310) tmp = fma(-0.125, Float64(M * Float64(Float64(M / d) * Float64(D * Float64(t_0 * Float64(-D))))), Float64(Float64(-d) * t_2)); elseif (d <= 1.32e-269) tmp = fma(d, t_2, Float64(t_0 * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(-0.125 / d)))); elseif (d <= 8.5e+133) tmp = Float64(Float64(sqrt(d) * Float64(t_1 * fma(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(Float64(d * d) * 4.0)), Float64(-0.5 * Float64(h / l)), 1.0))) / sqrt(h)); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return 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[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -7e-212], N[(t$95$1 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4e-310], N[(-0.125 * N[(M * N[(N[(M / d), $MachinePrecision] * N[(D * N[(t$95$0 * (-D)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-d) * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.32e-269], N[(d * t$95$2 + N[(t$95$0 * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.5e+133], N[(N[(N[Sqrt[d], $MachinePrecision] * N[(t$95$1 * N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{if}\;d \leq -7 \cdot 10^{-212}:\\
\;\;\;\;t\_1 \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{M \cdot D}{d \cdot 2} \cdot \frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, h, 1\right)\right)\\
\mathbf{elif}\;d \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, M \cdot \left(\frac{M}{d} \cdot \left(D \cdot \left(t\_0 \cdot \left(-D\right)\right)\right)\right), \left(-d\right) \cdot t\_2\right)\\
\mathbf{elif}\;d \leq 1.32 \cdot 10^{-269}:\\
\;\;\;\;\mathsf{fma}\left(d, t\_2, t\_0 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\right)\\
\mathbf{elif}\;d \leq 8.5 \cdot 10^{+133}:\\
\;\;\;\;\frac{\sqrt{d} \cdot \left(t\_1 \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right)\right)}{\sqrt{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -6.9999999999999995e-212Initial program 67.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites55.4%
lift-fma.f64N/A
Applied rewrites71.5%
if -6.9999999999999995e-212 < d < -3.999999999999988e-310Initial program 27.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites9.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites29.1%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites29.0%
Applied rewrites52.9%
if -3.999999999999988e-310 < d < 1.32000000000000007e-269Initial program 29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites0.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites0.0%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites13.4%
Taylor expanded in M around 0
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites48.5%
if 1.32000000000000007e-269 < d < 8.50000000000000044e133Initial program 67.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
associate-*r/N/A
Applied rewrites73.4%
if 8.50000000000000044e133 < d Initial program 64.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6467.2
Applied rewrites67.2%
Applied rewrites67.3%
Applied rewrites88.6%
Final simplification70.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* -0.5 (/ h l)))
(t_1 (sqrt (/ d l)))
(t_2 (sqrt (/ d h)))
(t_3 (* (* d d) 4.0)))
(if (<= l -3.5e+190)
(*
t_2
(*
(* (sqrt (- d)) (fma (* M D) (* (* M D) (/ (* h -0.5) (* l t_3))) 1.0))
(/ 1.0 (sqrt (- l)))))
(if (<= l 4e-308)
(*
t_1
(* t_2 (fma (* (/ M d) (* (* D 0.5) (/ (* M D) (* d 2.0)))) t_0 1.0)))
(if (<= l 1.7e-88)
(/
(* (sqrt d) (* t_1 (fma (/ (* M (* D (* M D))) t_3) t_0 1.0)))
(sqrt h))
(if (<= l 8e+172)
(*
(fma
(/ (* h (* M D)) (* d 2.0))
(/ (* (* M D) -0.5) (* l (* d 2.0)))
1.0)
(* t_2 t_1))
(/ d (* (sqrt h) (sqrt l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 * (h / l);
double t_1 = sqrt((d / l));
double t_2 = sqrt((d / h));
double t_3 = (d * d) * 4.0;
double tmp;
if (l <= -3.5e+190) {
tmp = t_2 * ((sqrt(-d) * fma((M * D), ((M * D) * ((h * -0.5) / (l * t_3))), 1.0)) * (1.0 / sqrt(-l)));
} else if (l <= 4e-308) {
tmp = t_1 * (t_2 * fma(((M / d) * ((D * 0.5) * ((M * D) / (d * 2.0)))), t_0, 1.0));
} else if (l <= 1.7e-88) {
tmp = (sqrt(d) * (t_1 * fma(((M * (D * (M * D))) / t_3), t_0, 1.0))) / sqrt(h);
} else if (l <= 8e+172) {
tmp = fma(((h * (M * D)) / (d * 2.0)), (((M * D) * -0.5) / (l * (d * 2.0))), 1.0) * (t_2 * t_1);
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(-0.5 * Float64(h / l)) t_1 = sqrt(Float64(d / l)) t_2 = sqrt(Float64(d / h)) t_3 = Float64(Float64(d * d) * 4.0) tmp = 0.0 if (l <= -3.5e+190) tmp = Float64(t_2 * Float64(Float64(sqrt(Float64(-d)) * fma(Float64(M * D), Float64(Float64(M * D) * Float64(Float64(h * -0.5) / Float64(l * t_3))), 1.0)) * Float64(1.0 / sqrt(Float64(-l))))); elseif (l <= 4e-308) tmp = Float64(t_1 * Float64(t_2 * fma(Float64(Float64(M / d) * Float64(Float64(D * 0.5) * Float64(Float64(M * D) / Float64(d * 2.0)))), t_0, 1.0))); elseif (l <= 1.7e-88) tmp = Float64(Float64(sqrt(d) * Float64(t_1 * fma(Float64(Float64(M * Float64(D * Float64(M * D))) / t_3), t_0, 1.0))) / sqrt(h)); elseif (l <= 8e+172) tmp = Float64(fma(Float64(Float64(h * Float64(M * D)) / Float64(d * 2.0)), Float64(Float64(Float64(M * D) * -0.5) / Float64(l * Float64(d * 2.0))), 1.0) * Float64(t_2 * t_1)); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]}, If[LessEqual[l, -3.5e+190], N[(t$95$2 * N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / N[(l * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4e-308], N[(t$95$1 * N[(t$95$2 * N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.5), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.7e-88], N[(N[(N[Sqrt[d], $MachinePrecision] * N[(t$95$1 * N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8e+172], N[(N[(N[(N[(h * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] * -0.5), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 \cdot \frac{h}{\ell}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \sqrt{\frac{d}{h}}\\
t_3 := \left(d \cdot d\right) \cdot 4\\
\mathbf{if}\;\ell \leq -3.5 \cdot 10^{+190}:\\
\;\;\;\;t\_2 \cdot \left(\left(\sqrt{-d} \cdot \mathsf{fma}\left(M \cdot D, \left(M \cdot D\right) \cdot \frac{h \cdot -0.5}{\ell \cdot t\_3}, 1\right)\right) \cdot \frac{1}{\sqrt{-\ell}}\right)\\
\mathbf{elif}\;\ell \leq 4 \cdot 10^{-308}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \mathsf{fma}\left(\frac{M}{d} \cdot \left(\left(D \cdot 0.5\right) \cdot \frac{M \cdot D}{d \cdot 2}\right), t\_0, 1\right)\right)\\
\mathbf{elif}\;\ell \leq 1.7 \cdot 10^{-88}:\\
\;\;\;\;\frac{\sqrt{d} \cdot \left(t\_1 \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{t\_3}, t\_0, 1\right)\right)}{\sqrt{h}}\\
\mathbf{elif}\;\ell \leq 8 \cdot 10^{+172}:\\
\;\;\;\;\mathsf{fma}\left(\frac{h \cdot \left(M \cdot D\right)}{d \cdot 2}, \frac{\left(M \cdot D\right) \cdot -0.5}{\ell \cdot \left(d \cdot 2\right)}, 1\right) \cdot \left(t\_2 \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.4999999999999999e190Initial program 30.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites23.2%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
div-invN/A
associate-*l*N/A
Applied rewrites55.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites75.6%
if -3.4999999999999999e190 < l < 4.00000000000000013e-308Initial program 69.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites55.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
metadata-evalN/A
frac-timesN/A
associate-/r*N/A
lift-*.f64N/A
times-fracN/A
div-invN/A
lift-*.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l*N/A
Applied rewrites68.7%
if 4.00000000000000013e-308 < l < 1.69999999999999987e-88Initial program 66.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
associate-*r/N/A
Applied rewrites78.5%
if 1.69999999999999987e-88 < l < 8.0000000000000007e172Initial program 68.8%
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 rewrites78.2%
lift-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
pow1/2N/A
lift-sqrt.f6478.2
Applied rewrites78.2%
lift-/.f64N/A
metadata-eval78.2
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6478.2
Applied rewrites78.2%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites78.2%
if 8.0000000000000007e172 < l Initial program 41.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Applied rewrites39.2%
Applied rewrites57.1%
Final simplification71.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l))))))
(if (<= l -9.6e+97)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= l -1.25e-93)
(fma
-0.125
(* M (* (/ M d) (* D (* t_0 (- D)))))
(* (- d) (sqrt (/ 1.0 (* l h)))))
(if (<= l 2.5e-308)
(* 0.125 (* t_0 (* M (/ (* M (* D D)) d))))
(if (<= l 0.000185)
(*
(/ d (sqrt (* l h)))
(+
1.0
(/ (* (* M (* D (* M D))) (* h -0.5)) (* l (* d (* d 4.0))))))
(/ d (* (sqrt h) (sqrt l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
double tmp;
if (l <= -9.6e+97) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (l <= -1.25e-93) {
tmp = fma(-0.125, (M * ((M / d) * (D * (t_0 * -D)))), (-d * sqrt((1.0 / (l * h)))));
} else if (l <= 2.5e-308) {
tmp = 0.125 * (t_0 * (M * ((M * (D * D)) / d)));
} else if (l <= 0.000185) {
tmp = (d / sqrt((l * h))) * (1.0 + (((M * (D * (M * D))) * (h * -0.5)) / (l * (d * (d * 4.0)))));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (l <= -9.6e+97) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (l <= -1.25e-93) tmp = fma(-0.125, Float64(M * Float64(Float64(M / d) * Float64(D * Float64(t_0 * Float64(-D))))), Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h))))); elseif (l <= 2.5e-308) tmp = Float64(0.125 * Float64(t_0 * Float64(M * Float64(Float64(M * Float64(D * D)) / d)))); elseif (l <= 0.000185) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(M * D))) * Float64(h * -0.5)) / Float64(l * Float64(d * Float64(d * 4.0)))))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return 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]}, If[LessEqual[l, -9.6e+97], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.25e-93], N[(-0.125 * N[(M * N[(N[(M / d), $MachinePrecision] * N[(D * N[(t$95$0 * (-D)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.5e-308], N[(0.125 * N[(t$95$0 * N[(M * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.000185], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;\ell \leq -9.6 \cdot 10^{+97}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -1.25 \cdot 10^{-93}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, M \cdot \left(\frac{M}{d} \cdot \left(D \cdot \left(t\_0 \cdot \left(-D\right)\right)\right)\right), \left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;\ell \leq 2.5 \cdot 10^{-308}:\\
\;\;\;\;0.125 \cdot \left(t\_0 \cdot \left(M \cdot \frac{M \cdot \left(D \cdot D\right)}{d}\right)\right)\\
\mathbf{elif}\;\ell \leq 0.000185:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -9.6000000000000001e97Initial program 43.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites43.1%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6450.6
Applied rewrites50.6%
if -9.6000000000000001e97 < l < -1.24999999999999999e-93Initial program 70.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites62.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites17.0%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites72.5%
Applied rewrites77.8%
if -1.24999999999999999e-93 < l < 2.49999999999999977e-308Initial program 70.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites51.1%
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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites28.1%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites17.2%
Taylor expanded in D around inf
Applied rewrites46.9%
if 2.49999999999999977e-308 < l < 1.85e-4Initial program 71.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites63.4%
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f6463.4
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f64N/A
Applied rewrites73.2%
if 1.85e-4 < l Initial program 50.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
Applied rewrites43.8%
Applied rewrites56.3%
Final simplification60.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))) (t_1 (sqrt (/ h (* l (* l l))))))
(if (<= l -9.6e+97)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= l -3.2e-92)
(fma (* D (* D t_1)) (- (* -0.125 (/ (* M M) d))) (/ (- d) t_0))
(if (<= l 2.5e-308)
(* 0.125 (* t_1 (* M (/ (* M (* D D)) d))))
(if (<= l 0.000185)
(*
(/ d t_0)
(+
1.0
(/ (* (* M (* D (* M D))) (* h -0.5)) (* l (* d (* d 4.0))))))
(/ d (* (sqrt h) (sqrt l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double t_1 = sqrt((h / (l * (l * l))));
double tmp;
if (l <= -9.6e+97) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (l <= -3.2e-92) {
tmp = fma((D * (D * t_1)), -(-0.125 * ((M * M) / d)), (-d / t_0));
} else if (l <= 2.5e-308) {
tmp = 0.125 * (t_1 * (M * ((M * (D * D)) / d)));
} else if (l <= 0.000185) {
tmp = (d / t_0) * (1.0 + (((M * (D * (M * D))) * (h * -0.5)) / (l * (d * (d * 4.0)))));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) t_1 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (l <= -9.6e+97) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (l <= -3.2e-92) tmp = fma(Float64(D * Float64(D * t_1)), Float64(-Float64(-0.125 * Float64(Float64(M * M) / d))), Float64(Float64(-d) / t_0)); elseif (l <= 2.5e-308) tmp = Float64(0.125 * Float64(t_1 * Float64(M * Float64(Float64(M * Float64(D * D)) / d)))); elseif (l <= 0.000185) tmp = Float64(Float64(d / t_0) * Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(M * D))) * Float64(h * -0.5)) / Float64(l * Float64(d * Float64(d * 4.0)))))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -9.6e+97], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3.2e-92], N[(N[(D * N[(D * t$95$1), $MachinePrecision]), $MachinePrecision] * (-N[(-0.125 * N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]) + N[((-d) / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.5e-308], N[(0.125 * N[(t$95$1 * N[(M * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.000185], N[(N[(d / t$95$0), $MachinePrecision] * N[(1.0 + N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;\ell \leq -9.6 \cdot 10^{+97}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -3.2 \cdot 10^{-92}:\\
\;\;\;\;\mathsf{fma}\left(D \cdot \left(D \cdot t\_1\right), --0.125 \cdot \frac{M \cdot M}{d}, \frac{-d}{t\_0}\right)\\
\mathbf{elif}\;\ell \leq 2.5 \cdot 10^{-308}:\\
\;\;\;\;0.125 \cdot \left(t\_1 \cdot \left(M \cdot \frac{M \cdot \left(D \cdot D\right)}{d}\right)\right)\\
\mathbf{elif}\;\ell \leq 0.000185:\\
\;\;\;\;\frac{d}{t\_0} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -9.6000000000000001e97Initial program 43.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites43.1%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6450.6
Applied rewrites50.6%
if -9.6000000000000001e97 < l < -3.1999999999999997e-92Initial program 70.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites62.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites17.0%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites72.5%
Applied rewrites72.7%
if -3.1999999999999997e-92 < l < 2.49999999999999977e-308Initial program 70.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites51.1%
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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites28.1%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites17.2%
Taylor expanded in D around inf
Applied rewrites46.9%
if 2.49999999999999977e-308 < l < 1.85e-4Initial program 71.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites63.4%
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f6463.4
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f64N/A
Applied rewrites73.2%
if 1.85e-4 < l Initial program 50.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
Applied rewrites43.8%
Applied rewrites56.3%
Final simplification60.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))) (t_1 (sqrt (/ h (* l (* l l))))))
(if (<= l -1.95e+95)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= l -2.2e-92)
(fma 0.125 (/ (* (* D D) (* t_1 (* M M))) d) (/ (- d) t_0))
(if (<= l 2.5e-308)
(* 0.125 (* t_1 (* M (/ (* M (* D D)) d))))
(if (<= l 0.000185)
(*
(/ d t_0)
(+
1.0
(/ (* (* M (* D (* M D))) (* h -0.5)) (* l (* d (* d 4.0))))))
(/ d (* (sqrt h) (sqrt l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double t_1 = sqrt((h / (l * (l * l))));
double tmp;
if (l <= -1.95e+95) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (l <= -2.2e-92) {
tmp = fma(0.125, (((D * D) * (t_1 * (M * M))) / d), (-d / t_0));
} else if (l <= 2.5e-308) {
tmp = 0.125 * (t_1 * (M * ((M * (D * D)) / d)));
} else if (l <= 0.000185) {
tmp = (d / t_0) * (1.0 + (((M * (D * (M * D))) * (h * -0.5)) / (l * (d * (d * 4.0)))));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) t_1 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (l <= -1.95e+95) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (l <= -2.2e-92) tmp = fma(0.125, Float64(Float64(Float64(D * D) * Float64(t_1 * Float64(M * M))) / d), Float64(Float64(-d) / t_0)); elseif (l <= 2.5e-308) tmp = Float64(0.125 * Float64(t_1 * Float64(M * Float64(Float64(M * Float64(D * D)) / d)))); elseif (l <= 0.000185) tmp = Float64(Float64(d / t_0) * Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(M * D))) * Float64(h * -0.5)) / Float64(l * Float64(d * Float64(d * 4.0)))))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.95e+95], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.2e-92], N[(0.125 * N[(N[(N[(D * D), $MachinePrecision] * N[(t$95$1 * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] + N[((-d) / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.5e-308], N[(0.125 * N[(t$95$1 * N[(M * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.000185], N[(N[(d / t$95$0), $MachinePrecision] * N[(1.0 + N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;\ell \leq -1.95 \cdot 10^{+95}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -2.2 \cdot 10^{-92}:\\
\;\;\;\;\mathsf{fma}\left(0.125, \frac{\left(D \cdot D\right) \cdot \left(t\_1 \cdot \left(M \cdot M\right)\right)}{d}, \frac{-d}{t\_0}\right)\\
\mathbf{elif}\;\ell \leq 2.5 \cdot 10^{-308}:\\
\;\;\;\;0.125 \cdot \left(t\_1 \cdot \left(M \cdot \frac{M \cdot \left(D \cdot D\right)}{d}\right)\right)\\
\mathbf{elif}\;\ell \leq 0.000185:\\
\;\;\;\;\frac{d}{t\_0} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.9499999999999999e95Initial program 43.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites43.1%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6450.6
Applied rewrites50.6%
if -1.9499999999999999e95 < l < -2.19999999999999987e-92Initial program 70.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites62.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites17.0%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites72.5%
Applied rewrites75.1%
if -2.19999999999999987e-92 < l < 2.49999999999999977e-308Initial program 70.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites51.1%
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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites28.1%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites17.2%
Taylor expanded in D around inf
Applied rewrites46.9%
if 2.49999999999999977e-308 < l < 1.85e-4Initial program 71.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites63.4%
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f6463.4
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f64N/A
Applied rewrites73.2%
if 1.85e-4 < l Initial program 50.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
Applied rewrites43.8%
Applied rewrites56.3%
Final simplification60.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (* D (* M D)))))
(if (<= d -1.5e+81)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= d -9.5e-125)
(*
(fma (/ t_0 (* (* d d) 4.0)) (* -0.5 (/ h l)) 1.0)
(sqrt (/ (* d d) (* l h))))
(if (<= d 1.45e-286)
(* 0.125 (* (sqrt (/ h (* l (* l l)))) (* M (/ (* M (* D D)) d))))
(if (<= d 4.3e+98)
(*
(/ d (sqrt (* l h)))
(+ 1.0 (/ (* t_0 (* h -0.5)) (* l (* d (* d 4.0))))))
(/ d (* (sqrt h) (sqrt l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (D * (M * D));
double tmp;
if (d <= -1.5e+81) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (d <= -9.5e-125) {
tmp = fma((t_0 / ((d * d) * 4.0)), (-0.5 * (h / l)), 1.0) * sqrt(((d * d) / (l * h)));
} else if (d <= 1.45e-286) {
tmp = 0.125 * (sqrt((h / (l * (l * l)))) * (M * ((M * (D * D)) / d)));
} else if (d <= 4.3e+98) {
tmp = (d / sqrt((l * h))) * (1.0 + ((t_0 * (h * -0.5)) / (l * (d * (d * 4.0)))));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(M * Float64(D * Float64(M * D))) tmp = 0.0 if (d <= -1.5e+81) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (d <= -9.5e-125) tmp = Float64(fma(Float64(t_0 / Float64(Float64(d * d) * 4.0)), Float64(-0.5 * Float64(h / l)), 1.0) * sqrt(Float64(Float64(d * d) / Float64(l * h)))); elseif (d <= 1.45e-286) tmp = Float64(0.125 * Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(M * Float64(Float64(M * Float64(D * D)) / d)))); elseif (d <= 4.3e+98) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * Float64(1.0 + Float64(Float64(t_0 * Float64(h * -0.5)) / Float64(l * Float64(d * Float64(d * 4.0)))))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.5e+81], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -9.5e-125], N[(N[(N[(t$95$0 / N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.45e-286], N[(0.125 * N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(M * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.3e+98], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(t$95$0 * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \left(D \cdot \left(M \cdot D\right)\right)\\
\mathbf{if}\;d \leq -1.5 \cdot 10^{+81}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq -9.5 \cdot 10^{-125}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_0}{\left(d \cdot d\right) \cdot 4}, -0.5 \cdot \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d \cdot d}{\ell \cdot h}}\\
\mathbf{elif}\;d \leq 1.45 \cdot 10^{-286}:\\
\;\;\;\;0.125 \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(M \cdot \frac{M \cdot \left(D \cdot D\right)}{d}\right)\right)\\
\mathbf{elif}\;d \leq 4.3 \cdot 10^{+98}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 + \frac{t\_0 \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -1.49999999999999999e81Initial program 76.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites55.0%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6469.2
Applied rewrites69.2%
if -1.49999999999999999e81 < d < -9.50000000000000031e-125Initial program 65.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.7
Applied rewrites58.5%
if -9.50000000000000031e-125 < d < 1.4499999999999999e-286Initial program 36.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites20.7%
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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites24.8%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites27.6%
Taylor expanded in D around inf
Applied rewrites36.5%
if 1.4499999999999999e-286 < d < 4.3000000000000001e98Initial program 61.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites55.4%
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f6455.4
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f64N/A
Applied rewrites60.8%
if 4.3000000000000001e98 < d Initial program 68.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6459.8
Applied rewrites59.8%
Applied rewrites59.9%
Applied rewrites85.0%
Final simplification60.4%
(FPCore (d h l M D)
:precision binary64
(if (<= d -4.3e-122)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= d 1.45e-286)
(* 0.125 (* (sqrt (/ h (* l (* l l)))) (* M (/ (* M (* D D)) d))))
(if (<= d 4.3e+98)
(*
(/ d (sqrt (* l h)))
(+ 1.0 (/ (* (* M (* D (* M D))) (* h -0.5)) (* l (* d (* d 4.0))))))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4.3e-122) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (d <= 1.45e-286) {
tmp = 0.125 * (sqrt((h / (l * (l * l)))) * (M * ((M * (D * D)) / d)));
} else if (d <= 4.3e+98) {
tmp = (d / sqrt((l * h))) * (1.0 + (((M * (D * (M * D))) * (h * -0.5)) / (l * (d * (d * 4.0)))));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-4.3d-122)) then
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l)
else if (d <= 1.45d-286) then
tmp = 0.125d0 * (sqrt((h / (l * (l * l)))) * (m * ((m * (d_1 * d_1)) / d)))
else if (d <= 4.3d+98) then
tmp = (d / sqrt((l * h))) * (1.0d0 + (((m * (d_1 * (m * d_1))) * (h * (-0.5d0))) / (l * (d * (d * 4.0d0)))))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4.3e-122) {
tmp = (Math.sqrt(-d) * Math.sqrt((d / h))) / Math.sqrt(-l);
} else if (d <= 1.45e-286) {
tmp = 0.125 * (Math.sqrt((h / (l * (l * l)))) * (M * ((M * (D * D)) / d)));
} else if (d <= 4.3e+98) {
tmp = (d / Math.sqrt((l * h))) * (1.0 + (((M * (D * (M * D))) * (h * -0.5)) / (l * (d * (d * 4.0)))));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -4.3e-122: tmp = (math.sqrt(-d) * math.sqrt((d / h))) / math.sqrt(-l) elif d <= 1.45e-286: tmp = 0.125 * (math.sqrt((h / (l * (l * l)))) * (M * ((M * (D * D)) / d))) elif d <= 4.3e+98: tmp = (d / math.sqrt((l * h))) * (1.0 + (((M * (D * (M * D))) * (h * -0.5)) / (l * (d * (d * 4.0))))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -4.3e-122) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (d <= 1.45e-286) tmp = Float64(0.125 * Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(M * Float64(Float64(M * Float64(D * D)) / d)))); elseif (d <= 4.3e+98) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * Float64(1.0 + Float64(Float64(Float64(M * Float64(D * Float64(M * D))) * Float64(h * -0.5)) / Float64(l * Float64(d * Float64(d * 4.0)))))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -4.3e-122) tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l); elseif (d <= 1.45e-286) tmp = 0.125 * (sqrt((h / (l * (l * l)))) * (M * ((M * (D * D)) / d))); elseif (d <= 4.3e+98) tmp = (d / sqrt((l * h))) * (1.0 + (((M * (D * (M * D))) * (h * -0.5)) / (l * (d * (d * 4.0))))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4.3e-122], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.45e-286], N[(0.125 * N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(M * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.3e+98], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4.3 \cdot 10^{-122}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq 1.45 \cdot 10^{-286}:\\
\;\;\;\;0.125 \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(M \cdot \frac{M \cdot \left(D \cdot D\right)}{d}\right)\right)\\
\mathbf{elif}\;d \leq 4.3 \cdot 10^{+98}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 + \frac{\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.30000000000000019e-122Initial program 71.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites65.0%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6456.8
Applied rewrites56.8%
if -4.30000000000000019e-122 < d < 1.4499999999999999e-286Initial program 36.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites20.7%
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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites24.8%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites27.6%
Taylor expanded in D around inf
Applied rewrites36.5%
if 1.4499999999999999e-286 < d < 4.3000000000000001e98Initial program 61.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites55.4%
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f6455.4
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-sqrt.f64N/A
pow1/2N/A
metadata-evalN/A
lift-pow.f64N/A
lift-/.f64N/A
Applied rewrites60.8%
if 4.3000000000000001e98 < d Initial program 68.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6459.8
Applied rewrites59.8%
Applied rewrites59.9%
Applied rewrites85.0%
Final simplification57.9%
(FPCore (d h l M D)
:precision binary64
(if (<= d -4.3e-122)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= d 1.45e-286)
(* 0.125 (* (sqrt (/ h (* l (* l l)))) (* M (/ (* M (* D D)) d))))
(if (<= d 7.5e+70)
(*
(/ d (sqrt (* l h)))
(fma (* M (* D (* M D))) (/ (* h -0.5) (* l (* (* d d) 4.0))) 1.0))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4.3e-122) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (d <= 1.45e-286) {
tmp = 0.125 * (sqrt((h / (l * (l * l)))) * (M * ((M * (D * D)) / d)));
} else if (d <= 7.5e+70) {
tmp = (d / sqrt((l * h))) * fma((M * (D * (M * D))), ((h * -0.5) / (l * ((d * d) * 4.0))), 1.0);
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (d <= -4.3e-122) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (d <= 1.45e-286) tmp = Float64(0.125 * Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(M * Float64(Float64(M * Float64(D * D)) / d)))); elseif (d <= 7.5e+70) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(M * Float64(D * Float64(M * D))), Float64(Float64(h * -0.5) / Float64(l * Float64(Float64(d * d) * 4.0))), 1.0)); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4.3e-122], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.45e-286], N[(0.125 * N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(M * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 7.5e+70], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4.3 \cdot 10^{-122}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq 1.45 \cdot 10^{-286}:\\
\;\;\;\;0.125 \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(M \cdot \frac{M \cdot \left(D \cdot D\right)}{d}\right)\right)\\
\mathbf{elif}\;d \leq 7.5 \cdot 10^{+70}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right), \frac{h \cdot -0.5}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.30000000000000019e-122Initial program 71.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites65.0%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6456.8
Applied rewrites56.8%
if -4.30000000000000019e-122 < d < 1.4499999999999999e-286Initial program 36.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites20.7%
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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites24.8%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites27.6%
Taylor expanded in D around inf
Applied rewrites36.5%
if 1.4499999999999999e-286 < d < 7.50000000000000031e70Initial program 61.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites55.0%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
div-invN/A
associate-*l*N/A
Applied rewrites0.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
Applied rewrites59.0%
if 7.50000000000000031e70 < d Initial program 68.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6460.3
Applied rewrites60.3%
Applied rewrites60.4%
Applied rewrites83.3%
Final simplification57.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* l (* l l))))
(if (<= d -4.3e-122)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= d -4.1e-305)
(* 0.125 (* (sqrt (/ h t_0)) (* M (/ (* M (* D D)) d))))
(if (<= d 5.6e-26)
(/ (* (sqrt h) (* (* M (* D (* M D))) -0.125)) (* d (sqrt t_0)))
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = l * (l * l);
double tmp;
if (d <= -4.3e-122) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (d <= -4.1e-305) {
tmp = 0.125 * (sqrt((h / t_0)) * (M * ((M * (D * D)) / d)));
} else if (d <= 5.6e-26) {
tmp = (sqrt(h) * ((M * (D * (M * D))) * -0.125)) / (d * sqrt(t_0));
} 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) :: t_0
real(8) :: tmp
t_0 = l * (l * l)
if (d <= (-4.3d-122)) then
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l)
else if (d <= (-4.1d-305)) then
tmp = 0.125d0 * (sqrt((h / t_0)) * (m * ((m * (d_1 * d_1)) / d)))
else if (d <= 5.6d-26) then
tmp = (sqrt(h) * ((m * (d_1 * (m * d_1))) * (-0.125d0))) / (d * sqrt(t_0))
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 t_0 = l * (l * l);
double tmp;
if (d <= -4.3e-122) {
tmp = (Math.sqrt(-d) * Math.sqrt((d / h))) / Math.sqrt(-l);
} else if (d <= -4.1e-305) {
tmp = 0.125 * (Math.sqrt((h / t_0)) * (M * ((M * (D * D)) / d)));
} else if (d <= 5.6e-26) {
tmp = (Math.sqrt(h) * ((M * (D * (M * D))) * -0.125)) / (d * Math.sqrt(t_0));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = l * (l * l) tmp = 0 if d <= -4.3e-122: tmp = (math.sqrt(-d) * math.sqrt((d / h))) / math.sqrt(-l) elif d <= -4.1e-305: tmp = 0.125 * (math.sqrt((h / t_0)) * (M * ((M * (D * D)) / d))) elif d <= 5.6e-26: tmp = (math.sqrt(h) * ((M * (D * (M * D))) * -0.125)) / (d * math.sqrt(t_0)) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(l * Float64(l * l)) tmp = 0.0 if (d <= -4.3e-122) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (d <= -4.1e-305) tmp = Float64(0.125 * Float64(sqrt(Float64(h / t_0)) * Float64(M * Float64(Float64(M * Float64(D * D)) / d)))); elseif (d <= 5.6e-26) tmp = Float64(Float64(sqrt(h) * Float64(Float64(M * Float64(D * Float64(M * D))) * -0.125)) / Float64(d * sqrt(t_0))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = l * (l * l); tmp = 0.0; if (d <= -4.3e-122) tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l); elseif (d <= -4.1e-305) tmp = 0.125 * (sqrt((h / t_0)) * (M * ((M * (D * D)) / d))); elseif (d <= 5.6e-26) tmp = (sqrt(h) * ((M * (D * (M * D))) * -0.125)) / (d * sqrt(t_0)); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -4.3e-122], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4.1e-305], N[(0.125 * N[(N[Sqrt[N[(h / t$95$0), $MachinePrecision]], $MachinePrecision] * N[(M * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.6e-26], N[(N[(N[Sqrt[h], $MachinePrecision] * N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] / N[(d * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \ell \cdot \left(\ell \cdot \ell\right)\\
\mathbf{if}\;d \leq -4.3 \cdot 10^{-122}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq -4.1 \cdot 10^{-305}:\\
\;\;\;\;0.125 \cdot \left(\sqrt{\frac{h}{t\_0}} \cdot \left(M \cdot \frac{M \cdot \left(D \cdot D\right)}{d}\right)\right)\\
\mathbf{elif}\;d \leq 5.6 \cdot 10^{-26}:\\
\;\;\;\;\frac{\sqrt{h} \cdot \left(\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot -0.125\right)}{d \cdot \sqrt{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.30000000000000019e-122Initial program 71.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites65.0%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6456.8
Applied rewrites56.8%
if -4.30000000000000019e-122 < d < -4.1000000000000002e-305Initial program 39.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites25.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites30.2%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites28.3%
Taylor expanded in D around inf
Applied rewrites39.2%
if -4.1000000000000002e-305 < d < 5.6000000000000002e-26Initial program 54.0%
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 rewrites31.9%
Applied rewrites47.5%
if 5.6000000000000002e-26 < d Initial program 70.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6450.9
Applied rewrites50.9%
Applied rewrites51.0%
Applied rewrites69.1%
Final simplification53.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l))))))
(if (<= d -4.3e-122)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= d -4.1e-305)
(* 0.125 (* t_0 (* M (/ (* M (* D D)) d))))
(if (<= d 5.6e-26)
(* t_0 (* (* M (* D (* M D))) (/ -0.125 d)))
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
double tmp;
if (d <= -4.3e-122) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (d <= -4.1e-305) {
tmp = 0.125 * (t_0 * (M * ((M * (D * D)) / d)));
} else if (d <= 5.6e-26) {
tmp = t_0 * ((M * (D * (M * D))) * (-0.125 / d));
} 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) :: t_0
real(8) :: tmp
t_0 = sqrt((h / (l * (l * l))))
if (d <= (-4.3d-122)) then
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l)
else if (d <= (-4.1d-305)) then
tmp = 0.125d0 * (t_0 * (m * ((m * (d_1 * d_1)) / d)))
else if (d <= 5.6d-26) then
tmp = t_0 * ((m * (d_1 * (m * d_1))) * ((-0.125d0) / d))
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 t_0 = Math.sqrt((h / (l * (l * l))));
double tmp;
if (d <= -4.3e-122) {
tmp = (Math.sqrt(-d) * Math.sqrt((d / h))) / Math.sqrt(-l);
} else if (d <= -4.1e-305) {
tmp = 0.125 * (t_0 * (M * ((M * (D * D)) / d)));
} else if (d <= 5.6e-26) {
tmp = t_0 * ((M * (D * (M * D))) * (-0.125 / d));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / (l * (l * l)))) tmp = 0 if d <= -4.3e-122: tmp = (math.sqrt(-d) * math.sqrt((d / h))) / math.sqrt(-l) elif d <= -4.1e-305: tmp = 0.125 * (t_0 * (M * ((M * (D * D)) / d))) elif d <= 5.6e-26: tmp = t_0 * ((M * (D * (M * D))) * (-0.125 / d)) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (d <= -4.3e-122) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (d <= -4.1e-305) tmp = Float64(0.125 * Float64(t_0 * Float64(M * Float64(Float64(M * Float64(D * D)) / d)))); elseif (d <= 5.6e-26) tmp = Float64(t_0 * Float64(Float64(M * Float64(D * Float64(M * D))) * Float64(-0.125 / d))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / (l * (l * l)))); tmp = 0.0; if (d <= -4.3e-122) tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l); elseif (d <= -4.1e-305) tmp = 0.125 * (t_0 * (M * ((M * (D * D)) / d))); elseif (d <= 5.6e-26) tmp = t_0 * ((M * (D * (M * D))) * (-0.125 / d)); else tmp = d / (sqrt(h) * sqrt(l)); 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]}, If[LessEqual[d, -4.3e-122], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -4.1e-305], N[(0.125 * N[(t$95$0 * N[(M * N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.6e-26], N[(t$95$0 * N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;d \leq -4.3 \cdot 10^{-122}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq -4.1 \cdot 10^{-305}:\\
\;\;\;\;0.125 \cdot \left(t\_0 \cdot \left(M \cdot \frac{M \cdot \left(D \cdot D\right)}{d}\right)\right)\\
\mathbf{elif}\;d \leq 5.6 \cdot 10^{-26}:\\
\;\;\;\;t\_0 \cdot \left(\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{-0.125}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -4.30000000000000019e-122Initial program 71.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites65.0%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6456.8
Applied rewrites56.8%
if -4.30000000000000019e-122 < d < -4.1000000000000002e-305Initial program 39.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites25.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
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
Applied rewrites30.2%
Taylor expanded in l around -inf
lower-fma.f64N/A
Applied rewrites28.3%
Taylor expanded in D around inf
Applied rewrites39.2%
if -4.1000000000000002e-305 < d < 5.6000000000000002e-26Initial program 54.0%
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 rewrites31.9%
Applied rewrites47.2%
if 5.6000000000000002e-26 < d Initial program 70.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6450.9
Applied rewrites50.9%
Applied rewrites51.0%
Applied rewrites69.1%
Final simplification53.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l))))))
(if (<= d -2.8e-122)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= d -1.15e-302)
(* t_0 (* (* D (* D (* M M))) (/ 0.125 d)))
(if (<= d 5.6e-26)
(* t_0 (* (* M (* D (* M D))) (/ -0.125 d)))
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
double tmp;
if (d <= -2.8e-122) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (d <= -1.15e-302) {
tmp = t_0 * ((D * (D * (M * M))) * (0.125 / d));
} else if (d <= 5.6e-26) {
tmp = t_0 * ((M * (D * (M * D))) * (-0.125 / d));
} 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) :: t_0
real(8) :: tmp
t_0 = sqrt((h / (l * (l * l))))
if (d <= (-2.8d-122)) then
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l)
else if (d <= (-1.15d-302)) then
tmp = t_0 * ((d_1 * (d_1 * (m * m))) * (0.125d0 / d))
else if (d <= 5.6d-26) then
tmp = t_0 * ((m * (d_1 * (m * d_1))) * ((-0.125d0) / d))
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 t_0 = Math.sqrt((h / (l * (l * l))));
double tmp;
if (d <= -2.8e-122) {
tmp = (Math.sqrt(-d) * Math.sqrt((d / h))) / Math.sqrt(-l);
} else if (d <= -1.15e-302) {
tmp = t_0 * ((D * (D * (M * M))) * (0.125 / d));
} else if (d <= 5.6e-26) {
tmp = t_0 * ((M * (D * (M * D))) * (-0.125 / d));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / (l * (l * l)))) tmp = 0 if d <= -2.8e-122: tmp = (math.sqrt(-d) * math.sqrt((d / h))) / math.sqrt(-l) elif d <= -1.15e-302: tmp = t_0 * ((D * (D * (M * M))) * (0.125 / d)) elif d <= 5.6e-26: tmp = t_0 * ((M * (D * (M * D))) * (-0.125 / d)) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) tmp = 0.0 if (d <= -2.8e-122) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (d <= -1.15e-302) tmp = Float64(t_0 * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(0.125 / d))); elseif (d <= 5.6e-26) tmp = Float64(t_0 * Float64(Float64(M * Float64(D * Float64(M * D))) * Float64(-0.125 / d))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / (l * (l * l)))); tmp = 0.0; if (d <= -2.8e-122) tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l); elseif (d <= -1.15e-302) tmp = t_0 * ((D * (D * (M * M))) * (0.125 / d)); elseif (d <= 5.6e-26) tmp = t_0 * ((M * (D * (M * D))) * (-0.125 / d)); else tmp = d / (sqrt(h) * sqrt(l)); 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]}, If[LessEqual[d, -2.8e-122], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.15e-302], N[(t$95$0 * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.6e-26], N[(t$95$0 * N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
\mathbf{if}\;d \leq -2.8 \cdot 10^{-122}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq -1.15 \cdot 10^{-302}:\\
\;\;\;\;t\_0 \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{0.125}{d}\right)\\
\mathbf{elif}\;d \leq 5.6 \cdot 10^{-26}:\\
\;\;\;\;t\_0 \cdot \left(\left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right) \cdot \frac{-0.125}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -2.7999999999999999e-122Initial program 71.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites65.0%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6456.8
Applied rewrites56.8%
if -2.7999999999999999e-122 < d < -1.15000000000000001e-302Initial program 37.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
distribute-rgt-neg-inN/A
distribute-neg-fracN/A
Applied rewrites43.0%
if -1.15000000000000001e-302 < d < 5.6000000000000002e-26Initial program 54.6%
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 rewrites31.5%
Applied rewrites46.7%
if 5.6000000000000002e-26 < d Initial program 70.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6450.9
Applied rewrites50.9%
Applied rewrites51.0%
Applied rewrites69.1%
Final simplification54.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l))))) (t_1 (* D (* M M))))
(if (<= d -2.8e-122)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= d -1.15e-302)
(* t_0 (* (* D t_1) (/ 0.125 d)))
(if (<= d 1.25e-25)
(* D (* t_0 (* t_1 (/ -0.125 d))))
(/ d (* (sqrt h) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
double t_1 = D * (M * M);
double tmp;
if (d <= -2.8e-122) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (d <= -1.15e-302) {
tmp = t_0 * ((D * t_1) * (0.125 / d));
} else if (d <= 1.25e-25) {
tmp = D * (t_0 * (t_1 * (-0.125 / d)));
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((h / (l * (l * l))))
t_1 = d_1 * (m * m)
if (d <= (-2.8d-122)) then
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l)
else if (d <= (-1.15d-302)) then
tmp = t_0 * ((d_1 * t_1) * (0.125d0 / d))
else if (d <= 1.25d-25) then
tmp = d_1 * (t_0 * (t_1 * ((-0.125d0) / d)))
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 t_0 = Math.sqrt((h / (l * (l * l))));
double t_1 = D * (M * M);
double tmp;
if (d <= -2.8e-122) {
tmp = (Math.sqrt(-d) * Math.sqrt((d / h))) / Math.sqrt(-l);
} else if (d <= -1.15e-302) {
tmp = t_0 * ((D * t_1) * (0.125 / d));
} else if (d <= 1.25e-25) {
tmp = D * (t_0 * (t_1 * (-0.125 / d)));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / (l * (l * l)))) t_1 = D * (M * M) tmp = 0 if d <= -2.8e-122: tmp = (math.sqrt(-d) * math.sqrt((d / h))) / math.sqrt(-l) elif d <= -1.15e-302: tmp = t_0 * ((D * t_1) * (0.125 / d)) elif d <= 1.25e-25: tmp = D * (t_0 * (t_1 * (-0.125 / d))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) t_1 = Float64(D * Float64(M * M)) tmp = 0.0 if (d <= -2.8e-122) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (d <= -1.15e-302) tmp = Float64(t_0 * Float64(Float64(D * t_1) * Float64(0.125 / d))); elseif (d <= 1.25e-25) tmp = Float64(D * Float64(t_0 * Float64(t_1 * Float64(-0.125 / d)))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / (l * (l * l)))); t_1 = D * (M * M); tmp = 0.0; if (d <= -2.8e-122) tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l); elseif (d <= -1.15e-302) tmp = t_0 * ((D * t_1) * (0.125 / d)); elseif (d <= 1.25e-25) tmp = D * (t_0 * (t_1 * (-0.125 / d))); else tmp = d / (sqrt(h) * sqrt(l)); 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[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.8e-122], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.15e-302], N[(t$95$0 * N[(N[(D * t$95$1), $MachinePrecision] * N[(0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.25e-25], N[(D * N[(t$95$0 * N[(t$95$1 * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
t_1 := D \cdot \left(M \cdot M\right)\\
\mathbf{if}\;d \leq -2.8 \cdot 10^{-122}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq -1.15 \cdot 10^{-302}:\\
\;\;\;\;t\_0 \cdot \left(\left(D \cdot t\_1\right) \cdot \frac{0.125}{d}\right)\\
\mathbf{elif}\;d \leq 1.25 \cdot 10^{-25}:\\
\;\;\;\;D \cdot \left(t\_0 \cdot \left(t\_1 \cdot \frac{-0.125}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if d < -2.7999999999999999e-122Initial program 71.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites65.0%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6456.8
Applied rewrites56.8%
if -2.7999999999999999e-122 < d < -1.15000000000000001e-302Initial program 37.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
distribute-rgt-neg-inN/A
distribute-neg-fracN/A
Applied rewrites43.0%
if -1.15000000000000001e-302 < d < 1.2499999999999999e-25Initial program 54.0%
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 rewrites31.1%
Applied rewrites36.7%
if 1.2499999999999999e-25 < d Initial program 71.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6451.9
Applied rewrites51.9%
Applied rewrites51.9%
Applied rewrites70.4%
Final simplification51.5%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.15e-82)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= l 2.5e-308)
(* d (sqrt (sqrt (/ 1.0 (* h (* l (* l h)))))))
(if (<= l 3.8e-215)
(* D (* (sqrt (/ h (* l (* l l)))) (* (* D (* M M)) (/ -0.125 d))))
(/ d (* (sqrt h) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.15e-82) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (l <= 2.5e-308) {
tmp = d * sqrt(sqrt((1.0 / (h * (l * (l * h))))));
} else if (l <= 3.8e-215) {
tmp = D * (sqrt((h / (l * (l * l)))) * ((D * (M * M)) * (-0.125 / d)));
} 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 <= (-2.15d-82)) then
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l)
else if (l <= 2.5d-308) then
tmp = d * sqrt(sqrt((1.0d0 / (h * (l * (l * h))))))
else if (l <= 3.8d-215) then
tmp = d_1 * (sqrt((h / (l * (l * l)))) * ((d_1 * (m * m)) * ((-0.125d0) / d)))
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 <= -2.15e-82) {
tmp = (Math.sqrt(-d) * Math.sqrt((d / h))) / Math.sqrt(-l);
} else if (l <= 2.5e-308) {
tmp = d * Math.sqrt(Math.sqrt((1.0 / (h * (l * (l * h))))));
} else if (l <= 3.8e-215) {
tmp = D * (Math.sqrt((h / (l * (l * l)))) * ((D * (M * M)) * (-0.125 / d)));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.15e-82: tmp = (math.sqrt(-d) * math.sqrt((d / h))) / math.sqrt(-l) elif l <= 2.5e-308: tmp = d * math.sqrt(math.sqrt((1.0 / (h * (l * (l * h)))))) elif l <= 3.8e-215: tmp = D * (math.sqrt((h / (l * (l * l)))) * ((D * (M * M)) * (-0.125 / d))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.15e-82) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (l <= 2.5e-308) tmp = Float64(d * sqrt(sqrt(Float64(1.0 / Float64(h * Float64(l * Float64(l * h))))))); elseif (l <= 3.8e-215) tmp = Float64(D * Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * Float64(M * M)) * Float64(-0.125 / d)))); 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 <= -2.15e-82) tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l); elseif (l <= 2.5e-308) tmp = d * sqrt(sqrt((1.0 / (h * (l * (l * h)))))); elseif (l <= 3.8e-215) tmp = D * (sqrt((h / (l * (l * l)))) * ((D * (M * M)) * (-0.125 / d))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.15e-82], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.5e-308], N[(d * N[Sqrt[N[Sqrt[N[(1.0 / N[(h * N[(l * N[(l * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.8e-215], N[(D * N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $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 -2.15 \cdot 10^{-82}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq 2.5 \cdot 10^{-308}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{\frac{1}{h \cdot \left(\ell \cdot \left(\ell \cdot h\right)\right)}}}\\
\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-215}:\\
\;\;\;\;D \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(M \cdot M\right)\right) \cdot \frac{-0.125}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < -2.15000000000000009e-82Initial program 55.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites51.6%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6449.7
Applied rewrites49.7%
if -2.15000000000000009e-82 < l < 2.49999999999999977e-308Initial program 70.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6429.5
Applied rewrites29.5%
Applied rewrites42.8%
Applied rewrites44.8%
if 2.49999999999999977e-308 < l < 3.79999999999999977e-215Initial program 66.8%
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 rewrites61.9%
Applied rewrites61.9%
if 3.79999999999999977e-215 < l Initial program 59.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6441.2
Applied rewrites41.2%
Applied rewrites41.3%
Applied rewrites50.5%
Final simplification50.1%
(FPCore (d h l M D)
:precision binary64
(if (<= h -2.45e-169)
(/ (* (sqrt (- d)) (sqrt (/ d h))) (sqrt (- l)))
(if (<= h -1e-310)
(* d (sqrt (sqrt (/ 1.0 (* l (* l (* h h)))))))
(/ d (* (sqrt h) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.45e-169) {
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l);
} else if (h <= -1e-310) {
tmp = d * sqrt(sqrt((1.0 / (l * (l * (h * h))))));
} 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 (h <= (-2.45d-169)) then
tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l)
else if (h <= (-1d-310)) then
tmp = d * sqrt(sqrt((1.0d0 / (l * (l * (h * h))))))
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 (h <= -2.45e-169) {
tmp = (Math.sqrt(-d) * Math.sqrt((d / h))) / Math.sqrt(-l);
} else if (h <= -1e-310) {
tmp = d * Math.sqrt(Math.sqrt((1.0 / (l * (l * (h * h))))));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -2.45e-169: tmp = (math.sqrt(-d) * math.sqrt((d / h))) / math.sqrt(-l) elif h <= -1e-310: tmp = d * math.sqrt(math.sqrt((1.0 / (l * (l * (h * h)))))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -2.45e-169) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / h))) / sqrt(Float64(-l))); elseif (h <= -1e-310) tmp = Float64(d * sqrt(sqrt(Float64(1.0 / Float64(l * Float64(l * Float64(h * h))))))); 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 (h <= -2.45e-169) tmp = (sqrt(-d) * sqrt((d / h))) / sqrt(-l); elseif (h <= -1e-310) tmp = d * sqrt(sqrt((1.0 / (l * (l * (h * h)))))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -2.45e-169], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-310], N[(d * N[Sqrt[N[Sqrt[N[(1.0 / N[(l * N[(l * N[(h * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;h \leq -2.45 \cdot 10^{-169}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{\frac{1}{\ell \cdot \left(\ell \cdot \left(h \cdot h\right)\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if h < -2.45e-169Initial program 61.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
Applied rewrites51.5%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6448.8
Applied rewrites48.8%
if -2.45e-169 < h < -9.999999999999969e-311Initial program 59.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites38.0%
Taylor expanded in h around 0
Applied rewrites44.2%
if -9.999999999999969e-311 < h Initial program 61.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6437.2
Applied rewrites37.2%
Applied rewrites37.3%
Applied rewrites45.7%
Final simplification46.7%
(FPCore (d h l M D) :precision binary64 (if (<= l 1.1e-251) (* (- d) (sqrt (/ 1.0 (* l h)))) (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 1.1e-251) {
tmp = -d * sqrt((1.0 / (l * h)));
} 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 <= 1.1d-251) then
tmp = -d * sqrt((1.0d0 / (l * h)))
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 <= 1.1e-251) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 1.1e-251: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 1.1e-251) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); 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 <= 1.1e-251) tmp = -d * sqrt((1.0 / (l * h))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 1.1e-251], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.1 \cdot 10^{-251}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < 1.1e-251Initial program 61.3%
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.f6440.1
Applied rewrites40.1%
if 1.1e-251 < l Initial program 60.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Applied rewrites39.4%
Applied rewrites47.8%
Final simplification43.5%
(FPCore (d h l M D) :precision binary64 (if (<= h -2.8e-237) (* (- d) (sqrt (/ 1.0 (* l h)))) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.8e-237) {
tmp = -d * sqrt((1.0 / (l * h)));
} else {
tmp = d / sqrt((l * h));
}
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 (h <= (-2.8d-237)) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else
tmp = d / sqrt((l * h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -2.8e-237) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -2.8e-237: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -2.8e-237) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -2.8e-237) tmp = -d * sqrt((1.0 / (l * h))); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -2.8e-237], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -2.8 \cdot 10^{-237}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if h < -2.79999999999999997e-237Initial program 59.3%
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.f6442.7
Applied rewrites42.7%
if -2.79999999999999997e-237 < h Initial program 62.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6438.7
Applied rewrites38.7%
Applied rewrites38.7%
Final simplification40.6%
(FPCore (d h l M D) :precision binary64 (if (<= l -6.5e-94) (sqrt (* d (/ d (* l h)))) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -6.5e-94) {
tmp = sqrt((d * (d / (l * h))));
} else {
tmp = d / sqrt((l * h));
}
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.5d-94)) then
tmp = sqrt((d * (d / (l * h))))
else
tmp = d / sqrt((l * h))
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.5e-94) {
tmp = Math.sqrt((d * (d / (l * h))));
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -6.5e-94: tmp = math.sqrt((d * (d / (l * h)))) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -6.5e-94) tmp = sqrt(Float64(d * Float64(d / Float64(l * h)))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -6.5e-94) tmp = sqrt((d * (d / (l * h)))); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -6.5e-94], N[Sqrt[N[(d * N[(d / N[(l * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.5 \cdot 10^{-94}:\\
\;\;\;\;\sqrt{d \cdot \frac{d}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -6.4999999999999996e-94Initial program 55.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f643.7
Applied rewrites3.7%
Applied rewrites23.4%
Applied rewrites29.0%
if -6.4999999999999996e-94 < l Initial program 63.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6435.2
Applied rewrites35.2%
Applied rewrites35.3%
Final simplification33.2%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
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((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 61.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6424.6
Applied rewrites24.6%
Applied rewrites24.7%
Final simplification24.7%
herbie shell --seed 2024231
(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)))))