
(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 26 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 (* (/ D d) M))
(t_1
(-
1.0
(*
(/ (* t_0 0.5) l)
(/ (* (* 0.5 (* D 0.5)) (/ M d)) (pow h -1.0))))))
(if (<= l -1e+175)
(* (* (pow (sqrt (/ h d)) -1.0) (/ (sqrt (- d)) (sqrt (- l)))) t_1)
(if (<= l -1.35e+101)
(/
(fma
(pow (/ h l) 1.5)
(/ (* -0.125 (pow (* D M) 2.0)) d)
(* (sqrt (/ h l)) d))
h)
(if (<= l -5e-310)
(* (* (- d) (sqrt (pow (* l h) -1.0))) t_1)
(if (<= l 3.7e+40)
(*
(fma (* (/ (* t_0 -0.5) l) (* (/ M d) (* 0.25 D))) h 1.0)
(/ d (sqrt (* l h))))
(/
(/
(* (fma (* -0.5 (/ h l)) (* (pow (/ (/ d D) M) -2.0) 0.25) 1.0) d)
(sqrt l))
(sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (D / d) * M;
double t_1 = 1.0 - (((t_0 * 0.5) / l) * (((0.5 * (D * 0.5)) * (M / d)) / pow(h, -1.0)));
double tmp;
if (l <= -1e+175) {
tmp = (pow(sqrt((h / d)), -1.0) * (sqrt(-d) / sqrt(-l))) * t_1;
} else if (l <= -1.35e+101) {
tmp = fma(pow((h / l), 1.5), ((-0.125 * pow((D * M), 2.0)) / d), (sqrt((h / l)) * d)) / h;
} else if (l <= -5e-310) {
tmp = (-d * sqrt(pow((l * h), -1.0))) * t_1;
} else if (l <= 3.7e+40) {
tmp = fma((((t_0 * -0.5) / l) * ((M / d) * (0.25 * D))), h, 1.0) * (d / sqrt((l * h)));
} else {
tmp = ((fma((-0.5 * (h / l)), (pow(((d / D) / M), -2.0) * 0.25), 1.0) * d) / sqrt(l)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(D / d) * M) t_1 = Float64(1.0 - Float64(Float64(Float64(t_0 * 0.5) / l) * Float64(Float64(Float64(0.5 * Float64(D * 0.5)) * Float64(M / d)) / (h ^ -1.0)))) tmp = 0.0 if (l <= -1e+175) tmp = Float64(Float64((sqrt(Float64(h / d)) ^ -1.0) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * t_1); elseif (l <= -1.35e+101) tmp = Float64(fma((Float64(h / l) ^ 1.5), Float64(Float64(-0.125 * (Float64(D * M) ^ 2.0)) / d), Float64(sqrt(Float64(h / l)) * d)) / h); elseif (l <= -5e-310) tmp = Float64(Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))) * t_1); elseif (l <= 3.7e+40) tmp = Float64(fma(Float64(Float64(Float64(t_0 * -0.5) / l) * Float64(Float64(M / d) * Float64(0.25 * D))), h, 1.0) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), Float64((Float64(Float64(d / D) / M) ^ -2.0) * 0.25), 1.0) * d) / sqrt(l)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[(N[(t$95$0 * 0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(0.5 * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1e+175], N[(N[(N[Power[N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, -1.35e+101], N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(-0.125 * N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, 3.7e+40], N[(N[(N[(N[(N[(t$95$0 * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision], -2.0], $MachinePrecision] * 0.25), $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{D}{d} \cdot M\\
t_1 := 1 - \frac{t\_0 \cdot 0.5}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{+175}:\\
\;\;\;\;\left({\left(\sqrt{\frac{h}{d}}\right)}^{-1} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_1\\
\mathbf{elif}\;\ell \leq -1.35 \cdot 10^{+101}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\frac{h}{\ell}\right)}^{1.5}, \frac{-0.125 \cdot {\left(D \cdot M\right)}^{2}}{d}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot t\_1\\
\mathbf{elif}\;\ell \leq 3.7 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_0 \cdot -0.5}{\ell} \cdot \left(\frac{M}{d} \cdot \left(0.25 \cdot D\right)\right), h, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot 0.25, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -9.9999999999999994e174Initial program 54.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites57.5%
lift-/.f64N/A
metadata-eval57.5
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6457.4
Applied rewrites57.4%
lift-/.f64N/A
metadata-eval57.4
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
pow1/2N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6473.8
Applied rewrites73.8%
if -9.9999999999999994e174 < l < -1.35000000000000003e101Initial program 59.9%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites45.9%
Applied rewrites91.0%
if -1.35000000000000003e101 < l < -4.999999999999985e-310Initial program 71.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
Applied rewrites78.6%
lift-/.f64N/A
metadata-eval78.6
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6478.5
Applied rewrites78.5%
Taylor expanded in d around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.3
Applied rewrites93.3%
if -4.999999999999985e-310 < l < 3.7e40Initial program 65.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.3
Applied rewrites76.7%
Applied rewrites90.4%
if 3.7e40 < l Initial program 60.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.6
Applied rewrites50.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites81.9%
Final simplification87.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (* D M) d))
(t_1
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_2
(*
(* (fma t_0 (* (* -0.25 (/ h l)) (* 0.5 t_0)) 1.0) (sqrt (/ d l)))
(sqrt (/ d h))))
(t_3 (/ d (sqrt (* l h))))
(t_4 (fabs t_3)))
(if (<= t_1 -2e-58)
t_2
(if (<= t_1 0.0)
t_4
(if (<= t_1 5e+264)
t_2
(if (<= t_1 INFINITY)
t_4
(*
(fma (/ (* (* (/ D d) M) -0.5) l) (* (* (/ M d) h) (* 0.25 D)) 1.0)
t_3)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (D * M) / d;
double t_1 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_2 = (fma(t_0, ((-0.25 * (h / l)) * (0.5 * t_0)), 1.0) * sqrt((d / l))) * sqrt((d / h));
double t_3 = d / sqrt((l * h));
double t_4 = fabs(t_3);
double tmp;
if (t_1 <= -2e-58) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = t_4;
} else if (t_1 <= 5e+264) {
tmp = t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = fma(((((D / d) * M) * -0.5) / l), (((M / d) * h) * (0.25 * D)), 1.0) * t_3;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(D * M) / d) t_1 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_2 = Float64(Float64(fma(t_0, Float64(Float64(-0.25 * Float64(h / l)) * Float64(0.5 * t_0)), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(d / h))) t_3 = Float64(d / sqrt(Float64(l * h))) t_4 = abs(t_3) tmp = 0.0 if (t_1 <= -2e-58) tmp = t_2; elseif (t_1 <= 0.0) tmp = t_4; elseif (t_1 <= 5e+264) tmp = t_2; elseif (t_1 <= Inf) tmp = t_4; else tmp = Float64(fma(Float64(Float64(Float64(Float64(D / d) * M) * -0.5) / l), Float64(Float64(Float64(M / d) * h) * Float64(0.25 * D)), 1.0) * t_3); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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]}, Block[{t$95$2 = N[(N[(N[(t$95$0 * N[(N[(-0.25 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[(0.5 * t$95$0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Abs[t$95$3], $MachinePrecision]}, If[LessEqual[t$95$1, -2e-58], t$95$2, If[LessEqual[t$95$1, 0.0], t$95$4, If[LessEqual[t$95$1, 5e+264], t$95$2, If[LessEqual[t$95$1, Infinity], t$95$4, N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$3), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{D \cdot M}{d}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_2 := \left(\mathsf{fma}\left(t\_0, \left(-0.25 \cdot \frac{h}{\ell}\right) \cdot \left(0.5 \cdot t\_0\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
t_3 := \frac{d}{\sqrt{\ell \cdot h}}\\
t_4 := \left|t\_3\right|\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-58}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+264}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\frac{D}{d} \cdot M\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \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)))) < -2.0000000000000001e-58 or 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)))) < 5.00000000000000033e264Initial program 91.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.9%
lift-fma.f64N/A
*-commutativeN/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites93.5%
lift-fma.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites93.5%
if -2.0000000000000001e-58 < (*.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.0 or 5.00000000000000033e264 < (*.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 43.8%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6456.9
Applied rewrites56.9%
Applied rewrites93.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)))) Initial program 0.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites0.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f643.7
Applied rewrites15.0%
Applied rewrites35.7%
Final simplification81.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ d (sqrt (* l h))))
(t_1 (fabs t_0))
(t_2
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_3 (sqrt (/ d h))))
(if (<= t_2 -4e-25)
(*
(*
(fma
(* (/ (* M D) d) 0.5)
(/ (* (* 0.5 (* D M)) (* -0.5 h)) (* d l))
1.0)
(sqrt (/ d l)))
t_3)
(if (<= t_2 1e-258)
t_1
(if (<= t_2 1e+183)
(/ t_3 (sqrt (/ l d)))
(if (<= t_2 INFINITY)
t_1
(*
(fma (/ (* (* (/ D d) M) -0.5) l) (* (* (/ M d) h) (* 0.25 D)) 1.0)
t_0)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d / sqrt((l * h));
double t_1 = fabs(t_0);
double t_2 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_3 = sqrt((d / h));
double tmp;
if (t_2 <= -4e-25) {
tmp = (fma((((M * D) / d) * 0.5), (((0.5 * (D * M)) * (-0.5 * h)) / (d * l)), 1.0) * sqrt((d / l))) * t_3;
} else if (t_2 <= 1e-258) {
tmp = t_1;
} else if (t_2 <= 1e+183) {
tmp = t_3 / sqrt((l / d));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(((((D / d) * M) * -0.5) / l), (((M / d) * h) * (0.25 * D)), 1.0) * t_0;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(d / sqrt(Float64(l * h))) t_1 = abs(t_0) t_2 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_3 = sqrt(Float64(d / h)) tmp = 0.0 if (t_2 <= -4e-25) tmp = Float64(Float64(fma(Float64(Float64(Float64(M * D) / d) * 0.5), Float64(Float64(Float64(0.5 * Float64(D * M)) * Float64(-0.5 * h)) / Float64(d * l)), 1.0) * sqrt(Float64(d / l))) * t_3); elseif (t_2 <= 1e-258) tmp = t_1; elseif (t_2 <= 1e+183) tmp = Float64(t_3 / sqrt(Float64(l / d))); elseif (t_2 <= Inf) tmp = t_1; else tmp = Float64(fma(Float64(Float64(Float64(Float64(D / d) * M) * -0.5) / l), Float64(Float64(Float64(M / d) * h) * Float64(0.25 * D)), 1.0) * t_0); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Abs[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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]}, Block[{t$95$3 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, -4e-25], N[(N[(N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[(N[(0.5 * N[(D * M), $MachinePrecision]), $MachinePrecision] * N[(-0.5 * h), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[t$95$2, 1e-258], t$95$1, If[LessEqual[t$95$2, 1e+183], N[(t$95$3 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$1, N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
t_1 := \left|t\_0\right|\\
t_2 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_3 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-25}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{M \cdot D}{d} \cdot 0.5, \frac{\left(0.5 \cdot \left(D \cdot M\right)\right) \cdot \left(-0.5 \cdot h\right)}{d \cdot \ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{-258}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+183}:\\
\;\;\;\;\frac{t\_3}{\sqrt{\frac{\ell}{d}}}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\frac{D}{d} \cdot M\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \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)))) < -4.00000000000000015e-25Initial program 82.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.3%
lift-fma.f64N/A
*-commutativeN/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites86.7%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*r/N/A
frac-timesN/A
lower-/.f64N/A
metadata-evalN/A
div-invN/A
*-commutativeN/A
lower-*.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6483.1
Applied rewrites83.1%
if -4.00000000000000015e-25 < (*.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.99999999999999954e-259 or 9.99999999999999947e182 < (*.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 57.2%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
Applied rewrites88.7%
if 9.99999999999999954e-259 < (*.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.99999999999999947e182Initial program 99.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites98.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)))) Initial program 0.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites0.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f643.7
Applied rewrites15.0%
Applied rewrites35.7%
Final simplification78.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ d (sqrt (* l h))))
(t_1
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_2 (sqrt (/ d h)))
(t_3 (fabs t_0)))
(if (<= t_1 -2e-8)
(*
(* (* (* (* (/ (* (* M M) h) l) -0.125) D) (/ (/ D d) d)) (sqrt (/ d l)))
t_2)
(if (<= t_1 1e-258)
t_3
(if (<= t_1 1e+183)
(/ t_2 (sqrt (/ l d)))
(if (<= t_1 INFINITY)
t_3
(*
(fma (/ (* (* (/ D d) M) -0.5) l) (* (* (/ M d) h) (* 0.25 D)) 1.0)
t_0)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d / sqrt((l * h));
double t_1 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_2 = sqrt((d / h));
double t_3 = fabs(t_0);
double tmp;
if (t_1 <= -2e-8) {
tmp = (((((((M * M) * h) / l) * -0.125) * D) * ((D / d) / d)) * sqrt((d / l))) * t_2;
} else if (t_1 <= 1e-258) {
tmp = t_3;
} else if (t_1 <= 1e+183) {
tmp = t_2 / sqrt((l / d));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = fma(((((D / d) * M) * -0.5) / l), (((M / d) * h) * (0.25 * D)), 1.0) * t_0;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(d / sqrt(Float64(l * h))) t_1 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_2 = sqrt(Float64(d / h)) t_3 = abs(t_0) tmp = 0.0 if (t_1 <= -2e-8) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(M * M) * h) / l) * -0.125) * D) * Float64(Float64(D / d) / d)) * sqrt(Float64(d / l))) * t_2); elseif (t_1 <= 1e-258) tmp = t_3; elseif (t_1 <= 1e+183) tmp = Float64(t_2 / sqrt(Float64(l / d))); elseif (t_1 <= Inf) tmp = t_3; else tmp = Float64(fma(Float64(Float64(Float64(Float64(D / d) * M) * -0.5) / l), Float64(Float64(Float64(M / d) * h) * Float64(0.25 * D)), 1.0) * t_0); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Abs[t$95$0], $MachinePrecision]}, If[LessEqual[t$95$1, -2e-8], N[(N[(N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision] * D), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 1e-258], t$95$3, If[LessEqual[t$95$1, 1e+183], N[(t$95$2 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$3, N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_2 := \sqrt{\frac{d}{h}}\\
t_3 := \left|t\_0\right|\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-8}:\\
\;\;\;\;\left(\left(\left(\left(\frac{\left(M \cdot M\right) \cdot h}{\ell} \cdot -0.125\right) \cdot D\right) \cdot \frac{\frac{D}{d}}{d}\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-258}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 10^{+183}:\\
\;\;\;\;\frac{t\_2}{\sqrt{\frac{\ell}{d}}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\frac{D}{d} \cdot M\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \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)))) < -2e-8Initial program 81.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.9%
lift-fma.f64N/A
*-commutativeN/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites86.3%
Taylor expanded in d around 0
associate-*r/N/A
associate-/l/N/A
*-commutativeN/A
associate-*r*N/A
associate-*l/N/A
associate-*r/N/A
unpow2N/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites65.0%
if -2e-8 < (*.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.99999999999999954e-259 or 9.99999999999999947e182 < (*.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 58.7%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6453.8
Applied rewrites53.8%
Applied rewrites85.7%
if 9.99999999999999954e-259 < (*.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.99999999999999947e182Initial program 99.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites98.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)))) Initial program 0.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites0.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f643.7
Applied rewrites15.0%
Applied rewrites35.7%
Final simplification72.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ d (sqrt (* l h))))
(t_1
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_2 (sqrt (/ d h)))
(t_3 (fabs t_0)))
(if (<= t_1 -4.0)
(*
(* (* (/ (* (* D D) -0.125) l) (* (/ (/ (* M M) d) d) h)) (sqrt (/ d l)))
t_2)
(if (<= t_1 1e-258)
t_3
(if (<= t_1 1e+183)
(/ t_2 (sqrt (/ l d)))
(if (<= t_1 INFINITY)
t_3
(*
(fma (/ (* (* (/ D d) M) -0.5) l) (* (* (/ M d) h) (* 0.25 D)) 1.0)
t_0)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d / sqrt((l * h));
double t_1 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_2 = sqrt((d / h));
double t_3 = fabs(t_0);
double tmp;
if (t_1 <= -4.0) {
tmp = (((((D * D) * -0.125) / l) * ((((M * M) / d) / d) * h)) * sqrt((d / l))) * t_2;
} else if (t_1 <= 1e-258) {
tmp = t_3;
} else if (t_1 <= 1e+183) {
tmp = t_2 / sqrt((l / d));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = fma(((((D / d) * M) * -0.5) / l), (((M / d) * h) * (0.25 * D)), 1.0) * t_0;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(d / sqrt(Float64(l * h))) t_1 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_2 = sqrt(Float64(d / h)) t_3 = abs(t_0) tmp = 0.0 if (t_1 <= -4.0) tmp = Float64(Float64(Float64(Float64(Float64(Float64(D * D) * -0.125) / l) * Float64(Float64(Float64(Float64(M * M) / d) / d) * h)) * sqrt(Float64(d / l))) * t_2); elseif (t_1 <= 1e-258) tmp = t_3; elseif (t_1 <= 1e+183) tmp = Float64(t_2 / sqrt(Float64(l / d))); elseif (t_1 <= Inf) tmp = t_3; else tmp = Float64(fma(Float64(Float64(Float64(Float64(D / d) * M) * -0.5) / l), Float64(Float64(Float64(M / d) * h) * Float64(0.25 * D)), 1.0) * t_0); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Abs[t$95$0], $MachinePrecision]}, If[LessEqual[t$95$1, -4.0], N[(N[(N[(N[(N[(N[(D * D), $MachinePrecision] * -0.125), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 1e-258], t$95$3, If[LessEqual[t$95$1, 1e+183], N[(t$95$2 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$3, N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_2 := \sqrt{\frac{d}{h}}\\
t_3 := \left|t\_0\right|\\
\mathbf{if}\;t\_1 \leq -4:\\
\;\;\;\;\left(\left(\frac{\left(D \cdot D\right) \cdot -0.125}{\ell} \cdot \left(\frac{\frac{M \cdot M}{d}}{d} \cdot h\right)\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-258}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 10^{+183}:\\
\;\;\;\;\frac{t\_2}{\sqrt{\frac{\ell}{d}}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\frac{D}{d} \cdot M\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \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)))) < -4Initial program 81.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.7%
Taylor expanded in d around 0
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6465.9
Applied rewrites65.9%
if -4 < (*.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.99999999999999954e-259 or 9.99999999999999947e182 < (*.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 59.3%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6452.9
Applied rewrites52.9%
Applied rewrites84.2%
if 9.99999999999999954e-259 < (*.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.99999999999999947e182Initial program 99.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites98.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)))) Initial program 0.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites0.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f643.7
Applied rewrites15.0%
Applied rewrites35.7%
Final simplification72.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ d (sqrt (* l h))))
(t_1
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_2 (sqrt (/ d h)))
(t_3 (fabs t_0)))
(if (<= t_1 -4e-25)
(*
(* (/ (* (* (* (/ (* (* M M) h) l) -0.125) D) D) (* d d)) (sqrt (/ d l)))
t_2)
(if (<= t_1 1e-258)
t_3
(if (<= t_1 1e+183)
(/ t_2 (sqrt (/ l d)))
(if (<= t_1 INFINITY)
t_3
(*
(fma (/ (* (* (/ D d) M) -0.5) l) (* (* (/ M d) h) (* 0.25 D)) 1.0)
t_0)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d / sqrt((l * h));
double t_1 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_2 = sqrt((d / h));
double t_3 = fabs(t_0);
double tmp;
if (t_1 <= -4e-25) {
tmp = ((((((((M * M) * h) / l) * -0.125) * D) * D) / (d * d)) * sqrt((d / l))) * t_2;
} else if (t_1 <= 1e-258) {
tmp = t_3;
} else if (t_1 <= 1e+183) {
tmp = t_2 / sqrt((l / d));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = fma(((((D / d) * M) * -0.5) / l), (((M / d) * h) * (0.25 * D)), 1.0) * t_0;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(d / sqrt(Float64(l * h))) t_1 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_2 = sqrt(Float64(d / h)) t_3 = abs(t_0) tmp = 0.0 if (t_1 <= -4e-25) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(M * M) * h) / l) * -0.125) * D) * D) / Float64(d * d)) * sqrt(Float64(d / l))) * t_2); elseif (t_1 <= 1e-258) tmp = t_3; elseif (t_1 <= 1e+183) tmp = Float64(t_2 / sqrt(Float64(l / d))); elseif (t_1 <= Inf) tmp = t_3; else tmp = Float64(fma(Float64(Float64(Float64(Float64(D / d) * M) * -0.5) / l), Float64(Float64(Float64(M / d) * h) * Float64(0.25 * D)), 1.0) * t_0); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Abs[t$95$0], $MachinePrecision]}, If[LessEqual[t$95$1, -4e-25], N[(N[(N[(N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision] * D), $MachinePrecision] * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 1e-258], t$95$3, If[LessEqual[t$95$1, 1e+183], N[(t$95$2 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$3, N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_2 := \sqrt{\frac{d}{h}}\\
t_3 := \left|t\_0\right|\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-25}:\\
\;\;\;\;\left(\frac{\left(\left(\frac{\left(M \cdot M\right) \cdot h}{\ell} \cdot -0.125\right) \cdot D\right) \cdot D}{d \cdot d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{-258}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 10^{+183}:\\
\;\;\;\;\frac{t\_2}{\sqrt{\frac{\ell}{d}}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\frac{D}{d} \cdot M\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \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)))) < -4.00000000000000015e-25Initial program 82.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.3%
Taylor expanded in d around 0
lower-/.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.8
Applied rewrites49.8%
Taylor expanded in d around 0
Applied rewrites52.9%
if -4.00000000000000015e-25 < (*.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.99999999999999954e-259 or 9.99999999999999947e182 < (*.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 57.2%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
Applied rewrites88.7%
if 9.99999999999999954e-259 < (*.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.99999999999999947e182Initial program 99.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites98.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)))) Initial program 0.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites0.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f643.7
Applied rewrites15.0%
Applied rewrites35.7%
Final simplification69.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_1 (/ d (sqrt (* l h)))))
(if (<= t_0 -2e+166)
(* (* (/ (* (* (* M M) h) -0.125) d) (/ (/ (* D D) l) d)) t_1)
(if (or (<= t_0 1e-258) (not (<= t_0 1e+183)))
(fabs t_1)
(/ (sqrt (/ d h)) (sqrt (/ l d)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_1 = d / sqrt((l * h));
double tmp;
if (t_0 <= -2e+166) {
tmp = (((((M * M) * h) * -0.125) / d) * (((D * D) / l) / d)) * t_1;
} else if ((t_0 <= 1e-258) || !(t_0 <= 1e+183)) {
tmp = fabs(t_1);
} else {
tmp = sqrt((d / h)) / sqrt((l / d));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
t_1 = d / sqrt((l * h))
if (t_0 <= (-2d+166)) then
tmp = (((((m * m) * h) * (-0.125d0)) / d) * (((d_1 * d_1) / l) / d)) * t_1
else if ((t_0 <= 1d-258) .or. (.not. (t_0 <= 1d+183))) then
tmp = abs(t_1)
else
tmp = sqrt((d / h)) / sqrt((l / d))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_1 = d / Math.sqrt((l * h));
double tmp;
if (t_0 <= -2e+166) {
tmp = (((((M * M) * h) * -0.125) / d) * (((D * D) / l) / d)) * t_1;
} else if ((t_0 <= 1e-258) || !(t_0 <= 1e+183)) {
tmp = Math.abs(t_1);
} else {
tmp = Math.sqrt((d / h)) / Math.sqrt((l / d));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) t_1 = d / math.sqrt((l * h)) tmp = 0 if t_0 <= -2e+166: tmp = (((((M * M) * h) * -0.125) / d) * (((D * D) / l) / d)) * t_1 elif (t_0 <= 1e-258) or not (t_0 <= 1e+183): tmp = math.fabs(t_1) else: tmp = math.sqrt((d / h)) / math.sqrt((l / d)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_1 = Float64(d / sqrt(Float64(l * h))) tmp = 0.0 if (t_0 <= -2e+166) tmp = Float64(Float64(Float64(Float64(Float64(Float64(M * M) * h) * -0.125) / d) * Float64(Float64(Float64(D * D) / l) / d)) * t_1); elseif ((t_0 <= 1e-258) || !(t_0 <= 1e+183)) tmp = abs(t_1); else tmp = Float64(sqrt(Float64(d / h)) / sqrt(Float64(l / d))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); t_1 = d / sqrt((l * h)); tmp = 0.0; if (t_0 <= -2e+166) tmp = (((((M * M) * h) * -0.125) / d) * (((D * D) / l) / d)) * t_1; elseif ((t_0 <= 1e-258) || ~((t_0 <= 1e+183))) tmp = abs(t_1); else tmp = sqrt((d / h)) / sqrt((l / d)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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]}, Block[{t$95$1 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+166], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * h), $MachinePrecision] * -0.125), $MachinePrecision] / d), $MachinePrecision] * N[(N[(N[(D * D), $MachinePrecision] / l), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[Or[LessEqual[t$95$0, 1e-258], N[Not[LessEqual[t$95$0, 1e+183]], $MachinePrecision]], N[Abs[t$95$1], $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+166}:\\
\;\;\;\;\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot -0.125}{d} \cdot \frac{\frac{D \cdot D}{\ell}}{d}\right) \cdot t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{-258} \lor \neg \left(t\_0 \leq 10^{+183}\right):\\
\;\;\;\;\left|t\_1\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.99999999999999988e166Initial program 80.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites81.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6465.1
Applied rewrites34.6%
Taylor expanded in d around 0
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6430.1
Applied rewrites30.1%
if -1.99999999999999988e166 < (*.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.99999999999999954e-259 or 9.99999999999999947e182 < (*.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 33.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
Applied rewrites52.0%
if 9.99999999999999954e-259 < (*.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.99999999999999947e182Initial program 99.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites98.0%
Final simplification59.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))))
(if (<= t_0 -2e-58)
(/ (* (- d) (sqrt (/ h l))) h)
(if (or (<= t_0 1e-258) (not (<= t_0 1e+183)))
(fabs (/ d (sqrt (* l h))))
(/ (sqrt (/ d h)) (sqrt (/ l d)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= -2e-58) {
tmp = (-d * sqrt((h / l))) / h;
} else if ((t_0 <= 1e-258) || !(t_0 <= 1e+183)) {
tmp = fabs((d / sqrt((l * h))));
} else {
tmp = sqrt((d / h)) / sqrt((l / d));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
if (t_0 <= (-2d-58)) then
tmp = (-d * sqrt((h / l))) / h
else if ((t_0 <= 1d-258) .or. (.not. (t_0 <= 1d+183))) then
tmp = abs((d / sqrt((l * h))))
else
tmp = sqrt((d / h)) / sqrt((l / d))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= -2e-58) {
tmp = (-d * Math.sqrt((h / l))) / h;
} else if ((t_0 <= 1e-258) || !(t_0 <= 1e+183)) {
tmp = Math.abs((d / Math.sqrt((l * h))));
} else {
tmp = Math.sqrt((d / h)) / Math.sqrt((l / d));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) tmp = 0 if t_0 <= -2e-58: tmp = (-d * math.sqrt((h / l))) / h elif (t_0 <= 1e-258) or not (t_0 <= 1e+183): tmp = math.fabs((d / math.sqrt((l * h)))) else: tmp = math.sqrt((d / h)) / math.sqrt((l / d)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) tmp = 0.0 if (t_0 <= -2e-58) tmp = Float64(Float64(Float64(-d) * sqrt(Float64(h / l))) / h); elseif ((t_0 <= 1e-258) || !(t_0 <= 1e+183)) tmp = abs(Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(sqrt(Float64(d / h)) / sqrt(Float64(l / d))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); tmp = 0.0; if (t_0 <= -2e-58) tmp = (-d * sqrt((h / l))) / h; elseif ((t_0 <= 1e-258) || ~((t_0 <= 1e+183))) tmp = abs((d / sqrt((l * h)))); else tmp = sqrt((d / h)) / sqrt((l / d)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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]}, If[LessEqual[t$95$0, -2e-58], N[(N[((-d) * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[Or[LessEqual[t$95$0, 1e-258], N[Not[LessEqual[t$95$0, 1e+183]], $MachinePrecision]], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{elif}\;t\_0 \leq 10^{-258} \lor \neg \left(t\_0 \leq 10^{+183}\right):\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.0000000000000001e-58Initial program 82.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites36.8%
Taylor expanded in l around -inf
Applied rewrites25.1%
if -2.0000000000000001e-58 < (*.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.99999999999999954e-259 or 9.99999999999999947e182 < (*.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 27.3%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6436.8
Applied rewrites36.8%
Applied rewrites56.6%
if 9.99999999999999954e-259 < (*.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.99999999999999947e182Initial program 99.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites98.0%
Final simplification59.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))))
(if (<= t_0 -2e-58)
(/ (* (- d) (sqrt (/ h l))) h)
(if (or (<= t_0 1e-258) (not (<= t_0 1e+183)))
(fabs (/ d (sqrt (* l h))))
(* (sqrt (/ d l)) (sqrt (/ d h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= -2e-58) {
tmp = (-d * sqrt((h / l))) / h;
} else if ((t_0 <= 1e-258) || !(t_0 <= 1e+183)) {
tmp = fabs((d / sqrt((l * h))));
} else {
tmp = sqrt((d / l)) * sqrt((d / h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
if (t_0 <= (-2d-58)) then
tmp = (-d * sqrt((h / l))) / h
else if ((t_0 <= 1d-258) .or. (.not. (t_0 <= 1d+183))) then
tmp = abs((d / sqrt((l * h))))
else
tmp = sqrt((d / l)) * sqrt((d / h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= -2e-58) {
tmp = (-d * Math.sqrt((h / l))) / h;
} else if ((t_0 <= 1e-258) || !(t_0 <= 1e+183)) {
tmp = Math.abs((d / Math.sqrt((l * h))));
} else {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) tmp = 0 if t_0 <= -2e-58: tmp = (-d * math.sqrt((h / l))) / h elif (t_0 <= 1e-258) or not (t_0 <= 1e+183): tmp = math.fabs((d / math.sqrt((l * h)))) else: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) tmp = 0.0 if (t_0 <= -2e-58) tmp = Float64(Float64(Float64(-d) * sqrt(Float64(h / l))) / h); elseif ((t_0 <= 1e-258) || !(t_0 <= 1e+183)) tmp = abs(Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); tmp = 0.0; if (t_0 <= -2e-58) tmp = (-d * sqrt((h / l))) / h; elseif ((t_0 <= 1e-258) || ~((t_0 <= 1e+183))) tmp = abs((d / sqrt((l * h)))); else tmp = sqrt((d / l)) * sqrt((d / h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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]}, If[LessEqual[t$95$0, -2e-58], N[(N[((-d) * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[Or[LessEqual[t$95$0, 1e-258], N[Not[LessEqual[t$95$0, 1e+183]], $MachinePrecision]], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{elif}\;t\_0 \leq 10^{-258} \lor \neg \left(t\_0 \leq 10^{+183}\right):\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.0000000000000001e-58Initial program 82.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites36.8%
Taylor expanded in l around -inf
Applied rewrites25.1%
if -2.0000000000000001e-58 < (*.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.99999999999999954e-259 or 9.99999999999999947e182 < (*.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 27.3%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6436.8
Applied rewrites36.8%
Applied rewrites56.6%
if 9.99999999999999954e-259 < (*.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.99999999999999947e182Initial program 99.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites98.0%
Final simplification59.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))))
(if (<= t_0 -2e-58)
(/ (* (- d) (sqrt (/ h l))) h)
(if (or (<= t_0 5e-160) (not (<= t_0 2e+119)))
(fabs (/ d (sqrt (* l h))))
(sqrt (* (/ d h) (/ d l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= -2e-58) {
tmp = (-d * sqrt((h / l))) / h;
} else if ((t_0 <= 5e-160) || !(t_0 <= 2e+119)) {
tmp = fabs((d / sqrt((l * h))));
} else {
tmp = sqrt(((d / h) * (d / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
if (t_0 <= (-2d-58)) then
tmp = (-d * sqrt((h / l))) / h
else if ((t_0 <= 5d-160) .or. (.not. (t_0 <= 2d+119))) then
tmp = abs((d / sqrt((l * h))))
else
tmp = sqrt(((d / h) * (d / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= -2e-58) {
tmp = (-d * Math.sqrt((h / l))) / h;
} else if ((t_0 <= 5e-160) || !(t_0 <= 2e+119)) {
tmp = Math.abs((d / Math.sqrt((l * h))));
} else {
tmp = Math.sqrt(((d / h) * (d / l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) tmp = 0 if t_0 <= -2e-58: tmp = (-d * math.sqrt((h / l))) / h elif (t_0 <= 5e-160) or not (t_0 <= 2e+119): tmp = math.fabs((d / math.sqrt((l * h)))) else: tmp = math.sqrt(((d / h) * (d / l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) tmp = 0.0 if (t_0 <= -2e-58) tmp = Float64(Float64(Float64(-d) * sqrt(Float64(h / l))) / h); elseif ((t_0 <= 5e-160) || !(t_0 <= 2e+119)) tmp = abs(Float64(d / sqrt(Float64(l * h)))); else tmp = sqrt(Float64(Float64(d / h) * Float64(d / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); tmp = 0.0; if (t_0 <= -2e-58) tmp = (-d * sqrt((h / l))) / h; elseif ((t_0 <= 5e-160) || ~((t_0 <= 2e+119))) tmp = abs((d / sqrt((l * h)))); else tmp = sqrt(((d / h) * (d / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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]}, If[LessEqual[t$95$0, -2e-58], N[(N[((-d) * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[Or[LessEqual[t$95$0, 5e-160], N[Not[LessEqual[t$95$0, 2e+119]], $MachinePrecision]], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-160} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+119}\right):\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2.0000000000000001e-58Initial program 82.5%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites36.8%
Taylor expanded in l around -inf
Applied rewrites25.1%
if -2.0000000000000001e-58 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.99999999999999994e-160 or 1.99999999999999989e119 < (*.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 38.7%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6438.3
Applied rewrites38.3%
Applied rewrites61.2%
if 4.99999999999999994e-160 < (*.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.99999999999999989e119Initial program 99.3%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6426.4
Applied rewrites26.4%
Applied rewrites38.6%
Applied rewrites96.8%
Final simplification57.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))))
(if (<= t_0 -4e-25)
(* (sqrt (/ (/ -1.0 (- h)) l)) d)
(if (or (<= t_0 5e-160) (not (<= t_0 2e+119)))
(fabs (/ d (sqrt (* l h))))
(sqrt (* (/ d h) (/ d l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= -4e-25) {
tmp = sqrt(((-1.0 / -h) / l)) * d;
} else if ((t_0 <= 5e-160) || !(t_0 <= 2e+119)) {
tmp = fabs((d / sqrt((l * h))));
} else {
tmp = sqrt(((d / h) * (d / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
if (t_0 <= (-4d-25)) then
tmp = sqrt((((-1.0d0) / -h) / l)) * d
else if ((t_0 <= 5d-160) .or. (.not. (t_0 <= 2d+119))) then
tmp = abs((d / sqrt((l * h))))
else
tmp = sqrt(((d / h) * (d / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= -4e-25) {
tmp = Math.sqrt(((-1.0 / -h) / l)) * d;
} else if ((t_0 <= 5e-160) || !(t_0 <= 2e+119)) {
tmp = Math.abs((d / Math.sqrt((l * h))));
} else {
tmp = Math.sqrt(((d / h) * (d / l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) tmp = 0 if t_0 <= -4e-25: tmp = math.sqrt(((-1.0 / -h) / l)) * d elif (t_0 <= 5e-160) or not (t_0 <= 2e+119): tmp = math.fabs((d / math.sqrt((l * h)))) else: tmp = math.sqrt(((d / h) * (d / l))) return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) tmp = 0.0 if (t_0 <= -4e-25) tmp = Float64(sqrt(Float64(Float64(-1.0 / Float64(-h)) / l)) * d); elseif ((t_0 <= 5e-160) || !(t_0 <= 2e+119)) tmp = abs(Float64(d / sqrt(Float64(l * h)))); else tmp = sqrt(Float64(Float64(d / h) * Float64(d / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); tmp = 0.0; if (t_0 <= -4e-25) tmp = sqrt(((-1.0 / -h) / l)) * d; elseif ((t_0 <= 5e-160) || ~((t_0 <= 2e+119))) tmp = abs((d / sqrt((l * h)))); else tmp = sqrt(((d / h) * (d / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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]}, If[LessEqual[t$95$0, -4e-25], N[(N[Sqrt[N[(N[(-1.0 / (-h)), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision], If[Or[LessEqual[t$95$0, 5e-160], N[Not[LessEqual[t$95$0, 2e+119]], $MachinePrecision]], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-25}:\\
\;\;\;\;\sqrt{\frac{\frac{-1}{-h}}{\ell}} \cdot d\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-160} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+119}\right):\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -4.00000000000000015e-25Initial program 82.0%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6414.0
Applied rewrites14.0%
Applied rewrites14.0%
if -4.00000000000000015e-25 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.99999999999999994e-160 or 1.99999999999999989e119 < (*.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 39.7%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6437.7
Applied rewrites37.7%
Applied rewrites60.3%
if 4.99999999999999994e-160 < (*.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.99999999999999989e119Initial program 99.3%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6426.4
Applied rewrites26.4%
Applied rewrites38.6%
Applied rewrites96.8%
Final simplification54.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h)))
(t_1
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))))
(if (<= t_1 -2000000.0)
(* (pow t_0 -1.0) d)
(if (or (<= t_1 5e-160) (not (<= t_1 2e+119)))
(fabs (/ d t_0))
(sqrt (* (/ d h) (/ d l)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double t_1 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_1 <= -2000000.0) {
tmp = pow(t_0, -1.0) * d;
} else if ((t_1 <= 5e-160) || !(t_1 <= 2e+119)) {
tmp = fabs((d / t_0));
} else {
tmp = sqrt(((d / h) * (d / l)));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((l * h))
t_1 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
if (t_1 <= (-2000000.0d0)) then
tmp = (t_0 ** (-1.0d0)) * d
else if ((t_1 <= 5d-160) .or. (.not. (t_1 <= 2d+119))) then
tmp = abs((d / t_0))
else
tmp = sqrt(((d / h) * (d / l)))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((l * h));
double t_1 = (Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_1 <= -2000000.0) {
tmp = Math.pow(t_0, -1.0) * d;
} else if ((t_1 <= 5e-160) || !(t_1 <= 2e+119)) {
tmp = Math.abs((d / t_0));
} else {
tmp = Math.sqrt(((d / h) * (d / l)));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((l * h)) t_1 = (math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) tmp = 0 if t_1 <= -2000000.0: tmp = math.pow(t_0, -1.0) * d elif (t_1 <= 5e-160) or not (t_1 <= 2e+119): tmp = math.fabs((d / t_0)) else: tmp = math.sqrt(((d / h) * (d / l))) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) t_1 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) tmp = 0.0 if (t_1 <= -2000000.0) tmp = Float64((t_0 ^ -1.0) * d); elseif ((t_1 <= 5e-160) || !(t_1 <= 2e+119)) tmp = abs(Float64(d / t_0)); else tmp = sqrt(Float64(Float64(d / h) * Float64(d / l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((l * h)); t_1 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); tmp = 0.0; if (t_1 <= -2000000.0) tmp = (t_0 ^ -1.0) * d; elseif ((t_1 <= 5e-160) || ~((t_1 <= 2e+119))) tmp = abs((d / t_0)); else tmp = sqrt(((d / h) * (d / l))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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]}, If[LessEqual[t$95$1, -2000000.0], N[(N[Power[t$95$0, -1.0], $MachinePrecision] * d), $MachinePrecision], If[Or[LessEqual[t$95$1, 5e-160], N[Not[LessEqual[t$95$1, 2e+119]], $MachinePrecision]], N[Abs[N[(d / t$95$0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(d / h), $MachinePrecision] * N[(d / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_1 \leq -2000000:\\
\;\;\;\;{t\_0}^{-1} \cdot d\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-160} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+119}\right):\\
\;\;\;\;\left|\frac{d}{t\_0}\right|\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2e6Initial program 81.1%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6414.6
Applied rewrites14.6%
Applied rewrites14.6%
if -2e6 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.99999999999999994e-160 or 1.99999999999999989e119 < (*.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 41.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6436.7
Applied rewrites36.7%
Applied rewrites58.6%
if 4.99999999999999994e-160 < (*.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.99999999999999989e119Initial program 99.3%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6426.4
Applied rewrites26.4%
Applied rewrites38.6%
Applied rewrites96.8%
Final simplification54.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (* l h))))
(if (<=
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))
-2000000.0)
(* (pow t_0 -1.0) d)
(fabs (/ d t_0)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((l * h));
double tmp;
if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -2000000.0) {
tmp = pow(t_0, -1.0) * d;
} else {
tmp = fabs((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((l * h))
if (((((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= (-2000000.0d0)) then
tmp = (t_0 ** (-1.0d0)) * d
else
tmp = abs((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((l * h));
double tmp;
if (((Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -2000000.0) {
tmp = Math.pow(t_0, -1.0) * d;
} else {
tmp = Math.abs((d / t_0));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((l * h)) tmp = 0 if ((math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -2000000.0: tmp = math.pow(t_0, -1.0) * d else: tmp = math.fabs((d / t_0)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(l * h)) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= -2000000.0) tmp = Float64((t_0 ^ -1.0) * d); else tmp = abs(Float64(d / t_0)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((l * h)); tmp = 0.0; if (((((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= -2000000.0) tmp = (t_0 ^ -1.0) * d; else tmp = abs((d / t_0)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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], -2000000.0], N[(N[Power[t$95$0, -1.0], $MachinePrecision] * d), $MachinePrecision], N[Abs[N[(d / t$95$0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\ell \cdot h}\\
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -2000000:\\
\;\;\;\;{t\_0}^{-1} \cdot d\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{t\_0}\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)))) < -2e6Initial program 81.1%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6414.6
Applied rewrites14.6%
Applied rewrites14.6%
if -2e6 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 58.0%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6433.7
Applied rewrites33.7%
Applied rewrites59.1%
Final simplification46.8%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(- 1.0 (* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))
-2000000.0)
(* (sqrt (pow (* l h) -1.0)) d)
(fabs (/ d (sqrt (* l h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -2000000.0) {
tmp = sqrt(pow((l * h), -1.0)) * d;
} else {
tmp = fabs((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 / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= (-2000000.0d0)) then
tmp = sqrt(((l * h) ** (-1.0d0))) * d
else
tmp = abs((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 (((Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -2000000.0) {
tmp = Math.sqrt(Math.pow((l * h), -1.0)) * d;
} else {
tmp = Math.abs((d / Math.sqrt((l * h))));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if ((math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -2000000.0: tmp = math.sqrt(math.pow((l * h), -1.0)) * d else: tmp = math.fabs((d / math.sqrt((l * h)))) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= -2000000.0) tmp = Float64(sqrt((Float64(l * h) ^ -1.0)) * d); else tmp = abs(Float64(d / sqrt(Float64(l * h)))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (((((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= -2000000.0) tmp = sqrt(((l * h) ^ -1.0)) * d; else tmp = abs((d / sqrt((l * h)))); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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], -2000000.0], N[(N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -2000000:\\
\;\;\;\;\sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\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)))) < -2e6Initial program 81.1%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6414.6
Applied rewrites14.6%
if -2e6 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 58.0%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6433.7
Applied rewrites33.7%
Applied rewrites59.1%
Final simplification46.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ d (sqrt (* l h)))))
(if (<=
(*
(* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
(-
1.0
(* (* (pow 2.0 -1.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))
-2000000.0)
t_0
(fabs t_0))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d / sqrt((l * h));
double tmp;
if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -2000000.0) {
tmp = t_0;
} else {
tmp = fabs(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 = d / sqrt((l * h))
if (((((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= (-2000000.0d0)) then
tmp = t_0
else
tmp = abs(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 = d / Math.sqrt((l * h));
double tmp;
if (((Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -2000000.0) {
tmp = t_0;
} else {
tmp = Math.abs(t_0);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = d / math.sqrt((l * h)) tmp = 0 if ((math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))) <= -2000000.0: tmp = t_0 else: tmp = math.fabs(t_0) return tmp
function code(d, h, l, M, D) t_0 = Float64(d / sqrt(Float64(l * h))) tmp = 0.0 if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= -2000000.0) tmp = t_0; else tmp = abs(t_0); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = d / sqrt((l * h)); tmp = 0.0; if (((((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= -2000000.0) tmp = t_0; else tmp = abs(t_0); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.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], -2000000.0], t$95$0, N[Abs[t$95$0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -2000000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|t\_0\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)))) < -2e6Initial program 81.1%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6414.6
Applied rewrites14.6%
Applied rewrites14.6%
if -2e6 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 58.0%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6433.7
Applied rewrites33.7%
Applied rewrites59.1%
Final simplification46.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ D d) M))
(t_1
(-
1.0
(*
(/ (* t_0 0.5) l)
(/ (* (* 0.5 (* D 0.5)) (/ M d)) (pow h -1.0))))))
(if (<= l -2e+98)
(* (* (pow (sqrt (/ h d)) -1.0) (/ (sqrt (- d)) (sqrt (- l)))) t_1)
(if (<= l -5e-310)
(* (* (- d) (sqrt (pow (* l h) -1.0))) t_1)
(if (<= l 3.7e+40)
(*
(fma (* (/ (* t_0 -0.5) l) (* (/ M d) (* 0.25 D))) h 1.0)
(/ d (sqrt (* l h))))
(/
(/
(* (fma (* -0.5 (/ h l)) (* (pow (/ (/ d D) M) -2.0) 0.25) 1.0) d)
(sqrt l))
(sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (D / d) * M;
double t_1 = 1.0 - (((t_0 * 0.5) / l) * (((0.5 * (D * 0.5)) * (M / d)) / pow(h, -1.0)));
double tmp;
if (l <= -2e+98) {
tmp = (pow(sqrt((h / d)), -1.0) * (sqrt(-d) / sqrt(-l))) * t_1;
} else if (l <= -5e-310) {
tmp = (-d * sqrt(pow((l * h), -1.0))) * t_1;
} else if (l <= 3.7e+40) {
tmp = fma((((t_0 * -0.5) / l) * ((M / d) * (0.25 * D))), h, 1.0) * (d / sqrt((l * h)));
} else {
tmp = ((fma((-0.5 * (h / l)), (pow(((d / D) / M), -2.0) * 0.25), 1.0) * d) / sqrt(l)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(D / d) * M) t_1 = Float64(1.0 - Float64(Float64(Float64(t_0 * 0.5) / l) * Float64(Float64(Float64(0.5 * Float64(D * 0.5)) * Float64(M / d)) / (h ^ -1.0)))) tmp = 0.0 if (l <= -2e+98) tmp = Float64(Float64((sqrt(Float64(h / d)) ^ -1.0) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * t_1); elseif (l <= -5e-310) tmp = Float64(Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))) * t_1); elseif (l <= 3.7e+40) tmp = Float64(fma(Float64(Float64(Float64(t_0 * -0.5) / l) * Float64(Float64(M / d) * Float64(0.25 * D))), h, 1.0) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), Float64((Float64(Float64(d / D) / M) ^ -2.0) * 0.25), 1.0) * d) / sqrt(l)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[(N[(t$95$0 * 0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(0.5 * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2e+98], N[(N[(N[Power[N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[l, 3.7e+40], N[(N[(N[(N[(N[(t$95$0 * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision], -2.0], $MachinePrecision] * 0.25), $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{D}{d} \cdot M\\
t_1 := 1 - \frac{t\_0 \cdot 0.5}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\\
\mathbf{if}\;\ell \leq -2 \cdot 10^{+98}:\\
\;\;\;\;\left({\left(\sqrt{\frac{h}{d}}\right)}^{-1} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_1\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot t\_1\\
\mathbf{elif}\;\ell \leq 3.7 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_0 \cdot -0.5}{\ell} \cdot \left(\frac{M}{d} \cdot \left(0.25 \cdot D\right)\right), h, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot 0.25, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -2e98Initial program 56.6%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites58.6%
lift-/.f64N/A
metadata-eval58.6
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6458.3
Applied rewrites58.3%
lift-/.f64N/A
metadata-eval58.3
lift-pow.f64N/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
pow1/2N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6467.8
Applied rewrites67.8%
if -2e98 < l < -4.999999999999985e-310Initial program 71.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
Applied rewrites78.6%
lift-/.f64N/A
metadata-eval78.6
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6478.5
Applied rewrites78.5%
Taylor expanded in d around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.3
Applied rewrites93.3%
if -4.999999999999985e-310 < l < 3.7e40Initial program 65.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.3
Applied rewrites76.7%
Applied rewrites90.4%
if 3.7e40 < l Initial program 60.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.6
Applied rewrites50.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites81.9%
Final simplification84.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* -0.5 (/ h l))) (t_1 (* (/ D d) M)))
(if (<= l -4.3e+105)
(/
(*
(* (fma t_0 (pow (* (/ 2.0 M) (/ d D)) -2.0) 1.0) (sqrt (/ d h)))
(sqrt (- d)))
(sqrt (- l)))
(if (<= l -5e-310)
(*
(* (- d) (sqrt (pow (* l h) -1.0)))
(-
1.0
(* (/ (* t_1 0.5) l) (/ (* (* 0.5 (* D 0.5)) (/ M d)) (pow h -1.0)))))
(if (<= l 3.7e+40)
(*
(fma (* (/ (* t_1 -0.5) l) (* (/ M d) (* 0.25 D))) h 1.0)
(/ d (sqrt (* l h))))
(/
(/ (* (fma t_0 (* (pow (/ (/ d D) M) -2.0) 0.25) 1.0) d) (sqrt l))
(sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = -0.5 * (h / l);
double t_1 = (D / d) * M;
double tmp;
if (l <= -4.3e+105) {
tmp = ((fma(t_0, pow(((2.0 / M) * (d / D)), -2.0), 1.0) * sqrt((d / h))) * sqrt(-d)) / sqrt(-l);
} else if (l <= -5e-310) {
tmp = (-d * sqrt(pow((l * h), -1.0))) * (1.0 - (((t_1 * 0.5) / l) * (((0.5 * (D * 0.5)) * (M / d)) / pow(h, -1.0))));
} else if (l <= 3.7e+40) {
tmp = fma((((t_1 * -0.5) / l) * ((M / d) * (0.25 * D))), h, 1.0) * (d / sqrt((l * h)));
} else {
tmp = ((fma(t_0, (pow(((d / D) / M), -2.0) * 0.25), 1.0) * d) / sqrt(l)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(-0.5 * Float64(h / l)) t_1 = Float64(Float64(D / d) * M) tmp = 0.0 if (l <= -4.3e+105) tmp = Float64(Float64(Float64(fma(t_0, (Float64(Float64(2.0 / M) * Float64(d / D)) ^ -2.0), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(-d))) / sqrt(Float64(-l))); elseif (l <= -5e-310) tmp = Float64(Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))) * Float64(1.0 - Float64(Float64(Float64(t_1 * 0.5) / l) * Float64(Float64(Float64(0.5 * Float64(D * 0.5)) * Float64(M / d)) / (h ^ -1.0))))); elseif (l <= 3.7e+40) tmp = Float64(fma(Float64(Float64(Float64(t_1 * -0.5) / l) * Float64(Float64(M / d) * Float64(0.25 * D))), h, 1.0) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(Float64(Float64(fma(t_0, Float64((Float64(Float64(d / D) / M) ^ -2.0) * 0.25), 1.0) * d) / sqrt(l)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision]}, If[LessEqual[l, -4.3e+105], N[(N[(N[(N[(t$95$0 * N[Power[N[(N[(2.0 / M), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(t$95$1 * 0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(0.5 * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.7e+40], N[(N[(N[(N[(N[(t$95$1 * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$0 * N[(N[Power[N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision], -2.0], $MachinePrecision] * 0.25), $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 \cdot \frac{h}{\ell}\\
t_1 := \frac{D}{d} \cdot M\\
\mathbf{if}\;\ell \leq -4.3 \cdot 10^{+105}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(t\_0, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{-d}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot \left(1 - \frac{t\_1 \cdot 0.5}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right)\\
\mathbf{elif}\;\ell \leq 3.7 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_1 \cdot -0.5}{\ell} \cdot \left(\frac{M}{d} \cdot \left(0.25 \cdot D\right)\right), h, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(t\_0, {\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot 0.25, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -4.3000000000000002e105Initial program 56.8%
Applied rewrites68.3%
if -4.3000000000000002e105 < l < -4.999999999999985e-310Initial program 71.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites77.9%
lift-/.f64N/A
metadata-eval77.9
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6477.8
Applied rewrites77.8%
Taylor expanded in d around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6492.2
Applied rewrites92.2%
if -4.999999999999985e-310 < l < 3.7e40Initial program 65.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.3
Applied rewrites76.7%
Applied rewrites90.4%
if 3.7e40 < l Initial program 60.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.6
Applied rewrites50.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites81.9%
Final simplification84.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ (* M D) d) 0.5)) (t_1 (* (/ D d) M)))
(if (<= h -9.2e+131)
(*
(* (fma t_0 (* t_0 (* (/ h l) -0.5)) 1.0) (sqrt (/ d l)))
(/ (sqrt (- d)) (sqrt (- h))))
(if (<= h -5e-310)
(*
(* (- d) (sqrt (pow (* l h) -1.0)))
(-
1.0
(* (/ (* t_1 0.5) l) (/ (* (* 0.5 (* D 0.5)) (/ M d)) (pow h -1.0)))))
(if (<= h 3.4e+150)
(*
(fma (/ (* t_1 -0.5) l) (* (* (/ M d) h) (* 0.25 D)) 1.0)
(/ d (sqrt (* l h))))
(/
(/
(* (fma (* -0.5 (/ h l)) (* (pow (/ (/ d D) M) -2.0) 0.25) 1.0) d)
(sqrt l))
(sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * D) / d) * 0.5;
double t_1 = (D / d) * M;
double tmp;
if (h <= -9.2e+131) {
tmp = (fma(t_0, (t_0 * ((h / l) * -0.5)), 1.0) * sqrt((d / l))) * (sqrt(-d) / sqrt(-h));
} else if (h <= -5e-310) {
tmp = (-d * sqrt(pow((l * h), -1.0))) * (1.0 - (((t_1 * 0.5) / l) * (((0.5 * (D * 0.5)) * (M / d)) / pow(h, -1.0))));
} else if (h <= 3.4e+150) {
tmp = fma(((t_1 * -0.5) / l), (((M / d) * h) * (0.25 * D)), 1.0) * (d / sqrt((l * h)));
} else {
tmp = ((fma((-0.5 * (h / l)), (pow(((d / D) / M), -2.0) * 0.25), 1.0) * d) / sqrt(l)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(M * D) / d) * 0.5) t_1 = Float64(Float64(D / d) * M) tmp = 0.0 if (h <= -9.2e+131) tmp = Float64(Float64(fma(t_0, Float64(t_0 * Float64(Float64(h / l) * -0.5)), 1.0) * sqrt(Float64(d / l))) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h)))); elseif (h <= -5e-310) tmp = Float64(Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))) * Float64(1.0 - Float64(Float64(Float64(t_1 * 0.5) / l) * Float64(Float64(Float64(0.5 * Float64(D * 0.5)) * Float64(M / d)) / (h ^ -1.0))))); elseif (h <= 3.4e+150) tmp = Float64(fma(Float64(Float64(t_1 * -0.5) / l), Float64(Float64(Float64(M / d) * h) * Float64(0.25 * D)), 1.0) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), Float64((Float64(Float64(d / D) / M) ^ -2.0) * 0.25), 1.0) * d) / sqrt(l)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision]}, If[LessEqual[h, -9.2e+131], N[(N[(N[(t$95$0 * N[(t$95$0 * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(t$95$1 * 0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(0.5 * N[(D * 0.5), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 3.4e+150], N[(N[(N[(N[(t$95$1 * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision], -2.0], $MachinePrecision] * 0.25), $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d} \cdot 0.5\\
t_1 := \frac{D}{d} \cdot M\\
\mathbf{if}\;h \leq -9.2 \cdot 10^{+131}:\\
\;\;\;\;\left(\mathsf{fma}\left(t\_0, t\_0 \cdot \left(\frac{h}{\ell} \cdot -0.5\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\right) \cdot \left(1 - \frac{t\_1 \cdot 0.5}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right)\\
\mathbf{elif}\;h \leq 3.4 \cdot 10^{+150}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_1 \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot 0.25, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -9.19999999999999966e131Initial program 63.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
lift-fma.f64N/A
*-commutativeN/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites65.3%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6480.5
Applied rewrites80.5%
if -9.19999999999999966e131 < h < -4.999999999999985e-310Initial program 66.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
Applied rewrites74.1%
lift-/.f64N/A
metadata-eval74.1
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6474.0
Applied rewrites74.0%
Taylor expanded in d around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6485.2
Applied rewrites85.2%
if -4.999999999999985e-310 < h < 3.39999999999999983e150Initial program 66.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6451.9
Applied rewrites79.5%
Applied rewrites86.1%
if 3.39999999999999983e150 < h Initial program 57.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites54.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6434.0
Applied rewrites31.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites75.2%
Final simplification83.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ (* M D) d) 0.5)))
(if (<= l -5e-310)
(*
(* (fma t_0 (* t_0 (* (/ h l) -0.5)) 1.0) (sqrt (/ d l)))
(/ (sqrt (- d)) (sqrt (- h))))
(if (<= l 3.7e+40)
(*
(fma (* (/ (* (* (/ D d) M) -0.5) l) (* (/ M d) (* 0.25 D))) h 1.0)
(/ d (sqrt (* l h))))
(/
(/
(* (fma (* -0.5 (/ h l)) (* (pow (/ (/ d D) M) -2.0) 0.25) 1.0) d)
(sqrt l))
(sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * D) / d) * 0.5;
double tmp;
if (l <= -5e-310) {
tmp = (fma(t_0, (t_0 * ((h / l) * -0.5)), 1.0) * sqrt((d / l))) * (sqrt(-d) / sqrt(-h));
} else if (l <= 3.7e+40) {
tmp = fma((((((D / d) * M) * -0.5) / l) * ((M / d) * (0.25 * D))), h, 1.0) * (d / sqrt((l * h)));
} else {
tmp = ((fma((-0.5 * (h / l)), (pow(((d / D) / M), -2.0) * 0.25), 1.0) * d) / sqrt(l)) / sqrt(h);
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(M * D) / d) * 0.5) tmp = 0.0 if (l <= -5e-310) tmp = Float64(Float64(fma(t_0, Float64(t_0 * Float64(Float64(h / l) * -0.5)), 1.0) * sqrt(Float64(d / l))) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h)))); elseif (l <= 3.7e+40) tmp = Float64(fma(Float64(Float64(Float64(Float64(Float64(D / d) * M) * -0.5) / l) * Float64(Float64(M / d) * Float64(0.25 * D))), h, 1.0) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), Float64((Float64(Float64(d / D) / M) ^ -2.0) * 0.25), 1.0) * d) / sqrt(l)) / sqrt(h)); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(N[(N[(t$95$0 * N[(t$95$0 * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.7e+40], N[(N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision], -2.0], $MachinePrecision] * 0.25), $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d} \cdot 0.5\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\mathsf{fma}\left(t\_0, t\_0 \cdot \left(\frac{h}{\ell} \cdot -0.5\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq 3.7 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\frac{D}{d} \cdot M\right) \cdot -0.5}{\ell} \cdot \left(\frac{M}{d} \cdot \left(0.25 \cdot D\right)\right), h, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot 0.25, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{h}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 65.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.2%
lift-fma.f64N/A
*-commutativeN/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites68.3%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6476.9
Applied rewrites76.9%
if -4.999999999999985e-310 < l < 3.7e40Initial program 65.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.3
Applied rewrites76.7%
Applied rewrites90.4%
if 3.7e40 < l Initial program 60.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.6
Applied rewrites50.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites81.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ h l) -0.5)) (t_1 (* (/ (* M D) d) 0.5)))
(if (<= l -5e-310)
(*
(* (fma t_1 (* t_1 t_0) 1.0) (sqrt (/ d l)))
(/ (sqrt (- d)) (sqrt (- h))))
(if (<= l 4e+116)
(*
(fma (/ (* (* (/ D d) M) -0.5) l) (* (* (/ M d) h) (* 0.25 D)) 1.0)
(/ d (sqrt (* l h))))
(*
(fma (* 0.25 (pow (/ (/ d D) M) -2.0)) t_0 1.0)
(/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = (h / l) * -0.5;
double t_1 = ((M * D) / d) * 0.5;
double tmp;
if (l <= -5e-310) {
tmp = (fma(t_1, (t_1 * t_0), 1.0) * sqrt((d / l))) * (sqrt(-d) / sqrt(-h));
} else if (l <= 4e+116) {
tmp = fma(((((D / d) * M) * -0.5) / l), (((M / d) * h) * (0.25 * D)), 1.0) * (d / sqrt((l * h)));
} else {
tmp = fma((0.25 * pow(((d / D) / M), -2.0)), t_0, 1.0) * (d / (sqrt(l) * sqrt(h)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(h / l) * -0.5) t_1 = Float64(Float64(Float64(M * D) / d) * 0.5) tmp = 0.0 if (l <= -5e-310) tmp = Float64(Float64(fma(t_1, Float64(t_1 * t_0), 1.0) * sqrt(Float64(d / l))) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h)))); elseif (l <= 4e+116) tmp = Float64(fma(Float64(Float64(Float64(Float64(D / d) * M) * -0.5) / l), Float64(Float64(Float64(M / d) * h) * Float64(0.25 * D)), 1.0) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(fma(Float64(0.25 * (Float64(Float64(d / D) / M) ^ -2.0)), t_0, 1.0) * Float64(d / Float64(sqrt(l) * sqrt(h)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(N[(N[(t$95$1 * N[(t$95$1 * t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4e+116], N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.25 * N[Power[N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{h}{\ell} \cdot -0.5\\
t_1 := \frac{M \cdot D}{d} \cdot 0.5\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\mathsf{fma}\left(t\_1, t\_1 \cdot t\_0, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq 4 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\frac{D}{d} \cdot M\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.25 \cdot {\left(\frac{\frac{d}{D}}{M}\right)}^{-2}, t\_0, 1\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 65.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.2%
lift-fma.f64N/A
*-commutativeN/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites68.3%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6476.9
Applied rewrites76.9%
if -4.999999999999985e-310 < l < 4.00000000000000006e116Initial program 64.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.2
Applied rewrites73.6%
Applied rewrites85.8%
if 4.00000000000000006e116 < l Initial program 62.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.9
Applied rewrites45.4%
lift-sqrt.f64N/A
pow1/2N/A
lift-*.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
pow1/2N/A
lower-sqrt.f6482.8
Applied rewrites82.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (/ (* M D) d) 0.5))
(t_1 (fma t_0 (* t_0 (* (/ h l) -0.5)) 1.0)))
(if (<= l -5e-310)
(* (* t_1 (sqrt (/ d l))) (/ (sqrt (- d)) (sqrt (- h))))
(if (<= l 4.2e+116)
(*
(fma (/ (* (* (/ D d) M) -0.5) l) (* (* (/ M d) h) (* 0.25 D)) 1.0)
(/ d (sqrt (* l h))))
(* (* t_1 (/ (sqrt d) (sqrt l))) (sqrt (/ d h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((M * D) / d) * 0.5;
double t_1 = fma(t_0, (t_0 * ((h / l) * -0.5)), 1.0);
double tmp;
if (l <= -5e-310) {
tmp = (t_1 * sqrt((d / l))) * (sqrt(-d) / sqrt(-h));
} else if (l <= 4.2e+116) {
tmp = fma(((((D / d) * M) * -0.5) / l), (((M / d) * h) * (0.25 * D)), 1.0) * (d / sqrt((l * h)));
} else {
tmp = (t_1 * (sqrt(d) / sqrt(l))) * sqrt((d / h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(M * D) / d) * 0.5) t_1 = fma(t_0, Float64(t_0 * Float64(Float64(h / l) * -0.5)), 1.0) tmp = 0.0 if (l <= -5e-310) tmp = Float64(Float64(t_1 * sqrt(Float64(d / l))) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h)))); elseif (l <= 4.2e+116) tmp = Float64(fma(Float64(Float64(Float64(Float64(D / d) * M) * -0.5) / l), Float64(Float64(Float64(M / d) * h) * Float64(0.25 * D)), 1.0) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(Float64(t_1 * Float64(sqrt(d) / sqrt(l))) * sqrt(Float64(d / h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(t$95$0 * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(N[(t$95$1 * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 4.2e+116], N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{d} \cdot 0.5\\
t_1 := \mathsf{fma}\left(t\_0, t\_0 \cdot \left(\frac{h}{\ell} \cdot -0.5\right), 1\right)\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(t\_1 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq 4.2 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\frac{D}{d} \cdot M\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 65.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.2%
lift-fma.f64N/A
*-commutativeN/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites68.3%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6476.9
Applied rewrites76.9%
if -4.999999999999985e-310 < l < 4.2000000000000002e116Initial program 64.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.2
Applied rewrites73.6%
Applied rewrites85.8%
if 4.2000000000000002e116 < l Initial program 62.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.4%
lift-fma.f64N/A
*-commutativeN/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
clear-numN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites62.4%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6473.4
Applied rewrites73.4%
(FPCore (d h l M D) :precision binary64 (if (<= h 3e-307) (* (- d) (sqrt (pow (* l h) -1.0))) (/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 3e-307) {
tmp = -d * sqrt(pow((l * h), -1.0));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (h <= 3d-307) then
tmp = -d * sqrt(((l * h) ** (-1.0d0)))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= 3e-307) {
tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= 3e-307: tmp = -d * math.sqrt(math.pow((l * h), -1.0)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= 3e-307) tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (h <= 3e-307) tmp = -d * sqrt(((l * h) ^ -1.0)); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, 3e-307], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq 3 \cdot 10^{-307}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < 2.9999999999999999e-307Initial program 65.7%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6441.4
Applied rewrites41.4%
if 2.9999999999999999e-307 < h Initial program 63.2%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6446.0
Applied rewrites46.0%
Applied rewrites46.0%
Applied rewrites57.4%
Final simplification49.5%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ d (sqrt (* l h)))))
(if (<= l -1.12e-122)
(fabs t_0)
(if (<= l -5e-310)
(/ (* (- d) (sqrt (/ h l))) h)
(if (<= l 4.8e+116)
(*
(fma (/ (* (* (/ D d) M) -0.5) l) (* (* (/ M d) h) (* 0.25 D)) 1.0)
t_0)
(/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d / sqrt((l * h));
double tmp;
if (l <= -1.12e-122) {
tmp = fabs(t_0);
} else if (l <= -5e-310) {
tmp = (-d * sqrt((h / l))) / h;
} else if (l <= 4.8e+116) {
tmp = fma(((((D / d) * M) * -0.5) / l), (((M / d) * h) * (0.25 * D)), 1.0) * t_0;
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(d / sqrt(Float64(l * h))) tmp = 0.0 if (l <= -1.12e-122) tmp = abs(t_0); elseif (l <= -5e-310) tmp = Float64(Float64(Float64(-d) * sqrt(Float64(h / l))) / h); elseif (l <= 4.8e+116) tmp = Float64(fma(Float64(Float64(Float64(Float64(D / d) * M) * -0.5) / l), Float64(Float64(Float64(M / d) * h) * Float64(0.25 * D)), 1.0) * t_0); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.12e-122], N[Abs[t$95$0], $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[((-d) * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[l, 4.8e+116], N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M / d), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;\ell \leq -1.12 \cdot 10^{-122}:\\
\;\;\;\;\left|t\_0\right|\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{elif}\;\ell \leq 4.8 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\frac{D}{d} \cdot M\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.12e-122Initial program 66.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f646.8
Applied rewrites6.8%
Applied rewrites48.0%
if -1.12e-122 < l < -4.999999999999985e-310Initial program 62.2%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites25.7%
Taylor expanded in l around -inf
Applied rewrites62.1%
if -4.999999999999985e-310 < l < 4.8000000000000001e116Initial program 64.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.2
Applied rewrites73.6%
Applied rewrites85.8%
if 4.8000000000000001e116 < l Initial program 62.3%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Applied rewrites40.9%
Applied rewrites67.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ d (sqrt (* l h)))))
(if (<= l -1.12e-122)
(fabs t_0)
(if (<= l -5e-310)
(/ (* (- d) (sqrt (/ h l))) h)
(if (<= l 4.8e+116)
(*
(fma (* (/ (* (* (/ D d) M) -0.5) l) (* (/ M d) (* 0.25 D))) h 1.0)
t_0)
(/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d / sqrt((l * h));
double tmp;
if (l <= -1.12e-122) {
tmp = fabs(t_0);
} else if (l <= -5e-310) {
tmp = (-d * sqrt((h / l))) / h;
} else if (l <= 4.8e+116) {
tmp = fma((((((D / d) * M) * -0.5) / l) * ((M / d) * (0.25 * D))), h, 1.0) * t_0;
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(d / sqrt(Float64(l * h))) tmp = 0.0 if (l <= -1.12e-122) tmp = abs(t_0); elseif (l <= -5e-310) tmp = Float64(Float64(Float64(-d) * sqrt(Float64(h / l))) / h); elseif (l <= 4.8e+116) tmp = Float64(fma(Float64(Float64(Float64(Float64(Float64(D / d) * M) * -0.5) / l) * Float64(Float64(M / d) * Float64(0.25 * D))), h, 1.0) * t_0); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.12e-122], N[Abs[t$95$0], $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[((-d) * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[l, 4.8e+116], N[(N[(N[(N[(N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;\ell \leq -1.12 \cdot 10^{-122}:\\
\;\;\;\;\left|t\_0\right|\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{elif}\;\ell \leq 4.8 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(\frac{D}{d} \cdot M\right) \cdot -0.5}{\ell} \cdot \left(\frac{M}{d} \cdot \left(0.25 \cdot D\right)\right), h, 1\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.12e-122Initial program 66.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f646.8
Applied rewrites6.8%
Applied rewrites48.0%
if -1.12e-122 < l < -4.999999999999985e-310Initial program 62.2%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites25.7%
Taylor expanded in l around -inf
Applied rewrites62.1%
if -4.999999999999985e-310 < l < 4.8000000000000001e116Initial program 64.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.2
Applied rewrites73.6%
Applied rewrites85.8%
if 4.8000000000000001e116 < l Initial program 62.3%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Applied rewrites40.9%
Applied rewrites67.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ d (sqrt (* l h)))))
(if (<= l -1.12e-122)
(fabs t_0)
(if (<= l -5e-310)
(/ (* (- d) (sqrt (/ h l))) h)
(if (<= l 1.55e+39)
(* (/ (fma (/ (* (* (* M M) h) -0.125) d) (/ (* D D) d) l) l) t_0)
(/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = d / sqrt((l * h));
double tmp;
if (l <= -1.12e-122) {
tmp = fabs(t_0);
} else if (l <= -5e-310) {
tmp = (-d * sqrt((h / l))) / h;
} else if (l <= 1.55e+39) {
tmp = (fma(((((M * M) * h) * -0.125) / d), ((D * D) / d), l) / l) * t_0;
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(d / sqrt(Float64(l * h))) tmp = 0.0 if (l <= -1.12e-122) tmp = abs(t_0); elseif (l <= -5e-310) tmp = Float64(Float64(Float64(-d) * sqrt(Float64(h / l))) / h); elseif (l <= 1.55e+39) tmp = Float64(Float64(fma(Float64(Float64(Float64(Float64(M * M) * h) * -0.125) / d), Float64(Float64(D * D) / d), l) / l) * t_0); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.12e-122], N[Abs[t$95$0], $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[((-d) * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[l, 1.55e+39], N[(N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] * h), $MachinePrecision] * -0.125), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] + l), $MachinePrecision] / l), $MachinePrecision] * t$95$0), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;\ell \leq -1.12 \cdot 10^{-122}:\\
\;\;\;\;\left|t\_0\right|\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\left(-d\right) \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{elif}\;\ell \leq 1.55 \cdot 10^{+39}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\left(\left(M \cdot M\right) \cdot h\right) \cdot -0.125}{d}, \frac{D \cdot D}{d}, \ell\right)}{\ell} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.12e-122Initial program 66.5%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f646.8
Applied rewrites6.8%
Applied rewrites48.0%
if -1.12e-122 < l < -4.999999999999985e-310Initial program 62.2%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites25.7%
Taylor expanded in l around -inf
Applied rewrites62.1%
if -4.999999999999985e-310 < l < 1.5500000000000001e39Initial program 65.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
associate-/l*N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lower-*.f6446.1
Applied rewrites76.0%
Taylor expanded in l around 0
lower-/.f64N/A
Applied rewrites72.3%
if 1.5500000000000001e39 < l Initial program 61.8%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6444.1
Applied rewrites44.1%
Applied rewrites44.0%
Applied rewrites65.1%
(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 64.4%
Taylor expanded in d around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6428.4
Applied rewrites28.4%
Applied rewrites28.4%
herbie shell --seed 2024314
(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)))))