
(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 20 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
(fma (/ (* M D) (* d 4.0)) (* (/ (* M D) d) (/ (* h -0.5) l)) 1.0))
(t_1 (sqrt (- d)))
(t_2 (sqrt (/ d l))))
(if (<= h -1.04e+158)
(/
(*
t_1
(*
t_2
(fma (/ (* M (* D (* M D))) (* 4.0 (* d d))) (* (/ h l) -0.5) 1.0)))
(sqrt (- h)))
(if (<= h -1e-310)
(* (* (/ t_1 (sqrt (- l))) t_0) (sqrt (/ d h)))
(if (<= h 8.5e+116)
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d h) (/ 1.0 2.0)) (/ (sqrt d) (sqrt l))))
(* (* t_0 t_2) (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = fma(((M * D) / (d * 4.0)), (((M * D) / d) * ((h * -0.5) / l)), 1.0);
double t_1 = sqrt(-d);
double t_2 = sqrt((d / l));
double tmp;
if (h <= -1.04e+158) {
tmp = (t_1 * (t_2 * fma(((M * (D * (M * D))) / (4.0 * (d * d))), ((h / l) * -0.5), 1.0))) / sqrt(-h);
} else if (h <= -1e-310) {
tmp = ((t_1 / sqrt(-l)) * t_0) * sqrt((d / h));
} else if (h <= 8.5e+116) {
tmp = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / h), (1.0 / 2.0)) * (sqrt(d) / sqrt(l)));
} else {
tmp = (t_0 * t_2) * (sqrt(d) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = fma(Float64(Float64(M * D) / Float64(d * 4.0)), Float64(Float64(Float64(M * D) / d) * Float64(Float64(h * -0.5) / l)), 1.0) t_1 = sqrt(Float64(-d)) t_2 = sqrt(Float64(d / l)) tmp = 0.0 if (h <= -1.04e+158) tmp = Float64(Float64(t_1 * Float64(t_2 * fma(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(4.0 * Float64(d * d))), Float64(Float64(h / l) * -0.5), 1.0))) / sqrt(Float64(-h))); elseif (h <= -1e-310) tmp = Float64(Float64(Float64(t_1 / sqrt(Float64(-l))) * t_0) * sqrt(Float64(d / h))); elseif (h <= 8.5e+116) tmp = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * Float64(sqrt(d) / sqrt(l)))); else tmp = Float64(Float64(t_0 * t_2) * Float64(sqrt(d) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * D), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -1.04e+158], N[(N[(t$95$1 * N[(t$95$2 * N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(4.0 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-310], N[(N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 8.5e+116], N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * t$95$2), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{M \cdot D}{d \cdot 4}, \frac{M \cdot D}{d} \cdot \frac{h \cdot -0.5}{\ell}, 1\right)\\
t_1 := \sqrt{-d}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;h \leq -1.04 \cdot 10^{+158}:\\
\;\;\;\;\frac{t\_1 \cdot \left(t\_2 \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{4 \cdot \left(d \cdot d\right)}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)}{\sqrt{-h}}\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{t\_1}{\sqrt{-\ell}} \cdot t\_0\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;h \leq 8.5 \cdot 10^{+116}:\\
\;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot t\_2\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -1.04000000000000004e158Initial program 51.6%
Applied rewrites64.6%
if -1.04000000000000004e158 < h < -9.999999999999969e-311Initial program 67.1%
Applied rewrites48.5%
Applied rewrites48.1%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites68.3%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lower-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6482.4
Applied rewrites82.4%
if -9.999999999999969e-311 < h < 8.5000000000000002e116Initial program 73.9%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f6483.0
Applied rewrites83.0%
if 8.5000000000000002e116 < h Initial program 62.1%
Applied rewrites47.2%
Applied rewrites44.7%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites62.2%
lift-/.f64N/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6474.0
Applied rewrites74.0%
Final simplification78.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (* h l)))
(t_2 (sqrt (/ d l)))
(t_3
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
(if (<= t_3 -2e-167)
(*
t_0
(*
t_2
(fma (/ (* (* M D) (* h -0.5)) (* l (* d 4.0))) (/ (* M D) d) 1.0)))
(if (<= t_3 1e-291)
(/ 1.0 (/ t_1 d))
(if (<= t_3 4e+234) (* t_0 t_2) (/ (sqrt (* d d)) t_1))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((h * l));
double t_2 = sqrt((d / l));
double t_3 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_3 <= -2e-167) {
tmp = t_0 * (t_2 * fma((((M * D) * (h * -0.5)) / (l * (d * 4.0))), ((M * D) / d), 1.0));
} else if (t_3 <= 1e-291) {
tmp = 1.0 / (t_1 / d);
} else if (t_3 <= 4e+234) {
tmp = t_0 * t_2;
} else {
tmp = sqrt((d * d)) / t_1;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(h * l)) t_2 = sqrt(Float64(d / l)) t_3 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_3 <= -2e-167) tmp = Float64(t_0 * Float64(t_2 * fma(Float64(Float64(Float64(M * D) * Float64(h * -0.5)) / Float64(l * Float64(d * 4.0))), Float64(Float64(M * D) / d), 1.0))); elseif (t_3 <= 1e-291) tmp = Float64(1.0 / Float64(t_1 / d)); elseif (t_3 <= 4e+234) tmp = Float64(t_0 * t_2); else tmp = Float64(sqrt(Float64(d * d)) / t_1); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-167], N[(t$95$0 * N[(t$95$2 * N[(N[(N[(N[(M * D), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-291], N[(1.0 / N[(t$95$1 / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e+234], N[(t$95$0 * t$95$2), $MachinePrecision], N[(N[Sqrt[N[(d * d), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{h \cdot \ell}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
t_3 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{-167}:\\
\;\;\;\;t\_0 \cdot \left(t\_2 \cdot \mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(h \cdot -0.5\right)}{\ell \cdot \left(d \cdot 4\right)}, \frac{M \cdot D}{d}, 1\right)\right)\\
\mathbf{elif}\;t\_3 \leq 10^{-291}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{d}}\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+234}:\\
\;\;\;\;t\_0 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d \cdot d}}{t\_1}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -2e-167Initial program 91.1%
Applied rewrites60.9%
Applied rewrites57.3%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites83.5%
if -2e-167 < (*.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.99999999999999962e-292Initial program 41.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6477.4
Applied rewrites77.4%
Applied rewrites77.8%
Applied rewrites77.9%
if 9.99999999999999962e-292 < (*.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.00000000000000007e234Initial program 98.6%
Applied rewrites83.7%
Applied rewrites79.5%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6498.3
Applied rewrites98.3%
if 4.00000000000000007e234 < (*.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 19.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.6
Applied rewrites25.6%
Applied rewrites25.6%
Applied rewrites27.6%
Applied rewrites32.2%
Final simplification70.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (/ d l)))
(t_2 (sqrt (* h l)))
(t_3
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
(if (<= t_3 -2e-167)
(*
t_0
(*
t_1
(fma (/ M d) (* (* D 0.25) (/ (* M (* D (* h -0.5))) (* d l))) 1.0)))
(if (<= t_3 1e-291)
(/ 1.0 (/ t_2 d))
(if (<= t_3 4e+234) (* t_0 t_1) (/ (sqrt (* d d)) t_2))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double t_2 = sqrt((h * l));
double t_3 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_3 <= -2e-167) {
tmp = t_0 * (t_1 * fma((M / d), ((D * 0.25) * ((M * (D * (h * -0.5))) / (d * l))), 1.0));
} else if (t_3 <= 1e-291) {
tmp = 1.0 / (t_2 / d);
} else if (t_3 <= 4e+234) {
tmp = t_0 * t_1;
} else {
tmp = sqrt((d * d)) / t_2;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) t_2 = sqrt(Float64(h * l)) t_3 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_3 <= -2e-167) tmp = Float64(t_0 * Float64(t_1 * fma(Float64(M / d), Float64(Float64(D * 0.25) * Float64(Float64(M * Float64(D * Float64(h * -0.5))) / Float64(d * l))), 1.0))); elseif (t_3 <= 1e-291) tmp = Float64(1.0 / Float64(t_2 / d)); elseif (t_3 <= 4e+234) tmp = Float64(t_0 * t_1); else tmp = Float64(sqrt(Float64(d * d)) / t_2); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-167], N[(t$95$0 * N[(t$95$1 * N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.25), $MachinePrecision] * N[(N[(M * N[(D * N[(h * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-291], N[(1.0 / N[(t$95$2 / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e+234], N[(t$95$0 * t$95$1), $MachinePrecision], N[(N[Sqrt[N[(d * d), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \sqrt{h \cdot \ell}\\
t_3 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{-167}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(\frac{M}{d}, \left(D \cdot 0.25\right) \cdot \frac{M \cdot \left(D \cdot \left(h \cdot -0.5\right)\right)}{d \cdot \ell}, 1\right)\right)\\
\mathbf{elif}\;t\_3 \leq 10^{-291}:\\
\;\;\;\;\frac{1}{\frac{t\_2}{d}}\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+234}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d \cdot d}}{t\_2}\\
\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-167Initial program 91.1%
Applied rewrites60.9%
Applied rewrites57.3%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites92.3%
lift-fma.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites74.3%
if -2e-167 < (*.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.99999999999999962e-292Initial program 41.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6477.4
Applied rewrites77.4%
Applied rewrites77.8%
Applied rewrites77.9%
if 9.99999999999999962e-292 < (*.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.00000000000000007e234Initial program 98.6%
Applied rewrites83.7%
Applied rewrites79.5%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6498.3
Applied rewrites98.3%
if 4.00000000000000007e234 < (*.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 19.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.6
Applied rewrites25.6%
Applied rewrites25.6%
Applied rewrites27.6%
Applied rewrites32.2%
Final simplification66.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (* h l)))
(t_2 (sqrt (/ d l)))
(t_3
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
(if (<= t_3 -2e-151)
(*
t_0
(* t_2 (fma (/ (* M (* M (* D D))) (* d l)) (* (/ h d) -0.125) 1.0)))
(if (<= t_3 1e-291)
(/ 1.0 (/ t_1 d))
(if (<= t_3 4e+234) (* t_0 t_2) (/ (sqrt (* d d)) t_1))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((h * l));
double t_2 = sqrt((d / l));
double t_3 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_3 <= -2e-151) {
tmp = t_0 * (t_2 * fma(((M * (M * (D * D))) / (d * l)), ((h / d) * -0.125), 1.0));
} else if (t_3 <= 1e-291) {
tmp = 1.0 / (t_1 / d);
} else if (t_3 <= 4e+234) {
tmp = t_0 * t_2;
} else {
tmp = sqrt((d * d)) / t_1;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(h * l)) t_2 = sqrt(Float64(d / l)) t_3 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_3 <= -2e-151) tmp = Float64(t_0 * Float64(t_2 * fma(Float64(Float64(M * Float64(M * Float64(D * D))) / Float64(d * l)), Float64(Float64(h / d) * -0.125), 1.0))); elseif (t_3 <= 1e-291) tmp = Float64(1.0 / Float64(t_1 / d)); elseif (t_3 <= 4e+234) tmp = Float64(t_0 * t_2); else tmp = Float64(sqrt(Float64(d * d)) / t_1); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-151], N[(t$95$0 * N[(t$95$2 * N[(N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(N[(h / d), $MachinePrecision] * -0.125), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-291], N[(1.0 / N[(t$95$1 / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e+234], N[(t$95$0 * t$95$2), $MachinePrecision], N[(N[Sqrt[N[(d * d), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{h \cdot \ell}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
t_3 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{-151}:\\
\;\;\;\;t\_0 \cdot \left(t\_2 \cdot \mathsf{fma}\left(\frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{d \cdot \ell}, \frac{h}{d} \cdot -0.125, 1\right)\right)\\
\mathbf{elif}\;t\_3 \leq 10^{-291}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{d}}\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+234}:\\
\;\;\;\;t\_0 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d \cdot d}}{t\_1}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.9999999999999999e-151Initial program 91.0%
Applied rewrites61.6%
Applied rewrites57.9%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-fma.f64N/A
Applied rewrites67.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f6467.3
Applied rewrites67.3%
if -1.9999999999999999e-151 < (*.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.99999999999999962e-292Initial program 45.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6472.2
Applied rewrites72.2%
Applied rewrites72.5%
Applied rewrites72.6%
if 9.99999999999999962e-292 < (*.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.00000000000000007e234Initial program 98.6%
Applied rewrites83.7%
Applied rewrites79.5%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6498.3
Applied rewrites98.3%
if 4.00000000000000007e234 < (*.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 19.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.6
Applied rewrites25.6%
Applied rewrites25.6%
Applied rewrites27.6%
Applied rewrites32.2%
Final simplification64.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1 (sqrt (/ d h)))
(t_2 (sqrt (* h l)))
(t_3
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
(if (<= t_3 -2e-151)
(*
t_0
(*
t_1
(fma (* h -0.5) (/ (* M (* M (* D D))) (* (* d 4.0) (* d l))) 1.0)))
(if (<= t_3 1e-291)
(/ 1.0 (/ t_2 d))
(if (<= t_3 4e+234) (* t_1 t_0) (/ (sqrt (* d d)) t_2))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = sqrt((d / h));
double t_2 = sqrt((h * l));
double t_3 = (1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
double tmp;
if (t_3 <= -2e-151) {
tmp = t_0 * (t_1 * fma((h * -0.5), ((M * (M * (D * D))) / ((d * 4.0) * (d * l))), 1.0));
} else if (t_3 <= 1e-291) {
tmp = 1.0 / (t_2 / d);
} else if (t_3 <= 4e+234) {
tmp = t_1 * t_0;
} else {
tmp = sqrt((d * d)) / t_2;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = sqrt(Float64(d / h)) t_2 = sqrt(Float64(h * l)) t_3 = Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) tmp = 0.0 if (t_3 <= -2e-151) tmp = Float64(t_0 * Float64(t_1 * fma(Float64(h * -0.5), Float64(Float64(M * Float64(M * Float64(D * D))) / Float64(Float64(d * 4.0) * Float64(d * l))), 1.0))); elseif (t_3 <= 1e-291) tmp = Float64(1.0 / Float64(t_2 / d)); elseif (t_3 <= 4e+234) tmp = Float64(t_1 * t_0); else tmp = Float64(sqrt(Float64(d * d)) / t_2); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-151], N[(t$95$0 * N[(t$95$1 * N[(N[(h * -0.5), $MachinePrecision] * N[(N[(M * N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d * 4.0), $MachinePrecision] * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-291], N[(1.0 / N[(t$95$2 / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 4e+234], N[(t$95$1 * t$95$0), $MachinePrecision], N[(N[Sqrt[N[(d * d), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \sqrt{h \cdot \ell}\\
t_3 := \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{-151}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \mathsf{fma}\left(h \cdot -0.5, \frac{M \cdot \left(M \cdot \left(D \cdot D\right)\right)}{\left(d \cdot 4\right) \cdot \left(d \cdot \ell\right)}, 1\right)\right)\\
\mathbf{elif}\;t\_3 \leq 10^{-291}:\\
\;\;\;\;\frac{1}{\frac{t\_2}{d}}\\
\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+234}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d \cdot d}}{t\_2}\\
\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.9999999999999999e-151Initial program 91.0%
Applied rewrites61.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6491.1
Applied rewrites91.1%
Applied rewrites61.4%
if -1.9999999999999999e-151 < (*.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.99999999999999962e-292Initial program 45.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6472.2
Applied rewrites72.2%
Applied rewrites72.5%
Applied rewrites72.6%
if 9.99999999999999962e-292 < (*.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.00000000000000007e234Initial program 98.6%
Applied rewrites83.7%
Applied rewrites79.5%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6498.3
Applied rewrites98.3%
if 4.00000000000000007e234 < (*.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 19.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.6
Applied rewrites25.6%
Applied rewrites25.6%
Applied rewrites27.6%
Applied rewrites32.2%
Final simplification62.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l))))
(if (<=
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
INFINITY)
(*
(sqrt (/ d h))
(*
(fma (/ (* M D) (* d 4.0)) (* (/ (* M D) d) (/ (* h -0.5) l)) 1.0)
t_0))
(*
(*
t_0
(+ 1.0 (/ (* (* h -0.5) (* M (* D (* M D)))) (* l (* d (* d 4.0))))))
(/ (sqrt (- d)) (sqrt (- h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double tmp;
if (((1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= ((double) INFINITY)) {
tmp = sqrt((d / h)) * (fma(((M * D) / (d * 4.0)), (((M * D) / d) * ((h * -0.5) / l)), 1.0) * t_0);
} else {
tmp = (t_0 * (1.0 + (((h * -0.5) * (M * (D * (M * D)))) / (l * (d * (d * 4.0)))))) * (sqrt(-d) / sqrt(-h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) tmp = 0.0 if (Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= Inf) tmp = Float64(sqrt(Float64(d / h)) * Float64(fma(Float64(Float64(M * D) / Float64(d * 4.0)), Float64(Float64(Float64(M * D) / d) * Float64(Float64(h * -0.5) / l)), 1.0) * t_0)); else tmp = Float64(Float64(t_0 * Float64(1.0 + Float64(Float64(Float64(h * -0.5) * Float64(M * Float64(D * Float64(M * D)))) / Float64(l * Float64(d * Float64(d * 4.0)))))) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(1.0 + N[(N[(N[(h * -0.5), $MachinePrecision] * N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq \infty:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\mathsf{fma}\left(\frac{M \cdot D}{d \cdot 4}, \frac{M \cdot D}{d} \cdot \frac{h \cdot -0.5}{\ell}, 1\right) \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot \left(1 + \frac{\left(h \cdot -0.5\right) \cdot \left(M \cdot \left(D \cdot \left(M \cdot D\right)\right)\right)}{\ell \cdot \left(d \cdot \left(d \cdot 4\right)\right)}\right)\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 83.1%
Applied rewrites61.3%
Applied rewrites57.6%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites83.5%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 0.0%
Applied rewrites0.0%
Applied rewrites11.0%
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.f6422.4
Applied rewrites22.4%
Final simplification71.4%
(FPCore (d h l M D)
:precision binary64
(if (<=
(*
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0))))
(* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
4e+234)
(*
(sqrt (/ d h))
(*
(fma (/ (* M D) (* d 4.0)) (* (/ (* M D) d) (/ (* h -0.5) l)) 1.0)
(sqrt (/ d l))))
(/ (sqrt (* d d)) (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (((1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= 4e+234) {
tmp = sqrt((d / h)) * (fma(((M * D) / (d * 4.0)), (((M * D) / d) * ((h * -0.5) / l)), 1.0) * sqrt((d / l)));
} else {
tmp = sqrt((d * d)) / sqrt((h * l));
}
return tmp;
}
function code(d, h, l, M, D) tmp = 0.0 if (Float64(Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= 4e+234) tmp = Float64(sqrt(Float64(d / h)) * Float64(fma(Float64(Float64(M * D) / Float64(d * 4.0)), Float64(Float64(Float64(M * D) / d) * Float64(Float64(h * -0.5) / l)), 1.0) * sqrt(Float64(d / l)))); else tmp = Float64(sqrt(Float64(d * d)) / sqrt(Float64(h * l))); end return tmp end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+234], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d * d), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq 4 \cdot 10^{+234}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\mathsf{fma}\left(\frac{M \cdot D}{d \cdot 4}, \frac{M \cdot D}{d} \cdot \frac{h \cdot -0.5}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d \cdot d}}{\sqrt{h \cdot \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.00000000000000007e234Initial program 90.4%
Applied rewrites65.7%
Applied rewrites62.1%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites91.0%
if 4.00000000000000007e234 < (*.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 19.3%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.6
Applied rewrites25.6%
Applied rewrites25.6%
Applied rewrites27.6%
Applied rewrites32.2%
Final simplification71.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(+ 1.0 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ -1.0 2.0)))))
(t_1 (sqrt (- d))))
(if (<= d -1.95e-150)
(* (* (* t_1 (/ 1.0 (sqrt (- h)))) (pow (/ d l) (/ 1.0 2.0))) t_0)
(if (<= d -2e-310)
(*
(*
(/ t_1 (sqrt (- l)))
(fma (/ (* M D) (* d 4.0)) (* (/ (* M D) d) (/ (* h -0.5) l)) 1.0))
(sqrt (/ d h)))
(* t_0 (* (pow (/ d h) (/ 1.0 2.0)) (/ (sqrt d) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * (-1.0 / 2.0)));
double t_1 = sqrt(-d);
double tmp;
if (d <= -1.95e-150) {
tmp = ((t_1 * (1.0 / sqrt(-h))) * pow((d / l), (1.0 / 2.0))) * t_0;
} else if (d <= -2e-310) {
tmp = ((t_1 / sqrt(-l)) * fma(((M * D) / (d * 4.0)), (((M * D) / d) * ((h * -0.5) / l)), 1.0)) * sqrt((d / h));
} else {
tmp = t_0 * (pow((d / h), (1.0 / 2.0)) * (sqrt(d) / sqrt(l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(-1.0 / 2.0)))) t_1 = sqrt(Float64(-d)) tmp = 0.0 if (d <= -1.95e-150) tmp = Float64(Float64(Float64(t_1 * Float64(1.0 / sqrt(Float64(-h)))) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * t_0); elseif (d <= -2e-310) tmp = Float64(Float64(Float64(t_1 / sqrt(Float64(-l))) * fma(Float64(Float64(M * D) / Float64(d * 4.0)), Float64(Float64(Float64(M * D) / d) * Float64(Float64(h * -0.5) / l)), 1.0)) * sqrt(Float64(d / h))); else tmp = Float64(t_0 * Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * Float64(sqrt(d) / sqrt(l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(-1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[d, -1.95e-150], N[(N[(N[(t$95$1 * N[(1.0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{-1}{2}\right)\\
t_1 := \sqrt{-d}\\
\mathbf{if}\;d \leq -1.95 \cdot 10^{-150}:\\
\;\;\;\;\left(\left(t\_1 \cdot \frac{1}{\sqrt{-h}}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot t\_0\\
\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{t\_1}{\sqrt{-\ell}} \cdot \mathsf{fma}\left(\frac{M \cdot D}{d \cdot 4}, \frac{M \cdot D}{d} \cdot \frac{h \cdot -0.5}{\ell}, 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if d < -1.9500000000000001e-150Initial program 69.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
div-invN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f6482.7
Applied rewrites82.7%
if -1.9500000000000001e-150 < d < -1.999999999999994e-310Initial program 41.9%
Applied rewrites16.2%
Applied rewrites15.8%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites45.3%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lower-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6467.9
Applied rewrites67.9%
if -1.999999999999994e-310 < d Initial program 70.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lift-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f6477.4
Applied rewrites77.4%
Final simplification78.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(fma (/ (* M D) (* d 4.0)) (* (/ (* M D) d) (/ (* h -0.5) l)) 1.0))
(t_1 (sqrt (- d)))
(t_2 (sqrt (/ d l))))
(if (<= h -1.04e+158)
(/
(*
t_1
(*
t_2
(fma (/ (* M (* D (* M D))) (* 4.0 (* d d))) (* (/ h l) -0.5) 1.0)))
(sqrt (- h)))
(if (<= h -1e-310)
(* (* (/ t_1 (sqrt (- l))) t_0) (sqrt (/ d h)))
(* (* t_0 t_2) (/ (sqrt d) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = fma(((M * D) / (d * 4.0)), (((M * D) / d) * ((h * -0.5) / l)), 1.0);
double t_1 = sqrt(-d);
double t_2 = sqrt((d / l));
double tmp;
if (h <= -1.04e+158) {
tmp = (t_1 * (t_2 * fma(((M * (D * (M * D))) / (4.0 * (d * d))), ((h / l) * -0.5), 1.0))) / sqrt(-h);
} else if (h <= -1e-310) {
tmp = ((t_1 / sqrt(-l)) * t_0) * sqrt((d / h));
} else {
tmp = (t_0 * t_2) * (sqrt(d) / sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = fma(Float64(Float64(M * D) / Float64(d * 4.0)), Float64(Float64(Float64(M * D) / d) * Float64(Float64(h * -0.5) / l)), 1.0) t_1 = sqrt(Float64(-d)) t_2 = sqrt(Float64(d / l)) tmp = 0.0 if (h <= -1.04e+158) tmp = Float64(Float64(t_1 * Float64(t_2 * fma(Float64(Float64(M * Float64(D * Float64(M * D))) / Float64(4.0 * Float64(d * d))), Float64(Float64(h / l) * -0.5), 1.0))) / sqrt(Float64(-h))); elseif (h <= -1e-310) tmp = Float64(Float64(Float64(t_1 / sqrt(Float64(-l))) * t_0) * sqrt(Float64(d / h))); else tmp = Float64(Float64(t_0 * t_2) * Float64(sqrt(d) / sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(M * D), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(h * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -1.04e+158], N[(N[(t$95$1 * N[(t$95$2 * N[(N[(N[(M * N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(4.0 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -1e-310], N[(N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * t$95$2), $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{M \cdot D}{d \cdot 4}, \frac{M \cdot D}{d} \cdot \frac{h \cdot -0.5}{\ell}, 1\right)\\
t_1 := \sqrt{-d}\\
t_2 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;h \leq -1.04 \cdot 10^{+158}:\\
\;\;\;\;\frac{t\_1 \cdot \left(t\_2 \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \left(M \cdot D\right)\right)}{4 \cdot \left(d \cdot d\right)}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)}{\sqrt{-h}}\\
\mathbf{elif}\;h \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{t\_1}{\sqrt{-\ell}} \cdot t\_0\right) \cdot \sqrt{\frac{d}{h}}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot t\_2\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\\
\end{array}
\end{array}
if h < -1.04000000000000004e158Initial program 51.6%
Applied rewrites64.6%
if -1.04000000000000004e158 < h < -9.999999999999969e-311Initial program 67.1%
Applied rewrites48.5%
Applied rewrites48.1%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites68.3%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
lower-/.f64N/A
metadata-evalN/A
pow1/2N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6482.4
Applied rewrites82.4%
if -9.999999999999969e-311 < h Initial program 70.7%
Applied rewrites51.8%
Applied rewrites52.0%
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites70.8%
lift-/.f64N/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6476.8
Applied rewrites76.8%
Final simplification76.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h (* l (* l l))))) (t_1 (* M (* D D))))
(if (<= l -3.15e-40)
(/ (* (sqrt (- d)) (sqrt (/ d l))) (sqrt (- h)))
(if (<= l 3.8e-305)
(* t_0 (* (* t_1 (- M)) (/ -0.125 d)))
(if (<= l 1.6e-26)
(*
(fma (* h -0.5) (/ (* M t_1) (* (* d 4.0) (* d l))) 1.0)
(/ d (sqrt (* h l))))
(if (<= l 1.2e+115)
(fma
-0.125
(* (* D (* D (* M M))) (/ t_0 d))
(* d (sqrt (/ 1.0 (* h l)))))
(/ d (* (sqrt l) (sqrt h)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / (l * (l * l))));
double t_1 = M * (D * D);
double tmp;
if (l <= -3.15e-40) {
tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
} else if (l <= 3.8e-305) {
tmp = t_0 * ((t_1 * -M) * (-0.125 / d));
} else if (l <= 1.6e-26) {
tmp = fma((h * -0.5), ((M * t_1) / ((d * 4.0) * (d * l))), 1.0) * (d / sqrt((h * l)));
} else if (l <= 1.2e+115) {
tmp = fma(-0.125, ((D * (D * (M * M))) * (t_0 / d)), (d * sqrt((1.0 / (h * l)))));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / Float64(l * Float64(l * l)))) t_1 = Float64(M * Float64(D * D)) tmp = 0.0 if (l <= -3.15e-40) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / l))) / sqrt(Float64(-h))); elseif (l <= 3.8e-305) tmp = Float64(t_0 * Float64(Float64(t_1 * Float64(-M)) * Float64(-0.125 / d))); elseif (l <= 1.6e-26) tmp = Float64(fma(Float64(h * -0.5), Float64(Float64(M * t_1) / Float64(Float64(d * 4.0) * Float64(d * l))), 1.0) * Float64(d / sqrt(Float64(h * l)))); elseif (l <= 1.2e+115) tmp = fma(-0.125, Float64(Float64(D * Float64(D * Float64(M * M))) * Float64(t_0 / d)), Float64(d * sqrt(Float64(1.0 / Float64(h * l))))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.15e-40], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.8e-305], N[(t$95$0 * N[(N[(t$95$1 * (-M)), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.6e-26], N[(N[(N[(h * -0.5), $MachinePrecision] * N[(N[(M * t$95$1), $MachinePrecision] / N[(N[(d * 4.0), $MachinePrecision] * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.2e+115], N[(-0.125 * N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / d), $MachinePrecision]), $MachinePrecision] + N[(d * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}}\\
t_1 := M \cdot \left(D \cdot D\right)\\
\mathbf{if}\;\ell \leq -3.15 \cdot 10^{-40}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-305}:\\
\;\;\;\;t\_0 \cdot \left(\left(t\_1 \cdot \left(-M\right)\right) \cdot \frac{-0.125}{d}\right)\\
\mathbf{elif}\;\ell \leq 1.6 \cdot 10^{-26}:\\
\;\;\;\;\mathsf{fma}\left(h \cdot -0.5, \frac{M \cdot t\_1}{\left(d \cdot 4\right) \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{elif}\;\ell \leq 1.2 \cdot 10^{+115}:\\
\;\;\;\;\mathsf{fma}\left(-0.125, \left(D \cdot \left(D \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{t\_0}{d}, d \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -3.1500000000000001e-40Initial program 61.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f646.4
Applied rewrites6.4%
Applied rewrites6.4%
Applied rewrites39.5%
Applied rewrites60.1%
if -3.1500000000000001e-40 < l < 3.8e-305Initial program 62.1%
Applied rewrites45.6%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites53.1%
if 3.8e-305 < l < 1.6000000000000001e-26Initial program 78.9%
Applied rewrites60.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
Applied rewrites64.5%
if 1.6000000000000001e-26 < l < 1.2e115Initial program 72.2%
Applied rewrites49.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6472.2
Applied rewrites72.2%
Taylor expanded in M around 0
lower-fma.f64N/A
Applied rewrites82.0%
if 1.2e115 < l Initial program 52.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6445.4
Applied rewrites45.4%
Applied rewrites45.4%
Applied rewrites55.9%
Final simplification62.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* M (* D D))))
(if (<= l -3.15e-40)
(/ (* (sqrt (- d)) (sqrt (/ d l))) (sqrt (- h)))
(if (<= l 3.8e-305)
(* (sqrt (/ h (* l (* l l)))) (* (* t_0 (- M)) (/ -0.125 d)))
(if (<= l 9.8e-95)
(*
(fma (* h -0.5) (/ (* M t_0) (* (* d 4.0) (* d l))) 1.0)
(/ d (sqrt (* h l))))
(* d (/ (/ 1.0 (sqrt h)) (sqrt l))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = M * (D * D);
double tmp;
if (l <= -3.15e-40) {
tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
} else if (l <= 3.8e-305) {
tmp = sqrt((h / (l * (l * l)))) * ((t_0 * -M) * (-0.125 / d));
} else if (l <= 9.8e-95) {
tmp = fma((h * -0.5), ((M * t_0) / ((d * 4.0) * (d * l))), 1.0) * (d / sqrt((h * l)));
} else {
tmp = d * ((1.0 / sqrt(h)) / sqrt(l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(M * Float64(D * D)) tmp = 0.0 if (l <= -3.15e-40) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / l))) / sqrt(Float64(-h))); elseif (l <= 3.8e-305) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(t_0 * Float64(-M)) * Float64(-0.125 / d))); elseif (l <= 9.8e-95) tmp = Float64(fma(Float64(h * -0.5), Float64(Float64(M * t_0) / Float64(Float64(d * 4.0) * Float64(d * l))), 1.0) * Float64(d / sqrt(Float64(h * l)))); else tmp = Float64(d * Float64(Float64(1.0 / sqrt(h)) / sqrt(l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.15e-40], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.8e-305], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 * (-M)), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.8e-95], N[(N[(N[(h * -0.5), $MachinePrecision] * N[(N[(M * t$95$0), $MachinePrecision] / N[(N[(d * 4.0), $MachinePrecision] * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[(1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \left(D \cdot D\right)\\
\mathbf{if}\;\ell \leq -3.15 \cdot 10^{-40}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-305}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(t\_0 \cdot \left(-M\right)\right) \cdot \frac{-0.125}{d}\right)\\
\mathbf{elif}\;\ell \leq 9.8 \cdot 10^{-95}:\\
\;\;\;\;\mathsf{fma}\left(h \cdot -0.5, \frac{M \cdot t\_0}{\left(d \cdot 4\right) \cdot \left(d \cdot \ell\right)}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \frac{\frac{1}{\sqrt{h}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.1500000000000001e-40Initial program 61.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f646.4
Applied rewrites6.4%
Applied rewrites6.4%
Applied rewrites39.5%
Applied rewrites60.1%
if -3.1500000000000001e-40 < l < 3.8e-305Initial program 62.1%
Applied rewrites45.6%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites53.1%
if 3.8e-305 < l < 9.8e-95Initial program 80.4%
Applied rewrites64.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6480.4
Applied rewrites80.4%
Applied rewrites68.0%
if 9.8e-95 < l Initial program 65.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6453.6
Applied rewrites53.6%
Applied rewrites57.1%
Final simplification59.1%
(FPCore (d h l M D)
:precision binary64
(if (<= l -3.15e-40)
(/ (* (sqrt (- d)) (sqrt (/ d l))) (sqrt (- h)))
(if (<= l -5e-310)
(* (sqrt (/ h (* l (* l l)))) (* (* (* M (* D D)) (- M)) (/ -0.125 d)))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.15e-40) {
tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
} else if (l <= -5e-310) {
tmp = sqrt((h / (l * (l * l)))) * (((M * (D * D)) * -M) * (-0.125 / d));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-3.15d-40)) then
tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h)
else if (l <= (-5d-310)) then
tmp = sqrt((h / (l * (l * l)))) * (((m * (d_1 * d_1)) * -m) * ((-0.125d0) / d))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -3.15e-40) {
tmp = (Math.sqrt(-d) * Math.sqrt((d / l))) / Math.sqrt(-h);
} else if (l <= -5e-310) {
tmp = Math.sqrt((h / (l * (l * l)))) * (((M * (D * D)) * -M) * (-0.125 / d));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -3.15e-40: tmp = (math.sqrt(-d) * math.sqrt((d / l))) / math.sqrt(-h) elif l <= -5e-310: tmp = math.sqrt((h / (l * (l * l)))) * (((M * (D * D)) * -M) * (-0.125 / d)) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -3.15e-40) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / l))) / sqrt(Float64(-h))); elseif (l <= -5e-310) tmp = Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(Float64(M * Float64(D * D)) * Float64(-M)) * Float64(-0.125 / d))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -3.15e-40) tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h); elseif (l <= -5e-310) tmp = sqrt((h / (l * (l * l)))) * (((M * (D * D)) * -M) * (-0.125 / d)); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -3.15e-40], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] * (-M)), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.15 \cdot 10^{-40}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \left(\left(\left(M \cdot \left(D \cdot D\right)\right) \cdot \left(-M\right)\right) \cdot \frac{-0.125}{d}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -3.1500000000000001e-40Initial program 61.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f646.4
Applied rewrites6.4%
Applied rewrites6.4%
Applied rewrites39.5%
Applied rewrites60.1%
if -3.1500000000000001e-40 < l < -4.999999999999985e-310Initial program 63.3%
Applied rewrites46.4%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites54.1%
if -4.999999999999985e-310 < l Initial program 70.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.1
Applied rewrites46.1%
Applied rewrites46.9%
Applied rewrites52.0%
Final simplification54.8%
(FPCore (d h l M D)
:precision binary64
(if (<= l -5.2e-8)
(/ (* (sqrt (- d)) (sqrt (/ d l))) (sqrt (- h)))
(if (<= l -5e-310)
(* D (* (sqrt (/ h (* l (* l l)))) (/ (* M (* M D)) (* d 8.0))))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -5.2e-8) {
tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
} else if (l <= -5e-310) {
tmp = D * (sqrt((h / (l * (l * l)))) * ((M * (M * D)) / (d * 8.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 (l <= (-5.2d-8)) then
tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h)
else if (l <= (-5d-310)) then
tmp = d_1 * (sqrt((h / (l * (l * l)))) * ((m * (m * d_1)) / (d * 8.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 (l <= -5.2e-8) {
tmp = (Math.sqrt(-d) * Math.sqrt((d / l))) / Math.sqrt(-h);
} else if (l <= -5e-310) {
tmp = D * (Math.sqrt((h / (l * (l * l)))) * ((M * (M * D)) / (d * 8.0)));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -5.2e-8: tmp = (math.sqrt(-d) * math.sqrt((d / l))) / math.sqrt(-h) elif l <= -5e-310: tmp = D * (math.sqrt((h / (l * (l * l)))) * ((M * (M * D)) / (d * 8.0))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -5.2e-8) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / l))) / sqrt(Float64(-h))); elseif (l <= -5e-310) tmp = Float64(D * Float64(sqrt(Float64(h / Float64(l * Float64(l * l)))) * Float64(Float64(M * Float64(M * D)) / Float64(d * 8.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 (l <= -5.2e-8) tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h); elseif (l <= -5e-310) tmp = D * (sqrt((h / (l * (l * l)))) * ((M * (M * D)) / (d * 8.0))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -5.2e-8], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(D * N[(N[Sqrt[N[(h / N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * 8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.2 \cdot 10^{-8}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;D \cdot \left(\sqrt{\frac{h}{\ell \cdot \left(\ell \cdot \ell\right)}} \cdot \frac{M \cdot \left(M \cdot D\right)}{d \cdot 8}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -5.2000000000000002e-8Initial program 61.1%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f646.8
Applied rewrites6.8%
Applied rewrites6.8%
Applied rewrites41.3%
Applied rewrites61.0%
if -5.2000000000000002e-8 < l < -4.999999999999985e-310Initial program 63.8%
Taylor expanded in h around -inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
distribute-neg-fracN/A
Applied rewrites44.3%
Applied rewrites55.5%
if -4.999999999999985e-310 < l Initial program 70.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.1
Applied rewrites46.1%
Applied rewrites46.9%
Applied rewrites52.0%
Final simplification55.2%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ 1.0 (* h l))))
(if (<= l -5e-239)
(/ (* (sqrt (- d)) (sqrt (/ d l))) (sqrt (- h)))
(if (<= l -5e-310)
(* d (sqrt (sqrt (* t_0 t_0))))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double tmp;
if (l <= -5e-239) {
tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
} else if (l <= -5e-310) {
tmp = d * sqrt(sqrt((t_0 * t_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) :: t_0
real(8) :: tmp
t_0 = 1.0d0 / (h * l)
if (l <= (-5d-239)) then
tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h)
else if (l <= (-5d-310)) then
tmp = d * sqrt(sqrt((t_0 * t_0)))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 / (h * l);
double tmp;
if (l <= -5e-239) {
tmp = (Math.sqrt(-d) * Math.sqrt((d / l))) / Math.sqrt(-h);
} else if (l <= -5e-310) {
tmp = d * Math.sqrt(Math.sqrt((t_0 * t_0)));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = 1.0 / (h * l) tmp = 0 if l <= -5e-239: tmp = (math.sqrt(-d) * math.sqrt((d / l))) / math.sqrt(-h) elif l <= -5e-310: tmp = d * math.sqrt(math.sqrt((t_0 * t_0))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(1.0 / Float64(h * l)) tmp = 0.0 if (l <= -5e-239) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / l))) / sqrt(Float64(-h))); elseif (l <= -5e-310) tmp = Float64(d * sqrt(sqrt(Float64(t_0 * t_0)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = 1.0 / (h * l); tmp = 0.0; if (l <= -5e-239) tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h); elseif (l <= -5e-310) tmp = d * sqrt(sqrt((t_0 * t_0))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5e-239], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(d * N[Sqrt[N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{h \cdot \ell}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-239}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;d \cdot \sqrt{\sqrt{t\_0 \cdot t\_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -5e-239Initial program 59.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f646.1
Applied rewrites6.1%
Applied rewrites6.1%
Applied rewrites33.7%
Applied rewrites49.0%
if -5e-239 < l < -4.999999999999985e-310Initial program 74.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6431.6
Applied rewrites31.6%
Applied rewrites55.5%
if -4.999999999999985e-310 < l Initial program 70.7%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.1
Applied rewrites46.1%
Applied rewrites46.9%
Applied rewrites52.0%
Final simplification51.1%
(FPCore (d h l M D)
:precision binary64
(if (<= h -1.56e+193)
(/ (* (sqrt (- d)) (sqrt (/ d l))) (sqrt (- h)))
(if (<= h 4.6e-293)
(* (- d) (sqrt (/ 1.0 (* h l))))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1.56e+193) {
tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h);
} else if (h <= 4.6e-293) {
tmp = -d * sqrt((1.0 / (h * l)));
} 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 <= (-1.56d+193)) then
tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h)
else if (h <= 4.6d-293) then
tmp = -d * sqrt((1.0d0 / (h * l)))
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 <= -1.56e+193) {
tmp = (Math.sqrt(-d) * Math.sqrt((d / l))) / Math.sqrt(-h);
} else if (h <= 4.6e-293) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -1.56e+193: tmp = (math.sqrt(-d) * math.sqrt((d / l))) / math.sqrt(-h) elif h <= 4.6e-293: tmp = -d * math.sqrt((1.0 / (h * l))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1.56e+193) tmp = Float64(Float64(sqrt(Float64(-d)) * sqrt(Float64(d / l))) / sqrt(Float64(-h))); elseif (h <= 4.6e-293) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); 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 <= -1.56e+193) tmp = (sqrt(-d) * sqrt((d / l))) / sqrt(-h); elseif (h <= 4.6e-293) tmp = -d * sqrt((1.0 / (h * l))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1.56e+193], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 4.6e-293], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1.56 \cdot 10^{+193}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{-h}}\\
\mathbf{elif}\;h \leq 4.6 \cdot 10^{-293}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -1.5599999999999999e193Initial program 55.2%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f646.1
Applied rewrites6.1%
Applied rewrites6.1%
Applied rewrites20.8%
Applied rewrites33.1%
if -1.5599999999999999e193 < h < 4.5999999999999999e-293Initial program 64.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.3
Applied rewrites49.3%
if 4.5999999999999999e-293 < h Initial program 70.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.8
Applied rewrites46.8%
Applied rewrites47.6%
Applied rewrites52.9%
Final simplification49.1%
(FPCore (d h l M D)
:precision binary64
(if (<= h -1.56e+193)
(* (sqrt (/ d h)) (sqrt (/ d l)))
(if (<= h 4.6e-293)
(* (- d) (sqrt (/ 1.0 (* h l))))
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (h <= -1.56e+193) {
tmp = sqrt((d / h)) * sqrt((d / l));
} else if (h <= 4.6e-293) {
tmp = -d * sqrt((1.0 / (h * l)));
} 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 <= (-1.56d+193)) then
tmp = sqrt((d / h)) * sqrt((d / l))
else if (h <= 4.6d-293) then
tmp = -d * sqrt((1.0d0 / (h * l)))
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 <= -1.56e+193) {
tmp = Math.sqrt((d / h)) * Math.sqrt((d / l));
} else if (h <= 4.6e-293) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if h <= -1.56e+193: tmp = math.sqrt((d / h)) * math.sqrt((d / l)) elif h <= 4.6e-293: tmp = -d * math.sqrt((1.0 / (h * l))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (h <= -1.56e+193) tmp = Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))); elseif (h <= 4.6e-293) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); 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 <= -1.56e+193) tmp = sqrt((d / h)) * sqrt((d / l)); elseif (h <= 4.6e-293) tmp = -d * sqrt((1.0 / (h * l))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[h, -1.56e+193], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 4.6e-293], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;h \leq -1.56 \cdot 10^{+193}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\
\mathbf{elif}\;h \leq 4.6 \cdot 10^{-293}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if h < -1.5599999999999999e193Initial program 55.2%
Applied rewrites45.5%
Applied rewrites39.2%
Taylor expanded in d around inf
lower-sqrt.f64N/A
lower-/.f6433.1
Applied rewrites33.1%
if -1.5599999999999999e193 < h < 4.5999999999999999e-293Initial program 64.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.3
Applied rewrites49.3%
if 4.5999999999999999e-293 < h Initial program 70.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6446.8
Applied rewrites46.8%
Applied rewrites47.6%
Applied rewrites52.9%
Final simplification49.1%
(FPCore (d h l M D) :precision binary64 (if (<= d 8.6e-262) (* (- d) (sqrt (/ 1.0 (* h l)))) (/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 8.6e-262) {
tmp = -d * sqrt((1.0 / (h * l)));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= 8.6d-262) then
tmp = -d * sqrt((1.0d0 / (h * l)))
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= 8.6e-262) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= 8.6e-262: tmp = -d * math.sqrt((1.0 / (h * l))) else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= 8.6e-262) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= 8.6e-262) tmp = -d * sqrt((1.0 / (h * l))); else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, 8.6e-262], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq 8.6 \cdot 10^{-262}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < 8.6000000000000002e-262Initial program 62.0%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6440.5
Applied rewrites40.5%
if 8.6000000000000002e-262 < d Initial program 71.8%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6448.7
Applied rewrites48.7%
Applied rewrites49.5%
Applied rewrites54.2%
Final simplification46.8%
(FPCore (d h l M D) :precision binary64 (if (<= l -7.8e-240) (* (- d) (sqrt (/ 1.0 (* h l)))) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -7.8e-240) {
tmp = -d * sqrt((1.0 / (h * l)));
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-7.8d-240)) then
tmp = -d * sqrt((1.0d0 / (h * l)))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -7.8e-240) {
tmp = -d * Math.sqrt((1.0 / (h * l)));
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -7.8e-240: tmp = -d * math.sqrt((1.0 / (h * l))) else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -7.8e-240) tmp = Float64(Float64(-d) * sqrt(Float64(1.0 / Float64(h * l)))); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -7.8e-240) tmp = -d * sqrt((1.0 / (h * l))); else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -7.8e-240], N[((-d) * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7.8 \cdot 10^{-240}:\\
\;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if l < -7.80000000000000029e-240Initial program 59.5%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6446.2
Applied rewrites46.2%
if -7.80000000000000029e-240 < l Initial program 71.4%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.8
Applied rewrites43.8%
Applied rewrites44.5%
Final simplification45.2%
(FPCore (d h l M D) :precision binary64 (if (<= d -1.1e-201) (sqrt (* d (/ d (* h l)))) (/ d (sqrt (* h l)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.1e-201) {
tmp = sqrt((d * (d / (h * l))));
} else {
tmp = d / sqrt((h * l));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-1.1d-201)) then
tmp = sqrt((d * (d / (h * l))))
else
tmp = d / sqrt((h * l))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -1.1e-201) {
tmp = Math.sqrt((d * (d / (h * l))));
} else {
tmp = d / Math.sqrt((h * l));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -1.1e-201: tmp = math.sqrt((d * (d / (h * l)))) else: tmp = d / math.sqrt((h * l)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -1.1e-201) tmp = sqrt(Float64(d * Float64(d / Float64(h * l)))); else tmp = Float64(d / sqrt(Float64(h * l))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -1.1e-201) tmp = sqrt((d * (d / (h * l)))); else tmp = d / sqrt((h * l)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -1.1e-201], N[Sqrt[N[(d * N[(d / N[(h * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -1.1 \cdot 10^{-201}:\\
\;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\
\end{array}
\end{array}
if d < -1.1e-201Initial program 68.0%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f647.0
Applied rewrites7.0%
Applied rewrites7.0%
Applied rewrites23.8%
Applied rewrites29.4%
if -1.1e-201 < d Initial program 65.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6443.4
Applied rewrites43.4%
Applied rewrites44.1%
Final simplification38.0%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* h l))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((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 / sqrt((h * l))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((h * l));
}
def code(d, h, l, M, D): return d / math.sqrt((h * l))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(h * l))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((h * l)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{h \cdot \ell}}
\end{array}
Initial program 66.5%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6428.3
Applied rewrites28.3%
Applied rewrites28.7%
herbie shell --seed 2024223
(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)))))