
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* 0.5 (* M D)) (* d 2.0)) (/ -1.0 h))))))
(if (<= l -5e-307)
(* (* (sqrt (/ 1.0 (* l h))) (- d)) t_0)
(* t_0 (/ (* d (/ 1.0 (sqrt h))) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * (((0.5 * (M * D)) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (l <= -5e-307) {
tmp = (sqrt((1.0 / (l * h))) * -d) * t_0;
} else {
tmp = t_0 * ((d * (1.0 / sqrt(h))) / sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + ((((m * d_1) / (d * 2.0d0)) / l) * (((0.5d0 * (m * d_1)) / (d * 2.0d0)) / ((-1.0d0) / h)))
if (l <= (-5d-307)) then
tmp = (sqrt((1.0d0 / (l * h))) * -d) * t_0
else
tmp = t_0 * ((d * (1.0d0 / sqrt(h))) / sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * (((0.5 * (M * D)) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (l <= -5e-307) {
tmp = (Math.sqrt((1.0 / (l * h))) * -d) * t_0;
} else {
tmp = t_0 * ((d * (1.0 / Math.sqrt(h))) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * (((0.5 * (M * D)) / (d * 2.0)) / (-1.0 / h))) tmp = 0 if l <= -5e-307: tmp = (math.sqrt((1.0 / (l * h))) * -d) * t_0 else: tmp = t_0 * ((d * (1.0 / math.sqrt(h))) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(0.5 * Float64(M * D)) / Float64(d * 2.0)) / Float64(-1.0 / h)))) tmp = 0.0 if (l <= -5e-307) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * t_0); else tmp = Float64(t_0 * Float64(Float64(d * Float64(1.0 / sqrt(h))) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * (((0.5 * (M * D)) / (d * 2.0)) / (-1.0 / h))); tmp = 0.0; if (l <= -5e-307) tmp = (sqrt((1.0 / (l * h))) * -d) * t_0; else tmp = t_0 * ((d * (1.0 / sqrt(h))) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5e-307], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[(N[(d * N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{0.5 \cdot \left(M \cdot D\right)}{d \cdot 2}}{\frac{-1}{h}}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-307}:\\
\;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \frac{d \cdot \frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -5.00000000000000014e-307Initial program 65.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites73.0%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6473.0
Applied rewrites73.0%
Taylor expanded in h around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6482.2
Applied rewrites82.2%
if -5.00000000000000014e-307 < l Initial program 69.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites75.7%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6475.7
Applied rewrites75.7%
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
metadata-evalN/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
unpow1/2N/A
pow1/2N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f6463.6
Applied rewrites63.6%
associate-*l/N/A
div-invN/A
lift-/.f64N/A
sqrt-prodN/A
pow1/2N/A
metadata-evalN/A
pow1/2N/A
metadata-evalN/A
metadata-evalN/A
pow1/2N/A
sqrt-prodN/A
rem-square-sqrtN/A
metadata-evalN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
lower-*.f64N/A
sqrt-pow1N/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f6487.2
Applied rewrites87.2%
Final simplification84.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (/ d l)))
(t_2
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
(t_3 (* d (* l d))))
(if (<= t_2 -1e-141)
(* t_0 (* t_1 (- 1.0 (/ (* (* h 0.5) (* (* M D) (* (* M D) 0.25))) t_3))))
(if (<= t_2 INFINITY)
(* t_0 t_1)
(*
(* (sqrt (/ 1.0 (* l h))) (- d))
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) t_3)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_3 = d * (l * d);
double tmp;
if (t_2 <= -1e-141) {
tmp = t_0 * (t_1 * (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_3)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0 * t_1;
} else {
tmp = (sqrt((1.0 / (l * h))) * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_3));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double t_1 = Math.sqrt((d / l));
double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_3 = d * (l * d);
double tmp;
if (t_2 <= -1e-141) {
tmp = t_0 * (t_1 * (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_3)));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_0 * t_1;
} else {
tmp = (Math.sqrt((1.0 / (l * h))) * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_3));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = math.sqrt((d / l)) t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_3 = d * (l * d) tmp = 0 if t_2 <= -1e-141: tmp = t_0 * (t_1 * (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_3))) elif t_2 <= math.inf: tmp = t_0 * t_1 else: tmp = (math.sqrt((1.0 / (l * h))) * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_3)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) t_3 = Float64(d * Float64(l * d)) tmp = 0.0 if (t_2 <= -1e-141) tmp = Float64(t_0 * Float64(t_1 * Float64(1.0 - Float64(Float64(Float64(h * 0.5) * Float64(Float64(M * D) * Float64(Float64(M * D) * 0.25))) / t_3)))); elseif (t_2 <= Inf) tmp = Float64(t_0 * t_1); else tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / t_3))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); t_1 = sqrt((d / l)); t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_3 = d * (l * d); tmp = 0.0; if (t_2 <= -1e-141) tmp = t_0 * (t_1 * (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_3))); elseif (t_2 <= Inf) tmp = t_0 * t_1; else tmp = (sqrt((1.0 / (l * h))) * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_3)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(d * N[(l * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-141], N[(t$95$0 * N[(t$95$1 * N[(1.0 - N[(N[(N[(h * 0.5), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$0 * t$95$1), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * N[(1.0 - N[(N[(D * N[(D * N[(0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_3 := d \cdot \left(\ell \cdot d\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-141}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \left(1 - \frac{\left(h \cdot 0.5\right) \cdot \left(\left(M \cdot D\right) \cdot \left(\left(M \cdot D\right) \cdot 0.25\right)\right)}{t\_3}\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot \left(1 - \frac{D \cdot \left(D \cdot \left(0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{t\_3}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1e-141Initial program 84.6%
Applied rewrites81.8%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6481.8
Applied rewrites81.8%
Applied rewrites76.2%
if -1e-141 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 76.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6450.0
Applied rewrites50.0%
Applied rewrites44.8%
Taylor expanded in M around 0
lower-sqrt.f64N/A
lower-/.f6476.8
Applied rewrites76.8%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6420.3
Applied rewrites20.3%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6420.3
Applied rewrites20.3%
Taylor expanded in h around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6430.0
Applied rewrites30.0%
Final simplification69.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
(t_1 (* d (* l d))))
(if (<= t_0 -1e-141)
(*
(- 1.0 (/ (* (* h 0.5) (* (* M D) (* (* M D) 0.25))) t_1))
(sqrt (* (/ d l) (/ d h))))
(if (<= t_0 INFINITY)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(*
(* (sqrt (/ 1.0 (* l h))) (- d))
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) t_1)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = d * (l * d);
double tmp;
if (t_0 <= -1e-141) {
tmp = (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_1)) * sqrt(((d / l) * (d / h)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = (sqrt((1.0 / (l * h))) * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_1));
}
return tmp;
}
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(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double t_1 = d * (l * d);
double tmp;
if (t_0 <= -1e-141) {
tmp = (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_1)) * Math.sqrt(((d / l) * (d / h)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = (Math.sqrt((1.0 / (l * h))) * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_1));
}
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(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) t_1 = d * (l * d) tmp = 0 if t_0 <= -1e-141: tmp = (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_1)) * math.sqrt(((d / l) * (d / h))) elif t_0 <= math.inf: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = (math.sqrt((1.0 / (l * h))) * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_1)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) t_1 = Float64(d * Float64(l * d)) tmp = 0.0 if (t_0 <= -1e-141) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(h * 0.5) * Float64(Float64(M * D) * Float64(Float64(M * D) * 0.25))) / t_1)) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); elseif (t_0 <= Inf) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / t_1))); 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) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); t_1 = d * (l * d); tmp = 0.0; if (t_0 <= -1e-141) tmp = (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_1)) * sqrt(((d / l) * (d / h))); elseif (t_0 <= Inf) tmp = sqrt((d / h)) * sqrt((d / l)); else tmp = (sqrt((1.0 / (l * h))) * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_1)); 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[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d * N[(l * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-141], N[(N[(1.0 - N[(N[(N[(h * 0.5), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * N[(1.0 - N[(N[(D * N[(D * N[(0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := d \cdot \left(\ell \cdot d\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-141}:\\
\;\;\;\;\left(1 - \frac{\left(h \cdot 0.5\right) \cdot \left(\left(M \cdot D\right) \cdot \left(\left(M \cdot D\right) \cdot 0.25\right)\right)}{t\_1}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot \left(1 - \frac{D \cdot \left(D \cdot \left(0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{t\_1}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1e-141Initial program 84.6%
Applied rewrites81.8%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6481.8
Applied rewrites81.8%
Applied rewrites61.9%
if -1e-141 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 76.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6450.0
Applied rewrites50.0%
Applied rewrites44.8%
Taylor expanded in M around 0
lower-sqrt.f64N/A
lower-/.f6476.8
Applied rewrites76.8%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6420.3
Applied rewrites20.3%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6420.3
Applied rewrites20.3%
Taylor expanded in h around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6430.0
Applied rewrites30.0%
Final simplification63.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 (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))
-1e-141)
(* (sqrt (/ h (* l (* l l)))) (/ (* 0.125 (* D (* D (* M M)))) d))
(* (sqrt (/ d h)) (sqrt (/ d l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -1e-141) {
tmp = sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d);
} else {
tmp = sqrt((d / h)) * sqrt((d / l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0))))) <= (-1d-141)) then
tmp = sqrt((h / (l * (l * l)))) * ((0.125d0 * (d_1 * (d_1 * (m * m)))) / d)
else
tmp = sqrt((d / h)) * sqrt((d / l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -1e-141) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d);
} else {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
}
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(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -1e-141: tmp = math.sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d) else: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) <= -1e-141) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(0.125 * Float64(D * Float64(D * Float64(M * M)))) / d)); else tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); 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) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))))) <= -1e-141) tmp = sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d); else tmp = sqrt((d / h)) * sqrt((d / l)); 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[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-141], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(0.125 * N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -1 \cdot 10^{-141}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{0.125 \cdot \left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right)}{d}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1e-141Initial program 84.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites90.7%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites32.9%
if -1e-141 < (*.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 56.6%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6442.2
Applied rewrites42.2%
Applied rewrites38.3%
Taylor expanded in M around 0
lower-sqrt.f64N/A
lower-/.f6461.0
Applied rewrites61.0%
Final simplification50.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 (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))
-2e+47)
(* (sqrt (/ h (* l (* l l)))) (* (/ (* M M) d) (* 0.125 (* D D))))
(* (sqrt (/ d h)) (sqrt (/ d l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -2e+47) {
tmp = sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D)));
} else {
tmp = sqrt((d / h)) * sqrt((d / l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0))))) <= (-2d+47)) then
tmp = sqrt((h / (l * (l * l)))) * (((m * m) / d) * (0.125d0 * (d_1 * d_1)))
else
tmp = sqrt((d / h)) * sqrt((d / l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -2e+47) {
tmp = Math.sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D)));
} else {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
}
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(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -2e+47: tmp = math.sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D))) else: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) <= -2e+47) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(Float64(M * M) / d) * Float64(0.125 * Float64(D * D)))); else tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); 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) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))))) <= -2e+47) tmp = sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D))); else tmp = sqrt((d / h)) * sqrt((d / l)); 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[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e+47], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * N[(0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -2 \cdot 10^{+47}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(0.125 \cdot \left(D \cdot D\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.0000000000000001e47Initial program 83.9%
Applied rewrites83.1%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6483.1
Applied rewrites83.1%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites30.4%
if -2.0000000000000001e47 < (*.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 57.9%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6442.8
Applied rewrites42.8%
Applied rewrites38.3%
Taylor expanded in M around 0
lower-sqrt.f64N/A
lower-/.f6459.1
Applied rewrites59.1%
Final simplification48.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h))) (t_1 (sqrt (/ d l))))
(if (<=
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))
-1e-141)
(* t_0 (- t_1))
(* t_0 t_1))))
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 tmp;
if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -1e-141) {
tmp = t_0 * -t_1;
} else {
tmp = t_0 * t_1;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / h))
t_1 = sqrt((d / l))
if (((((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0))))) <= (-1d-141)) then
tmp = t_0 * -t_1
else
tmp = t_0 * t_1
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double t_1 = Math.sqrt((d / l));
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(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -1e-141) {
tmp = t_0 * -t_1;
} else {
tmp = t_0 * t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = math.sqrt((d / l)) 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(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= -1e-141: tmp = t_0 * -t_1 else: tmp = t_0 * t_1 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) <= -1e-141) tmp = Float64(t_0 * Float64(-t_1)); else tmp = Float64(t_0 * t_1); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); t_1 = sqrt((d / l)); tmp = 0.0; if (((((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))))) <= -1e-141) tmp = t_0 * -t_1; else tmp = t_0 * t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-141], N[(t$95$0 * (-t$95$1)), $MachinePrecision], N[(t$95$0 * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq -1 \cdot 10^{-141}:\\
\;\;\;\;t\_0 \cdot \left(-t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1e-141Initial program 84.6%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6464.2
Applied rewrites64.2%
Applied rewrites57.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f6417.7
Applied rewrites17.7%
if -1e-141 < (*.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 56.6%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6442.2
Applied rewrites42.2%
Applied rewrites38.3%
Taylor expanded in M around 0
lower-sqrt.f64N/A
lower-/.f6461.0
Applied rewrites61.0%
Final simplification44.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 (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))
0.0)
(* d (sqrt (/ 1.0 (* l h))))
(* (sqrt (/ d h)) (sqrt (/ d l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= 0.0) {
tmp = d * sqrt((1.0 / (l * h)));
} else {
tmp = sqrt((d / h)) * sqrt((d / l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (((((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 + ((h / l) * ((((m * d_1) / (d * 2.0d0)) ** 2.0d0) * ((-1.0d0) / 2.0d0))))) <= 0.0d0) then
tmp = d * sqrt((1.0d0 / (l * h)))
else
tmp = sqrt((d / h)) * sqrt((d / l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (((Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= 0.0) {
tmp = d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
}
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(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))))) <= 0.0: tmp = d * math.sqrt((1.0 / (l * h))) else: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) <= 0.0) tmp = Float64(d * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); 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) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0))))) <= 0.0) tmp = d * sqrt((1.0 / (l * h))); else tmp = sqrt((d / h)) * sqrt((d / l)); 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[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \leq 0:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 0.0Initial program 77.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites82.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6420.6
Applied rewrites20.6%
if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 58.9%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6445.2
Applied rewrites45.2%
Applied rewrites40.8%
Taylor expanded in M around 0
lower-sqrt.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
Final simplification43.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (* l h)))))
(if (<= d -2e-72)
(*
(*
(fma (* (/ (* M D) (* l (* d -2.0))) (* h 0.25)) (/ (* M D) d) 1.0)
(sqrt (/ d l)))
(sqrt (/ d h)))
(if (<= d -5e-296)
(*
(* t_0 (- d))
(- 1.0 (/ (* (/ (* 0.25 (* M (* D (* M D)))) d) (/ (* h 0.5) l)) d)))
(*
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* 0.5 (* M D)) (* d 2.0)) (/ -1.0 h))))
(* d t_0))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h)));
double tmp;
if (d <= -2e-72) {
tmp = (fma((((M * D) / (l * (d * -2.0))) * (h * 0.25)), ((M * D) / d), 1.0) * sqrt((d / l))) * sqrt((d / h));
} else if (d <= -5e-296) {
tmp = (t_0 * -d) * (1.0 - ((((0.25 * (M * (D * (M * D)))) / d) * ((h * 0.5) / l)) / d));
} else {
tmp = (1.0 + ((((M * D) / (d * 2.0)) / l) * (((0.5 * (M * D)) / (d * 2.0)) / (-1.0 / h)))) * (d * t_0);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(l * h))) tmp = 0.0 if (d <= -2e-72) tmp = Float64(Float64(fma(Float64(Float64(Float64(M * D) / Float64(l * Float64(d * -2.0))) * Float64(h * 0.25)), Float64(Float64(M * D) / d), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(d / h))); elseif (d <= -5e-296) tmp = Float64(Float64(t_0 * Float64(-d)) * Float64(1.0 - Float64(Float64(Float64(Float64(0.25 * Float64(M * Float64(D * Float64(M * D)))) / d) * Float64(Float64(h * 0.5) / l)) / d))); else tmp = Float64(Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(0.5 * Float64(M * D)) / Float64(d * 2.0)) / Float64(-1.0 / h)))) * Float64(d * t_0)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -2e-72], N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] / N[(l * N[(d * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * 0.25), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-296], N[(N[(t$95$0 * (-d)), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(0.25 * N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(h * 0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{if}\;d \leq -2 \cdot 10^{-72}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{M \cdot D}{\ell \cdot \left(d \cdot -2\right)} \cdot \left(h \cdot 0.25\right), \frac{M \cdot D}{d}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-296}:\\
\;\;\;\;\left(t\_0 \cdot \left(-d\right)\right) \cdot \left(1 - \frac{\frac{0.25 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{d} \cdot \frac{h \cdot 0.5}{\ell}}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{0.5 \cdot \left(M \cdot D\right)}{d \cdot 2}}{\frac{-1}{h}}\right) \cdot \left(d \cdot t\_0\right)\\
\end{array}
\end{array}
if d < -1.9999999999999999e-72Initial program 70.4%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6461.2
Applied rewrites61.2%
Applied rewrites54.8%
Applied rewrites75.5%
if -1.9999999999999999e-72 < d < -5.0000000000000003e-296Initial program 56.7%
Applied rewrites62.3%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6462.3
Applied rewrites62.3%
Taylor expanded in h around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6477.4
Applied rewrites77.4%
if -5.0000000000000003e-296 < d Initial program 69.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites75.7%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6475.7
Applied rewrites75.7%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6478.1
Applied rewrites78.1%
Final simplification77.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* 0.5 (* M D)) (* d 2.0)) (/ -1.0 h)))))
(t_1 (sqrt (/ 1.0 (* l h)))))
(if (<= h -1e-302) (* (* t_1 (- d)) t_0) (* t_0 (* d t_1)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * (((0.5 * (M * D)) / (d * 2.0)) / (-1.0 / h)));
double t_1 = sqrt((1.0 / (l * h)));
double tmp;
if (h <= -1e-302) {
tmp = (t_1 * -d) * t_0;
} else {
tmp = t_0 * (d * t_1);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 + ((((m * d_1) / (d * 2.0d0)) / l) * (((0.5d0 * (m * d_1)) / (d * 2.0d0)) / ((-1.0d0) / h)))
t_1 = sqrt((1.0d0 / (l * h)))
if (h <= (-1d-302)) then
tmp = (t_1 * -d) * t_0
else
tmp = t_0 * (d * t_1)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * (((0.5 * (M * D)) / (d * 2.0)) / (-1.0 / h)));
double t_1 = Math.sqrt((1.0 / (l * h)));
double tmp;
if (h <= -1e-302) {
tmp = (t_1 * -d) * t_0;
} else {
tmp = t_0 * (d * t_1);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * (((0.5 * (M * D)) / (d * 2.0)) / (-1.0 / h))) t_1 = math.sqrt((1.0 / (l * h))) tmp = 0 if h <= -1e-302: tmp = (t_1 * -d) * t_0 else: tmp = t_0 * (d * t_1) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(0.5 * Float64(M * D)) / Float64(d * 2.0)) / Float64(-1.0 / h)))) t_1 = sqrt(Float64(1.0 / Float64(l * h))) tmp = 0.0 if (h <= -1e-302) tmp = Float64(Float64(t_1 * Float64(-d)) * t_0); else tmp = Float64(t_0 * Float64(d * t_1)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * (((0.5 * (M * D)) / (d * 2.0)) / (-1.0 / h))); t_1 = sqrt((1.0 / (l * h))); tmp = 0.0; if (h <= -1e-302) tmp = (t_1 * -d) * t_0; else tmp = t_0 * (d * t_1); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(0.5 * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -1e-302], N[(N[(t$95$1 * (-d)), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[(d * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{0.5 \cdot \left(M \cdot D\right)}{d \cdot 2}}{\frac{-1}{h}}\\
t_1 := \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{if}\;h \leq -1 \cdot 10^{-302}:\\
\;\;\;\;\left(t\_1 \cdot \left(-d\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(d \cdot t\_1\right)\\
\end{array}
\end{array}
if h < -9.9999999999999996e-303Initial program 65.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites73.0%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6473.0
Applied rewrites73.0%
Taylor expanded in h around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6482.2
Applied rewrites82.2%
if -9.9999999999999996e-303 < h Initial program 69.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites75.7%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6475.7
Applied rewrites75.7%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6478.1
Applied rewrites78.1%
Final simplification80.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(- 1.0 (/ (* (/ (* 0.25 (* M (* D (* M D)))) d) (/ (* h 0.5) l)) d)))
(t_1 (sqrt (/ 1.0 (* l h))))
(t_2 (* t_1 (- d))))
(if (<= d -1.3e-84)
(* t_2 (- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d)))))
(if (<= d -5e-296)
(* t_2 t_0)
(if (<= d 5e-53)
(* (* d t_1) t_0)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(fma
(* (/ (* M D) (* l (* d -2.0))) (* M (* 0.25 (/ D d))))
h
1.0))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - ((((0.25 * (M * (D * (M * D)))) / d) * ((h * 0.5) / l)) / d);
double t_1 = sqrt((1.0 / (l * h)));
double t_2 = t_1 * -d;
double tmp;
if (d <= -1.3e-84) {
tmp = t_2 * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
} else if (d <= -5e-296) {
tmp = t_2 * t_0;
} else if (d <= 5e-53) {
tmp = (d * t_1) * t_0;
} else {
tmp = sqrt((d / h)) * (sqrt((d / l)) * fma((((M * D) / (l * (d * -2.0))) * (M * (0.25 * (D / d)))), h, 1.0));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(Float64(Float64(Float64(0.25 * Float64(M * Float64(D * Float64(M * D)))) / d) * Float64(Float64(h * 0.5) / l)) / d)) t_1 = sqrt(Float64(1.0 / Float64(l * h))) t_2 = Float64(t_1 * Float64(-d)) tmp = 0.0 if (d <= -1.3e-84) tmp = Float64(t_2 * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d))))); elseif (d <= -5e-296) tmp = Float64(t_2 * t_0); elseif (d <= 5e-53) tmp = Float64(Float64(d * t_1) * t_0); else tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(Float64(M * D) / Float64(l * Float64(d * -2.0))) * Float64(M * Float64(0.25 * Float64(D / d)))), h, 1.0))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 - N[(N[(N[(N[(0.25 * N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(h * 0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * (-d)), $MachinePrecision]}, If[LessEqual[d, -1.3e-84], N[(t$95$2 * N[(1.0 - N[(N[(D * N[(D * N[(0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-296], N[(t$95$2 * t$95$0), $MachinePrecision], If[LessEqual[d, 5e-53], N[(N[(d * t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] / N[(l * N[(d * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M * N[(0.25 * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{\frac{0.25 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{d} \cdot \frac{h \cdot 0.5}{\ell}}{d}\\
t_1 := \sqrt{\frac{1}{\ell \cdot h}}\\
t_2 := t\_1 \cdot \left(-d\right)\\
\mathbf{if}\;d \leq -1.3 \cdot 10^{-84}:\\
\;\;\;\;t\_2 \cdot \left(1 - \frac{D \cdot \left(D \cdot \left(0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot \left(\ell \cdot d\right)}\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-296}:\\
\;\;\;\;t\_2 \cdot t\_0\\
\mathbf{elif}\;d \leq 5 \cdot 10^{-53}:\\
\;\;\;\;\left(d \cdot t\_1\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{M \cdot D}{\ell \cdot \left(d \cdot -2\right)} \cdot \left(M \cdot \left(0.25 \cdot \frac{D}{d}\right)\right), h, 1\right)\right)\\
\end{array}
\end{array}
if d < -1.3e-84Initial program 68.6%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6459.7
Applied rewrites59.7%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6459.7
Applied rewrites59.7%
Taylor expanded in h around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6466.5
Applied rewrites66.5%
if -1.3e-84 < d < -5.0000000000000003e-296Initial program 59.3%
Applied rewrites65.0%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6465.0
Applied rewrites65.0%
Taylor expanded in h around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6478.6
Applied rewrites78.6%
if -5.0000000000000003e-296 < d < 5e-53Initial program 58.4%
Applied rewrites60.5%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6460.5
Applied rewrites60.5%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6459.8
Applied rewrites59.8%
if 5e-53 < d Initial program 78.8%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6455.5
Applied rewrites55.5%
Applied rewrites49.9%
Applied rewrites81.7%
Final simplification71.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))) (t_1 (sqrt (/ d h))))
(if (<= (* M D) 2e-287)
(* t_1 t_0)
(*
(*
(fma (* (/ (* M D) (* l (* d -2.0))) (* h 0.25)) (/ (* M D) d) 1.0)
t_0)
t_1))))
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 tmp;
if ((M * D) <= 2e-287) {
tmp = t_1 * t_0;
} else {
tmp = (fma((((M * D) / (l * (d * -2.0))) * (h * 0.25)), ((M * D) / d), 1.0) * t_0) * t_1;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = sqrt(Float64(d / h)) tmp = 0.0 if (Float64(M * D) <= 2e-287) tmp = Float64(t_1 * t_0); else tmp = Float64(Float64(fma(Float64(Float64(Float64(M * D) / Float64(l * Float64(d * -2.0))) * Float64(h * 0.25)), Float64(Float64(M * D) / d), 1.0) * t_0) * t_1); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(M * D), $MachinePrecision], 2e-287], N[(t$95$1 * t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] / N[(l * N[(d * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * 0.25), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;M \cdot D \leq 2 \cdot 10^{-287}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{M \cdot D}{\ell \cdot \left(d \cdot -2\right)} \cdot \left(h \cdot 0.25\right), \frac{M \cdot D}{d}, 1\right) \cdot t\_0\right) \cdot t\_1\\
\end{array}
\end{array}
if (*.f64 M D) < 2.00000000000000004e-287Initial program 69.6%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6454.3
Applied rewrites54.3%
Applied rewrites49.6%
Taylor expanded in M around 0
lower-sqrt.f64N/A
lower-/.f6443.2
Applied rewrites43.2%
if 2.00000000000000004e-287 < (*.f64 M D) Initial program 64.7%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6445.8
Applied rewrites45.8%
Applied rewrites40.8%
Applied rewrites66.9%
Final simplification53.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (* l d))) (t_1 (sqrt (/ 1.0 (* l h)))) (t_2 (* d t_1)))
(if (<= l -5e+153)
(* (* t_1 (- d)) (- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) t_0)))
(if (<= l -5e-96)
(-
(* (sqrt (/ h (* l (* l l)))) (/ (* 0.125 (* D (* D (* M M)))) d))
t_2)
(if (<= l -5e-307)
(*
(- 1.0 (/ (* (* h 0.5) (* (* M D) (* (* M D) 0.25))) t_0))
(sqrt (* (/ d l) (/ d h))))
(*
t_2
(-
1.0
(/ (* (/ (* 0.25 (* M (* D (* M D)))) d) (/ (* h 0.5) l)) d))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d * (l * d);
double t_1 = sqrt((1.0 / (l * h)));
double t_2 = d * t_1;
double tmp;
if (l <= -5e+153) {
tmp = (t_1 * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_0));
} else if (l <= -5e-96) {
tmp = (sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d)) - t_2;
} else if (l <= -5e-307) {
tmp = (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_0)) * sqrt(((d / l) * (d / h)));
} else {
tmp = t_2 * (1.0 - ((((0.25 * (M * (D * (M * D)))) / d) * ((h * 0.5) / l)) / d));
}
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 * (l * d)
t_1 = sqrt((1.0d0 / (l * h)))
t_2 = d * t_1
if (l <= (-5d+153)) then
tmp = (t_1 * -d) * (1.0d0 - ((d_1 * (d_1 * (0.125d0 * (h * (m * m))))) / t_0))
else if (l <= (-5d-96)) then
tmp = (sqrt((h / (l * (l * l)))) * ((0.125d0 * (d_1 * (d_1 * (m * m)))) / d)) - t_2
else if (l <= (-5d-307)) then
tmp = (1.0d0 - (((h * 0.5d0) * ((m * d_1) * ((m * d_1) * 0.25d0))) / t_0)) * sqrt(((d / l) * (d / h)))
else
tmp = t_2 * (1.0d0 - ((((0.25d0 * (m * (d_1 * (m * d_1)))) / d) * ((h * 0.5d0) / l)) / d))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d * (l * d);
double t_1 = Math.sqrt((1.0 / (l * h)));
double t_2 = d * t_1;
double tmp;
if (l <= -5e+153) {
tmp = (t_1 * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_0));
} else if (l <= -5e-96) {
tmp = (Math.sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d)) - t_2;
} else if (l <= -5e-307) {
tmp = (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_0)) * Math.sqrt(((d / l) * (d / h)));
} else {
tmp = t_2 * (1.0 - ((((0.25 * (M * (D * (M * D)))) / d) * ((h * 0.5) / l)) / d));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = d * (l * d) t_1 = math.sqrt((1.0 / (l * h))) t_2 = d * t_1 tmp = 0 if l <= -5e+153: tmp = (t_1 * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_0)) elif l <= -5e-96: tmp = (math.sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d)) - t_2 elif l <= -5e-307: tmp = (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_0)) * math.sqrt(((d / l) * (d / h))) else: tmp = t_2 * (1.0 - ((((0.25 * (M * (D * (M * D)))) / d) * ((h * 0.5) / l)) / d)) return tmp
function code(d, h, l, M, D) t_0 = Float64(d * Float64(l * d)) t_1 = sqrt(Float64(1.0 / Float64(l * h))) t_2 = Float64(d * t_1) tmp = 0.0 if (l <= -5e+153) tmp = Float64(Float64(t_1 * Float64(-d)) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / t_0))); elseif (l <= -5e-96) tmp = Float64(Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(0.125 * Float64(D * Float64(D * Float64(M * M)))) / d)) - t_2); elseif (l <= -5e-307) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(h * 0.5) * Float64(Float64(M * D) * Float64(Float64(M * D) * 0.25))) / t_0)) * sqrt(Float64(Float64(d / l) * Float64(d / h)))); else tmp = Float64(t_2 * Float64(1.0 - Float64(Float64(Float64(Float64(0.25 * Float64(M * Float64(D * Float64(M * D)))) / d) * Float64(Float64(h * 0.5) / l)) / d))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = d * (l * d); t_1 = sqrt((1.0 / (l * h))); t_2 = d * t_1; tmp = 0.0; if (l <= -5e+153) tmp = (t_1 * -d) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / t_0)); elseif (l <= -5e-96) tmp = (sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d)) - t_2; elseif (l <= -5e-307) tmp = (1.0 - (((h * 0.5) * ((M * D) * ((M * D) * 0.25))) / t_0)) * sqrt(((d / l) * (d / h))); else tmp = t_2 * (1.0 - ((((0.25 * (M * (D * (M * D)))) / d) * ((h * 0.5) / l)) / d)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * N[(l * d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(d * t$95$1), $MachinePrecision]}, If[LessEqual[l, -5e+153], N[(N[(t$95$1 * (-d)), $MachinePrecision] * N[(1.0 - N[(N[(D * N[(D * N[(0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-96], N[(N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(0.125 * N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[l, -5e-307], N[(N[(1.0 - N[(N[(N[(h * 0.5), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d / l), $MachinePrecision] * N[(d / h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(1.0 - N[(N[(N[(N[(0.25 * N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(h * 0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := d \cdot \left(\ell \cdot d\right)\\
t_1 := \sqrt{\frac{1}{\ell \cdot h}}\\
t_2 := d \cdot t\_1\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{+153}:\\
\;\;\;\;\left(t\_1 \cdot \left(-d\right)\right) \cdot \left(1 - \frac{D \cdot \left(D \cdot \left(0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{t\_0}\right)\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-96}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{0.125 \cdot \left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right)}{d} - t\_2\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-307}:\\
\;\;\;\;\left(1 - \frac{\left(h \cdot 0.5\right) \cdot \left(\left(M \cdot D\right) \cdot \left(\left(M \cdot D\right) \cdot 0.25\right)\right)}{t\_0}\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(1 - \frac{\frac{0.25 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{d} \cdot \frac{h \cdot 0.5}{\ell}}{d}\right)\\
\end{array}
\end{array}
if l < -5.00000000000000018e153Initial program 49.4%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6442.0
Applied rewrites42.0%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6442.0
Applied rewrites42.0%
Taylor expanded in h around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6456.2
Applied rewrites56.2%
if -5.00000000000000018e153 < l < -4.99999999999999995e-96Initial program 62.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites71.9%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
mul-1-negN/A
cancel-sign-sub-invN/A
lower--.f64N/A
Applied rewrites69.2%
if -4.99999999999999995e-96 < l < -5.00000000000000014e-307Initial program 79.9%
Applied rewrites79.8%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6479.8
Applied rewrites79.8%
Applied rewrites75.8%
if -5.00000000000000014e-307 < l Initial program 69.8%
Applied rewrites64.1%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6464.1
Applied rewrites64.1%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6462.2
Applied rewrites62.2%
Final simplification65.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(- 1.0 (/ (* (/ (* 0.25 (* M (* D (* M D)))) d) (/ (* h 0.5) l)) d)))
(t_1 (sqrt (/ 1.0 (* l h))))
(t_2 (* t_1 (- d))))
(if (<= d -1.3e-84)
(* t_2 (- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d)))))
(if (<= d -5e-296) (* t_2 t_0) (* (* d t_1) t_0)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - ((((0.25 * (M * (D * (M * D)))) / d) * ((h * 0.5) / l)) / d);
double t_1 = sqrt((1.0 / (l * h)));
double t_2 = t_1 * -d;
double tmp;
if (d <= -1.3e-84) {
tmp = t_2 * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
} else if (d <= -5e-296) {
tmp = t_2 * t_0;
} else {
tmp = (d * t_1) * t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 1.0d0 - ((((0.25d0 * (m * (d_1 * (m * d_1)))) / d) * ((h * 0.5d0) / l)) / d)
t_1 = sqrt((1.0d0 / (l * h)))
t_2 = t_1 * -d
if (d <= (-1.3d-84)) then
tmp = t_2 * (1.0d0 - ((d_1 * (d_1 * (0.125d0 * (h * (m * m))))) / (d * (l * d))))
else if (d <= (-5d-296)) then
tmp = t_2 * t_0
else
tmp = (d * t_1) * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - ((((0.25 * (M * (D * (M * D)))) / d) * ((h * 0.5) / l)) / d);
double t_1 = Math.sqrt((1.0 / (l * h)));
double t_2 = t_1 * -d;
double tmp;
if (d <= -1.3e-84) {
tmp = t_2 * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
} else if (d <= -5e-296) {
tmp = t_2 * t_0;
} else {
tmp = (d * t_1) * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - ((((0.25 * (M * (D * (M * D)))) / d) * ((h * 0.5) / l)) / d) t_1 = math.sqrt((1.0 / (l * h))) t_2 = t_1 * -d tmp = 0 if d <= -1.3e-84: tmp = t_2 * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))) elif d <= -5e-296: tmp = t_2 * t_0 else: tmp = (d * t_1) * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(Float64(Float64(Float64(0.25 * Float64(M * Float64(D * Float64(M * D)))) / d) * Float64(Float64(h * 0.5) / l)) / d)) t_1 = sqrt(Float64(1.0 / Float64(l * h))) t_2 = Float64(t_1 * Float64(-d)) tmp = 0.0 if (d <= -1.3e-84) tmp = Float64(t_2 * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d))))); elseif (d <= -5e-296) tmp = Float64(t_2 * t_0); else tmp = Float64(Float64(d * t_1) * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - ((((0.25 * (M * (D * (M * D)))) / d) * ((h * 0.5) / l)) / d); t_1 = sqrt((1.0 / (l * h))); t_2 = t_1 * -d; tmp = 0.0; if (d <= -1.3e-84) tmp = t_2 * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))); elseif (d <= -5e-296) tmp = t_2 * t_0; else tmp = (d * t_1) * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 - N[(N[(N[(N[(0.25 * N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(h * 0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * (-d)), $MachinePrecision]}, If[LessEqual[d, -1.3e-84], N[(t$95$2 * N[(1.0 - N[(N[(D * N[(D * N[(0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-296], N[(t$95$2 * t$95$0), $MachinePrecision], N[(N[(d * t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{\frac{0.25 \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{d} \cdot \frac{h \cdot 0.5}{\ell}}{d}\\
t_1 := \sqrt{\frac{1}{\ell \cdot h}}\\
t_2 := t\_1 \cdot \left(-d\right)\\
\mathbf{if}\;d \leq -1.3 \cdot 10^{-84}:\\
\;\;\;\;t\_2 \cdot \left(1 - \frac{D \cdot \left(D \cdot \left(0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot \left(\ell \cdot d\right)}\right)\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-296}:\\
\;\;\;\;t\_2 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(d \cdot t\_1\right) \cdot t\_0\\
\end{array}
\end{array}
if d < -1.3e-84Initial program 68.6%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6459.7
Applied rewrites59.7%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6459.7
Applied rewrites59.7%
Taylor expanded in h around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6466.5
Applied rewrites66.5%
if -1.3e-84 < d < -5.0000000000000003e-296Initial program 59.3%
Applied rewrites65.0%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6465.0
Applied rewrites65.0%
Taylor expanded in h around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6478.6
Applied rewrites78.6%
if -5.0000000000000003e-296 < d Initial program 69.8%
Applied rewrites64.1%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6464.1
Applied rewrites64.1%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6462.2
Applied rewrites62.2%
Final simplification66.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (* l h)))) (t_1 (* d t_0)))
(if (<= l -1.5e-96)
(* t_0 (- d))
(if (<= l -1e-287)
(* (sqrt (/ h (* l (* l l)))) (* (/ (* M M) d) (* 0.125 (* D D))))
(if (<= l 2e+159)
(* t_1 (- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d)))))
t_1)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h)));
double t_1 = d * t_0;
double tmp;
if (l <= -1.5e-96) {
tmp = t_0 * -d;
} else if (l <= -1e-287) {
tmp = sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D)));
} else if (l <= 2e+159) {
tmp = t_1 * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((1.0d0 / (l * h)))
t_1 = d * t_0
if (l <= (-1.5d-96)) then
tmp = t_0 * -d
else if (l <= (-1d-287)) then
tmp = sqrt((h / (l * (l * l)))) * (((m * m) / d) * (0.125d0 * (d_1 * d_1)))
else if (l <= 2d+159) then
tmp = t_1 * (1.0d0 - ((d_1 * (d_1 * (0.125d0 * (h * (m * m))))) / (d * (l * d))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((1.0 / (l * h)));
double t_1 = d * t_0;
double tmp;
if (l <= -1.5e-96) {
tmp = t_0 * -d;
} else if (l <= -1e-287) {
tmp = Math.sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D)));
} else if (l <= 2e+159) {
tmp = t_1 * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
} else {
tmp = t_1;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (l * h))) t_1 = d * t_0 tmp = 0 if l <= -1.5e-96: tmp = t_0 * -d elif l <= -1e-287: tmp = math.sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D))) elif l <= 2e+159: tmp = t_1 * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))) else: tmp = t_1 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(l * h))) t_1 = Float64(d * t_0) tmp = 0.0 if (l <= -1.5e-96) tmp = Float64(t_0 * Float64(-d)); elseif (l <= -1e-287) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(Float64(M * M) / d) * Float64(0.125 * Float64(D * D)))); elseif (l <= 2e+159) tmp = Float64(t_1 * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d))))); else tmp = t_1; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((1.0 / (l * h))); t_1 = d * t_0; tmp = 0.0; if (l <= -1.5e-96) tmp = t_0 * -d; elseif (l <= -1e-287) tmp = sqrt((h / (l * (l * l)))) * (((M * M) / d) * (0.125 * (D * D))); elseif (l <= 2e+159) tmp = t_1 * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))); else tmp = t_1; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(d * t$95$0), $MachinePrecision]}, If[LessEqual[l, -1.5e-96], N[(t$95$0 * (-d)), $MachinePrecision], If[LessEqual[l, -1e-287], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * N[(0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2e+159], N[(t$95$1 * N[(1.0 - N[(N[(D * N[(D * N[(0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
t_1 := d \cdot t\_0\\
\mathbf{if}\;\ell \leq -1.5 \cdot 10^{-96}:\\
\;\;\;\;t\_0 \cdot \left(-d\right)\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-287}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\frac{M \cdot M}{d} \cdot \left(0.125 \cdot \left(D \cdot D\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 2 \cdot 10^{+159}:\\
\;\;\;\;t\_1 \cdot \left(1 - \frac{D \cdot \left(D \cdot \left(0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot \left(\ell \cdot d\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if l < -1.5e-96Initial program 58.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites66.6%
Taylor expanded in l around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6455.4
Applied rewrites55.4%
if -1.5e-96 < l < -1.00000000000000002e-287Initial program 80.4%
Applied rewrites80.3%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6480.3
Applied rewrites80.3%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites58.9%
if -1.00000000000000002e-287 < l < 1.9999999999999999e159Initial program 75.0%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6451.4
Applied rewrites51.4%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6451.4
Applied rewrites51.4%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6455.3
Applied rewrites55.3%
if 1.9999999999999999e159 < l Initial program 53.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites56.6%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6454.7
Applied rewrites54.7%
Final simplification55.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (* l h)))) (t_1 (* 0.125 (* D D))))
(if (<= l -1.5e-96)
(* t_0 (- d))
(if (<= l -1e-287)
(* (sqrt (/ h (* l (* l l)))) (* (/ (* M M) d) t_1))
(if (<= l 4e+145)
(*
(/ d (sqrt (* l h)))
(- 1.0 (/ (* (* h (* M M)) t_1) (* d (* l d)))))
(* d t_0))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h)));
double t_1 = 0.125 * (D * D);
double tmp;
if (l <= -1.5e-96) {
tmp = t_0 * -d;
} else if (l <= -1e-287) {
tmp = sqrt((h / (l * (l * l)))) * (((M * M) / d) * t_1);
} else if (l <= 4e+145) {
tmp = (d / sqrt((l * h))) * (1.0 - (((h * (M * M)) * t_1) / (d * (l * d))));
} else {
tmp = d * t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((1.0d0 / (l * h)))
t_1 = 0.125d0 * (d_1 * d_1)
if (l <= (-1.5d-96)) then
tmp = t_0 * -d
else if (l <= (-1d-287)) then
tmp = sqrt((h / (l * (l * l)))) * (((m * m) / d) * t_1)
else if (l <= 4d+145) then
tmp = (d / sqrt((l * h))) * (1.0d0 - (((h * (m * m)) * t_1) / (d * (l * d))))
else
tmp = d * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((1.0 / (l * h)));
double t_1 = 0.125 * (D * D);
double tmp;
if (l <= -1.5e-96) {
tmp = t_0 * -d;
} else if (l <= -1e-287) {
tmp = Math.sqrt((h / (l * (l * l)))) * (((M * M) / d) * t_1);
} else if (l <= 4e+145) {
tmp = (d / Math.sqrt((l * h))) * (1.0 - (((h * (M * M)) * t_1) / (d * (l * d))));
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (l * h))) t_1 = 0.125 * (D * D) tmp = 0 if l <= -1.5e-96: tmp = t_0 * -d elif l <= -1e-287: tmp = math.sqrt((h / (l * (l * l)))) * (((M * M) / d) * t_1) elif l <= 4e+145: tmp = (d / math.sqrt((l * h))) * (1.0 - (((h * (M * M)) * t_1) / (d * (l * d)))) else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(l * h))) t_1 = Float64(0.125 * Float64(D * D)) tmp = 0.0 if (l <= -1.5e-96) tmp = Float64(t_0 * Float64(-d)); elseif (l <= -1e-287) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(Float64(M * M) / d) * t_1)); elseif (l <= 4e+145) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * Float64(1.0 - Float64(Float64(Float64(h * Float64(M * M)) * t_1) / Float64(d * Float64(l * d))))); else tmp = Float64(d * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((1.0 / (l * h))); t_1 = 0.125 * (D * D); tmp = 0.0; if (l <= -1.5e-96) tmp = t_0 * -d; elseif (l <= -1e-287) tmp = sqrt((h / (l * (l * l)))) * (((M * M) / d) * t_1); elseif (l <= 4e+145) tmp = (d / sqrt((l * h))) * (1.0 - (((h * (M * M)) * t_1) / (d * (l * d)))); else tmp = d * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(0.125 * N[(D * D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.5e-96], N[(t$95$0 * (-d)), $MachinePrecision], If[LessEqual[l, -1e-287], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4e+145], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(d * N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
t_1 := 0.125 \cdot \left(D \cdot D\right)\\
\mathbf{if}\;\ell \leq -1.5 \cdot 10^{-96}:\\
\;\;\;\;t\_0 \cdot \left(-d\right)\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-287}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\frac{M \cdot M}{d} \cdot t\_1\right)\\
\mathbf{elif}\;\ell \leq 4 \cdot 10^{+145}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(1 - \frac{\left(h \cdot \left(M \cdot M\right)\right) \cdot t\_1}{d \cdot \left(\ell \cdot d\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < -1.5e-96Initial program 58.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites66.6%
Taylor expanded in l around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6455.4
Applied rewrites55.4%
if -1.5e-96 < l < -1.00000000000000002e-287Initial program 80.4%
Applied rewrites80.3%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6480.3
Applied rewrites80.3%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites58.9%
if -1.00000000000000002e-287 < l < 4e145Initial program 74.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
div-invN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites69.6%
Applied rewrites76.2%
Applied rewrites49.3%
if 4e145 < l Initial program 57.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites60.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6453.0
Applied rewrites53.0%
Final simplification53.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d)))))
(t_1 (sqrt (/ 1.0 (* l h)))))
(if (<= d -2e-211)
(* (* t_1 (- d)) t_0)
(if (<= d 2e-254) (* (sqrt (/ d h)) (sqrt (/ d l))) (* (* d t_1) t_0)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)));
double t_1 = sqrt((1.0 / (l * h)));
double tmp;
if (d <= -2e-211) {
tmp = (t_1 * -d) * t_0;
} else if (d <= 2e-254) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = (d * t_1) * t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - ((d_1 * (d_1 * (0.125d0 * (h * (m * m))))) / (d * (l * d)))
t_1 = sqrt((1.0d0 / (l * h)))
if (d <= (-2d-211)) then
tmp = (t_1 * -d) * t_0
else if (d <= 2d-254) then
tmp = sqrt((d / h)) * sqrt((d / l))
else
tmp = (d * t_1) * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)));
double t_1 = Math.sqrt((1.0 / (l * h)));
double tmp;
if (d <= -2e-211) {
tmp = (t_1 * -d) * t_0;
} else if (d <= 2e-254) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = (d * t_1) * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))) t_1 = math.sqrt((1.0 / (l * h))) tmp = 0 if d <= -2e-211: tmp = (t_1 * -d) * t_0 elif d <= 2e-254: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = (d * t_1) * t_0 return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d)))) t_1 = sqrt(Float64(1.0 / Float64(l * h))) tmp = 0.0 if (d <= -2e-211) tmp = Float64(Float64(t_1 * Float64(-d)) * t_0); elseif (d <= 2e-254) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(Float64(d * t_1) * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))); t_1 = sqrt((1.0 / (l * h))); tmp = 0.0; if (d <= -2e-211) tmp = (t_1 * -d) * t_0; elseif (d <= 2e-254) tmp = sqrt((d / h)) * sqrt((d / l)); else tmp = (d * t_1) * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 - N[(N[(D * N[(D * N[(0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -2e-211], N[(N[(t$95$1 * (-d)), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, 2e-254], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(d * t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{D \cdot \left(D \cdot \left(0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot \left(\ell \cdot d\right)}\\
t_1 := \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{if}\;d \leq -2 \cdot 10^{-211}:\\
\;\;\;\;\left(t\_1 \cdot \left(-d\right)\right) \cdot t\_0\\
\mathbf{elif}\;d \leq 2 \cdot 10^{-254}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(d \cdot t\_1\right) \cdot t\_0\\
\end{array}
\end{array}
if d < -2.00000000000000017e-211Initial program 66.0%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6460.1
Applied rewrites60.1%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6460.1
Applied rewrites60.1%
Taylor expanded in h around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6468.1
Applied rewrites68.1%
if -2.00000000000000017e-211 < d < 1.9999999999999998e-254Initial program 59.0%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6410.7
Applied rewrites10.7%
Applied rewrites10.7%
Taylor expanded in M around 0
lower-sqrt.f64N/A
lower-/.f6438.7
Applied rewrites38.7%
if 1.9999999999999998e-254 < d Initial program 71.0%
Taylor expanded in M around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6451.7
Applied rewrites51.7%
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6451.7
Applied rewrites51.7%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6456.6
Applied rewrites56.6%
Final simplification59.5%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (/ 1.0 (* l h))))) (if (<= l -4e-143) (* t_0 (- d)) (* d t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h)));
double tmp;
if (l <= -4e-143) {
tmp = t_0 * -d;
} else {
tmp = d * t_0;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((1.0d0 / (l * h)))
if (l <= (-4d-143)) then
tmp = t_0 * -d
else
tmp = d * t_0
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((1.0 / (l * h)));
double tmp;
if (l <= -4e-143) {
tmp = t_0 * -d;
} else {
tmp = d * t_0;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (l * h))) tmp = 0 if l <= -4e-143: tmp = t_0 * -d else: tmp = d * t_0 return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(l * h))) tmp = 0.0 if (l <= -4e-143) tmp = Float64(t_0 * Float64(-d)); else tmp = Float64(d * t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((1.0 / (l * h))); tmp = 0.0; if (l <= -4e-143) tmp = t_0 * -d; else tmp = d * t_0; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -4e-143], N[(t$95$0 * (-d)), $MachinePrecision], N[(d * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{if}\;\ell \leq -4 \cdot 10^{-143}:\\
\;\;\;\;t\_0 \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < -3.9999999999999998e-143Initial program 59.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites69.3%
Taylor expanded in l around -inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6453.3
Applied rewrites53.3%
if -3.9999999999999998e-143 < l Initial program 72.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites77.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
Final simplification43.7%
(FPCore (d h l M D) :precision binary64 (* d (sqrt (/ 1.0 (* l h)))))
double code(double d, double h, double l, double M, double D) {
return d * sqrt((1.0 / (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((1.0d0 / (l * h)))
end function
public static double code(double d, double h, double l, double M, double D) {
return d * Math.sqrt((1.0 / (l * h)));
}
def code(d, h, l, M, D): return d * math.sqrt((1.0 / (l * h)))
function code(d, h, l, M, D) return Float64(d * sqrt(Float64(1.0 / Float64(l * h)))) end
function tmp = code(d, h, l, M, D) tmp = d * sqrt((1.0 / (l * h))); end
code[d_, h_, l_, M_, D_] := N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
d \cdot \sqrt{\frac{1}{\ell \cdot h}}
\end{array}
Initial program 67.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
div-invN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
Applied rewrites74.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6426.3
Applied rewrites26.3%
Final simplification26.3%
herbie shell --seed 2024212
(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)))))