
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 27 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (- d)))
(t_1
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* (* M D) 0.5) (* d 2.0)) (/ -1.0 h)))))
(t_2 (sqrt (/ d l))))
(if (<= l -3.15e+125)
(* (* (pow (/ d h) (/ 1.0 2.0)) (/ t_0 (sqrt (- l)))) t_1)
(if (<= l -5e-311)
(* t_1 (* (/ t_0 (sqrt (- h))) t_2))
(* t_1 (* t_2 (* (/ 1.0 (sqrt h)) (sqrt d))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt(-d);
double t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double t_2 = sqrt((d / l));
double tmp;
if (l <= -3.15e+125) {
tmp = (pow((d / h), (1.0 / 2.0)) * (t_0 / sqrt(-l))) * t_1;
} else if (l <= -5e-311) {
tmp = t_1 * ((t_0 / sqrt(-h)) * t_2);
} else {
tmp = t_1 * (t_2 * ((1.0 / sqrt(h)) * sqrt(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 = sqrt(-d)
t_1 = 1.0d0 + ((((m * d_1) / (d * 2.0d0)) / l) * ((((m * d_1) * 0.5d0) / (d * 2.0d0)) / ((-1.0d0) / h)))
t_2 = sqrt((d / l))
if (l <= (-3.15d+125)) then
tmp = (((d / h) ** (1.0d0 / 2.0d0)) * (t_0 / sqrt(-l))) * t_1
else if (l <= (-5d-311)) then
tmp = t_1 * ((t_0 / sqrt(-h)) * t_2)
else
tmp = t_1 * (t_2 * ((1.0d0 / sqrt(h)) * sqrt(d)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt(-d);
double t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double t_2 = Math.sqrt((d / l));
double tmp;
if (l <= -3.15e+125) {
tmp = (Math.pow((d / h), (1.0 / 2.0)) * (t_0 / Math.sqrt(-l))) * t_1;
} else if (l <= -5e-311) {
tmp = t_1 * ((t_0 / Math.sqrt(-h)) * t_2);
} else {
tmp = t_1 * (t_2 * ((1.0 / Math.sqrt(h)) * Math.sqrt(d)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt(-d) t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h))) t_2 = math.sqrt((d / l)) tmp = 0 if l <= -3.15e+125: tmp = (math.pow((d / h), (1.0 / 2.0)) * (t_0 / math.sqrt(-l))) * t_1 elif l <= -5e-311: tmp = t_1 * ((t_0 / math.sqrt(-h)) * t_2) else: tmp = t_1 * (t_2 * ((1.0 / math.sqrt(h)) * math.sqrt(d))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(-d)) t_1 = Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) / Float64(-1.0 / h)))) t_2 = sqrt(Float64(d / l)) tmp = 0.0 if (l <= -3.15e+125) tmp = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * Float64(t_0 / sqrt(Float64(-l)))) * t_1); elseif (l <= -5e-311) tmp = Float64(t_1 * Float64(Float64(t_0 / sqrt(Float64(-h))) * t_2)); else tmp = Float64(t_1 * Float64(t_2 * Float64(Float64(1.0 / sqrt(h)) * sqrt(d)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt(-d); t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h))); t_2 = sqrt((d / l)); tmp = 0.0; if (l <= -3.15e+125) tmp = (((d / h) ^ (1.0 / 2.0)) * (t_0 / sqrt(-l))) * t_1; elseif (l <= -5e-311) tmp = t_1 * ((t_0 / sqrt(-h)) * t_2); else tmp = t_1 * (t_2 * ((1.0 / sqrt(h)) * sqrt(d))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -3.15e+125], N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, -5e-311], N[(t$95$1 * N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$2 * N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{-d}\\
t_1 := 1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\frac{-1}{h}}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\ell \leq -3.15 \cdot 10^{+125}:\\
\;\;\;\;\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{t\_0}{\sqrt{-\ell}}\right) \cdot t\_1\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;t\_1 \cdot \left(\frac{t\_0}{\sqrt{-h}} \cdot t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot \left(\frac{1}{\sqrt{h}} \cdot \sqrt{d}\right)\right)\\
\end{array}
\end{array}
if l < -3.1500000000000001e125Initial program 53.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites56.1%
lift-/.f64N/A
metadata-eval56.1
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6478.6
Applied rewrites78.6%
if -3.1500000000000001e125 < l < -5.00000000000023e-311Initial program 73.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites79.6%
lift-/.f64N/A
metadata-eval79.6
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6479.6
Applied rewrites79.6%
lift-/.f64N/A
metadata-eval79.6
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-undivN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-/.f6490.0
Applied rewrites90.0%
if -5.00000000000023e-311 < l Initial program 72.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites74.6%
lift-/.f64N/A
metadata-eval74.6
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6474.6
Applied rewrites74.6%
lift-/.f64N/A
metadata-eval74.6
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
unpow-prod-downN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
pow1/2N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6483.3
Applied rewrites83.3%
Final simplification85.2%
(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)))))))
(if (<= t_2 (- INFINITY))
(* t_0 (* t_1 (/ (/ (* (* h (* (* D D) -0.125)) (/ (* M M) l)) d) d)))
(if (<= t_2 -4e-140)
(*
t_0
(*
t_1
(fma
(* (* (* M D) (/ M (* d (* d 2.0)))) (* D 0.25))
(- (/ h l))
1.0)))
(if (<= t_2 INFINITY)
(* t_0 t_1)
(*
(* (- d) (sqrt (/ 1.0 (* l h))))
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d))))))))))
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 tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_0 * (t_1 * ((((h * ((D * D) * -0.125)) * ((M * M) / l)) / d) / d));
} else if (t_2 <= -4e-140) {
tmp = t_0 * (t_1 * fma((((M * D) * (M / (d * (d * 2.0)))) * (D * 0.25)), -(h / l), 1.0));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0 * t_1;
} else {
tmp = (-d * sqrt((1.0 / (l * h)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
}
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))))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_0 * Float64(t_1 * Float64(Float64(Float64(Float64(h * Float64(Float64(D * D) * -0.125)) * Float64(Float64(M * M) / l)) / d) / d))); elseif (t_2 <= -4e-140) tmp = Float64(t_0 * Float64(t_1 * fma(Float64(Float64(Float64(M * D) * Float64(M / Float64(d * Float64(d * 2.0)))) * Float64(D * 0.25)), Float64(-Float64(h / l)), 1.0))); elseif (t_2 <= Inf) tmp = Float64(t_0 * t_1); else tmp = Float64(Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d))))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$0 * N[(t$95$1 * N[(N[(N[(N[(h * N[(N[(D * D), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -4e-140], N[(t$95$0 * N[(t$95$1 * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M / N[(d * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * 0.25), $MachinePrecision]), $MachinePrecision] * (-N[(h / l), $MachinePrecision]) + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$0 * t$95$1), $MachinePrecision], N[(N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 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]]]]]]]
\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)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{\frac{\left(h \cdot \left(\left(D \cdot D\right) \cdot -0.125\right)\right) \cdot \frac{M \cdot M}{\ell}}{d}}{d}\right)\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-140}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(\left(\left(M \cdot D\right) \cdot \frac{M}{d \cdot \left(d \cdot 2\right)}\right) \cdot \left(D \cdot 0.25\right), -\frac{h}{\ell}, 1\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\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)}{d \cdot \left(\ell \cdot d\right)}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -inf.0Initial program 84.4%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6483.0
Applied rewrites83.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites58.1%
Taylor expanded in M around inf
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*l*N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites76.0%
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)))) < -3.9999999999999999e-140Initial program 93.9%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6478.7
Applied rewrites78.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.2%
if -3.9999999999999999e-140 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 83.0%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.5
Applied rewrites82.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.1%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6481.7
Applied rewrites81.7%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in 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-*.f6412.2
Applied rewrites12.2%
lift-/.f64N/A
metadata-eval12.2
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6414.2
Applied rewrites14.2%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6425.6
Applied rewrites25.6%
Final simplification69.0%
(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)))))))
(if (<= t_2 (- INFINITY))
(* t_0 (* t_1 (/ (/ (* (* h (* (* D D) -0.125)) (/ (* M M) l)) d) d)))
(if (<= t_2 INFINITY)
(*
t_0
(*
t_1
(fma
(* (* D 0.25) (* (* M D) (/ (/ M (* d 2.0)) d)))
(- (/ h l))
1.0)))
(*
(* (- d) (sqrt (/ 1.0 (* l h))))
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d)))))))))
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 tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_0 * (t_1 * ((((h * ((D * D) * -0.125)) * ((M * M) / l)) / d) / d));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0 * (t_1 * fma(((D * 0.25) * ((M * D) * ((M / (d * 2.0)) / d))), -(h / l), 1.0));
} else {
tmp = (-d * sqrt((1.0 / (l * h)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
}
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))))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_0 * Float64(t_1 * Float64(Float64(Float64(Float64(h * Float64(Float64(D * D) * -0.125)) * Float64(Float64(M * M) / l)) / d) / d))); elseif (t_2 <= Inf) tmp = Float64(t_0 * Float64(t_1 * fma(Float64(Float64(D * 0.25) * Float64(Float64(M * D) * Float64(Float64(M / Float64(d * 2.0)) / d))), Float64(-Float64(h / l)), 1.0))); else tmp = Float64(Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d))))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$0 * N[(t$95$1 * N[(N[(N[(N[(h * N[(N[(D * D), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$0 * N[(t$95$1 * N[(N[(N[(D * 0.25), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-N[(h / l), $MachinePrecision]) + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 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]]]]]]
\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)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{\frac{\left(h \cdot \left(\left(D \cdot D\right) \cdot -0.125\right)\right) \cdot \frac{M \cdot M}{\ell}}{d}}{d}\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(\left(D \cdot 0.25\right) \cdot \left(\left(M \cdot D\right) \cdot \frac{\frac{M}{d \cdot 2}}{d}\right), -\frac{h}{\ell}, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\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)}{d \cdot \left(\ell \cdot d\right)}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -inf.0Initial program 84.4%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6483.0
Applied rewrites83.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites58.1%
Taylor expanded in M around inf
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*l*N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites76.0%
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)))) < +inf.0Initial program 84.2%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.1
Applied rewrites82.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6478.5
Applied rewrites78.5%
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-*.f6412.2
Applied rewrites12.2%
lift-/.f64N/A
metadata-eval12.2
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6414.2
Applied rewrites14.2%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6425.6
Applied rewrites25.6%
Final simplification68.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (/ d l)))
(t_2
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_2 -1e-90)
(*
t_0
(*
t_1
(-
1.0
(* h (/ (* (* M D) (* (* M D) 0.5)) (* (* d 2.0) (* l (* d 2.0))))))))
(if (<= t_2 INFINITY)
(* t_0 t_1)
(*
(* (- d) (sqrt (/ 1.0 (* l h))))
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d)))))))))
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 tmp;
if (t_2 <= -1e-90) {
tmp = t_0 * (t_1 * (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0)))))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0 * t_1;
} else {
tmp = (-d * sqrt((1.0 / (l * h)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
}
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 tmp;
if (t_2 <= -1e-90) {
tmp = t_0 * (t_1 * (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0)))))));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_0 * t_1;
} else {
tmp = (-d * Math.sqrt((1.0 / (l * h)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
}
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)))) tmp = 0 if t_2 <= -1e-90: tmp = t_0 * (t_1 * (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0))))))) elif t_2 <= math.inf: tmp = t_0 * t_1 else: tmp = (-d * math.sqrt((1.0 / (l * h)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))) 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))))) tmp = 0.0 if (t_2 <= -1e-90) tmp = Float64(t_0 * Float64(t_1 * Float64(1.0 - Float64(h * Float64(Float64(Float64(M * D) * Float64(Float64(M * D) * 0.5)) / Float64(Float64(d * 2.0) * Float64(l * Float64(d * 2.0)))))))); elseif (t_2 <= Inf) tmp = Float64(t_0 * t_1); else tmp = Float64(Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d))))); 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)))); tmp = 0.0; if (t_2 <= -1e-90) tmp = t_0 * (t_1 * (1.0 - (h * (((M * D) * ((M * D) * 0.5)) / ((d * 2.0) * (l * (d * 2.0))))))); elseif (t_2 <= Inf) tmp = t_0 * t_1; else tmp = (-d * sqrt((1.0 / (l * h)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))); 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]}, If[LessEqual[t$95$2, -1e-90], N[(t$95$0 * N[(t$95$1 * N[(1.0 - N[(h * N[(N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[(N[(d * 2.0), $MachinePrecision] * N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$0 * t$95$1), $MachinePrecision], N[(N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 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]]]]]]
\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)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-90}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \left(1 - h \cdot \frac{\left(M \cdot D\right) \cdot \left(\left(M \cdot D\right) \cdot 0.5\right)}{\left(d \cdot 2\right) \cdot \left(\ell \cdot \left(d \cdot 2\right)\right)}\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\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)}{d \cdot \left(\ell \cdot d\right)}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -9.99999999999999995e-91Initial program 85.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites88.9%
Applied rewrites72.4%
if -9.99999999999999995e-91 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 83.1%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.6
Applied rewrites82.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.4%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6481.1
Applied rewrites81.1%
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-*.f6412.2
Applied rewrites12.2%
lift-/.f64N/A
metadata-eval12.2
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6414.2
Applied rewrites14.2%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6425.6
Applied rewrites25.6%
Final simplification68.5%
(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)))))))
(if (<= t_2 -4e-140)
(* t_0 (* t_1 (/ (/ (* (* h (* (* D D) -0.125)) (/ (* M M) l)) d) d)))
(if (<= t_2 INFINITY)
(* t_0 t_1)
(*
(* (- d) (sqrt (/ 1.0 (* l h))))
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d)))))))))
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 tmp;
if (t_2 <= -4e-140) {
tmp = t_0 * (t_1 * ((((h * ((D * D) * -0.125)) * ((M * M) / l)) / d) / d));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0 * t_1;
} else {
tmp = (-d * sqrt((1.0 / (l * h)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
}
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 tmp;
if (t_2 <= -4e-140) {
tmp = t_0 * (t_1 * ((((h * ((D * D) * -0.125)) * ((M * M) / l)) / d) / d));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_0 * t_1;
} else {
tmp = (-d * Math.sqrt((1.0 / (l * h)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
}
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)))) tmp = 0 if t_2 <= -4e-140: tmp = t_0 * (t_1 * ((((h * ((D * D) * -0.125)) * ((M * M) / l)) / d) / d)) elif t_2 <= math.inf: tmp = t_0 * t_1 else: tmp = (-d * math.sqrt((1.0 / (l * h)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))) 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))))) tmp = 0.0 if (t_2 <= -4e-140) tmp = Float64(t_0 * Float64(t_1 * Float64(Float64(Float64(Float64(h * Float64(Float64(D * D) * -0.125)) * Float64(Float64(M * M) / l)) / d) / d))); elseif (t_2 <= Inf) tmp = Float64(t_0 * t_1); else tmp = Float64(Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d))))); 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)))); tmp = 0.0; if (t_2 <= -4e-140) tmp = t_0 * (t_1 * ((((h * ((D * D) * -0.125)) * ((M * M) / l)) / d) / d)); elseif (t_2 <= Inf) tmp = t_0 * t_1; else tmp = (-d * sqrt((1.0 / (l * h)))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))); 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]}, If[LessEqual[t$95$2, -4e-140], N[(t$95$0 * N[(t$95$1 * N[(N[(N[(N[(h * N[(N[(D * D), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$0 * t$95$1), $MachinePrecision], N[(N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 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]]]]]]
\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)\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-140}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{\frac{\left(h \cdot \left(\left(D \cdot D\right) \cdot -0.125\right)\right) \cdot \frac{M \cdot M}{\ell}}{d}}{d}\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\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)}{d \cdot \left(\ell \cdot d\right)}\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -3.9999999999999999e-140Initial program 85.9%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.3
Applied rewrites82.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites58.3%
Taylor expanded in M around inf
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*l*N/A
associate-*r/N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6444.0
Applied rewrites44.0%
Applied rewrites65.9%
if -3.9999999999999999e-140 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 83.0%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.5
Applied rewrites82.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.1%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6481.7
Applied rewrites81.7%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Taylor expanded in 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-*.f6412.2
Applied rewrites12.2%
lift-/.f64N/A
metadata-eval12.2
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6414.2
Applied rewrites14.2%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6425.6
Applied rewrites25.6%
Final simplification66.4%
(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 (/ 1.0 (* l h))))
(if (<= t_0 0.0)
(*
(- 1.0 (/ (* (* D D) (* h (* (* M M) 0.125))) (* d (* l d))))
(sqrt (/ (* d d) (* l h))))
(if (<= t_0 2e+267)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(* d (sqrt (sqrt (* t_1 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 = 1.0 / (l * h);
double tmp;
if (t_0 <= 0.0) {
tmp = (1.0 - (((D * D) * (h * ((M * M) * 0.125))) / (d * (l * d)))) * sqrt(((d * d) / (l * h)));
} else if (t_0 <= 2e+267) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = d * sqrt(sqrt((t_1 * 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 = (((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))))
t_1 = 1.0d0 / (l * h)
if (t_0 <= 0.0d0) then
tmp = (1.0d0 - (((d_1 * d_1) * (h * ((m * m) * 0.125d0))) / (d * (l * d)))) * sqrt(((d * d) / (l * h)))
else if (t_0 <= 2d+267) then
tmp = sqrt((d / h)) * sqrt((d / l))
else
tmp = d * sqrt(sqrt((t_1 * 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.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 = 1.0 / (l * h);
double tmp;
if (t_0 <= 0.0) {
tmp = (1.0 - (((D * D) * (h * ((M * M) * 0.125))) / (d * (l * d)))) * Math.sqrt(((d * d) / (l * h)));
} else if (t_0 <= 2e+267) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = d * Math.sqrt(Math.sqrt((t_1 * 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 = 1.0 / (l * h) tmp = 0 if t_0 <= 0.0: tmp = (1.0 - (((D * D) * (h * ((M * M) * 0.125))) / (d * (l * d)))) * math.sqrt(((d * d) / (l * h))) elif t_0 <= 2e+267: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = d * math.sqrt(math.sqrt((t_1 * 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(1.0 / Float64(l * h)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(D * D) * Float64(h * Float64(Float64(M * M) * 0.125))) / Float64(d * Float64(l * d)))) * sqrt(Float64(Float64(d * d) / Float64(l * h)))); elseif (t_0 <= 2e+267) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(d * sqrt(sqrt(Float64(t_1 * 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 = 1.0 / (l * h); tmp = 0.0; if (t_0 <= 0.0) tmp = (1.0 - (((D * D) * (h * ((M * M) * 0.125))) / (d * (l * d)))) * sqrt(((d * d) / (l * h))); elseif (t_0 <= 2e+267) tmp = sqrt((d / h)) * sqrt((d / l)); else tmp = d * sqrt(sqrt((t_1 * 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[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[(1.0 - N[(N[(N[(D * D), $MachinePrecision] * N[(h * N[(N[(M * M), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+267], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
t_1 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\left(1 - \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(\left(M \cdot M\right) \cdot 0.125\right)\right)}{d \cdot \left(\ell \cdot d\right)}\right) \cdot \sqrt{\frac{d \cdot d}{\ell \cdot h}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+267}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_1 \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)))) < 0.0Initial program 80.5%
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-*.f6457.7
Applied rewrites57.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6457.7
Applied rewrites43.7%
if 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.9999999999999999e267Initial program 98.4%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6497.8
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites87.8%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6496.7
Applied rewrites96.7%
if 1.9999999999999999e267 < (*.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 18.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites30.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6430.7
Applied rewrites30.7%
Applied rewrites33.4%
Final simplification58.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* l h)))
(t_1
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_1 (- INFINITY))
(* (sqrt (/ h (* l (* l l)))) (/ (* 0.125 (* D (* D (* M M)))) d))
(if (<= t_1 2e+267)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(* d (sqrt (sqrt (* t_0 t_0))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d);
} else if (t_1 <= 2e+267) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = d * sqrt(sqrt((t_0 * t_0)));
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d);
} else if (t_1 <= 2e+267) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = d * Math.sqrt(Math.sqrt((t_0 * t_0)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 / (l * h) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) tmp = 0 if t_1 <= -math.inf: tmp = math.sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d) elif t_1 <= 2e+267: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = d * math.sqrt(math.sqrt((t_0 * t_0))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(l * h)) t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(0.125 * Float64(D * Float64(D * Float64(M * M)))) / d)); elseif (t_1 <= 2e+267) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(d * sqrt(sqrt(Float64(t_0 * t_0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 / (l * h); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_1 <= -Inf) tmp = sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d); elseif (t_1 <= 2e+267) tmp = sqrt((d / h)) * sqrt((d / l)); else tmp = d * sqrt(sqrt((t_0 * t_0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], 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], If[LessEqual[t$95$1, 2e+267], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\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{elif}\;t\_1 \leq 2 \cdot 10^{+267}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_0 \cdot t\_0}}\\
\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)))) < -inf.0Initial program 84.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites89.2%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
Applied rewrites43.2%
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)))) < 1.9999999999999999e267Initial program 91.5%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6488.9
Applied rewrites88.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.1%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6477.6
Applied rewrites77.6%
if 1.9999999999999999e267 < (*.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 18.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites30.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6430.7
Applied rewrites30.7%
Applied rewrites33.4%
Final simplification55.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* l h)))
(t_1
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))))
(if (<= t_1 -1e-90)
(* (sqrt (/ h (* l (* l l)))) (* (* D (* D (* M M))) (/ -0.125 d)))
(if (<= t_1 2e+267)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(* d (sqrt (sqrt (* t_0 t_0))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (l * h);
double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= -1e-90) {
tmp = sqrt((h / (l * (l * l)))) * ((D * (D * (M * M))) * (-0.125 / d));
} else if (t_1 <= 2e+267) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else {
tmp = d * sqrt(sqrt((t_0 * 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 / (l * h)
t_1 = (((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))))
if (t_1 <= (-1d-90)) then
tmp = sqrt((h / (l * (l * l)))) * ((d_1 * (d_1 * (m * m))) * ((-0.125d0) / d))
else if (t_1 <= 2d+267) then
tmp = sqrt((d / h)) * sqrt((d / l))
else
tmp = d * sqrt(sqrt((t_0 * 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 / (l * h);
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0))));
double tmp;
if (t_1 <= -1e-90) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((D * (D * (M * M))) * (-0.125 / d));
} else if (t_1 <= 2e+267) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else {
tmp = d * Math.sqrt(Math.sqrt((t_0 * t_0)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 / (l * h) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) tmp = 0 if t_1 <= -1e-90: tmp = math.sqrt((h / (l * (l * l)))) * ((D * (D * (M * M))) * (-0.125 / d)) elif t_1 <= 2e+267: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) else: tmp = d * math.sqrt(math.sqrt((t_0 * t_0))) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(l * h)) t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0))))) tmp = 0.0 if (t_1 <= -1e-90) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(-0.125 / d))); elseif (t_1 <= 2e+267) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); else tmp = Float64(d * sqrt(sqrt(Float64(t_0 * t_0)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 / (l * h); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * (-1.0 / 2.0)))); tmp = 0.0; if (t_1 <= -1e-90) tmp = sqrt((h / (l * (l * l)))) * ((D * (D * (M * M))) * (-0.125 / d)); elseif (t_1 <= 2e+267) tmp = sqrt((d / h)) * sqrt((d / l)); else tmp = d * sqrt(sqrt((t_0 * t_0))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-90], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+267], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\ell \cdot h}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-90}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+267}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_0 \cdot t\_0}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -9.99999999999999995e-91Initial program 85.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites88.9%
Taylor expanded in d around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6426.7
Applied rewrites26.7%
if -9.99999999999999995e-91 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.9999999999999999e267Initial program 91.2%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6490.6
Applied rewrites90.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.2%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6488.7
Applied rewrites88.7%
if 1.9999999999999999e267 < (*.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 18.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites30.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6430.7
Applied rewrites30.7%
Applied rewrites33.4%
Final simplification51.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (/ d l)))
(t_2
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(+
1.0
(* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))))
(t_3 (/ 1.0 (* l h))))
(if (<= t_2 -4e-140)
(* t_0 (- t_1))
(if (<= t_2 2e+267) (* t_0 t_1) (* d (sqrt (sqrt (* t_3 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 = 1.0 / (l * h);
double tmp;
if (t_2 <= -4e-140) {
tmp = t_0 * -t_1;
} else if (t_2 <= 2e+267) {
tmp = t_0 * t_1;
} else {
tmp = d * sqrt(sqrt((t_3 * t_3)));
}
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) :: t_3
real(8) :: tmp
t_0 = sqrt((d / h))
t_1 = sqrt((d / l))
t_2 = (((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))))
t_3 = 1.0d0 / (l * h)
if (t_2 <= (-4d-140)) then
tmp = t_0 * -t_1
else if (t_2 <= 2d+267) then
tmp = t_0 * t_1
else
tmp = d * sqrt(sqrt((t_3 * t_3)))
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 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 = 1.0 / (l * h);
double tmp;
if (t_2 <= -4e-140) {
tmp = t_0 * -t_1;
} else if (t_2 <= 2e+267) {
tmp = t_0 * t_1;
} else {
tmp = d * Math.sqrt(Math.sqrt((t_3 * 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 = 1.0 / (l * h) tmp = 0 if t_2 <= -4e-140: tmp = t_0 * -t_1 elif t_2 <= 2e+267: tmp = t_0 * t_1 else: tmp = d * math.sqrt(math.sqrt((t_3 * 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(1.0 / Float64(l * h)) tmp = 0.0 if (t_2 <= -4e-140) tmp = Float64(t_0 * Float64(-t_1)); elseif (t_2 <= 2e+267) tmp = Float64(t_0 * t_1); else tmp = Float64(d * sqrt(sqrt(Float64(t_3 * 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 = 1.0 / (l * h); tmp = 0.0; if (t_2 <= -4e-140) tmp = t_0 * -t_1; elseif (t_2 <= 2e+267) tmp = t_0 * t_1; else tmp = d * sqrt(sqrt((t_3 * 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[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-140], N[(t$95$0 * (-t$95$1)), $MachinePrecision], If[LessEqual[t$95$2, 2e+267], N[(t$95$0 * t$95$1), $MachinePrecision], N[(d * N[Sqrt[N[Sqrt[N[(t$95$3 * t$95$3), $MachinePrecision]], $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 := \frac{1}{\ell \cdot h}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-140}:\\
\;\;\;\;t\_0 \cdot \left(-t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+267}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_3 \cdot t\_3}}\\
\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)))) < -3.9999999999999999e-140Initial program 85.9%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.3
Applied rewrites82.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites58.3%
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-/.f6421.8
Applied rewrites21.8%
if -3.9999999999999999e-140 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.9999999999999999e267Initial program 91.1%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6490.5
Applied rewrites90.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.0%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6489.6
Applied rewrites89.6%
if 1.9999999999999999e267 < (*.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 18.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites30.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6430.7
Applied rewrites30.7%
Applied rewrites33.4%
Final simplification50.1%
(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)))))))
(if (<= t_2 -4e-140)
(* t_0 (- t_1))
(if (<= t_2 2e+267) (* t_0 t_1) (* d (/ (/ 1.0 (sqrt h)) (sqrt l)))))))
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 tmp;
if (t_2 <= -4e-140) {
tmp = t_0 * -t_1;
} else if (t_2 <= 2e+267) {
tmp = t_0 * t_1;
} else {
tmp = 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = sqrt((d / h))
t_1 = sqrt((d / l))
t_2 = (((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))))
if (t_2 <= (-4d-140)) then
tmp = t_0 * -t_1
else if (t_2 <= 2d+267) then
tmp = t_0 * t_1
else
tmp = 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 = 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 tmp;
if (t_2 <= -4e-140) {
tmp = t_0 * -t_1;
} else if (t_2 <= 2e+267) {
tmp = t_0 * t_1;
} else {
tmp = d * ((1.0 / Math.sqrt(h)) / Math.sqrt(l));
}
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)))) tmp = 0 if t_2 <= -4e-140: tmp = t_0 * -t_1 elif t_2 <= 2e+267: tmp = t_0 * t_1 else: tmp = d * ((1.0 / math.sqrt(h)) / math.sqrt(l)) 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))))) tmp = 0.0 if (t_2 <= -4e-140) tmp = Float64(t_0 * Float64(-t_1)); elseif (t_2 <= 2e+267) tmp = Float64(t_0 * t_1); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(h)) / sqrt(l))); 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)))); tmp = 0.0; if (t_2 <= -4e-140) tmp = t_0 * -t_1; elseif (t_2 <= 2e+267) tmp = t_0 * t_1; else tmp = d * ((1.0 / sqrt(h)) / sqrt(l)); 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]}, If[LessEqual[t$95$2, -4e-140], N[(t$95$0 * (-t$95$1)), $MachinePrecision], If[LessEqual[t$95$2, 2e+267], N[(t$95$0 * t$95$1), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $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)\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-140}:\\
\;\;\;\;t\_0 \cdot \left(-t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+267}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -3.9999999999999999e-140Initial program 85.9%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.3
Applied rewrites82.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites58.3%
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-/.f6421.8
Applied rewrites21.8%
if -3.9999999999999999e-140 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.9999999999999999e267Initial program 91.1%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6490.5
Applied rewrites90.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.0%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6489.6
Applied rewrites89.6%
if 1.9999999999999999e267 < (*.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 18.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites30.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6430.7
Applied rewrites30.7%
Applied rewrites32.1%
Final simplification49.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* (* M D) 0.5) (* d 2.0)) (/ -1.0 h))))))
(if (<= h -3.2e+170)
(* t_1 (* (/ (sqrt (- d)) (sqrt (- h))) t_0))
(if (<= h -5e-310)
(* t_1 (* (- d) (sqrt (/ 1.0 (* l h)))))
(* t_1 (* t_0 (* (/ 1.0 (sqrt h)) (sqrt d))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (h <= -3.2e+170) {
tmp = t_1 * ((sqrt(-d) / sqrt(-h)) * t_0);
} else if (h <= -5e-310) {
tmp = t_1 * (-d * sqrt((1.0 / (l * h))));
} else {
tmp = t_1 * (t_0 * ((1.0 / sqrt(h)) * sqrt(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) :: tmp
t_0 = sqrt((d / l))
t_1 = 1.0d0 + ((((m * d_1) / (d * 2.0d0)) / l) * ((((m * d_1) * 0.5d0) / (d * 2.0d0)) / ((-1.0d0) / h)))
if (h <= (-3.2d+170)) then
tmp = t_1 * ((sqrt(-d) / sqrt(-h)) * t_0)
else if (h <= (-5d-310)) then
tmp = t_1 * (-d * sqrt((1.0d0 / (l * h))))
else
tmp = t_1 * (t_0 * ((1.0d0 / sqrt(h)) * sqrt(d)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (h <= -3.2e+170) {
tmp = t_1 * ((Math.sqrt(-d) / Math.sqrt(-h)) * t_0);
} else if (h <= -5e-310) {
tmp = t_1 * (-d * Math.sqrt((1.0 / (l * h))));
} else {
tmp = t_1 * (t_0 * ((1.0 / Math.sqrt(h)) * Math.sqrt(d)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h))) tmp = 0 if h <= -3.2e+170: tmp = t_1 * ((math.sqrt(-d) / math.sqrt(-h)) * t_0) elif h <= -5e-310: tmp = t_1 * (-d * math.sqrt((1.0 / (l * h)))) else: tmp = t_1 * (t_0 * ((1.0 / math.sqrt(h)) * math.sqrt(d))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) / Float64(-1.0 / h)))) tmp = 0.0 if (h <= -3.2e+170) tmp = Float64(t_1 * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0)); elseif (h <= -5e-310) tmp = Float64(t_1 * Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h))))); else tmp = Float64(t_1 * Float64(t_0 * Float64(Float64(1.0 / sqrt(h)) * sqrt(d)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h))); tmp = 0.0; if (h <= -3.2e+170) tmp = t_1 * ((sqrt(-d) / sqrt(-h)) * t_0); elseif (h <= -5e-310) tmp = t_1 * (-d * sqrt((1.0 / (l * h)))); else tmp = t_1 * (t_0 * ((1.0 / sqrt(h)) * sqrt(d))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -3.2e+170], N[(t$95$1 * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(t$95$1 * N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := 1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\frac{-1}{h}}\\
\mathbf{if}\;h \leq -3.2 \cdot 10^{+170}:\\
\;\;\;\;t\_1 \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t\_0\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot \left(\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_0 \cdot \left(\frac{1}{\sqrt{h}} \cdot \sqrt{d}\right)\right)\\
\end{array}
\end{array}
if h < -3.19999999999999979e170Initial program 67.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites68.0%
lift-/.f64N/A
metadata-eval68.0
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6468.0
Applied rewrites68.0%
lift-/.f64N/A
metadata-eval68.0
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-undivN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-/.f6490.0
Applied rewrites90.0%
if -3.19999999999999979e170 < h < -4.999999999999985e-310Initial program 68.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites74.7%
lift-/.f64N/A
metadata-eval74.7
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6474.7
Applied rewrites74.7%
lift-/.f64N/A
metadata-eval74.7
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6474.7
Applied rewrites74.7%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6485.9
Applied rewrites85.9%
if -4.999999999999985e-310 < h Initial program 72.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites74.6%
lift-/.f64N/A
metadata-eval74.6
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6474.6
Applied rewrites74.6%
lift-/.f64N/A
metadata-eval74.6
lift-pow.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
unpow-prod-downN/A
pow1/2N/A
lift-/.f64N/A
inv-powN/A
sqrt-pow1N/A
pow1/2N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6483.3
Applied rewrites83.3%
Final simplification85.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* (* M D) 0.5) (* d 2.0)) (/ -1.0 h))))))
(if (<= h -3.2e+170)
(* t_1 (* (/ (sqrt (- d)) (sqrt (- h))) t_0))
(if (<= h -5e-310)
(* t_1 (* (- d) (sqrt (/ 1.0 (* l h)))))
(* t_1 (* t_0 (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (h <= -3.2e+170) {
tmp = t_1 * ((sqrt(-d) / sqrt(-h)) * t_0);
} else if (h <= -5e-310) {
tmp = t_1 * (-d * sqrt((1.0 / (l * h))));
} else {
tmp = t_1 * (t_0 * (sqrt(d) / sqrt(h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((d / l))
t_1 = 1.0d0 + ((((m * d_1) / (d * 2.0d0)) / l) * ((((m * d_1) * 0.5d0) / (d * 2.0d0)) / ((-1.0d0) / h)))
if (h <= (-3.2d+170)) then
tmp = t_1 * ((sqrt(-d) / sqrt(-h)) * t_0)
else if (h <= (-5d-310)) then
tmp = t_1 * (-d * sqrt((1.0d0 / (l * h))))
else
tmp = t_1 * (t_0 * (sqrt(d) / sqrt(h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (h <= -3.2e+170) {
tmp = t_1 * ((Math.sqrt(-d) / Math.sqrt(-h)) * t_0);
} else if (h <= -5e-310) {
tmp = t_1 * (-d * Math.sqrt((1.0 / (l * h))));
} else {
tmp = t_1 * (t_0 * (Math.sqrt(d) / Math.sqrt(h)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h))) tmp = 0 if h <= -3.2e+170: tmp = t_1 * ((math.sqrt(-d) / math.sqrt(-h)) * t_0) elif h <= -5e-310: tmp = t_1 * (-d * math.sqrt((1.0 / (l * h)))) else: tmp = t_1 * (t_0 * (math.sqrt(d) / math.sqrt(h))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) / Float64(-1.0 / h)))) tmp = 0.0 if (h <= -3.2e+170) tmp = Float64(t_1 * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * t_0)); elseif (h <= -5e-310) tmp = Float64(t_1 * Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h))))); else tmp = Float64(t_1 * Float64(t_0 * Float64(sqrt(d) / sqrt(h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h))); tmp = 0.0; if (h <= -3.2e+170) tmp = t_1 * ((sqrt(-d) / sqrt(-h)) * t_0); elseif (h <= -5e-310) tmp = t_1 * (-d * sqrt((1.0 / (l * h)))); else tmp = t_1 * (t_0 * (sqrt(d) / sqrt(h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -3.2e+170], N[(t$95$1 * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(t$95$1 * N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := 1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\frac{-1}{h}}\\
\mathbf{if}\;h \leq -3.2 \cdot 10^{+170}:\\
\;\;\;\;t\_1 \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t\_0\right)\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot \left(\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if h < -3.19999999999999979e170Initial program 67.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites68.0%
lift-/.f64N/A
metadata-eval68.0
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6468.0
Applied rewrites68.0%
lift-/.f64N/A
metadata-eval68.0
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
lift-neg.f64N/A
sqrt-undivN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
lift-/.f6490.0
Applied rewrites90.0%
if -3.19999999999999979e170 < h < -4.999999999999985e-310Initial program 68.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites74.7%
lift-/.f64N/A
metadata-eval74.7
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6474.7
Applied rewrites74.7%
lift-/.f64N/A
metadata-eval74.7
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6474.7
Applied rewrites74.7%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6485.9
Applied rewrites85.9%
if -4.999999999999985e-310 < h Initial program 72.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites74.6%
lift-/.f64N/A
metadata-eval74.6
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6474.6
Applied rewrites74.6%
lift-/.f64N/A
metadata-eval74.6
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6483.2
Applied rewrites83.2%
Final simplification85.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* (* M D) 0.5) (* d 2.0)) (/ -1.0 h))))))
(if (<= l -3.4e+143)
(*
(*
(/ (sqrt (- d)) (sqrt (- l)))
(fma (* (* (* M D) (/ M (* d (* d 2.0)))) (* D 0.25)) (- (/ h l)) 1.0))
(sqrt (/ d h)))
(if (<= l -5e-311)
(* t_0 (* (- d) (sqrt (/ 1.0 (* l h)))))
(* t_0 (* (sqrt (/ d l)) (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (l <= -3.4e+143) {
tmp = ((sqrt(-d) / sqrt(-l)) * fma((((M * D) * (M / (d * (d * 2.0)))) * (D * 0.25)), -(h / l), 1.0)) * sqrt((d / h));
} else if (l <= -5e-311) {
tmp = t_0 * (-d * sqrt((1.0 / (l * h))));
} else {
tmp = t_0 * (sqrt((d / l)) * (sqrt(d) / sqrt(h)));
}
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(Float64(M * D) * 0.5) / Float64(d * 2.0)) / Float64(-1.0 / h)))) tmp = 0.0 if (l <= -3.4e+143) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * fma(Float64(Float64(Float64(M * D) * Float64(M / Float64(d * Float64(d * 2.0)))) * Float64(D * 0.25)), Float64(-Float64(h / l)), 1.0)) * sqrt(Float64(d / h))); elseif (l <= -5e-311) tmp = Float64(t_0 * Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h))))); else tmp = Float64(t_0 * Float64(sqrt(Float64(d / l)) * Float64(sqrt(d) / sqrt(h)))); end return 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[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.4e+143], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M / N[(d * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * 0.25), $MachinePrecision]), $MachinePrecision] * (-N[(h / l), $MachinePrecision]) + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-311], N[(t$95$0 * N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\frac{-1}{h}}\\
\mathbf{if}\;\ell \leq -3.4 \cdot 10^{+143}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \mathsf{fma}\left(\left(\left(M \cdot D\right) \cdot \frac{M}{d \cdot \left(d \cdot 2\right)}\right) \cdot \left(D \cdot 0.25\right), -\frac{h}{\ell}, 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;t\_0 \cdot \left(\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\
\end{array}
\end{array}
if l < -3.39999999999999982e143Initial program 55.9%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6455.9
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites54.6%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f6468.5
Applied rewrites68.5%
if -3.39999999999999982e143 < l < -5.00000000000023e-311Initial program 72.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites78.1%
lift-/.f64N/A
metadata-eval78.1
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6478.4
Applied rewrites78.4%
lift-/.f64N/A
metadata-eval78.4
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6478.4
Applied rewrites78.4%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6489.1
Applied rewrites89.1%
if -5.00000000000023e-311 < l Initial program 72.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites74.6%
lift-/.f64N/A
metadata-eval74.6
lift-pow.f64N/A
unpow1/2N/A
lower-sqrt.f6474.6
Applied rewrites74.6%
lift-/.f64N/A
metadata-eval74.6
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6483.2
Applied rewrites83.2%
Final simplification83.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* (* M D) 0.5) (* d 2.0)) (/ -1.0 h))))))
(if (<= l -3.4e+143)
(*
(*
(/ (sqrt (- d)) (sqrt (- l)))
(fma (* (* (* M D) (/ M (* d (* d 2.0)))) (* D 0.25)) (- (/ h l)) 1.0))
(sqrt (/ d h)))
(if (<= l -5e-311)
(* t_0 (* (- d) (sqrt (/ 1.0 (* l h)))))
(if (<= l 4.5e+97)
(* t_0 (/ d (sqrt (* l h))))
(* 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) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (l <= -3.4e+143) {
tmp = ((sqrt(-d) / sqrt(-l)) * fma((((M * D) * (M / (d * (d * 2.0)))) * (D * 0.25)), -(h / l), 1.0)) * sqrt((d / h));
} else if (l <= -5e-311) {
tmp = t_0 * (-d * sqrt((1.0 / (l * h))));
} else if (l <= 4.5e+97) {
tmp = t_0 * (d / sqrt((l * h)));
} else {
tmp = d * ((1.0 / sqrt(h)) / 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(Float64(M * D) * 0.5) / Float64(d * 2.0)) / Float64(-1.0 / h)))) tmp = 0.0 if (l <= -3.4e+143) tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * fma(Float64(Float64(Float64(M * D) * Float64(M / Float64(d * Float64(d * 2.0)))) * Float64(D * 0.25)), Float64(-Float64(h / l)), 1.0)) * sqrt(Float64(d / h))); elseif (l <= -5e-311) tmp = Float64(t_0 * Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h))))); elseif (l <= 4.5e+97) tmp = Float64(t_0 * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(h)) / sqrt(l))); end return 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[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.4e+143], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M / N[(d * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * 0.25), $MachinePrecision]), $MachinePrecision] * (-N[(h / l), $MachinePrecision]) + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-311], N[(t$95$0 * N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.5e+97], N[(t$95$0 * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[h], $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{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\frac{-1}{h}}\\
\mathbf{if}\;\ell \leq -3.4 \cdot 10^{+143}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \mathsf{fma}\left(\left(\left(M \cdot D\right) \cdot \frac{M}{d \cdot \left(d \cdot 2\right)}\right) \cdot \left(D \cdot 0.25\right), -\frac{h}{\ell}, 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;t\_0 \cdot \left(\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;\ell \leq 4.5 \cdot 10^{+97}:\\
\;\;\;\;t\_0 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.39999999999999982e143Initial program 55.9%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6455.9
Applied rewrites55.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites54.6%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f6468.5
Applied rewrites68.5%
if -3.39999999999999982e143 < l < -5.00000000000023e-311Initial program 72.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites78.1%
lift-/.f64N/A
metadata-eval78.1
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6478.4
Applied rewrites78.4%
lift-/.f64N/A
metadata-eval78.4
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6478.4
Applied rewrites78.4%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6489.1
Applied rewrites89.1%
if -5.00000000000023e-311 < l < 4.49999999999999976e97Initial program 75.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites79.6%
lift-/.f64N/A
metadata-eval79.6
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6482.0
Applied rewrites82.0%
lift-/.f64N/A
metadata-eval82.0
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6482.0
Applied rewrites82.0%
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
un-div-invN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
sqrt-divN/A
lift-*.f64N/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-/.f6487.9
Applied rewrites87.9%
if 4.49999999999999976e97 < l Initial program 64.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites64.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites77.4%
Final simplification84.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -2.7e+228)
(/ (sqrt (- (* d (/ d h)))) (sqrt (- l)))
(if (<= l -5e-311)
(*
(* (sqrt (/ d h)) (/ 1.0 (sqrt (/ l d))))
(- 1.0 (/ (* (* M D) (* h (* 0.25 (/ (* M D) d)))) (* l (* d 2.0)))))
(if (<= l 4.5e+97)
(*
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* (* M D) 0.5) (* d 2.0)) (/ -1.0 h))))
(/ d (sqrt (* l h))))
(* d (/ (/ 1.0 (sqrt h)) (sqrt l)))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -2.7e+228) {
tmp = sqrt(-(d * (d / h))) / sqrt(-l);
} else if (l <= -5e-311) {
tmp = (sqrt((d / h)) * (1.0 / sqrt((l / d)))) * (1.0 - (((M * D) * (h * (0.25 * ((M * D) / d)))) / (l * (d * 2.0))));
} else if (l <= 4.5e+97) {
tmp = (1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d / sqrt((l * h)));
} else {
tmp = 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) :: tmp
if (l <= (-2.7d+228)) then
tmp = sqrt(-(d * (d / h))) / sqrt(-l)
else if (l <= (-5d-311)) then
tmp = (sqrt((d / h)) * (1.0d0 / sqrt((l / d)))) * (1.0d0 - (((m * d_1) * (h * (0.25d0 * ((m * d_1) / d)))) / (l * (d * 2.0d0))))
else if (l <= 4.5d+97) then
tmp = (1.0d0 + ((((m * d_1) / (d * 2.0d0)) / l) * ((((m * d_1) * 0.5d0) / (d * 2.0d0)) / ((-1.0d0) / h)))) * (d / sqrt((l * h)))
else
tmp = 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 tmp;
if (l <= -2.7e+228) {
tmp = Math.sqrt(-(d * (d / h))) / Math.sqrt(-l);
} else if (l <= -5e-311) {
tmp = (Math.sqrt((d / h)) * (1.0 / Math.sqrt((l / d)))) * (1.0 - (((M * D) * (h * (0.25 * ((M * D) / d)))) / (l * (d * 2.0))));
} else if (l <= 4.5e+97) {
tmp = (1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d / Math.sqrt((l * h)));
} else {
tmp = d * ((1.0 / Math.sqrt(h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -2.7e+228: tmp = math.sqrt(-(d * (d / h))) / math.sqrt(-l) elif l <= -5e-311: tmp = (math.sqrt((d / h)) * (1.0 / math.sqrt((l / d)))) * (1.0 - (((M * D) * (h * (0.25 * ((M * D) / d)))) / (l * (d * 2.0)))) elif l <= 4.5e+97: tmp = (1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d / math.sqrt((l * h))) else: tmp = d * ((1.0 / math.sqrt(h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -2.7e+228) tmp = Float64(sqrt(Float64(-Float64(d * Float64(d / h)))) / sqrt(Float64(-l))); elseif (l <= -5e-311) tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(1.0 / sqrt(Float64(l / d)))) * Float64(1.0 - Float64(Float64(Float64(M * D) * Float64(h * Float64(0.25 * Float64(Float64(M * D) / d)))) / Float64(l * Float64(d * 2.0))))); elseif (l <= 4.5e+97) tmp = Float64(Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) / Float64(-1.0 / h)))) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -2.7e+228) tmp = sqrt(-(d * (d / h))) / sqrt(-l); elseif (l <= -5e-311) tmp = (sqrt((d / h)) * (1.0 / sqrt((l / d)))) * (1.0 - (((M * D) * (h * (0.25 * ((M * D) / d)))) / (l * (d * 2.0)))); elseif (l <= 4.5e+97) tmp = (1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d / sqrt((l * h))); else tmp = d * ((1.0 / sqrt(h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -2.7e+228], N[(N[Sqrt[(-N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision])], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-311], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(M * D), $MachinePrecision] * N[(h * N[(0.25 * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.5e+97], N[(N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.7 \cdot 10^{+228}:\\
\;\;\;\;\frac{\sqrt{-d \cdot \frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right) \cdot \left(1 - \frac{\left(M \cdot D\right) \cdot \left(h \cdot \left(0.25 \cdot \frac{M \cdot D}{d}\right)\right)}{\ell \cdot \left(d \cdot 2\right)}\right)\\
\mathbf{elif}\;\ell \leq 4.5 \cdot 10^{+97}:\\
\;\;\;\;\left(1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\frac{-1}{h}}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -2.7000000000000002e228Initial program 44.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites45.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6415.6
Applied rewrites15.6%
Applied rewrites68.9%
if -2.7000000000000002e228 < l < -5.00000000000023e-311Initial program 70.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites76.9%
lift-/.f64N/A
metadata-eval76.9
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6476.9
Applied rewrites76.9%
lift-/.f64N/A
metadata-eval76.9
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites72.9%
if -5.00000000000023e-311 < l < 4.49999999999999976e97Initial program 75.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites79.6%
lift-/.f64N/A
metadata-eval79.6
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6482.0
Applied rewrites82.0%
lift-/.f64N/A
metadata-eval82.0
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6482.0
Applied rewrites82.0%
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
un-div-invN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
sqrt-divN/A
lift-*.f64N/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-/.f6487.9
Applied rewrites87.9%
if 4.49999999999999976e97 < l Initial program 64.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites64.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites77.4%
Final simplification78.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* (* M D) 0.5) (* d 2.0)) (/ -1.0 h))))))
(if (<= l -5e-311)
(* t_0 (* (- d) (sqrt (/ 1.0 (* l h)))))
(if (<= l 4.5e+97)
(* t_0 (/ d (sqrt (* l h))))
(* 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) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (l <= -5e-311) {
tmp = t_0 * (-d * sqrt((1.0 / (l * h))));
} else if (l <= 4.5e+97) {
tmp = t_0 * (d / sqrt((l * h)));
} else {
tmp = 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) * ((((m * d_1) * 0.5d0) / (d * 2.0d0)) / ((-1.0d0) / h)))
if (l <= (-5d-311)) then
tmp = t_0 * (-d * sqrt((1.0d0 / (l * h))))
else if (l <= 4.5d+97) then
tmp = t_0 * (d / sqrt((l * h)))
else
tmp = 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) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)));
double tmp;
if (l <= -5e-311) {
tmp = t_0 * (-d * Math.sqrt((1.0 / (l * h))));
} else if (l <= 4.5e+97) {
tmp = t_0 * (d / Math.sqrt((l * h)));
} else {
tmp = 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) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h))) tmp = 0 if l <= -5e-311: tmp = t_0 * (-d * math.sqrt((1.0 / (l * h)))) elif l <= 4.5e+97: tmp = t_0 * (d / math.sqrt((l * h))) else: tmp = 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(Float64(M * D) * 0.5) / Float64(d * 2.0)) / Float64(-1.0 / h)))) tmp = 0.0 if (l <= -5e-311) tmp = Float64(t_0 * Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h))))); elseif (l <= 4.5e+97) tmp = Float64(t_0 * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(d * Float64(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) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h))); tmp = 0.0; if (l <= -5e-311) tmp = t_0 * (-d * sqrt((1.0 / (l * h)))); elseif (l <= 4.5e+97) tmp = t_0 * (d / sqrt((l * h))); else tmp = 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[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5e-311], N[(t$95$0 * N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.5e+97], N[(t$95$0 * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[h], $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{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\frac{-1}{h}}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;t\_0 \cdot \left(\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\right)\\
\mathbf{elif}\;\ell \leq 4.5 \cdot 10^{+97}:\\
\;\;\;\;t\_0 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -5.00000000000023e-311Initial program 67.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites73.2%
lift-/.f64N/A
metadata-eval73.2
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6472.6
Applied rewrites72.6%
lift-/.f64N/A
metadata-eval72.6
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6472.6
Applied rewrites72.6%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6480.6
Applied rewrites80.6%
if -5.00000000000023e-311 < l < 4.49999999999999976e97Initial program 75.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites79.6%
lift-/.f64N/A
metadata-eval79.6
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6482.0
Applied rewrites82.0%
lift-/.f64N/A
metadata-eval82.0
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6482.0
Applied rewrites82.0%
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
un-div-invN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
sqrt-divN/A
lift-*.f64N/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-/.f6487.9
Applied rewrites87.9%
if 4.49999999999999976e97 < l Initial program 64.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites64.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites77.4%
Final simplification82.4%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5e-311)
(*
(sqrt (/ d h))
(*
(sqrt (/ d l))
(fma (* (* D 0.25) (* (* M D) (/ (/ M (* d 2.0)) d))) (- (/ h l)) 1.0)))
(if (<= l 4.5e+97)
(*
(+
1.0
(*
(/ (/ (* M D) (* d 2.0)) l)
(/ (/ (* (* M D) 0.5) (* d 2.0)) (/ -1.0 h))))
(/ d (sqrt (* l h))))
(* d (/ (/ 1.0 (sqrt h)) (sqrt l))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5e-311) {
tmp = sqrt((d / h)) * (sqrt((d / l)) * fma(((D * 0.25) * ((M * D) * ((M / (d * 2.0)) / d))), -(h / l), 1.0));
} else if (l <= 4.5e+97) {
tmp = (1.0 + ((((M * D) / (d * 2.0)) / l) * ((((M * D) * 0.5) / (d * 2.0)) / (-1.0 / h)))) * (d / sqrt((l * h)));
} else {
tmp = d * ((1.0 / sqrt(h)) / sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (l <= -5e-311) tmp = Float64(sqrt(Float64(d / h)) * Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(D * 0.25) * Float64(Float64(M * D) * Float64(Float64(M / Float64(d * 2.0)) / d))), Float64(-Float64(h / l)), 1.0))); elseif (l <= 4.5e+97) tmp = Float64(Float64(1.0 + Float64(Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / l) * Float64(Float64(Float64(Float64(M * D) * 0.5) / Float64(d * 2.0)) / Float64(-1.0 / h)))) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(h)) / sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5e-311], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(D * 0.25), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(N[(M / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-N[(h / l), $MachinePrecision]) + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.5e+97], N[(N[(1.0 + N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\left(D \cdot 0.25\right) \cdot \left(\left(M \cdot D\right) \cdot \frac{\frac{M}{d \cdot 2}}{d}\right), -\frac{h}{\ell}, 1\right)\right)\\
\mathbf{elif}\;\ell \leq 4.5 \cdot 10^{+97}:\\
\;\;\;\;\left(1 + \frac{\frac{M \cdot D}{d \cdot 2}}{\ell} \cdot \frac{\frac{\left(M \cdot D\right) \cdot 0.5}{d \cdot 2}}{\frac{-1}{h}}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -5.00000000000023e-311Initial program 67.8%
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-*.f64N/A
associate-/l*N/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lift-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6466.9
Applied rewrites66.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites54.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6463.6
Applied rewrites63.6%
if -5.00000000000023e-311 < l < 4.49999999999999976e97Initial program 75.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites79.6%
lift-/.f64N/A
metadata-eval79.6
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6482.0
Applied rewrites82.0%
lift-/.f64N/A
metadata-eval82.0
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6482.0
Applied rewrites82.0%
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
un-div-invN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
sqrt-divN/A
lift-*.f64N/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-/.f6487.9
Applied rewrites87.9%
if 4.49999999999999976e97 < l Initial program 64.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites64.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites77.4%
Final simplification73.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (* l h)))))
(if (<= l -1.9e+155)
(/ (sqrt (- (* d (/ d h)))) (sqrt (- l)))
(if (<= l -2.3e-83)
(* (- d) t_0)
(if (<= l -8e-271)
(* (sqrt (/ h (* l (* l l)))) (/ (* 0.125 (* D (* D (* M M)))) d))
(if (<= l 4.15e+93)
(*
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d))))
(* d t_0))
(* d (/ (/ 1.0 (sqrt h)) (sqrt l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h)));
double tmp;
if (l <= -1.9e+155) {
tmp = sqrt(-(d * (d / h))) / sqrt(-l);
} else if (l <= -2.3e-83) {
tmp = -d * t_0;
} else if (l <= -8e-271) {
tmp = sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d);
} else if (l <= 4.15e+93) {
tmp = (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))) * (d * t_0);
} else {
tmp = 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 = sqrt((1.0d0 / (l * h)))
if (l <= (-1.9d+155)) then
tmp = sqrt(-(d * (d / h))) / sqrt(-l)
else if (l <= (-2.3d-83)) then
tmp = -d * t_0
else if (l <= (-8d-271)) then
tmp = sqrt((h / (l * (l * l)))) * ((0.125d0 * (d_1 * (d_1 * (m * m)))) / d)
else if (l <= 4.15d+93) then
tmp = (1.0d0 - ((d_1 * (d_1 * (0.125d0 * (h * (m * m))))) / (d * (l * d)))) * (d * t_0)
else
tmp = 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 = Math.sqrt((1.0 / (l * h)));
double tmp;
if (l <= -1.9e+155) {
tmp = Math.sqrt(-(d * (d / h))) / Math.sqrt(-l);
} else if (l <= -2.3e-83) {
tmp = -d * t_0;
} else if (l <= -8e-271) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d);
} else if (l <= 4.15e+93) {
tmp = (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))) * (d * t_0);
} else {
tmp = d * ((1.0 / Math.sqrt(h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (l * h))) tmp = 0 if l <= -1.9e+155: tmp = math.sqrt(-(d * (d / h))) / math.sqrt(-l) elif l <= -2.3e-83: tmp = -d * t_0 elif l <= -8e-271: tmp = math.sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d) elif l <= 4.15e+93: tmp = (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))) * (d * t_0) else: tmp = d * ((1.0 / math.sqrt(h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(l * h))) tmp = 0.0 if (l <= -1.9e+155) tmp = Float64(sqrt(Float64(-Float64(d * Float64(d / h)))) / sqrt(Float64(-l))); elseif (l <= -2.3e-83) tmp = Float64(Float64(-d) * t_0); elseif (l <= -8e-271) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(0.125 * Float64(D * Float64(D * Float64(M * M)))) / d)); elseif (l <= 4.15e+93) tmp = Float64(Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d)))) * Float64(d * t_0)); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(h)) / sqrt(l))); 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 <= -1.9e+155) tmp = sqrt(-(d * (d / h))) / sqrt(-l); elseif (l <= -2.3e-83) tmp = -d * t_0; elseif (l <= -8e-271) tmp = sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d); elseif (l <= 4.15e+93) tmp = (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))) * (d * t_0); else tmp = d * ((1.0 / sqrt(h)) / sqrt(l)); 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, -1.9e+155], N[(N[Sqrt[(-N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision])], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.3e-83], N[((-d) * t$95$0), $MachinePrecision], If[LessEqual[l, -8e-271], 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], If[LessEqual[l, 4.15e+93], N[(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] * N[(d * t$95$0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{if}\;\ell \leq -1.9 \cdot 10^{+155}:\\
\;\;\;\;\frac{\sqrt{-d \cdot \frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -2.3 \cdot 10^{-83}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{elif}\;\ell \leq -8 \cdot 10^{-271}:\\
\;\;\;\;\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{elif}\;\ell \leq 4.15 \cdot 10^{+93}:\\
\;\;\;\;\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) \cdot \left(d \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.9e155Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites57.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f648.9
Applied rewrites8.9%
Applied rewrites59.5%
if -1.9e155 < l < -2.2999999999999999e-83Initial program 74.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites78.3%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6446.3
Applied rewrites46.3%
if -2.2999999999999999e-83 < l < -7.9999999999999997e-271Initial program 70.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites77.6%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
Applied rewrites49.5%
if -7.9999999999999997e-271 < l < 4.1499999999999999e93Initial program 75.1%
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.6
Applied rewrites55.6%
lift-/.f64N/A
metadata-eval55.6
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f643.5
Applied rewrites3.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lift-neg.f64N/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lift-/.f64N/A
sqrt-divN/A
frac-timesN/A
rem-square-sqrtN/A
sqrt-prodN/A
lift-*.f64N/A
un-div-invN/A
Applied rewrites59.1%
if 4.1499999999999999e93 < l Initial program 64.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites64.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites77.4%
Final simplification57.7%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.9e+155)
(/ (sqrt (- (* d (/ d h)))) (sqrt (- l)))
(if (<= l -2.3e-83)
(* (- d) (sqrt (/ 1.0 (* l h))))
(if (<= l -8e-271)
(* (sqrt (/ h (* l (* l l)))) (/ (* 0.125 (* D (* D (* M M)))) d))
(if (<= l 4.15e+93)
(*
(/ d (sqrt (* l h)))
(- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d)))))
(* d (/ (/ 1.0 (sqrt h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.9e+155) {
tmp = sqrt(-(d * (d / h))) / sqrt(-l);
} else if (l <= -2.3e-83) {
tmp = -d * sqrt((1.0 / (l * h)));
} else if (l <= -8e-271) {
tmp = sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d);
} else if (l <= 4.15e+93) {
tmp = (d / sqrt((l * h))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
} else {
tmp = 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) :: tmp
if (l <= (-1.9d+155)) then
tmp = sqrt(-(d * (d / h))) / sqrt(-l)
else if (l <= (-2.3d-83)) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else if (l <= (-8d-271)) then
tmp = sqrt((h / (l * (l * l)))) * ((0.125d0 * (d_1 * (d_1 * (m * m)))) / d)
else if (l <= 4.15d+93) then
tmp = (d / sqrt((l * h))) * (1.0d0 - ((d_1 * (d_1 * (0.125d0 * (h * (m * m))))) / (d * (l * d))))
else
tmp = 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 tmp;
if (l <= -1.9e+155) {
tmp = Math.sqrt(-(d * (d / h))) / Math.sqrt(-l);
} else if (l <= -2.3e-83) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else if (l <= -8e-271) {
tmp = Math.sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d);
} else if (l <= 4.15e+93) {
tmp = (d / Math.sqrt((l * h))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))));
} else {
tmp = d * ((1.0 / Math.sqrt(h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.9e+155: tmp = math.sqrt(-(d * (d / h))) / math.sqrt(-l) elif l <= -2.3e-83: tmp = -d * math.sqrt((1.0 / (l * h))) elif l <= -8e-271: tmp = math.sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d) elif l <= 4.15e+93: tmp = (d / math.sqrt((l * h))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))) else: tmp = d * ((1.0 / math.sqrt(h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.9e+155) tmp = Float64(sqrt(Float64(-Float64(d * Float64(d / h)))) / sqrt(Float64(-l))); elseif (l <= -2.3e-83) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); elseif (l <= -8e-271) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(0.125 * Float64(D * Float64(D * Float64(M * M)))) / d)); elseif (l <= 4.15e+93) tmp = Float64(Float64(d / sqrt(Float64(l * h))) * Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d))))); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.9e+155) tmp = sqrt(-(d * (d / h))) / sqrt(-l); elseif (l <= -2.3e-83) tmp = -d * sqrt((1.0 / (l * h))); elseif (l <= -8e-271) tmp = sqrt((h / (l * (l * l)))) * ((0.125 * (D * (D * (M * M)))) / d); elseif (l <= 4.15e+93) tmp = (d / sqrt((l * h))) * (1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)))); else tmp = d * ((1.0 / sqrt(h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.9e+155], N[(N[Sqrt[(-N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision])], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.3e-83], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -8e-271], 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], If[LessEqual[l, 4.15e+93], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 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], N[(d * N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.9 \cdot 10^{+155}:\\
\;\;\;\;\frac{\sqrt{-d \cdot \frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -2.3 \cdot 10^{-83}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{elif}\;\ell \leq -8 \cdot 10^{-271}:\\
\;\;\;\;\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{elif}\;\ell \leq 4.15 \cdot 10^{+93}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \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}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.9e155Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites57.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f648.9
Applied rewrites8.9%
Applied rewrites59.5%
if -1.9e155 < l < -2.2999999999999999e-83Initial program 74.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites78.3%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6446.3
Applied rewrites46.3%
if -2.2999999999999999e-83 < l < -7.9999999999999997e-271Initial program 70.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites77.6%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-*r*N/A
Applied rewrites49.5%
if -7.9999999999999997e-271 < l < 4.1499999999999999e93Initial program 75.1%
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.6
Applied rewrites55.6%
lift-/.f64N/A
metadata-eval55.6
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f643.5
Applied rewrites3.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lift-neg.f64N/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lift-/.f64N/A
sqrt-divN/A
frac-timesN/A
rem-square-sqrtN/A
sqrt-prodN/A
lift-*.f64N/A
lower-/.f64N/A
Applied rewrites59.0%
if 4.1499999999999999e93 < l Initial program 64.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites64.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites77.4%
Final simplification57.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (* l h))))
(t_1 (- 1.0 (/ (* D (* D (* 0.125 (* h (* M M))))) (* d (* l d))))))
(if (<= l -1.95e+180)
(/ (sqrt (- (* d (/ d h)))) (sqrt (- l)))
(if (<= l -8e-271)
(* (* (- d) t_0) t_1)
(if (<= l 4.15e+93)
(* t_1 (* d t_0))
(* d (/ (/ 1.0 (sqrt h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h)));
double t_1 = 1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)));
double tmp;
if (l <= -1.95e+180) {
tmp = sqrt(-(d * (d / h))) / sqrt(-l);
} else if (l <= -8e-271) {
tmp = (-d * t_0) * t_1;
} else if (l <= 4.15e+93) {
tmp = t_1 * (d * t_0);
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_0 = sqrt((1.0d0 / (l * h)))
t_1 = 1.0d0 - ((d_1 * (d_1 * (0.125d0 * (h * (m * m))))) / (d * (l * d)))
if (l <= (-1.95d+180)) then
tmp = sqrt(-(d * (d / h))) / sqrt(-l)
else if (l <= (-8d-271)) then
tmp = (-d * t_0) * t_1
else if (l <= 4.15d+93) then
tmp = t_1 * (d * t_0)
else
tmp = 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 = Math.sqrt((1.0 / (l * h)));
double t_1 = 1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d)));
double tmp;
if (l <= -1.95e+180) {
tmp = Math.sqrt(-(d * (d / h))) / Math.sqrt(-l);
} else if (l <= -8e-271) {
tmp = (-d * t_0) * t_1;
} else if (l <= 4.15e+93) {
tmp = t_1 * (d * t_0);
} else {
tmp = d * ((1.0 / Math.sqrt(h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (l * h))) t_1 = 1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))) tmp = 0 if l <= -1.95e+180: tmp = math.sqrt(-(d * (d / h))) / math.sqrt(-l) elif l <= -8e-271: tmp = (-d * t_0) * t_1 elif l <= 4.15e+93: tmp = t_1 * (d * t_0) else: tmp = d * ((1.0 / math.sqrt(h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(l * h))) t_1 = Float64(1.0 - Float64(Float64(D * Float64(D * Float64(0.125 * Float64(h * Float64(M * M))))) / Float64(d * Float64(l * d)))) tmp = 0.0 if (l <= -1.95e+180) tmp = Float64(sqrt(Float64(-Float64(d * Float64(d / h)))) / sqrt(Float64(-l))); elseif (l <= -8e-271) tmp = Float64(Float64(Float64(-d) * t_0) * t_1); elseif (l <= 4.15e+93) tmp = Float64(t_1 * Float64(d * t_0)); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((1.0 / (l * h))); t_1 = 1.0 - ((D * (D * (0.125 * (h * (M * M))))) / (d * (l * d))); tmp = 0.0; if (l <= -1.95e+180) tmp = sqrt(-(d * (d / h))) / sqrt(-l); elseif (l <= -8e-271) tmp = (-d * t_0) * t_1; elseif (l <= 4.15e+93) tmp = t_1 * (d * t_0); else tmp = d * ((1.0 / sqrt(h)) / sqrt(l)); 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[(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]}, If[LessEqual[l, -1.95e+180], N[(N[Sqrt[(-N[(d * N[(d / h), $MachinePrecision]), $MachinePrecision])], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -8e-271], N[(N[((-d) * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, 4.15e+93], N[(t$95$1 * N[(d * t$95$0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
t_1 := 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)}\\
\mathbf{if}\;\ell \leq -1.95 \cdot 10^{+180}:\\
\;\;\;\;\frac{\sqrt{-d \cdot \frac{d}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -8 \cdot 10^{-271}:\\
\;\;\;\;\left(\left(-d\right) \cdot t\_0\right) \cdot t\_1\\
\mathbf{elif}\;\ell \leq 4.15 \cdot 10^{+93}:\\
\;\;\;\;t\_1 \cdot \left(d \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.95e180Initial program 54.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites58.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f649.3
Applied rewrites9.3%
Applied rewrites60.1%
if -1.95e180 < l < -7.9999999999999997e-271Initial program 72.1%
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.7
Applied rewrites55.7%
lift-/.f64N/A
metadata-eval55.7
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6460.5
Applied rewrites60.5%
Taylor expanded in d around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6464.4
Applied rewrites64.4%
if -7.9999999999999997e-271 < l < 4.1499999999999999e93Initial program 75.1%
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.6
Applied rewrites55.6%
lift-/.f64N/A
metadata-eval55.6
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f643.5
Applied rewrites3.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-undivN/A
lift-neg.f64N/A
lift-neg.f64N/A
frac-2negN/A
lift-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lift-/.f64N/A
sqrt-divN/A
frac-timesN/A
rem-square-sqrtN/A
sqrt-prodN/A
lift-*.f64N/A
un-div-invN/A
Applied rewrites59.1%
if 4.1499999999999999e93 < l Initial program 64.5%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites64.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites77.4%
Final simplification64.1%
(FPCore (d h l M D) :precision binary64 (if (<= l 3.6e-175) (* (- d) (sqrt (/ 1.0 (* l h)))) (* d (/ (/ 1.0 (sqrt h)) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.6e-175) {
tmp = -d * sqrt((1.0 / (l * h)));
} else {
tmp = 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) :: tmp
if (l <= 3.6d-175) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else
tmp = 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 tmp;
if (l <= 3.6e-175) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d * ((1.0 / Math.sqrt(h)) / Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3.6e-175: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = d * ((1.0 / math.sqrt(h)) / math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3.6e-175) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(h)) / sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 3.6e-175) tmp = -d * sqrt((1.0 / (l * h))); else tmp = d * ((1.0 / sqrt(h)) / sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.6e-175], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.6 \cdot 10^{-175}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 3.6e-175Initial program 69.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6436.0
Applied rewrites36.0%
if 3.6e-175 < l Initial program 70.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites72.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6452.8
Applied rewrites52.8%
Applied rewrites66.7%
Final simplification47.1%
(FPCore (d h l M D) :precision binary64 (if (<= l 3.6e-175) (* (- d) (sqrt (/ 1.0 (* l h)))) (/ (/ d (sqrt h)) (sqrt l))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.6e-175) {
tmp = -d * sqrt((1.0 / (l * h)));
} else {
tmp = (d / sqrt(h)) / sqrt(l);
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 3.6d-175) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else
tmp = (d / sqrt(h)) / sqrt(l)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.6e-175) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = (d / Math.sqrt(h)) / Math.sqrt(l);
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3.6e-175: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = (d / math.sqrt(h)) / math.sqrt(l) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3.6e-175) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(Float64(d / sqrt(h)) / sqrt(l)); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 3.6e-175) tmp = -d * sqrt((1.0 / (l * h))); else tmp = (d / sqrt(h)) / sqrt(l); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.6e-175], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.6 \cdot 10^{-175}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 3.6e-175Initial program 69.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6436.0
Applied rewrites36.0%
if 3.6e-175 < l Initial program 70.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites72.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6452.8
Applied rewrites52.8%
Applied rewrites52.8%
Applied rewrites66.7%
Final simplification47.0%
(FPCore (d h l M D) :precision binary64 (if (<= l 3.6e-175) (* (- d) (sqrt (/ 1.0 (* l h)))) (/ d (* (sqrt h) (sqrt l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.6e-175) {
tmp = -d * sqrt((1.0 / (l * h)));
} else {
tmp = d / (sqrt(h) * sqrt(l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 3.6d-175) then
tmp = -d * sqrt((1.0d0 / (l * h)))
else
tmp = d / (sqrt(h) * sqrt(l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 3.6e-175) {
tmp = -d * Math.sqrt((1.0 / (l * h)));
} else {
tmp = d / (Math.sqrt(h) * Math.sqrt(l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 3.6e-175: tmp = -d * math.sqrt((1.0 / (l * h))) else: tmp = d / (math.sqrt(h) * math.sqrt(l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 3.6e-175) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(l * h)))); else tmp = Float64(d / Float64(sqrt(h) * sqrt(l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 3.6e-175) tmp = -d * sqrt((1.0 / (l * h))); else tmp = d / (sqrt(h) * sqrt(l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 3.6e-175], N[((-d) * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.6 \cdot 10^{-175}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
\end{array}
\end{array}
if l < 3.6e-175Initial program 69.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6436.0
Applied rewrites36.0%
if 3.6e-175 < l Initial program 70.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites72.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6452.8
Applied rewrites52.8%
Applied rewrites52.8%
Applied rewrites66.6%
Final simplification47.0%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (/ 1.0 (* l h))))) (if (<= l 3.6e-175) (* (- d) t_0) (* 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 <= 3.6e-175) {
tmp = -d * t_0;
} 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 <= 3.6d-175) then
tmp = -d * t_0
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 <= 3.6e-175) {
tmp = -d * t_0;
} 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 <= 3.6e-175: tmp = -d * t_0 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 <= 3.6e-175) tmp = Float64(Float64(-d) * t_0); 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 <= 3.6e-175) tmp = -d * t_0; 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, 3.6e-175], N[((-d) * t$95$0), $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 3.6 \cdot 10^{-175}:\\
\;\;\;\;\left(-d\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;d \cdot t\_0\\
\end{array}
\end{array}
if l < 3.6e-175Initial program 69.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites74.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6436.0
Applied rewrites36.0%
if 3.6e-175 < l Initial program 70.0%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites72.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6452.8
Applied rewrites52.8%
Final simplification42.0%
(FPCore (d h l M D) :precision binary64 (if (<= d -2.5e-132) (sqrt (/ (* d d) (* l h))) (* d (sqrt (/ 1.0 (* l h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.5e-132) {
tmp = sqrt(((d * d) / (l * h)));
} else {
tmp = d * sqrt((1.0 / (l * h)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-2.5d-132)) then
tmp = sqrt(((d * d) / (l * h)))
else
tmp = d * sqrt((1.0d0 / (l * h)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.5e-132) {
tmp = Math.sqrt(((d * d) / (l * h)));
} else {
tmp = d * Math.sqrt((1.0 / (l * h)));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -2.5e-132: tmp = math.sqrt(((d * d) / (l * h))) else: tmp = d * math.sqrt((1.0 / (l * h))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.5e-132) tmp = sqrt(Float64(Float64(d * d) / Float64(l * h))); else tmp = Float64(d * sqrt(Float64(1.0 / Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -2.5e-132) tmp = sqrt(((d * d) / (l * h))); else tmp = d * sqrt((1.0 / (l * h))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.5e-132], N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d * N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.5 \cdot 10^{-132}:\\
\;\;\;\;\sqrt{\frac{d \cdot d}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -2.5e-132Initial program 73.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites81.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f645.3
Applied rewrites5.3%
Applied rewrites27.2%
if -2.5e-132 < d Initial program 67.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites69.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
Final simplification33.8%
(FPCore (d h l M D) :precision binary64 (if (<= d -2.5e-132) (sqrt (/ (* d d) (* l h))) (/ d (sqrt (* l h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.5e-132) {
tmp = sqrt(((d * d) / (l * h)));
} else {
tmp = d / sqrt((l * h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-2.5d-132)) then
tmp = sqrt(((d * d) / (l * h)))
else
tmp = d / sqrt((l * h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -2.5e-132) {
tmp = Math.sqrt(((d * d) / (l * h)));
} else {
tmp = d / Math.sqrt((l * h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -2.5e-132: tmp = math.sqrt(((d * d) / (l * h))) else: tmp = d / math.sqrt((l * h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -2.5e-132) tmp = sqrt(Float64(Float64(d * d) / Float64(l * h))); else tmp = Float64(d / sqrt(Float64(l * h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -2.5e-132) tmp = sqrt(((d * d) / (l * h))); else tmp = d / sqrt((l * h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -2.5e-132], N[Sqrt[N[(N[(d * d), $MachinePrecision] / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2.5 \cdot 10^{-132}:\\
\;\;\;\;\sqrt{\frac{d \cdot d}{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -2.5e-132Initial program 73.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites81.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f645.3
Applied rewrites5.3%
Applied rewrites27.2%
if -2.5e-132 < d Initial program 67.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites69.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
Applied rewrites37.9%
Final simplification33.8%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 69.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
Applied rewrites73.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.3
Applied rewrites25.3%
Applied rewrites25.3%
Final simplification25.3%
herbie shell --seed 2024216
(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)))))