
(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 27 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 (* M (/ 0.5 d))) (t_1 (sqrt (- d))))
(if (<= h -2.25e-61)
(*
(- 1.0 (* (/ (* (/ M d) (* (* D 0.5) 0.5)) (/ 1.0 h)) (/ (* D t_0) l)))
(* (/ t_1 (sqrt (- l))) (sqrt (/ d h))))
(if (<= h -1e-310)
(*
(- 1.0 (* (/ h l) (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ 1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (* (sqrt (/ -1.0 h)) t_1)))
(*
(- 1.0 (* (/ D l) (* (* (* 0.25 D) (* (/ M d) h)) t_0)))
(* (* (/ 1.0 (sqrt l)) (sqrt d)) (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (0.5 / d);
double t_1 = sqrt(-d);
double tmp;
if (h <= -2.25e-61) {
tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((t_1 / sqrt(-l)) * sqrt((d / h)));
} else if (h <= -1e-310) {
tmp = (1.0 - ((h / l) * (pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * (sqrt((-1.0 / h)) * t_1));
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (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 = m * (0.5d0 / d)
t_1 = sqrt(-d)
if (h <= (-2.25d-61)) then
tmp = (1.0d0 - ((((m / d) * ((d_1 * 0.5d0) * 0.5d0)) / (1.0d0 / h)) * ((d_1 * t_0) / l))) * ((t_1 / sqrt(-l)) * sqrt((d / h)))
else if (h <= (-1d-310)) then
tmp = (1.0d0 - ((h / l) * ((((d_1 * m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * (sqrt(((-1.0d0) / h)) * t_1))
else
tmp = (1.0d0 - ((d_1 / l) * (((0.25d0 * d_1) * ((m / d) * h)) * t_0))) * (((1.0d0 / sqrt(l)) * sqrt(d)) * (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 = M * (0.5 / d);
double t_1 = Math.sqrt(-d);
double tmp;
if (h <= -2.25e-61) {
tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((t_1 / Math.sqrt(-l)) * Math.sqrt((d / h)));
} else if (h <= -1e-310) {
tmp = (1.0 - ((h / l) * (Math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * (Math.sqrt((-1.0 / h)) * t_1));
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / Math.sqrt(l)) * Math.sqrt(d)) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M * (0.5 / d) t_1 = math.sqrt(-d) tmp = 0 if h <= -2.25e-61: tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((t_1 / math.sqrt(-l)) * math.sqrt((d / h))) elif h <= -1e-310: tmp = (1.0 - ((h / l) * (math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * (math.sqrt((-1.0 / h)) * t_1)) else: tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / math.sqrt(l)) * math.sqrt(d)) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 / d)) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -2.25e-61) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(M / d) * Float64(Float64(D * 0.5) * 0.5)) / Float64(1.0 / h)) * Float64(Float64(D * t_0) / l))) * Float64(Float64(t_1 / sqrt(Float64(-l))) * sqrt(Float64(d / h)))); elseif (h <= -1e-310) tmp = Float64(Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * Float64(sqrt(Float64(-1.0 / h)) * t_1))); else tmp = Float64(Float64(1.0 - Float64(Float64(D / l) * Float64(Float64(Float64(0.25 * D) * Float64(Float64(M / d) * h)) * t_0))) * Float64(Float64(Float64(1.0 / sqrt(l)) * sqrt(d)) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M * (0.5 / d); t_1 = sqrt(-d); tmp = 0.0; if (h <= -2.25e-61) tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((t_1 / sqrt(-l)) * sqrt((d / h))); elseif (h <= -1e-310) tmp = (1.0 - ((h / l) * ((((D * M) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * (sqrt((-1.0 / h)) * t_1)); else tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -2.25e-61], N[(N[(1.0 - N[(N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(1.0 / h), $MachinePrecision]), $MachinePrecision] * N[(N[(D * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-310], N[(N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(D / l), $MachinePrecision] * N[(N[(N[(0.25 * D), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{0.5}{d}\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;h \leq -2.25 \cdot 10^{-61}:\\
\;\;\;\;\left(1 - \frac{\frac{M}{d} \cdot \left(\left(D \cdot 0.5\right) \cdot 0.5\right)}{\frac{1}{h}} \cdot \frac{D \cdot t\_0}{\ell}\right) \cdot \left(\frac{t\_1}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(\sqrt{\frac{-1}{h}} \cdot t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{D}{\ell} \cdot \left(\left(\left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right)\right) \cdot t\_0\right)\right) \cdot \left(\left(\frac{1}{\sqrt{\ell}} \cdot \sqrt{d}\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -2.25e-61Initial program 77.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites80.2%
lift-/.f64N/A
metadata-eval80.2
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6480.2
Applied rewrites80.2%
lift-/.f64N/A
metadata-eval80.2
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6480.2
Applied rewrites80.2%
lift-/.f64N/A
lift-sqrt.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6491.5
Applied rewrites91.5%
if -2.25e-61 < h < -9.999999999999969e-311Initial program 73.4%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
neg-mul-1N/A
associate-/r*N/A
metadata-evalN/A
lower-/.f6491.4
Applied rewrites91.4%
if -9.999999999999969e-311 < h Initial program 60.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6471.9
Applied rewrites71.9%
lift-/.f64N/A
metadata-eval71.9
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6474.2
Applied rewrites74.2%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites75.6%
Applied rewrites83.5%
Final simplification87.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (/ h l) (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ 1.0 2.0))))))
(t_1 (sqrt (/ d h)))
(t_2 (sqrt (/ d l))))
(if (<= t_0 -4e-53)
(* (* (* (* -0.125 h) (* (* (/ D (* (* d d) l)) M) (* D M))) t_1) t_2)
(if (<= t_0 2e+282) (* t_2 t_1) (/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double t_1 = sqrt((d / h));
double t_2 = sqrt((d / l));
double tmp;
if (t_0 <= -4e-53) {
tmp = (((-0.125 * h) * (((D / ((d * d) * l)) * M) * (D * M))) * t_1) * t_2;
} else if (t_0 <= 2e+282) {
tmp = t_2 * t_1;
} else {
tmp = d / (sqrt(l) * 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 = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((d_1 * m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))
t_1 = sqrt((d / h))
t_2 = sqrt((d / l))
if (t_0 <= (-4d-53)) then
tmp = ((((-0.125d0) * h) * (((d_1 / ((d * d) * l)) * m) * (d_1 * m))) * t_1) * t_2
else if (t_0 <= 2d+282) then
tmp = t_2 * t_1
else
tmp = d / (sqrt(l) * 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.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double t_1 = Math.sqrt((d / h));
double t_2 = Math.sqrt((d / l));
double tmp;
if (t_0 <= -4e-53) {
tmp = (((-0.125 * h) * (((D / ((d * d) * l)) * M) * (D * M))) * t_1) * t_2;
} else if (t_0 <= 2e+282) {
tmp = t_2 * t_1;
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) t_1 = math.sqrt((d / h)) t_2 = math.sqrt((d / l)) tmp = 0 if t_0 <= -4e-53: tmp = (((-0.125 * h) * (((D / ((d * d) * l)) * M) * (D * M))) * t_1) * t_2 elif t_0 <= 2e+282: tmp = t_2 * t_1 else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0))))) t_1 = sqrt(Float64(d / h)) t_2 = sqrt(Float64(d / l)) tmp = 0.0 if (t_0 <= -4e-53) tmp = Float64(Float64(Float64(Float64(-0.125 * h) * Float64(Float64(Float64(D / Float64(Float64(d * d) * l)) * M) * Float64(D * M))) * t_1) * t_2); elseif (t_0 <= 2e+282) tmp = Float64(t_2 * t_1); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((D * M) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)))); t_1 = sqrt((d / h)); t_2 = sqrt((d / l)); tmp = 0.0; if (t_0 <= -4e-53) tmp = (((-0.125 * h) * (((D / ((d * d) * l)) * M) * (D * M))) * t_1) * t_2; elseif (t_0 <= 2e+282) tmp = t_2 * t_1; else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -4e-53], N[(N[(N[(N[(-0.125 * h), $MachinePrecision] * N[(N[(N[(D / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$0, 2e+282], N[(t$95$2 * t$95$1), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right)\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-53}:\\
\;\;\;\;\left(\left(\left(-0.125 \cdot h\right) \cdot \left(\left(\frac{D}{\left(d \cdot d\right) \cdot \ell} \cdot M\right) \cdot \left(D \cdot M\right)\right)\right) \cdot t\_1\right) \cdot t\_2\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;t\_2 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -4.00000000000000012e-53Initial program 88.9%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6437.7
Applied rewrites37.7%
Taylor expanded in h around inf
associate-*r*N/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.1
Applied rewrites27.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
Applied rewrites55.6%
if -4.00000000000000012e-53 < (*.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.00000000000000007e282Initial program 89.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites71.8%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6437.5
Applied rewrites37.5%
Applied rewrites86.3%
if 2.00000000000000007e282 < (*.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 22.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites29.2%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Applied rewrites41.7%
Applied rewrites42.3%
Final simplification61.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (/ h l) (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ 1.0 2.0)))))))
(if (<= t_0 -4e-53)
(/
(* (* -0.125 h) (* (* (/ D (* (* d d) l)) M) (* D M)))
(sqrt (/ h (* (/ d l) d))))
(if (<= t_0 2e+282)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double tmp;
if (t_0 <= -4e-53) {
tmp = ((-0.125 * h) * (((D / ((d * d) * l)) * M) * (D * M))) / sqrt((h / ((d / l) * d)));
} else if (t_0 <= 2e+282) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = d / (sqrt(l) * 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) :: tmp
t_0 = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((d_1 * m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))
if (t_0 <= (-4d-53)) then
tmp = (((-0.125d0) * h) * (((d_1 / ((d * d) * l)) * m) * (d_1 * m))) / sqrt((h / ((d / l) * d)))
else if (t_0 <= 2d+282) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = d / (sqrt(l) * 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.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double tmp;
if (t_0 <= -4e-53) {
tmp = ((-0.125 * h) * (((D / ((d * d) * l)) * M) * (D * M))) / Math.sqrt((h / ((d / l) * d)));
} else if (t_0 <= 2e+282) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) tmp = 0 if t_0 <= -4e-53: tmp = ((-0.125 * h) * (((D / ((d * d) * l)) * M) * (D * M))) / math.sqrt((h / ((d / l) * d))) elif t_0 <= 2e+282: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0))))) tmp = 0.0 if (t_0 <= -4e-53) tmp = Float64(Float64(Float64(-0.125 * h) * Float64(Float64(Float64(D / Float64(Float64(d * d) * l)) * M) * Float64(D * M))) / sqrt(Float64(h / Float64(Float64(d / l) * d)))); elseif (t_0 <= 2e+282) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((D * M) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)))); tmp = 0.0; if (t_0 <= -4e-53) tmp = ((-0.125 * h) * (((D / ((d * d) * l)) * M) * (D * M))) / sqrt((h / ((d / l) * d))); elseif (t_0 <= 2e+282) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e-53], N[(N[(N[(-0.125 * h), $MachinePrecision] * N[(N[(N[(D / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h / N[(N[(d / l), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+282], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right)\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-53}:\\
\;\;\;\;\frac{\left(-0.125 \cdot h\right) \cdot \left(\left(\frac{D}{\left(d \cdot d\right) \cdot \ell} \cdot M\right) \cdot \left(D \cdot M\right)\right)}{\sqrt{\frac{h}{\frac{d}{\ell} \cdot d}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -4.00000000000000012e-53Initial program 88.9%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6437.7
Applied rewrites37.7%
Taylor expanded in h around inf
associate-*r*N/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.1
Applied rewrites27.1%
Applied rewrites44.8%
if -4.00000000000000012e-53 < (*.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.00000000000000007e282Initial program 89.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites71.8%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6437.5
Applied rewrites37.5%
Applied rewrites86.3%
if 2.00000000000000007e282 < (*.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 22.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites29.2%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Applied rewrites41.7%
Applied rewrites42.3%
Final simplification58.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (/ h l) (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ 1.0 2.0)))))))
(if (<= t_0 -2e+73)
(*
(sqrt (/ (* d d) (* l h)))
(- 1.0 (* (* (* (* 0.125 (/ D (* (* d d) l))) h) M) (* D M))))
(if (<= t_0 2e+282)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double tmp;
if (t_0 <= -2e+73) {
tmp = sqrt(((d * d) / (l * h))) * (1.0 - ((((0.125 * (D / ((d * d) * l))) * h) * M) * (D * M)));
} else if (t_0 <= 2e+282) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = d / (sqrt(l) * 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) :: tmp
t_0 = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((d_1 * m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))
if (t_0 <= (-2d+73)) then
tmp = sqrt(((d * d) / (l * h))) * (1.0d0 - ((((0.125d0 * (d_1 / ((d * d) * l))) * h) * m) * (d_1 * m)))
else if (t_0 <= 2d+282) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = d / (sqrt(l) * 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.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double tmp;
if (t_0 <= -2e+73) {
tmp = Math.sqrt(((d * d) / (l * h))) * (1.0 - ((((0.125 * (D / ((d * d) * l))) * h) * M) * (D * M)));
} else if (t_0 <= 2e+282) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) tmp = 0 if t_0 <= -2e+73: tmp = math.sqrt(((d * d) / (l * h))) * (1.0 - ((((0.125 * (D / ((d * d) * l))) * h) * M) * (D * M))) elif t_0 <= 2e+282: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0))))) tmp = 0.0 if (t_0 <= -2e+73) tmp = Float64(sqrt(Float64(Float64(d * d) / Float64(l * h))) * Float64(1.0 - Float64(Float64(Float64(Float64(0.125 * Float64(D / Float64(Float64(d * d) * l))) * h) * M) * Float64(D * M)))); elseif (t_0 <= 2e+282) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((D * M) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)))); tmp = 0.0; if (t_0 <= -2e+73) tmp = sqrt(((d * d) / (l * h))) * (1.0 - ((((0.125 * (D / ((d * d) * l))) * h) * M) * (D * M))); elseif (t_0 <= 2e+282) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+73], N[(N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(0.125 * N[(D / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+282], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+73}:\\
\;\;\;\;\sqrt{\frac{d \cdot d}{\ell \cdot h}} \cdot \left(1 - \left(\left(\left(0.125 \cdot \frac{D}{\left(d \cdot d\right) \cdot \ell}\right) \cdot h\right) \cdot M\right) \cdot \left(D \cdot M\right)\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{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)))) < -1.99999999999999997e73Initial program 88.4%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites54.4%
Applied rewrites40.9%
if -1.99999999999999997e73 < (*.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.00000000000000007e282Initial program 90.2%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites68.8%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Applied rewrites82.6%
if 2.00000000000000007e282 < (*.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 22.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites29.2%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Applied rewrites41.7%
Applied rewrites42.3%
Final simplification56.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (/ h l) (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ 1.0 2.0)))))))
(if (<= t_0 -4e-53)
(*
(* (* (* (* M M) D) (/ D (* (* d d) l))) (* -0.125 h))
(sqrt (/ (* d d) (* l h))))
(if (<= t_0 2e+282)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double tmp;
if (t_0 <= -4e-53) {
tmp = ((((M * M) * D) * (D / ((d * d) * l))) * (-0.125 * h)) * sqrt(((d * d) / (l * h)));
} else if (t_0 <= 2e+282) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = d / (sqrt(l) * 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) :: tmp
t_0 = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((d_1 * m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))
if (t_0 <= (-4d-53)) then
tmp = ((((m * m) * d_1) * (d_1 / ((d * d) * l))) * ((-0.125d0) * h)) * sqrt(((d * d) / (l * h)))
else if (t_0 <= 2d+282) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = d / (sqrt(l) * 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.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double tmp;
if (t_0 <= -4e-53) {
tmp = ((((M * M) * D) * (D / ((d * d) * l))) * (-0.125 * h)) * Math.sqrt(((d * d) / (l * h)));
} else if (t_0 <= 2e+282) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) tmp = 0 if t_0 <= -4e-53: tmp = ((((M * M) * D) * (D / ((d * d) * l))) * (-0.125 * h)) * math.sqrt(((d * d) / (l * h))) elif t_0 <= 2e+282: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0))))) tmp = 0.0 if (t_0 <= -4e-53) tmp = Float64(Float64(Float64(Float64(Float64(M * M) * D) * Float64(D / Float64(Float64(d * d) * l))) * Float64(-0.125 * h)) * sqrt(Float64(Float64(d * d) / Float64(l * h)))); elseif (t_0 <= 2e+282) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((D * M) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)))); tmp = 0.0; if (t_0 <= -4e-53) tmp = ((((M * M) * D) * (D / ((d * d) * l))) * (-0.125 * h)) * sqrt(((d * d) / (l * h))); elseif (t_0 <= 2e+282) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e-53], N[(N[(N[(N[(N[(M * M), $MachinePrecision] * D), $MachinePrecision] * N[(D / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 * h), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+282], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right)\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-53}:\\
\;\;\;\;\left(\left(\left(\left(M \cdot M\right) \cdot D\right) \cdot \frac{D}{\left(d \cdot d\right) \cdot \ell}\right) \cdot \left(-0.125 \cdot h\right)\right) \cdot \sqrt{\frac{d \cdot d}{\ell \cdot h}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -4.00000000000000012e-53Initial program 88.9%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6437.7
Applied rewrites37.7%
Taylor expanded in h around inf
associate-*r*N/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6427.1
Applied rewrites27.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lift-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6438.8
Applied rewrites38.8%
if -4.00000000000000012e-53 < (*.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.00000000000000007e282Initial program 89.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites71.8%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6437.5
Applied rewrites37.5%
Applied rewrites86.3%
if 2.00000000000000007e282 < (*.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 22.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites29.2%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Applied rewrites41.7%
Applied rewrites42.3%
Final simplification56.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (/ h l) (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ 1.0 2.0)))))))
(if (<= t_0 -4e+280)
(* (* (/ (* D D) d) (* (* M M) 0.125)) (sqrt (/ h (* (* l l) l))))
(if (<= t_0 2e+282)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double tmp;
if (t_0 <= -4e+280) {
tmp = (((D * D) / d) * ((M * M) * 0.125)) * sqrt((h / ((l * l) * l)));
} else if (t_0 <= 2e+282) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else {
tmp = d / (sqrt(l) * 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) :: tmp
t_0 = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((d_1 * m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))
if (t_0 <= (-4d+280)) then
tmp = (((d_1 * d_1) / d) * ((m * m) * 0.125d0)) * sqrt((h / ((l * l) * l)))
else if (t_0 <= 2d+282) then
tmp = sqrt((d / l)) * sqrt((d / h))
else
tmp = d / (sqrt(l) * 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.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double tmp;
if (t_0 <= -4e+280) {
tmp = (((D * D) / d) * ((M * M) * 0.125)) * Math.sqrt((h / ((l * l) * l)));
} else if (t_0 <= 2e+282) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) tmp = 0 if t_0 <= -4e+280: tmp = (((D * D) / d) * ((M * M) * 0.125)) * math.sqrt((h / ((l * l) * l))) elif t_0 <= 2e+282: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0))))) tmp = 0.0 if (t_0 <= -4e+280) tmp = Float64(Float64(Float64(Float64(D * D) / d) * Float64(Float64(M * M) * 0.125)) * sqrt(Float64(h / Float64(Float64(l * l) * l)))); elseif (t_0 <= 2e+282) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((D * M) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)))); tmp = 0.0; if (t_0 <= -4e+280) tmp = (((D * D) / d) * ((M * M) * 0.125)) * sqrt((h / ((l * l) * l))); elseif (t_0 <= 2e+282) tmp = sqrt((d / l)) * sqrt((d / h)); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e+280], N[(N[(N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+282], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right)\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{+280}:\\
\;\;\;\;\left(\frac{D \cdot D}{d} \cdot \left(\left(M \cdot M\right) \cdot 0.125\right)\right) \cdot \sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -4.0000000000000001e280Initial program 87.6%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites58.5%
Taylor expanded in h around -inf
associate-*r*N/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
associate-/l*N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
associate-*r*N/A
associate-/l*N/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
Applied rewrites37.2%
if -4.0000000000000001e280 < (*.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.00000000000000007e282Initial program 90.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites64.7%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.0
Applied rewrites34.0%
Applied rewrites77.5%
if 2.00000000000000007e282 < (*.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 22.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites29.2%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Applied rewrites41.7%
Applied rewrites42.3%
Final simplification54.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1 (sqrt (/ d h)))
(t_2
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (/ h l) (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ 1.0 2.0)))))))
(if (<= t_2 0.0)
(* (- t_0) t_1)
(if (<= t_2 2e+282) (* t_0 t_1) (/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = sqrt((d / h));
double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double tmp;
if (t_2 <= 0.0) {
tmp = -t_0 * t_1;
} else if (t_2 <= 2e+282) {
tmp = t_0 * t_1;
} else {
tmp = d / (sqrt(l) * 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 / l))
t_1 = sqrt((d / h))
t_2 = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((d_1 * m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))
if (t_2 <= 0.0d0) then
tmp = -t_0 * t_1
else if (t_2 <= 2d+282) then
tmp = t_0 * t_1
else
tmp = d / (sqrt(l) * 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 / l));
double t_1 = Math.sqrt((d / h));
double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
double tmp;
if (t_2 <= 0.0) {
tmp = -t_0 * t_1;
} else if (t_2 <= 2e+282) {
tmp = t_0 * t_1;
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = math.sqrt((d / h)) t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) tmp = 0 if t_2 <= 0.0: tmp = -t_0 * t_1 elif t_2 <= 2e+282: tmp = t_0 * t_1 else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = sqrt(Float64(d / h)) t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0))))) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(Float64(-t_0) * t_1); elseif (t_2 <= 2e+282) tmp = Float64(t_0 * t_1); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = sqrt((d / h)); t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((D * M) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)))); tmp = 0.0; if (t_2 <= 0.0) tmp = -t_0 * t_1; elseif (t_2 <= 2e+282) tmp = t_0 * t_1; else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[((-t$95$0) * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+282], N[(t$95$0 * t$95$1), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right)\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\left(-t\_0\right) \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{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 82.6%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites47.8%
Applied rewrites25.0%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f648.9
Applied rewrites8.9%
lift-/.f64N/A
Applied rewrites24.7%
if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2.00000000000000007e282Initial program 98.2%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites80.5%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6440.1
Applied rewrites40.1%
Applied rewrites96.7%
if 2.00000000000000007e282 < (*.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 22.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites29.2%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Applied rewrites41.7%
Applied rewrites42.3%
Final simplification51.5%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (/ h l) (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ 1.0 2.0)))))
2e+282)
(*
(- 1.0 (* (/ (* (* 0.25 (/ M d)) D) (/ l h)) (* D (* M (/ 0.5 d)))))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(/
(/
(*
(*
(- 1.0 (* (* (* (* (* 0.125 (/ D (* (* d d) l))) h) M) D) M))
(sqrt d))
(sqrt d))
(sqrt l))
(sqrt h))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))))) <= 2e+282) {
tmp = (1.0 - ((((0.25 * (M / d)) * D) / (l / h)) * (D * (M * (0.5 / d))))) * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = ((((1.0 - (((((0.125 * (D / ((d * d) * l))) * h) * M) * D) * M)) * sqrt(d)) * sqrt(d)) / sqrt(l)) / 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) :: tmp
if (((((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((d_1 * m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))) <= 2d+282) then
tmp = (1.0d0 - ((((0.25d0 * (m / d)) * d_1) / (l / h)) * (d_1 * (m * (0.5d0 / d))))) * (sqrt((d / l)) * sqrt((d / h)))
else
tmp = ((((1.0d0 - (((((0.125d0 * (d_1 / ((d * d) * l))) * h) * m) * d_1) * m)) * sqrt(d)) * sqrt(d)) / sqrt(l)) / sqrt(h)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))))) <= 2e+282) {
tmp = (1.0 - ((((0.25 * (M / d)) * D) / (l / h)) * (D * (M * (0.5 / d))))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else {
tmp = ((((1.0 - (((((0.125 * (D / ((d * d) * l))) * h) * M) * D) * M)) * Math.sqrt(d)) * Math.sqrt(d)) / Math.sqrt(l)) / Math.sqrt(h);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))))) <= 2e+282: tmp = (1.0 - ((((0.25 * (M / d)) * D) / (l / h)) * (D * (M * (0.5 / d))))) * (math.sqrt((d / l)) * math.sqrt((d / h))) else: tmp = ((((1.0 - (((((0.125 * (D / ((d * d) * l))) * h) * M) * D) * M)) * math.sqrt(d)) * math.sqrt(d)) / math.sqrt(l)) / math.sqrt(h) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0))))) <= 2e+282) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(0.25 * Float64(M / d)) * D) / Float64(l / h)) * Float64(D * Float64(M * Float64(0.5 / d))))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(Float64(Float64(Float64(1.0 - Float64(Float64(Float64(Float64(Float64(0.125 * Float64(D / Float64(Float64(d * d) * l))) * h) * M) * D) * M)) * sqrt(d)) * sqrt(d)) / sqrt(l)) / sqrt(h)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((D * M) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0))))) <= 2e+282) tmp = (1.0 - ((((0.25 * (M / d)) * D) / (l / h)) * (D * (M * (0.5 / d))))) * (sqrt((d / l)) * sqrt((d / h))); else tmp = ((((1.0 - (((((0.125 * (D / ((d * d) * l))) * h) * M) * D) * M)) * sqrt(d)) * sqrt(d)) / sqrt(l)) / sqrt(h); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+282], N[(N[(1.0 - N[(N[(N[(N[(0.25 * N[(M / d), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision] / N[(l / h), $MachinePrecision]), $MachinePrecision] * N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(1.0 - N[(N[(N[(N[(N[(0.125 * N[(D / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] * M), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \leq 2 \cdot 10^{+282}:\\
\;\;\;\;\left(1 - \frac{\left(0.25 \cdot \frac{M}{d}\right) \cdot D}{\frac{\ell}{h}} \cdot \left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\left(1 - \left(\left(\left(\left(0.125 \cdot \frac{D}{\left(d \cdot d\right) \cdot \ell}\right) \cdot h\right) \cdot M\right) \cdot D\right) \cdot M\right) \cdot \sqrt{d}\right) \cdot \sqrt{d}}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2.00000000000000007e282Initial program 89.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites92.3%
lift-/.f64N/A
metadata-eval92.3
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6492.3
Applied rewrites92.3%
lift-/.f64N/A
metadata-eval92.3
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6492.3
Applied rewrites92.3%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-/.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
associate-/r/N/A
clear-numN/A
lower-*.f64N/A
Applied rewrites91.8%
if 2.00000000000000007e282 < (*.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 22.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites29.2%
Applied rewrites35.7%
Applied rewrites46.1%
Final simplification77.0%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (/ h l) (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ 1.0 2.0)))))
2e+282)
(*
(- 1.0 (* (/ (* (* 0.25 D) (* (/ M d) h)) l) (* D (* M (/ 0.5 d)))))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(/
(/
(*
(*
(- 1.0 (* (* (* (* (* 0.125 (/ D (* (* d d) l))) h) M) D) M))
(sqrt d))
(sqrt d))
(sqrt l))
(sqrt h))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))))) <= 2e+282) {
tmp = (1.0 - ((((0.25 * D) * ((M / d) * h)) / l) * (D * (M * (0.5 / d))))) * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = ((((1.0 - (((((0.125 * (D / ((d * d) * l))) * h) * M) * D) * M)) * sqrt(d)) * sqrt(d)) / sqrt(l)) / 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) :: tmp
if (((((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((d_1 * m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))) <= 2d+282) then
tmp = (1.0d0 - ((((0.25d0 * d_1) * ((m / d) * h)) / l) * (d_1 * (m * (0.5d0 / d))))) * (sqrt((d / l)) * sqrt((d / h)))
else
tmp = ((((1.0d0 - (((((0.125d0 * (d_1 / ((d * d) * l))) * h) * m) * d_1) * m)) * sqrt(d)) * sqrt(d)) / sqrt(l)) / sqrt(h)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))))) <= 2e+282) {
tmp = (1.0 - ((((0.25 * D) * ((M / d) * h)) / l) * (D * (M * (0.5 / d))))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else {
tmp = ((((1.0 - (((((0.125 * (D / ((d * d) * l))) * h) * M) * D) * M)) * Math.sqrt(d)) * Math.sqrt(d)) / Math.sqrt(l)) / Math.sqrt(h);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))))) <= 2e+282: tmp = (1.0 - ((((0.25 * D) * ((M / d) * h)) / l) * (D * (M * (0.5 / d))))) * (math.sqrt((d / l)) * math.sqrt((d / h))) else: tmp = ((((1.0 - (((((0.125 * (D / ((d * d) * l))) * h) * M) * D) * M)) * math.sqrt(d)) * math.sqrt(d)) / math.sqrt(l)) / math.sqrt(h) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0))))) <= 2e+282) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(0.25 * D) * Float64(Float64(M / d) * h)) / l) * Float64(D * Float64(M * Float64(0.5 / d))))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(Float64(Float64(Float64(1.0 - Float64(Float64(Float64(Float64(Float64(0.125 * Float64(D / Float64(Float64(d * d) * l))) * h) * M) * D) * M)) * sqrt(d)) * sqrt(d)) / sqrt(l)) / sqrt(h)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((D * M) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0))))) <= 2e+282) tmp = (1.0 - ((((0.25 * D) * ((M / d) * h)) / l) * (D * (M * (0.5 / d))))) * (sqrt((d / l)) * sqrt((d / h))); else tmp = ((((1.0 - (((((0.125 * (D / ((d * d) * l))) * h) * M) * D) * M)) * sqrt(d)) * sqrt(d)) / sqrt(l)) / sqrt(h); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+282], N[(N[(1.0 - N[(N[(N[(N[(0.25 * D), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(1.0 - N[(N[(N[(N[(N[(0.125 * N[(D / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] * M), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \leq 2 \cdot 10^{+282}:\\
\;\;\;\;\left(1 - \frac{\left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right)}{\ell} \cdot \left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\left(1 - \left(\left(\left(\left(0.125 \cdot \frac{D}{\left(d \cdot d\right) \cdot \ell}\right) \cdot h\right) \cdot M\right) \cdot D\right) \cdot M\right) \cdot \sqrt{d}\right) \cdot \sqrt{d}}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2.00000000000000007e282Initial program 89.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites92.3%
lift-/.f64N/A
metadata-eval92.3
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6492.3
Applied rewrites92.3%
lift-/.f64N/A
metadata-eval92.3
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6492.3
Applied rewrites92.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
associate-/r/N/A
clear-numN/A
lower-*.f64N/A
Applied rewrites89.6%
if 2.00000000000000007e282 < (*.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 22.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites29.2%
Applied rewrites35.7%
Applied rewrites46.1%
Final simplification75.5%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (/ h l) (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ 1.0 2.0)))))
2e+282)
(*
(- 1.0 (* (* (/ (* (* M 0.5) D) (* l d)) h) (* (* 0.25 (/ M d)) D)))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))))) <= 2e+282) {
tmp = (1.0 - (((((M * 0.5) * D) / (l * d)) * h) * ((0.25 * (M / d)) * D))) * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = d / (sqrt(l) * 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) :: tmp
if (((((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((d_1 * m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))) <= 2d+282) then
tmp = (1.0d0 - (((((m * 0.5d0) * d_1) / (l * d)) * h) * ((0.25d0 * (m / d)) * d_1))) * (sqrt((d / l)) * sqrt((d / h)))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))))) <= 2e+282) {
tmp = (1.0 - (((((M * 0.5) * D) / (l * d)) * h) * ((0.25 * (M / d)) * D))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))))) <= 2e+282: tmp = (1.0 - (((((M * 0.5) * D) / (l * d)) * h) * ((0.25 * (M / d)) * D))) * (math.sqrt((d / l)) * math.sqrt((d / h))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0))))) <= 2e+282) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(Float64(M * 0.5) * D) / Float64(l * d)) * h) * Float64(Float64(0.25 * Float64(M / d)) * D))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((D * M) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0))))) <= 2e+282) tmp = (1.0 - (((((M * 0.5) * D) / (l * d)) * h) * ((0.25 * (M / d)) * D))) * (sqrt((d / l)) * sqrt((d / h))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+282], N[(N[(1.0 - N[(N[(N[(N[(N[(M * 0.5), $MachinePrecision] * D), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] * N[(N[(0.25 * N[(M / d), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \leq 2 \cdot 10^{+282}:\\
\;\;\;\;\left(1 - \left(\frac{\left(M \cdot 0.5\right) \cdot D}{\ell \cdot d} \cdot h\right) \cdot \left(\left(0.25 \cdot \frac{M}{d}\right) \cdot D\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2.00000000000000007e282Initial program 89.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites92.3%
lift-/.f64N/A
metadata-eval92.3
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6492.3
Applied rewrites92.3%
lift-/.f64N/A
metadata-eval92.3
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6492.3
Applied rewrites92.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites84.9%
if 2.00000000000000007e282 < (*.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 22.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites29.2%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6441.7
Applied rewrites41.7%
Applied rewrites41.7%
Applied rewrites42.3%
Final simplification71.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (/ 0.5 d))) (t_1 (sqrt (- d))))
(if (<= h -2.25e-61)
(*
(- 1.0 (* (/ (* (/ M d) (* (* D 0.5) 0.5)) (/ 1.0 h)) (/ (* D t_0) l)))
(* (/ t_1 (sqrt (- l))) (sqrt (/ d h))))
(if (<= h -1e-310)
(*
(* (/ t_1 (sqrt (- h))) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (/ h l) (* (pow (/ (* D M) (* 2.0 d)) 2.0) (/ 1.0 2.0)))))
(*
(- 1.0 (* (/ D l) (* (* (* 0.25 D) (* (/ M d) h)) t_0)))
(* (* (/ 1.0 (sqrt l)) (sqrt d)) (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (0.5 / d);
double t_1 = sqrt(-d);
double tmp;
if (h <= -2.25e-61) {
tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((t_1 / sqrt(-l)) * sqrt((d / h)));
} else if (h <= -1e-310) {
tmp = ((t_1 / sqrt(-h)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (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 = m * (0.5d0 / d)
t_1 = sqrt(-d)
if (h <= (-2.25d-61)) then
tmp = (1.0d0 - ((((m / d) * ((d_1 * 0.5d0) * 0.5d0)) / (1.0d0 / h)) * ((d_1 * t_0) / l))) * ((t_1 / sqrt(-l)) * sqrt((d / h)))
else if (h <= (-1d-310)) then
tmp = ((t_1 / sqrt(-h)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((d_1 * m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))
else
tmp = (1.0d0 - ((d_1 / l) * (((0.25d0 * d_1) * ((m / d) * h)) * t_0))) * (((1.0d0 / sqrt(l)) * sqrt(d)) * (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 = M * (0.5 / d);
double t_1 = Math.sqrt(-d);
double tmp;
if (h <= -2.25e-61) {
tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((t_1 / Math.sqrt(-l)) * Math.sqrt((d / h)));
} else if (h <= -1e-310) {
tmp = ((t_1 / Math.sqrt(-h)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / Math.sqrt(l)) * Math.sqrt(d)) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M * (0.5 / d) t_1 = math.sqrt(-d) tmp = 0 if h <= -2.25e-61: tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((t_1 / math.sqrt(-l)) * math.sqrt((d / h))) elif h <= -1e-310: tmp = ((t_1 / math.sqrt(-h)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((D * M) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) else: tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / math.sqrt(l)) * math.sqrt(d)) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 / d)) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -2.25e-61) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(M / d) * Float64(Float64(D * 0.5) * 0.5)) / Float64(1.0 / h)) * Float64(Float64(D * t_0) / l))) * Float64(Float64(t_1 / sqrt(Float64(-l))) * sqrt(Float64(d / h)))); elseif (h <= -1e-310) tmp = Float64(Float64(Float64(t_1 / sqrt(Float64(-h))) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D * M) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0))))); else tmp = Float64(Float64(1.0 - Float64(Float64(D / l) * Float64(Float64(Float64(0.25 * D) * Float64(Float64(M / d) * h)) * t_0))) * Float64(Float64(Float64(1.0 / sqrt(l)) * sqrt(d)) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M * (0.5 / d); t_1 = sqrt(-d); tmp = 0.0; if (h <= -2.25e-61) tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((t_1 / sqrt(-l)) * sqrt((d / h))); elseif (h <= -1e-310) tmp = ((t_1 / sqrt(-h)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((D * M) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)))); else tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -2.25e-61], N[(N[(1.0 - N[(N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(1.0 / h), $MachinePrecision]), $MachinePrecision] * N[(N[(D * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-310], N[(N[(N[(t$95$1 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D * M), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(D / l), $MachinePrecision] * N[(N[(N[(0.25 * D), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{0.5}{d}\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;h \leq -2.25 \cdot 10^{-61}:\\
\;\;\;\;\left(1 - \frac{\frac{M}{d} \cdot \left(\left(D \cdot 0.5\right) \cdot 0.5\right)}{\frac{1}{h}} \cdot \frac{D \cdot t\_0}{\ell}\right) \cdot \left(\frac{t\_1}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{t\_1}{\sqrt{-h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{D}{\ell} \cdot \left(\left(\left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right)\right) \cdot t\_0\right)\right) \cdot \left(\left(\frac{1}{\sqrt{\ell}} \cdot \sqrt{d}\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -2.25e-61Initial program 77.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites80.2%
lift-/.f64N/A
metadata-eval80.2
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6480.2
Applied rewrites80.2%
lift-/.f64N/A
metadata-eval80.2
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6480.2
Applied rewrites80.2%
lift-/.f64N/A
lift-sqrt.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6491.5
Applied rewrites91.5%
if -2.25e-61 < h < -9.999999999999969e-311Initial program 73.4%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6491.3
Applied rewrites91.3%
if -9.999999999999969e-311 < h Initial program 60.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6471.9
Applied rewrites71.9%
lift-/.f64N/A
metadata-eval71.9
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6474.2
Applied rewrites74.2%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites75.6%
Applied rewrites83.5%
Final simplification87.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (/ 0.5 d)))
(t_1
(-
1.0
(* (/ (* (/ M d) (* (* D 0.5) 0.5)) (/ 1.0 h)) (/ (* D t_0) l))))
(t_2 (sqrt (- d))))
(if (<= h -5.6e-131)
(* t_1 (* (/ t_2 (sqrt (- l))) (sqrt (/ d h))))
(if (<= h -1e-310)
(* (* (sqrt (/ d l)) (* (sqrt (/ -1.0 h)) t_2)) t_1)
(*
(- 1.0 (* (/ D l) (* (* (* 0.25 D) (* (/ M d) h)) t_0)))
(* (* (/ 1.0 (sqrt l)) (sqrt d)) (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (0.5 / d);
double t_1 = 1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l));
double t_2 = sqrt(-d);
double tmp;
if (h <= -5.6e-131) {
tmp = t_1 * ((t_2 / sqrt(-l)) * sqrt((d / h)));
} else if (h <= -1e-310) {
tmp = (sqrt((d / l)) * (sqrt((-1.0 / h)) * t_2)) * t_1;
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (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 = m * (0.5d0 / d)
t_1 = 1.0d0 - ((((m / d) * ((d_1 * 0.5d0) * 0.5d0)) / (1.0d0 / h)) * ((d_1 * t_0) / l))
t_2 = sqrt(-d)
if (h <= (-5.6d-131)) then
tmp = t_1 * ((t_2 / sqrt(-l)) * sqrt((d / h)))
else if (h <= (-1d-310)) then
tmp = (sqrt((d / l)) * (sqrt(((-1.0d0) / h)) * t_2)) * t_1
else
tmp = (1.0d0 - ((d_1 / l) * (((0.25d0 * d_1) * ((m / d) * h)) * t_0))) * (((1.0d0 / sqrt(l)) * sqrt(d)) * (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 = M * (0.5 / d);
double t_1 = 1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l));
double t_2 = Math.sqrt(-d);
double tmp;
if (h <= -5.6e-131) {
tmp = t_1 * ((t_2 / Math.sqrt(-l)) * Math.sqrt((d / h)));
} else if (h <= -1e-310) {
tmp = (Math.sqrt((d / l)) * (Math.sqrt((-1.0 / h)) * t_2)) * t_1;
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / Math.sqrt(l)) * Math.sqrt(d)) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M * (0.5 / d) t_1 = 1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l)) t_2 = math.sqrt(-d) tmp = 0 if h <= -5.6e-131: tmp = t_1 * ((t_2 / math.sqrt(-l)) * math.sqrt((d / h))) elif h <= -1e-310: tmp = (math.sqrt((d / l)) * (math.sqrt((-1.0 / h)) * t_2)) * t_1 else: tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / math.sqrt(l)) * math.sqrt(d)) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 / d)) t_1 = Float64(1.0 - Float64(Float64(Float64(Float64(M / d) * Float64(Float64(D * 0.5) * 0.5)) / Float64(1.0 / h)) * Float64(Float64(D * t_0) / l))) t_2 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -5.6e-131) tmp = Float64(t_1 * Float64(Float64(t_2 / sqrt(Float64(-l))) * sqrt(Float64(d / h)))); elseif (h <= -1e-310) tmp = Float64(Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(-1.0 / h)) * t_2)) * t_1); else tmp = Float64(Float64(1.0 - Float64(Float64(D / l) * Float64(Float64(Float64(0.25 * D) * Float64(Float64(M / d) * h)) * t_0))) * Float64(Float64(Float64(1.0 / sqrt(l)) * sqrt(d)) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M * (0.5 / d); t_1 = 1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l)); t_2 = sqrt(-d); tmp = 0.0; if (h <= -5.6e-131) tmp = t_1 * ((t_2 / sqrt(-l)) * sqrt((d / h))); elseif (h <= -1e-310) tmp = (sqrt((d / l)) * (sqrt((-1.0 / h)) * t_2)) * t_1; else tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(1.0 / h), $MachinePrecision]), $MachinePrecision] * N[(N[(D * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -5.6e-131], N[(t$95$1 * N[(N[(t$95$2 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-310], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(1.0 - N[(N[(D / l), $MachinePrecision] * N[(N[(N[(0.25 * D), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{0.5}{d}\\
t_1 := 1 - \frac{\frac{M}{d} \cdot \left(\left(D \cdot 0.5\right) \cdot 0.5\right)}{\frac{1}{h}} \cdot \frac{D \cdot t\_0}{\ell}\\
t_2 := \sqrt{-d}\\
\mathbf{if}\;h \leq -5.6 \cdot 10^{-131}:\\
\;\;\;\;t\_1 \cdot \left(\frac{t\_2}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{-1}{h}} \cdot t\_2\right)\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{D}{\ell} \cdot \left(\left(\left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right)\right) \cdot t\_0\right)\right) \cdot \left(\left(\frac{1}{\sqrt{\ell}} \cdot \sqrt{d}\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -5.5999999999999999e-131Initial program 77.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites79.2%
lift-/.f64N/A
metadata-eval79.2
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6479.2
Applied rewrites79.2%
lift-/.f64N/A
metadata-eval79.2
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6479.2
Applied rewrites79.2%
lift-/.f64N/A
lift-sqrt.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6490.0
Applied rewrites90.0%
if -5.5999999999999999e-131 < h < -9.999999999999969e-311Initial program 72.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites72.5%
lift-/.f64N/A
metadata-eval72.5
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6472.5
Applied rewrites72.5%
lift-/.f64N/A
metadata-eval72.5
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
distribute-neg-frac2N/A
lift-/.f64N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6494.2
Applied rewrites94.2%
if -9.999999999999969e-311 < h Initial program 60.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6471.9
Applied rewrites71.9%
lift-/.f64N/A
metadata-eval71.9
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6474.2
Applied rewrites74.2%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites75.6%
Applied rewrites83.5%
Final simplification87.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (/ 0.5 d)))
(t_1
(-
1.0
(* (/ (* (/ M d) (* (* D 0.5) 0.5)) (/ 1.0 h)) (/ (* D t_0) l))))
(t_2 (sqrt (- d))))
(if (<= h -2.25e-61)
(* t_1 (* (/ t_2 (sqrt (- l))) (sqrt (/ d h))))
(if (<= h -1e-310)
(* (* (sqrt (/ d l)) (/ t_2 (sqrt (- h)))) t_1)
(*
(- 1.0 (* (/ D l) (* (* (* 0.25 D) (* (/ M d) h)) t_0)))
(* (* (/ 1.0 (sqrt l)) (sqrt d)) (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (0.5 / d);
double t_1 = 1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l));
double t_2 = sqrt(-d);
double tmp;
if (h <= -2.25e-61) {
tmp = t_1 * ((t_2 / sqrt(-l)) * sqrt((d / h)));
} else if (h <= -1e-310) {
tmp = (sqrt((d / l)) * (t_2 / sqrt(-h))) * t_1;
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (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 = m * (0.5d0 / d)
t_1 = 1.0d0 - ((((m / d) * ((d_1 * 0.5d0) * 0.5d0)) / (1.0d0 / h)) * ((d_1 * t_0) / l))
t_2 = sqrt(-d)
if (h <= (-2.25d-61)) then
tmp = t_1 * ((t_2 / sqrt(-l)) * sqrt((d / h)))
else if (h <= (-1d-310)) then
tmp = (sqrt((d / l)) * (t_2 / sqrt(-h))) * t_1
else
tmp = (1.0d0 - ((d_1 / l) * (((0.25d0 * d_1) * ((m / d) * h)) * t_0))) * (((1.0d0 / sqrt(l)) * sqrt(d)) * (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 = M * (0.5 / d);
double t_1 = 1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l));
double t_2 = Math.sqrt(-d);
double tmp;
if (h <= -2.25e-61) {
tmp = t_1 * ((t_2 / Math.sqrt(-l)) * Math.sqrt((d / h)));
} else if (h <= -1e-310) {
tmp = (Math.sqrt((d / l)) * (t_2 / Math.sqrt(-h))) * t_1;
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / Math.sqrt(l)) * Math.sqrt(d)) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M * (0.5 / d) t_1 = 1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l)) t_2 = math.sqrt(-d) tmp = 0 if h <= -2.25e-61: tmp = t_1 * ((t_2 / math.sqrt(-l)) * math.sqrt((d / h))) elif h <= -1e-310: tmp = (math.sqrt((d / l)) * (t_2 / math.sqrt(-h))) * t_1 else: tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / math.sqrt(l)) * math.sqrt(d)) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 / d)) t_1 = Float64(1.0 - Float64(Float64(Float64(Float64(M / d) * Float64(Float64(D * 0.5) * 0.5)) / Float64(1.0 / h)) * Float64(Float64(D * t_0) / l))) t_2 = sqrt(Float64(-d)) tmp = 0.0 if (h <= -2.25e-61) tmp = Float64(t_1 * Float64(Float64(t_2 / sqrt(Float64(-l))) * sqrt(Float64(d / h)))); elseif (h <= -1e-310) tmp = Float64(Float64(sqrt(Float64(d / l)) * Float64(t_2 / sqrt(Float64(-h)))) * t_1); else tmp = Float64(Float64(1.0 - Float64(Float64(D / l) * Float64(Float64(Float64(0.25 * D) * Float64(Float64(M / d) * h)) * t_0))) * Float64(Float64(Float64(1.0 / sqrt(l)) * sqrt(d)) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M * (0.5 / d); t_1 = 1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l)); t_2 = sqrt(-d); tmp = 0.0; if (h <= -2.25e-61) tmp = t_1 * ((t_2 / sqrt(-l)) * sqrt((d / h))); elseif (h <= -1e-310) tmp = (sqrt((d / l)) * (t_2 / sqrt(-h))) * t_1; else tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(1.0 / h), $MachinePrecision]), $MachinePrecision] * N[(N[(D * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[h, -2.25e-61], N[(t$95$1 * N[(N[(t$95$2 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-310], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(1.0 - N[(N[(D / l), $MachinePrecision] * N[(N[(N[(0.25 * D), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{0.5}{d}\\
t_1 := 1 - \frac{\frac{M}{d} \cdot \left(\left(D \cdot 0.5\right) \cdot 0.5\right)}{\frac{1}{h}} \cdot \frac{D \cdot t\_0}{\ell}\\
t_2 := \sqrt{-d}\\
\mathbf{if}\;h \leq -2.25 \cdot 10^{-61}:\\
\;\;\;\;t\_1 \cdot \left(\frac{t\_2}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \frac{t\_2}{\sqrt{-h}}\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{D}{\ell} \cdot \left(\left(\left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right)\right) \cdot t\_0\right)\right) \cdot \left(\left(\frac{1}{\sqrt{\ell}} \cdot \sqrt{d}\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -2.25e-61Initial program 77.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites80.2%
lift-/.f64N/A
metadata-eval80.2
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6480.2
Applied rewrites80.2%
lift-/.f64N/A
metadata-eval80.2
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6480.2
Applied rewrites80.2%
lift-/.f64N/A
lift-sqrt.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6491.5
Applied rewrites91.5%
if -2.25e-61 < h < -9.999999999999969e-311Initial program 73.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites72.6%
lift-/.f64N/A
metadata-eval72.6
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6472.6
Applied rewrites72.6%
lift-/.f64N/A
metadata-eval72.6
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6490.6
Applied rewrites90.6%
if -9.999999999999969e-311 < h Initial program 60.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6471.9
Applied rewrites71.9%
lift-/.f64N/A
metadata-eval71.9
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6474.2
Applied rewrites74.2%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites75.6%
Applied rewrites83.5%
Final simplification87.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (/ 0.5 d))))
(if (<= h -1e-310)
(*
(- 1.0 (* (/ (* (/ M d) (* (* D 0.5) 0.5)) (/ 1.0 h)) (/ (* D t_0) l)))
(* (/ (sqrt (- d)) (sqrt (- l))) (sqrt (/ d h))))
(*
(- 1.0 (* (/ D l) (* (* (* 0.25 D) (* (/ M d) h)) t_0)))
(* (* (/ 1.0 (sqrt l)) (sqrt d)) (/ (sqrt d) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (0.5 / d);
double tmp;
if (h <= -1e-310) {
tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((sqrt(-d) / sqrt(-l)) * sqrt((d / h)));
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (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) :: tmp
t_0 = m * (0.5d0 / d)
if (h <= (-1d-310)) then
tmp = (1.0d0 - ((((m / d) * ((d_1 * 0.5d0) * 0.5d0)) / (1.0d0 / h)) * ((d_1 * t_0) / l))) * ((sqrt(-d) / sqrt(-l)) * sqrt((d / h)))
else
tmp = (1.0d0 - ((d_1 / l) * (((0.25d0 * d_1) * ((m / d) * h)) * t_0))) * (((1.0d0 / sqrt(l)) * sqrt(d)) * (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 = M * (0.5 / d);
double tmp;
if (h <= -1e-310) {
tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((Math.sqrt(-d) / Math.sqrt(-l)) * Math.sqrt((d / h)));
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / Math.sqrt(l)) * Math.sqrt(d)) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M * (0.5 / d) tmp = 0 if h <= -1e-310: tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((math.sqrt(-d) / math.sqrt(-l)) * math.sqrt((d / h))) else: tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / math.sqrt(l)) * math.sqrt(d)) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 / d)) tmp = 0.0 if (h <= -1e-310) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(M / d) * Float64(Float64(D * 0.5) * 0.5)) / Float64(1.0 / h)) * Float64(Float64(D * t_0) / l))) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(1.0 - Float64(Float64(D / l) * Float64(Float64(Float64(0.25 * D) * Float64(Float64(M / d) * h)) * t_0))) * Float64(Float64(Float64(1.0 / sqrt(l)) * sqrt(d)) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M * (0.5 / d); tmp = 0.0; if (h <= -1e-310) tmp = (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) * ((sqrt(-d) / sqrt(-l)) * sqrt((d / h))); else tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -1e-310], N[(N[(1.0 - N[(N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(1.0 / h), $MachinePrecision]), $MachinePrecision] * N[(N[(D * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(D / l), $MachinePrecision] * N[(N[(N[(0.25 * D), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{0.5}{d}\\
\mathbf{if}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(1 - \frac{\frac{M}{d} \cdot \left(\left(D \cdot 0.5\right) \cdot 0.5\right)}{\frac{1}{h}} \cdot \frac{D \cdot t\_0}{\ell}\right) \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{D}{\ell} \cdot \left(\left(\left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right)\right) \cdot t\_0\right)\right) \cdot \left(\left(\frac{1}{\sqrt{\ell}} \cdot \sqrt{d}\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -9.999999999999969e-311Initial program 75.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites77.3%
lift-/.f64N/A
metadata-eval77.3
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6477.3
Applied rewrites77.3%
lift-/.f64N/A
metadata-eval77.3
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6477.3
Applied rewrites77.3%
lift-/.f64N/A
lift-sqrt.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6486.5
Applied rewrites86.5%
if -9.999999999999969e-311 < h Initial program 60.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6471.9
Applied rewrites71.9%
lift-/.f64N/A
metadata-eval71.9
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6474.2
Applied rewrites74.2%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites75.6%
Applied rewrites83.5%
Final simplification84.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (/ 0.5 d))))
(if (<= l 3.5e-305)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* (/ (* (/ M d) (* (* D 0.5) 0.5)) (/ 1.0 h)) (/ (* D t_0) l))))
(*
(- 1.0 (* (/ D l) (* (* (* 0.25 D) (* (/ M d) h)) t_0)))
(* (* (/ 1.0 (sqrt l)) (sqrt d)) (/ (sqrt d) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (0.5 / d);
double tmp;
if (l <= 3.5e-305) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l)));
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (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) :: tmp
t_0 = m * (0.5d0 / d)
if (l <= 3.5d-305) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - ((((m / d) * ((d_1 * 0.5d0) * 0.5d0)) / (1.0d0 / h)) * ((d_1 * t_0) / l)))
else
tmp = (1.0d0 - ((d_1 / l) * (((0.25d0 * d_1) * ((m / d) * h)) * t_0))) * (((1.0d0 / sqrt(l)) * sqrt(d)) * (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 = M * (0.5 / d);
double tmp;
if (l <= 3.5e-305) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l)));
} else {
tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / Math.sqrt(l)) * Math.sqrt(d)) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = M * (0.5 / d) tmp = 0 if l <= 3.5e-305: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))) else: tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / math.sqrt(l)) * math.sqrt(d)) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(M * Float64(0.5 / d)) tmp = 0.0 if (l <= 3.5e-305) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(M / d) * Float64(Float64(D * 0.5) * 0.5)) / Float64(1.0 / h)) * Float64(Float64(D * t_0) / l)))); else tmp = Float64(Float64(1.0 - Float64(Float64(D / l) * Float64(Float64(Float64(0.25 * D) * Float64(Float64(M / d) * h)) * t_0))) * Float64(Float64(Float64(1.0 / sqrt(l)) * sqrt(d)) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = M * (0.5 / d); tmp = 0.0; if (l <= 3.5e-305) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * t_0) / l))); else tmp = (1.0 - ((D / l) * (((0.25 * D) * ((M / d) * h)) * t_0))) * (((1.0 / sqrt(l)) * sqrt(d)) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, 3.5e-305], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(1.0 / h), $MachinePrecision]), $MachinePrecision] * N[(N[(D * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(D / l), $MachinePrecision] * N[(N[(N[(0.25 * D), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \frac{0.5}{d}\\
\mathbf{if}\;\ell \leq 3.5 \cdot 10^{-305}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\frac{M}{d} \cdot \left(\left(D \cdot 0.5\right) \cdot 0.5\right)}{\frac{1}{h}} \cdot \frac{D \cdot t\_0}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{D}{\ell} \cdot \left(\left(\left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right)\right) \cdot t\_0\right)\right) \cdot \left(\left(\frac{1}{\sqrt{\ell}} \cdot \sqrt{d}\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if l < 3.4999999999999998e-305Initial program 75.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites77.6%
lift-/.f64N/A
metadata-eval77.6
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6477.6
Applied rewrites77.6%
lift-/.f64N/A
metadata-eval77.6
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6477.6
Applied rewrites77.6%
if 3.4999999999999998e-305 < l Initial program 60.8%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6472.2
Applied rewrites72.2%
lift-/.f64N/A
metadata-eval72.2
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6474.5
Applied rewrites74.5%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites75.2%
Applied rewrites83.3%
Final simplification80.6%
(FPCore (d h l M D)
:precision binary64
(if (<= l 2.45e-177)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(-
1.0
(*
(/ (* (/ M d) (* (* D 0.5) 0.5)) (/ 1.0 h))
(/ (* D (* M (/ 0.5 d))) l))))
(*
(- 1.0 (* (/ (* (* M 0.5) D) (* l d)) (* (* 0.25 D) (* (/ M d) h))))
(* (* (/ 1.0 (sqrt l)) (sqrt d)) (/ (sqrt d) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 2.45e-177) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * (M * (0.5 / d))) / l)));
} else {
tmp = (1.0 - ((((M * 0.5) * D) / (l * d)) * ((0.25 * D) * ((M / d) * h)))) * (((1.0 / sqrt(l)) * sqrt(d)) * (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) :: tmp
if (l <= 2.45d-177) then
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0d0 - ((((m / d) * ((d_1 * 0.5d0) * 0.5d0)) / (1.0d0 / h)) * ((d_1 * (m * (0.5d0 / d))) / l)))
else
tmp = (1.0d0 - ((((m * 0.5d0) * d_1) / (l * d)) * ((0.25d0 * d_1) * ((m / d) * h)))) * (((1.0d0 / sqrt(l)) * sqrt(d)) * (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 tmp;
if (l <= 2.45e-177) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * (M * (0.5 / d))) / l)));
} else {
tmp = (1.0 - ((((M * 0.5) * D) / (l * d)) * ((0.25 * D) * ((M / d) * h)))) * (((1.0 / Math.sqrt(l)) * Math.sqrt(d)) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 2.45e-177: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * (M * (0.5 / d))) / l))) else: tmp = (1.0 - ((((M * 0.5) * D) / (l * d)) * ((0.25 * D) * ((M / d) * h)))) * (((1.0 / math.sqrt(l)) * math.sqrt(d)) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 2.45e-177) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(M / d) * Float64(Float64(D * 0.5) * 0.5)) / Float64(1.0 / h)) * Float64(Float64(D * Float64(M * Float64(0.5 / d))) / l)))); else tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(M * 0.5) * D) / Float64(l * d)) * Float64(Float64(0.25 * D) * Float64(Float64(M / d) * h)))) * Float64(Float64(Float64(1.0 / sqrt(l)) * sqrt(d)) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 2.45e-177) tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((((M / d) * ((D * 0.5) * 0.5)) / (1.0 / h)) * ((D * (M * (0.5 / d))) / l))); else tmp = (1.0 - ((((M * 0.5) * D) / (l * d)) * ((0.25 * D) * ((M / d) * h)))) * (((1.0 / sqrt(l)) * sqrt(d)) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 2.45e-177], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(1.0 / h), $MachinePrecision]), $MachinePrecision] * N[(N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(N[(N[(M * 0.5), $MachinePrecision] * D), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision] * N[(N[(0.25 * D), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.45 \cdot 10^{-177}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \frac{\frac{M}{d} \cdot \left(\left(D \cdot 0.5\right) \cdot 0.5\right)}{\frac{1}{h}} \cdot \frac{D \cdot \left(M \cdot \frac{0.5}{d}\right)}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\left(M \cdot 0.5\right) \cdot D}{\ell \cdot d} \cdot \left(\left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right)\right)\right) \cdot \left(\left(\frac{1}{\sqrt{\ell}} \cdot \sqrt{d}\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if l < 2.44999999999999994e-177Initial program 72.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites77.8%
lift-/.f64N/A
metadata-eval77.8
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6477.8
Applied rewrites77.8%
lift-/.f64N/A
metadata-eval77.8
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6477.8
Applied rewrites77.8%
if 2.44999999999999994e-177 < l Initial program 59.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6473.0
Applied rewrites73.0%
lift-/.f64N/A
metadata-eval73.0
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6475.3
Applied rewrites75.3%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites76.2%
Applied rewrites84.0%
Final simplification80.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (* 0.25 D) (* (/ M d) h))))
(if (<= l 1.35e-272)
(*
(- 1.0 (* (/ t_0 l) (* D (* M (/ 0.5 d)))))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(*
(- 1.0 (* (/ (* (* M 0.5) D) (* l d)) t_0))
(* (* (/ 1.0 (sqrt l)) (sqrt d)) (/ (sqrt d) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (0.25 * D) * ((M / d) * h);
double tmp;
if (l <= 1.35e-272) {
tmp = (1.0 - ((t_0 / l) * (D * (M * (0.5 / d))))) * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = (1.0 - ((((M * 0.5) * D) / (l * d)) * t_0)) * (((1.0 / sqrt(l)) * sqrt(d)) * (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) :: tmp
t_0 = (0.25d0 * d_1) * ((m / d) * h)
if (l <= 1.35d-272) then
tmp = (1.0d0 - ((t_0 / l) * (d_1 * (m * (0.5d0 / d))))) * (sqrt((d / l)) * sqrt((d / h)))
else
tmp = (1.0d0 - ((((m * 0.5d0) * d_1) / (l * d)) * t_0)) * (((1.0d0 / sqrt(l)) * sqrt(d)) * (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 = (0.25 * D) * ((M / d) * h);
double tmp;
if (l <= 1.35e-272) {
tmp = (1.0 - ((t_0 / l) * (D * (M * (0.5 / d))))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else {
tmp = (1.0 - ((((M * 0.5) * D) / (l * d)) * t_0)) * (((1.0 / Math.sqrt(l)) * Math.sqrt(d)) * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (0.25 * D) * ((M / d) * h) tmp = 0 if l <= 1.35e-272: tmp = (1.0 - ((t_0 / l) * (D * (M * (0.5 / d))))) * (math.sqrt((d / l)) * math.sqrt((d / h))) else: tmp = (1.0 - ((((M * 0.5) * D) / (l * d)) * t_0)) * (((1.0 / math.sqrt(l)) * math.sqrt(d)) * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(0.25 * D) * Float64(Float64(M / d) * h)) tmp = 0.0 if (l <= 1.35e-272) tmp = Float64(Float64(1.0 - Float64(Float64(t_0 / l) * Float64(D * Float64(M * Float64(0.5 / d))))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(M * 0.5) * D) / Float64(l * d)) * t_0)) * Float64(Float64(Float64(1.0 / sqrt(l)) * sqrt(d)) * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (0.25 * D) * ((M / d) * h); tmp = 0.0; if (l <= 1.35e-272) tmp = (1.0 - ((t_0 / l) * (D * (M * (0.5 / d))))) * (sqrt((d / l)) * sqrt((d / h))); else tmp = (1.0 - ((((M * 0.5) * D) / (l * d)) * t_0)) * (((1.0 / sqrt(l)) * sqrt(d)) * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(0.25 * D), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, 1.35e-272], N[(N[(1.0 - N[(N[(t$95$0 / l), $MachinePrecision] * N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(N[(N[(M * 0.5), $MachinePrecision] * D), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right)\\
\mathbf{if}\;\ell \leq 1.35 \cdot 10^{-272}:\\
\;\;\;\;\left(1 - \frac{t\_0}{\ell} \cdot \left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\left(M \cdot 0.5\right) \cdot D}{\ell \cdot d} \cdot t\_0\right) \cdot \left(\left(\frac{1}{\sqrt{\ell}} \cdot \sqrt{d}\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if l < 1.34999999999999996e-272Initial program 74.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites77.9%
lift-/.f64N/A
metadata-eval77.9
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6477.9
Applied rewrites77.9%
lift-/.f64N/A
metadata-eval77.9
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6477.9
Applied rewrites77.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
associate-/r/N/A
clear-numN/A
lower-*.f64N/A
Applied rewrites75.2%
if 1.34999999999999996e-272 < l Initial program 60.8%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6473.1
Applied rewrites73.1%
lift-/.f64N/A
metadata-eval73.1
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6474.9
Applied rewrites74.9%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites75.6%
Applied rewrites83.3%
Final simplification79.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (/ d l)))
(t_2 (/ D (* (* d d) l)))
(t_3 (- 1.0 (* (* (* (* 0.125 t_2) h) M) (* D M))))
(t_4 (sqrt (* l h))))
(if (<= d -1.02e+155)
(* (sqrt (/ 1.0 (* l h))) (- d))
(if (<= d -4.6e-150)
(* (* t_3 t_0) t_1)
(if (<= d -2.8e-303)
(fma
(* (sqrt (/ h (* (* l l) l))) D)
(* (- D) (* (* -0.125 (/ M d)) M))
(/ (- d) t_4))
(if (<= d 4.1e-162)
(* (* (* -0.125 h) (* (* t_2 M) (* D M))) (/ d t_4))
(if (<= d 98000.0)
(*
(- 1.0 (/ (* (* (/ (* M M) (* d d)) (* (* D D) 0.125)) h) l))
(* t_1 t_0))
(if (<= d 9e+110)
(* (sqrt (/ (* d d) (* l h))) t_3)
(/ d (* (sqrt l) (sqrt h)))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double t_2 = D / ((d * d) * l);
double t_3 = 1.0 - ((((0.125 * t_2) * h) * M) * (D * M));
double t_4 = sqrt((l * h));
double tmp;
if (d <= -1.02e+155) {
tmp = sqrt((1.0 / (l * h))) * -d;
} else if (d <= -4.6e-150) {
tmp = (t_3 * t_0) * t_1;
} else if (d <= -2.8e-303) {
tmp = fma((sqrt((h / ((l * l) * l))) * D), (-D * ((-0.125 * (M / d)) * M)), (-d / t_4));
} else if (d <= 4.1e-162) {
tmp = ((-0.125 * h) * ((t_2 * M) * (D * M))) * (d / t_4);
} else if (d <= 98000.0) {
tmp = (1.0 - (((((M * M) / (d * d)) * ((D * D) * 0.125)) * h) / l)) * (t_1 * t_0);
} else if (d <= 9e+110) {
tmp = sqrt(((d * d) / (l * h))) * t_3;
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) t_2 = Float64(D / Float64(Float64(d * d) * l)) t_3 = Float64(1.0 - Float64(Float64(Float64(Float64(0.125 * t_2) * h) * M) * Float64(D * M))) t_4 = sqrt(Float64(l * h)) tmp = 0.0 if (d <= -1.02e+155) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); elseif (d <= -4.6e-150) tmp = Float64(Float64(t_3 * t_0) * t_1); elseif (d <= -2.8e-303) tmp = fma(Float64(sqrt(Float64(h / Float64(Float64(l * l) * l))) * D), Float64(Float64(-D) * Float64(Float64(-0.125 * Float64(M / d)) * M)), Float64(Float64(-d) / t_4)); elseif (d <= 4.1e-162) tmp = Float64(Float64(Float64(-0.125 * h) * Float64(Float64(t_2 * M) * Float64(D * M))) * Float64(d / t_4)); elseif (d <= 98000.0) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(Float64(M * M) / Float64(d * d)) * Float64(Float64(D * D) * 0.125)) * h) / l)) * Float64(t_1 * t_0)); elseif (d <= 9e+110) tmp = Float64(sqrt(Float64(Float64(d * d) / Float64(l * h))) * t_3); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(D / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 - N[(N[(N[(N[(0.125 * t$95$2), $MachinePrecision] * h), $MachinePrecision] * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.02e+155], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[d, -4.6e-150], N[(N[(t$95$3 * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[d, -2.8e-303], N[(N[(N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * D), $MachinePrecision] * N[((-D) * N[(N[(-0.125 * N[(M / d), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision]), $MachinePrecision] + N[((-d) / t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.1e-162], N[(N[(N[(-0.125 * h), $MachinePrecision] * N[(N[(t$95$2 * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 98000.0], N[(N[(1.0 - N[(N[(N[(N[(N[(M * M), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9e+110], N[(N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \frac{D}{\left(d \cdot d\right) \cdot \ell}\\
t_3 := 1 - \left(\left(\left(0.125 \cdot t\_2\right) \cdot h\right) \cdot M\right) \cdot \left(D \cdot M\right)\\
t_4 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;d \leq -1.02 \cdot 10^{+155}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{elif}\;d \leq -4.6 \cdot 10^{-150}:\\
\;\;\;\;\left(t\_3 \cdot t\_0\right) \cdot t\_1\\
\mathbf{elif}\;d \leq -2.8 \cdot 10^{-303}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \cdot D, \left(-D\right) \cdot \left(\left(-0.125 \cdot \frac{M}{d}\right) \cdot M\right), \frac{-d}{t\_4}\right)\\
\mathbf{elif}\;d \leq 4.1 \cdot 10^{-162}:\\
\;\;\;\;\left(\left(-0.125 \cdot h\right) \cdot \left(\left(t\_2 \cdot M\right) \cdot \left(D \cdot M\right)\right)\right) \cdot \frac{d}{t\_4}\\
\mathbf{elif}\;d \leq 98000:\\
\;\;\;\;\left(1 - \frac{\left(\frac{M \cdot M}{d \cdot d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right) \cdot h}{\ell}\right) \cdot \left(t\_1 \cdot t\_0\right)\\
\mathbf{elif}\;d \leq 9 \cdot 10^{+110}:\\
\;\;\;\;\sqrt{\frac{d \cdot d}{\ell \cdot h}} \cdot t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -1.02e155Initial program 70.1%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites38.1%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6456.8
Applied rewrites56.8%
if -1.02e155 < d < -4.60000000000000006e-150Initial program 86.1%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites77.8%
Applied rewrites77.9%
if -4.60000000000000006e-150 < d < -2.8e-303Initial program 62.0%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites28.4%
Applied rewrites0.0%
Taylor expanded in l around -inf
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.6%
Applied rewrites78.1%
if -2.8e-303 < d < 4.10000000000000019e-162Initial program 34.6%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6451.3
Applied rewrites51.3%
Taylor expanded in h around inf
associate-*r*N/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6430.7
Applied rewrites30.7%
Applied rewrites34.2%
if 4.10000000000000019e-162 < d < 98000Initial program 74.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites88.5%
lift-/.f64N/A
metadata-eval88.5
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6488.5
Applied rewrites88.5%
lift-/.f64N/A
metadata-eval88.5
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6488.5
Applied rewrites88.5%
Applied rewrites80.1%
if 98000 < d < 9.0000000000000005e110Initial program 67.0%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites75.6%
Applied rewrites83.9%
if 9.0000000000000005e110 < d Initial program 62.3%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites45.1%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.1
Applied rewrites75.1%
Applied rewrites75.3%
Applied rewrites78.0%
Final simplification70.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))) (t_1 (* (/ M d) D)))
(if (<= d -1.02e+155)
(* (sqrt (/ 1.0 (* l h))) (- d))
(if (<= d -4.6e-150)
(*
(*
(- 1.0 (* (* (* (* 0.125 (/ D (* (* d d) l))) h) M) (* D M)))
(sqrt (/ d h)))
(sqrt (/ d l)))
(if (<= d -2.8e-303)
(fma
(* (sqrt (/ h (* (* l l) l))) D)
(* (- D) (* (* -0.125 (/ M d)) M))
(/ (- d) t_0))
(*
(- 1.0 (* (* (* (* t_1 t_1) 0.25) (/ 1.0 2.0)) (/ h l)))
(/ d t_0)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double t_1 = (M / d) * D;
double tmp;
if (d <= -1.02e+155) {
tmp = sqrt((1.0 / (l * h))) * -d;
} else if (d <= -4.6e-150) {
tmp = ((1.0 - ((((0.125 * (D / ((d * d) * l))) * h) * M) * (D * M))) * sqrt((d / h))) * sqrt((d / l));
} else if (d <= -2.8e-303) {
tmp = fma((sqrt((h / ((l * l) * l))) * D), (-D * ((-0.125 * (M / d)) * M)), (-d / t_0));
} else {
tmp = (1.0 - ((((t_1 * t_1) * 0.25) * (1.0 / 2.0)) * (h / l))) * (d / t_0);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) t_1 = Float64(Float64(M / d) * D) tmp = 0.0 if (d <= -1.02e+155) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); elseif (d <= -4.6e-150) tmp = Float64(Float64(Float64(1.0 - Float64(Float64(Float64(Float64(0.125 * Float64(D / Float64(Float64(d * d) * l))) * h) * M) * Float64(D * M))) * sqrt(Float64(d / h))) * sqrt(Float64(d / l))); elseif (d <= -2.8e-303) tmp = fma(Float64(sqrt(Float64(h / Float64(Float64(l * l) * l))) * D), Float64(Float64(-D) * Float64(Float64(-0.125 * Float64(M / d)) * M)), Float64(Float64(-d) / t_0)); else tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(t_1 * t_1) * 0.25) * Float64(1.0 / 2.0)) * Float64(h / l))) * Float64(d / t_0)); 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[(N[(M / d), $MachinePrecision] * D), $MachinePrecision]}, If[LessEqual[d, -1.02e+155], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[d, -4.6e-150], N[(N[(N[(1.0 - N[(N[(N[(N[(0.125 * N[(D / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.8e-303], N[(N[(N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * D), $MachinePrecision] * N[((-D) * N[(N[(-0.125 * N[(M / d), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision]), $MachinePrecision] + N[((-d) / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] * 0.25), $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := \frac{M}{d} \cdot D\\
\mathbf{if}\;d \leq -1.02 \cdot 10^{+155}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{elif}\;d \leq -4.6 \cdot 10^{-150}:\\
\;\;\;\;\left(\left(1 - \left(\left(\left(0.125 \cdot \frac{D}{\left(d \cdot d\right) \cdot \ell}\right) \cdot h\right) \cdot M\right) \cdot \left(D \cdot M\right)\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;d \leq -2.8 \cdot 10^{-303}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \cdot D, \left(-D\right) \cdot \left(\left(-0.125 \cdot \frac{M}{d}\right) \cdot M\right), \frac{-d}{t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \left(\left(\left(t\_1 \cdot t\_1\right) \cdot 0.25\right) \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \frac{d}{t\_0}\\
\end{array}
\end{array}
if d < -1.02e155Initial program 70.1%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites38.1%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6456.8
Applied rewrites56.8%
if -1.02e155 < d < -4.60000000000000006e-150Initial program 86.1%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites77.8%
Applied rewrites77.9%
if -4.60000000000000006e-150 < d < -2.8e-303Initial program 62.0%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites28.4%
Applied rewrites0.0%
Taylor expanded in l around -inf
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.6%
Applied rewrites78.1%
if -2.8e-303 < d Initial program 60.2%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6471.4
Applied rewrites71.4%
lift-/.f64N/A
metadata-eval71.4
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6473.6
Applied rewrites73.6%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites75.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-timesN/A
lift-sqrt.f64N/A
*-lft-identityN/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-prodN/A
*-commutativeN/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f6467.1
Applied rewrites67.1%
Final simplification68.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (* (* (* (* 0.125 (/ D (* (* d d) l))) h) M) (* D M)))))
(if (<= d -1.02e+155)
(* (sqrt (/ 1.0 (* l h))) (- d))
(if (<= d -4.6e-150)
(* (* t_0 (sqrt (/ d h))) (sqrt (/ d l)))
(if (<= d -2.8e-303)
(fma
(* (sqrt (/ h (* (* l l) l))) D)
(* (- D) (* (* -0.125 (/ M d)) M))
(/ (- d) (sqrt (* l h))))
(if (<= d 98000.0)
(/
(*
(fma (* (* (/ (* M M) (* d d)) (* D D)) -0.125) (/ h l) 1.0)
(/ d (sqrt l)))
(sqrt h))
(if (<= d 9e+110)
(* (sqrt (/ (* d d) (* l h))) t_0)
(/ d (* (sqrt l) (sqrt h))))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - ((((0.125 * (D / ((d * d) * l))) * h) * M) * (D * M));
double tmp;
if (d <= -1.02e+155) {
tmp = sqrt((1.0 / (l * h))) * -d;
} else if (d <= -4.6e-150) {
tmp = (t_0 * sqrt((d / h))) * sqrt((d / l));
} else if (d <= -2.8e-303) {
tmp = fma((sqrt((h / ((l * l) * l))) * D), (-D * ((-0.125 * (M / d)) * M)), (-d / sqrt((l * h))));
} else if (d <= 98000.0) {
tmp = (fma(((((M * M) / (d * d)) * (D * D)) * -0.125), (h / l), 1.0) * (d / sqrt(l))) / sqrt(h);
} else if (d <= 9e+110) {
tmp = sqrt(((d * d) / (l * h))) * t_0;
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(Float64(Float64(Float64(0.125 * Float64(D / Float64(Float64(d * d) * l))) * h) * M) * Float64(D * M))) tmp = 0.0 if (d <= -1.02e+155) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); elseif (d <= -4.6e-150) tmp = Float64(Float64(t_0 * sqrt(Float64(d / h))) * sqrt(Float64(d / l))); elseif (d <= -2.8e-303) tmp = fma(Float64(sqrt(Float64(h / Float64(Float64(l * l) * l))) * D), Float64(Float64(-D) * Float64(Float64(-0.125 * Float64(M / d)) * M)), Float64(Float64(-d) / sqrt(Float64(l * h)))); elseif (d <= 98000.0) tmp = Float64(Float64(fma(Float64(Float64(Float64(Float64(M * M) / Float64(d * d)) * Float64(D * D)) * -0.125), Float64(h / l), 1.0) * Float64(d / sqrt(l))) / sqrt(h)); elseif (d <= 9e+110) tmp = Float64(sqrt(Float64(Float64(d * d) / Float64(l * h))) * t_0); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 - N[(N[(N[(N[(0.125 * N[(D / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.02e+155], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[d, -4.6e-150], N[(N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.8e-303], N[(N[(N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * D), $MachinePrecision] * N[((-D) * N[(N[(-0.125 * N[(M / d), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision]), $MachinePrecision] + N[((-d) / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 98000.0], N[(N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9e+110], N[(N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \left(\left(\left(0.125 \cdot \frac{D}{\left(d \cdot d\right) \cdot \ell}\right) \cdot h\right) \cdot M\right) \cdot \left(D \cdot M\right)\\
\mathbf{if}\;d \leq -1.02 \cdot 10^{+155}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{elif}\;d \leq -4.6 \cdot 10^{-150}:\\
\;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;d \leq -2.8 \cdot 10^{-303}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \cdot D, \left(-D\right) \cdot \left(\left(-0.125 \cdot \frac{M}{d}\right) \cdot M\right), \frac{-d}{\sqrt{\ell \cdot h}}\right)\\
\mathbf{elif}\;d \leq 98000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(\frac{M \cdot M}{d \cdot d} \cdot \left(D \cdot D\right)\right) \cdot -0.125, \frac{h}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\
\mathbf{elif}\;d \leq 9 \cdot 10^{+110}:\\
\;\;\;\;\sqrt{\frac{d \cdot d}{\ell \cdot h}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -1.02e155Initial program 70.1%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites38.1%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6456.8
Applied rewrites56.8%
if -1.02e155 < d < -4.60000000000000006e-150Initial program 86.1%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites77.8%
Applied rewrites77.9%
if -4.60000000000000006e-150 < d < -2.8e-303Initial program 62.0%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites28.4%
Applied rewrites0.0%
Taylor expanded in l around -inf
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites61.6%
Applied rewrites78.1%
if -2.8e-303 < d < 98000Initial program 56.2%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6465.4
Applied rewrites65.4%
lift-/.f64N/A
metadata-eval65.4
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6466.3
Applied rewrites66.3%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites67.7%
Applied rewrites49.8%
if 98000 < d < 9.0000000000000005e110Initial program 67.0%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites75.6%
Applied rewrites83.9%
if 9.0000000000000005e110 < d Initial program 62.3%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites45.1%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.1
Applied rewrites75.1%
Applied rewrites75.3%
Applied rewrites78.0%
Final simplification67.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ M d) D)))
(if (<= d 1.2e+74)
(*
(- 1.0 (* (/ (* (* 0.25 D) (* (/ M d) h)) l) (* D (* M (/ 0.5 d)))))
(* (sqrt (/ d l)) (sqrt (/ d h))))
(*
(- 1.0 (* (* (* (* t_0 t_0) 0.25) (/ 1.0 2.0)) (/ h l)))
(/ d (sqrt (* l h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (M / d) * D;
double tmp;
if (d <= 1.2e+74) {
tmp = (1.0 - ((((0.25 * D) * ((M / d) * h)) / l) * (D * (M * (0.5 / d))))) * (sqrt((d / l)) * sqrt((d / h)));
} else {
tmp = (1.0 - ((((t_0 * t_0) * 0.25) * (1.0 / 2.0)) * (h / l))) * (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) :: t_0
real(8) :: tmp
t_0 = (m / d) * d_1
if (d <= 1.2d+74) then
tmp = (1.0d0 - ((((0.25d0 * d_1) * ((m / d) * h)) / l) * (d_1 * (m * (0.5d0 / d))))) * (sqrt((d / l)) * sqrt((d / h)))
else
tmp = (1.0d0 - ((((t_0 * t_0) * 0.25d0) * (1.0d0 / 2.0d0)) * (h / l))) * (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 t_0 = (M / d) * D;
double tmp;
if (d <= 1.2e+74) {
tmp = (1.0 - ((((0.25 * D) * ((M / d) * h)) / l) * (D * (M * (0.5 / d))))) * (Math.sqrt((d / l)) * Math.sqrt((d / h)));
} else {
tmp = (1.0 - ((((t_0 * t_0) * 0.25) * (1.0 / 2.0)) * (h / l))) * (d / Math.sqrt((l * h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (M / d) * D tmp = 0 if d <= 1.2e+74: tmp = (1.0 - ((((0.25 * D) * ((M / d) * h)) / l) * (D * (M * (0.5 / d))))) * (math.sqrt((d / l)) * math.sqrt((d / h))) else: tmp = (1.0 - ((((t_0 * t_0) * 0.25) * (1.0 / 2.0)) * (h / l))) * (d / math.sqrt((l * h))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64(M / d) * D) tmp = 0.0 if (d <= 1.2e+74) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(0.25 * D) * Float64(Float64(M / d) * h)) / l) * Float64(D * Float64(M * Float64(0.5 / d))))) * Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)))); else tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(t_0 * t_0) * 0.25) * Float64(1.0 / 2.0)) * Float64(h / l))) * Float64(d / sqrt(Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (M / d) * D; tmp = 0.0; if (d <= 1.2e+74) tmp = (1.0 - ((((0.25 * D) * ((M / d) * h)) / l) * (D * (M * (0.5 / d))))) * (sqrt((d / l)) * sqrt((d / h))); else tmp = (1.0 - ((((t_0 * t_0) * 0.25) * (1.0 / 2.0)) * (h / l))) * (d / sqrt((l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(M / d), $MachinePrecision] * D), $MachinePrecision]}, If[LessEqual[d, 1.2e+74], N[(N[(1.0 - N[(N[(N[(N[(0.25 * D), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(D * N[(M * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] * 0.25), $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M}{d} \cdot D\\
\mathbf{if}\;d \leq 1.2 \cdot 10^{+74}:\\
\;\;\;\;\left(1 - \frac{\left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right)}{\ell} \cdot \left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \left(\left(\left(t\_0 \cdot t\_0\right) \cdot 0.25\right) \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < 1.20000000000000004e74Initial program 68.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites75.3%
lift-/.f64N/A
metadata-eval75.3
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6475.3
Applied rewrites75.3%
lift-/.f64N/A
metadata-eval75.3
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6475.3
Applied rewrites75.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
associate-/r/N/A
clear-numN/A
lower-*.f64N/A
Applied rewrites73.0%
if 1.20000000000000004e74 < d Initial program 64.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6481.8
Applied rewrites81.8%
lift-/.f64N/A
metadata-eval81.8
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6486.6
Applied rewrites86.6%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites88.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-timesN/A
lift-sqrt.f64N/A
*-lft-identityN/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-prodN/A
*-commutativeN/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f6479.8
Applied rewrites79.8%
Final simplification74.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<= d -9.4e+154)
(* (sqrt (/ 1.0 (* l h))) (- d))
(if (<= d -1.5e-127)
(/
(- 1.0 (* (* (* (* 0.125 (/ D (* (* d d) l))) h) M) (* D M)))
(sqrt (/ h (* (/ d l) d))))
(if (<= d -2.8e-303)
(fma
(* (sqrt (/ h (* (* l l) l))) D)
(* (- D) (* (* -0.125 (/ M d)) M))
(/ (- d) t_0))
(if (<= d 3.8e-51)
(*
(fma (* (* (/ (* M M) (* d d)) (* D D)) -0.125) (/ h l) 1.0)
(/ d t_0))
(/ d (* (sqrt l) (sqrt h)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (d <= -9.4e+154) {
tmp = sqrt((1.0 / (l * h))) * -d;
} else if (d <= -1.5e-127) {
tmp = (1.0 - ((((0.125 * (D / ((d * d) * l))) * h) * M) * (D * M))) / sqrt((h / ((d / l) * d)));
} else if (d <= -2.8e-303) {
tmp = fma((sqrt((h / ((l * l) * l))) * D), (-D * ((-0.125 * (M / d)) * M)), (-d / t_0));
} else if (d <= 3.8e-51) {
tmp = fma(((((M * M) / (d * d)) * (D * D)) * -0.125), (h / l), 1.0) * (d / t_0);
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (d <= -9.4e+154) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); elseif (d <= -1.5e-127) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(0.125 * Float64(D / Float64(Float64(d * d) * l))) * h) * M) * Float64(D * M))) / sqrt(Float64(h / Float64(Float64(d / l) * d)))); elseif (d <= -2.8e-303) tmp = fma(Float64(sqrt(Float64(h / Float64(Float64(l * l) * l))) * D), Float64(Float64(-D) * Float64(Float64(-0.125 * Float64(M / d)) * M)), Float64(Float64(-d) / t_0)); elseif (d <= 3.8e-51) tmp = Float64(fma(Float64(Float64(Float64(Float64(M * M) / Float64(d * d)) * Float64(D * D)) * -0.125), Float64(h / l), 1.0) * Float64(d / t_0)); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -9.4e+154], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[d, -1.5e-127], N[(N[(1.0 - N[(N[(N[(N[(0.125 * N[(D / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h), $MachinePrecision] * M), $MachinePrecision] * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h / N[(N[(d / l), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.8e-303], N[(N[(N[Sqrt[N[(h / N[(N[(l * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * D), $MachinePrecision] * N[((-D) * N[(N[(-0.125 * N[(M / d), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision]), $MachinePrecision] + N[((-d) / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.8e-51], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * -0.125), $MachinePrecision] * N[(h / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / t$95$0), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;d \leq -9.4 \cdot 10^{+154}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{elif}\;d \leq -1.5 \cdot 10^{-127}:\\
\;\;\;\;\frac{1 - \left(\left(\left(0.125 \cdot \frac{D}{\left(d \cdot d\right) \cdot \ell}\right) \cdot h\right) \cdot M\right) \cdot \left(D \cdot M\right)}{\sqrt{\frac{h}{\frac{d}{\ell} \cdot d}}}\\
\mathbf{elif}\;d \leq -2.8 \cdot 10^{-303}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt{\frac{h}{\left(\ell \cdot \ell\right) \cdot \ell}} \cdot D, \left(-D\right) \cdot \left(\left(-0.125 \cdot \frac{M}{d}\right) \cdot M\right), \frac{-d}{t\_0}\right)\\
\mathbf{elif}\;d \leq 3.8 \cdot 10^{-51}:\\
\;\;\;\;\mathsf{fma}\left(\left(\frac{M \cdot M}{d \cdot d} \cdot \left(D \cdot D\right)\right) \cdot -0.125, \frac{h}{\ell}, 1\right) \cdot \frac{d}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -9.39999999999999966e154Initial program 70.1%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites38.1%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6456.8
Applied rewrites56.8%
if -9.39999999999999966e154 < d < -1.50000000000000004e-127Initial program 88.3%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites79.1%
Applied rewrites66.4%
if -1.50000000000000004e-127 < d < -2.8e-303Initial program 63.3%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites37.9%
Applied rewrites0.0%
Taylor expanded in l around -inf
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.5%
Applied rewrites62.9%
if -2.8e-303 < d < 3.80000000000000003e-51Initial program 53.4%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6463.9
Applied rewrites63.9%
lift-/.f64N/A
metadata-eval63.9
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
unpow-prod-downN/A
pow1/2N/A
lift-sqrt.f64N/A
lower-*.f64N/A
pow1/2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6464.9
Applied rewrites64.9%
lift-pow.f64N/A
lift-/.f64N/A
div-invN/A
unpow-prod-downN/A
pow2N/A
lift-*.f64N/A
associate-/r*N/A
metadata-evalN/A
lift-/.f64N/A
pow2N/A
swap-sqrN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites66.6%
Applied rewrites44.7%
if 3.80000000000000003e-51 < d Initial program 65.1%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites56.1%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6467.9
Applied rewrites67.9%
Applied rewrites67.9%
Applied rewrites72.6%
Final simplification61.5%
(FPCore (d h l M D)
:precision binary64
(if (<= h -250000000.0)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= h -1e-310)
(* (sqrt (/ 1.0 (* l h))) (- d))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -250000000.0) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (h <= -1e-310) {
tmp = sqrt((1.0 / (l * h))) * -d;
} else {
tmp = d / (sqrt(l) * 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) :: tmp
if (h <= (-250000000.0d0)) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (h <= (-1d-310)) then
tmp = sqrt((1.0d0 / (l * h))) * -d
else
tmp = d / (sqrt(l) * sqrt(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 <= -250000000.0) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (h <= -1e-310) {
tmp = Math.sqrt((1.0 / (l * h))) * -d;
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -250000000.0: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif h <= -1e-310: tmp = math.sqrt((1.0 / (l * h))) * -d else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -250000000.0) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (h <= -1e-310) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= -250000000.0) tmp = sqrt((d / l)) * sqrt((d / h)); elseif (h <= -1e-310) tmp = sqrt((1.0 / (l * h))) * -d; else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -250000000.0], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-310], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -250000000:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -2.5e8Initial program 78.1%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites60.8%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f647.6
Applied rewrites7.6%
Applied rewrites41.3%
if -2.5e8 < h < -9.999999999999969e-311Initial program 73.4%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites48.9%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6453.2
Applied rewrites53.2%
if -9.999999999999969e-311 < h Initial program 60.7%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites48.0%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6448.7
Applied rewrites48.7%
Applied rewrites48.9%
Applied rewrites53.6%
Final simplification50.5%
(FPCore (d h l M D) :precision binary64 (if (<= d 5.5e-155) (* (sqrt (/ 1.0 (* l h))) (- d)) (/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 5.5e-155) {
tmp = sqrt((1.0 / (l * h))) * -d;
} else {
tmp = d / (sqrt(l) * 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) :: tmp
if (d <= 5.5d-155) then
tmp = sqrt((1.0d0 / (l * h))) * -d
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 5.5e-155) {
tmp = Math.sqrt((1.0 / (l * h))) * -d;
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 5.5e-155: tmp = math.sqrt((1.0 / (l * h))) * -d else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 5.5e-155) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 5.5e-155) tmp = sqrt((1.0 / (l * h))) * -d; else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 5.5e-155], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5.5 \cdot 10^{-155}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < 5.50000000000000018e-155Initial program 68.3%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites48.3%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6436.3
Applied rewrites36.3%
if 5.50000000000000018e-155 < d Initial program 67.1%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites55.7%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6459.9
Applied rewrites59.9%
Applied rewrites60.2%
Applied rewrites65.3%
Final simplification48.3%
(FPCore (d h l M D) :precision binary64 (if (<= d 5.5e-155) (* (sqrt (/ 1.0 (* l h))) (- d)) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 5.5e-155) {
tmp = sqrt((1.0 / (l * h))) * -d;
} 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 (d <= 5.5d-155) then
tmp = sqrt((1.0d0 / (l * h))) * -d
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 (d <= 5.5e-155) {
tmp = Math.sqrt((1.0 / (l * h))) * -d;
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 5.5e-155: tmp = math.sqrt((1.0 / (l * h))) * -d else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 5.5e-155) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); 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 (d <= 5.5e-155) tmp = sqrt((1.0 / (l * h))) * -d; else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 5.5e-155], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 5.5 \cdot 10^{-155}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < 5.50000000000000018e-155Initial program 68.3%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites48.3%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6436.3
Applied rewrites36.3%
if 5.50000000000000018e-155 < d Initial program 67.1%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites55.7%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6459.9
Applied rewrites59.9%
Applied rewrites60.2%
Final simplification46.2%
(FPCore (d h l M D) :precision binary64 (if (<= l -1.3e-156) (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 <= -1.3e-156) {
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 <= (-1.3d-156)) 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 <= -1.3e-156) {
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 <= -1.3e-156: 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 <= -1.3e-156) tmp = sqrt(Float64(Float64(d * 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 <= -1.3e-156) 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, -1.3e-156], N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.3 \cdot 10^{-156}:\\
\;\;\;\;\sqrt{\frac{d \cdot d}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if l < -1.3e-156Initial program 73.9%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites60.7%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f643.6
Applied rewrites3.6%
Applied rewrites24.1%
if -1.3e-156 < l Initial program 64.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites46.7%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6443.8
Applied rewrites43.8%
Applied rewrites43.9%
(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 67.8%
Taylor expanded in h around 0
associate-*r/N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l/N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites51.3%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6430.5
Applied rewrites30.5%
Applied rewrites30.6%
herbie shell --seed 2024240
(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)))))