
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\end{array}
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(-
1.0
(*
(/ (* (* (/ 0.5 d) D) M) (pow h -1.0))
(/ (* (/ M d) (* (* D 0.5) 0.5)) l))))
(t_1 (pow (/ d l) (/ 1.0 2.0))))
(if (<= d -1.9e-169)
(* t_0 (* t_1 (/ (sqrt (- d)) (sqrt (- h)))))
(if (<= d 3.8e-296)
(/
(fma
(pow (/ h l) 1.5)
(* (/ (pow (* M D) 2.0) d) -0.125)
(* (sqrt (/ h l)) d))
h)
(if (<= d 1.7e-68)
(*
(- 1.0 (* (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ 1.0 2.0)) (/ h l)))
(* (sqrt (/ 1.0 (* l h))) d))
(* (* (/ (sqrt d) (sqrt h)) t_1) t_0))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - (((((0.5 / d) * D) * M) / pow(h, -1.0)) * (((M / d) * ((D * 0.5) * 0.5)) / l));
double t_1 = pow((d / l), (1.0 / 2.0));
double tmp;
if (d <= -1.9e-169) {
tmp = t_0 * (t_1 * (sqrt(-d) / sqrt(-h)));
} else if (d <= 3.8e-296) {
tmp = fma(pow((h / l), 1.5), ((pow((M * D), 2.0) / d) * -0.125), (sqrt((h / l)) * d)) / h;
} else if (d <= 1.7e-68) {
tmp = (1.0 - ((pow(((M * D) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l))) * (sqrt((1.0 / (l * h))) * d);
} else {
tmp = ((sqrt(d) / sqrt(h)) * t_1) * t_0;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(1.0 - Float64(Float64(Float64(Float64(Float64(0.5 / d) * D) * M) / (h ^ -1.0)) * Float64(Float64(Float64(M / d) * Float64(Float64(D * 0.5) * 0.5)) / l))) t_1 = Float64(d / l) ^ Float64(1.0 / 2.0) tmp = 0.0 if (d <= -1.9e-169) tmp = Float64(t_0 * Float64(t_1 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))))); elseif (d <= 3.8e-296) tmp = Float64(fma((Float64(h / l) ^ 1.5), Float64(Float64((Float64(M * D) ^ 2.0) / d) * -0.125), Float64(sqrt(Float64(h / l)) * d)) / h); elseif (d <= 1.7e-68) tmp = Float64(Float64(1.0 - Float64(Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)) * Float64(h / l))) * Float64(sqrt(Float64(1.0 / Float64(l * h))) * d)); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * t_1) * t_0); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(1.0 - N[(N[(N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.9e-169], N[(t$95$0 * N[(t$95$1 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.8e-296], N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * -0.125), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 1.7e-68], N[(N[(1.0 - N[(N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{{h}^{-1}} \cdot \frac{\frac{M}{d} \cdot \left(\left(D \cdot 0.5\right) \cdot 0.5\right)}{\ell}\\
t_1 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\\
\mathbf{if}\;d \leq -1.9 \cdot 10^{-169}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\right)\\
\mathbf{elif}\;d \leq 3.8 \cdot 10^{-296}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\frac{h}{\ell}\right)}^{1.5}, \frac{{\left(M \cdot D\right)}^{2}}{d} \cdot -0.125, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\
\mathbf{elif}\;d \leq 1.7 \cdot 10^{-68}:\\
\;\;\;\;\left(1 - \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_1\right) \cdot t\_0\\
\end{array}
\end{array}
if d < -1.9e-169Initial program 72.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites77.1%
lift-/.f64N/A
metadata-eval77.1
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6488.7
Applied rewrites88.7%
if -1.9e-169 < d < 3.8000000000000002e-296Initial program 36.3%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites39.2%
Applied rewrites68.1%
if 3.8000000000000002e-296 < d < 1.70000000000000009e-68Initial program 50.9%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6450.8
Applied rewrites50.8%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6473.8
Applied rewrites73.8%
if 1.70000000000000009e-68 < d Initial program 72.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites77.9%
lift-/.f64N/A
metadata-eval77.9
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6492.3
Applied rewrites92.3%
Final simplification85.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (* l h)))) (t_1 (* (* (/ 0.5 d) D) M)))
(if (<= d -2.95e-67)
(* (- 1.0 (* (/ (* t_1 0.5) (pow h -1.0)) (/ t_1 l))) (* t_0 (- d)))
(if (<= d 3.8e-296)
(/
(fma
(pow (/ h l) 1.5)
(* (/ (pow (* M D) 2.0) d) -0.125)
(* (sqrt (/ h l)) d))
h)
(if (<= d 1.7e-68)
(*
(- 1.0 (* (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ 1.0 2.0)) (/ h l)))
(* t_0 d))
(*
(* (/ (sqrt d) (sqrt h)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (/ t_1 (pow h -1.0)) (/ (* (/ M d) (* (* D 0.5) 0.5)) l)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h)));
double t_1 = ((0.5 / d) * D) * M;
double tmp;
if (d <= -2.95e-67) {
tmp = (1.0 - (((t_1 * 0.5) / pow(h, -1.0)) * (t_1 / l))) * (t_0 * -d);
} else if (d <= 3.8e-296) {
tmp = fma(pow((h / l), 1.5), ((pow((M * D), 2.0) / d) * -0.125), (sqrt((h / l)) * d)) / h;
} else if (d <= 1.7e-68) {
tmp = (1.0 - ((pow(((M * D) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l))) * (t_0 * d);
} else {
tmp = ((sqrt(d) / sqrt(h)) * pow((d / l), (1.0 / 2.0))) * (1.0 - ((t_1 / pow(h, -1.0)) * (((M / d) * ((D * 0.5) * 0.5)) / l)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(l * h))) t_1 = Float64(Float64(Float64(0.5 / d) * D) * M) tmp = 0.0 if (d <= -2.95e-67) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(t_1 * 0.5) / (h ^ -1.0)) * Float64(t_1 / l))) * Float64(t_0 * Float64(-d))); elseif (d <= 3.8e-296) tmp = Float64(fma((Float64(h / l) ^ 1.5), Float64(Float64((Float64(M * D) ^ 2.0) / d) * -0.125), Float64(sqrt(Float64(h / l)) * d)) / h); elseif (d <= 1.7e-68) tmp = Float64(Float64(1.0 - Float64(Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)) * Float64(h / l))) * Float64(t_0 * d)); else tmp = Float64(Float64(Float64(sqrt(d) / sqrt(h)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(t_1 / (h ^ -1.0)) * Float64(Float64(Float64(M / d) * Float64(Float64(D * 0.5) * 0.5)) / l)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]}, If[LessEqual[d, -2.95e-67], N[(N[(1.0 - N[(N[(N[(t$95$1 * 0.5), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * (-d)), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.8e-296], N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * -0.125), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 1.7e-68], N[(N[(1.0 - N[(N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * d), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(t$95$1 / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
t_1 := \left(\frac{0.5}{d} \cdot D\right) \cdot M\\
\mathbf{if}\;d \leq -2.95 \cdot 10^{-67}:\\
\;\;\;\;\left(1 - \frac{t\_1 \cdot 0.5}{{h}^{-1}} \cdot \frac{t\_1}{\ell}\right) \cdot \left(t\_0 \cdot \left(-d\right)\right)\\
\mathbf{elif}\;d \leq 3.8 \cdot 10^{-296}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\frac{h}{\ell}\right)}^{1.5}, \frac{{\left(M \cdot D\right)}^{2}}{d} \cdot -0.125, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\
\mathbf{elif}\;d \leq 1.7 \cdot 10^{-68}:\\
\;\;\;\;\left(1 - \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left(t\_0 \cdot d\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\sqrt{d}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{t\_1}{{h}^{-1}} \cdot \frac{\frac{M}{d} \cdot \left(\left(D \cdot 0.5\right) \cdot 0.5\right)}{\ell}\right)\\
\end{array}
\end{array}
if d < -2.95e-67Initial program 75.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6474.4
Applied rewrites74.4%
Taylor expanded in h around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6474.1
Applied rewrites74.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites85.7%
if -2.95e-67 < d < 3.8000000000000002e-296Initial program 46.8%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites48.4%
Applied rewrites73.2%
if 3.8000000000000002e-296 < d < 1.70000000000000009e-68Initial program 50.9%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6450.8
Applied rewrites50.8%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6473.8
Applied rewrites73.8%
if 1.70000000000000009e-68 < d Initial program 72.4%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites77.9%
lift-/.f64N/A
metadata-eval77.9
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6492.3
Applied rewrites92.3%
Final simplification83.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (* (/ 0.5 d) D) M)))
(if (<= d -2.95e-67)
(*
(- 1.0 (* (/ (* t_0 0.5) (pow h -1.0)) (/ t_0 l)))
(* (sqrt (/ 1.0 (* l h))) (- d)))
(if (<= d 1.35e-297)
(/
(fma
(pow (/ h l) 1.5)
(* (/ (pow (* M D) 2.0) d) -0.125)
(* (sqrt (/ h l)) d))
h)
(if (<= d 5e+264)
(* (fma (/ (* (* -0.5 h) t_0) l) t_0 1.0) (/ d (sqrt (* l h))))
(*
(fma (* (* -0.5 (/ h l)) t_0) t_0 1.0)
(* (/ 1.0 (sqrt (/ l d))) (pow (/ d h) (/ 1.0 2.0)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((0.5 / d) * D) * M;
double tmp;
if (d <= -2.95e-67) {
tmp = (1.0 - (((t_0 * 0.5) / pow(h, -1.0)) * (t_0 / l))) * (sqrt((1.0 / (l * h))) * -d);
} else if (d <= 1.35e-297) {
tmp = fma(pow((h / l), 1.5), ((pow((M * D), 2.0) / d) * -0.125), (sqrt((h / l)) * d)) / h;
} else if (d <= 5e+264) {
tmp = fma((((-0.5 * h) * t_0) / l), t_0, 1.0) * (d / sqrt((l * h)));
} else {
tmp = fma(((-0.5 * (h / l)) * t_0), t_0, 1.0) * ((1.0 / sqrt((l / d))) * pow((d / h), (1.0 / 2.0)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(0.5 / d) * D) * M) tmp = 0.0 if (d <= -2.95e-67) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(t_0 * 0.5) / (h ^ -1.0)) * Float64(t_0 / l))) * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d))); elseif (d <= 1.35e-297) tmp = Float64(fma((Float64(h / l) ^ 1.5), Float64(Float64((Float64(M * D) ^ 2.0) / d) * -0.125), Float64(sqrt(Float64(h / l)) * d)) / h); elseif (d <= 5e+264) tmp = Float64(fma(Float64(Float64(Float64(-0.5 * h) * t_0) / l), t_0, 1.0) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(fma(Float64(Float64(-0.5 * Float64(h / l)) * t_0), t_0, 1.0) * Float64(Float64(1.0 / sqrt(Float64(l / d))) * (Float64(d / h) ^ Float64(1.0 / 2.0)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]}, If[LessEqual[d, -2.95e-67], N[(N[(1.0 - N[(N[(N[(t$95$0 * 0.5), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.35e-297], N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * -0.125), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 5e+264], N[(N[(N[(N[(N[(-0.5 * h), $MachinePrecision] * t$95$0), $MachinePrecision] / l), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{0.5}{d} \cdot D\right) \cdot M\\
\mathbf{if}\;d \leq -2.95 \cdot 10^{-67}:\\
\;\;\;\;\left(1 - \frac{t\_0 \cdot 0.5}{{h}^{-1}} \cdot \frac{t\_0}{\ell}\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\
\mathbf{elif}\;d \leq 1.35 \cdot 10^{-297}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\frac{h}{\ell}\right)}^{1.5}, \frac{{\left(M \cdot D\right)}^{2}}{d} \cdot -0.125, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\
\mathbf{elif}\;d \leq 5 \cdot 10^{+264}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(-0.5 \cdot h\right) \cdot t\_0}{\ell}, t\_0, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(-0.5 \cdot \frac{h}{\ell}\right) \cdot t\_0, t\_0, 1\right) \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
\end{array}
\end{array}
if d < -2.95e-67Initial program 75.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6474.4
Applied rewrites74.4%
Taylor expanded in h around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6474.1
Applied rewrites74.1%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites85.7%
if -2.95e-67 < d < 1.3500000000000001e-297Initial program 46.8%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites48.4%
Applied rewrites73.2%
if 1.3500000000000001e-297 < d < 5.00000000000000033e264Initial program 64.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6465.1
Applied rewrites65.1%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites65.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites67.6%
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
sqrt-divN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lower-/.f6482.1
Applied rewrites82.1%
if 5.00000000000000033e264 < d Initial program 88.2%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites99.6%
Final simplification81.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (* (/ 0.5 d) D) M))
(t_1 (fma (/ (* (* -0.5 h) t_0) l) t_0 1.0)))
(if (<= h -5e-310)
(*
(- 1.0 (* (/ (* t_0 0.5) (pow h -1.0)) (/ t_0 l)))
(* (sqrt (/ 1.0 (* l h))) (- d)))
(if (<= h 7.7e+136)
(* t_1 (/ d (sqrt (* l h))))
(* (* (sqrt (/ d h)) (sqrt (/ d l))) t_1)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((0.5 / d) * D) * M;
double t_1 = fma((((-0.5 * h) * t_0) / l), t_0, 1.0);
double tmp;
if (h <= -5e-310) {
tmp = (1.0 - (((t_0 * 0.5) / pow(h, -1.0)) * (t_0 / l))) * (sqrt((1.0 / (l * h))) * -d);
} else if (h <= 7.7e+136) {
tmp = t_1 * (d / sqrt((l * h)));
} else {
tmp = (sqrt((d / h)) * sqrt((d / l))) * t_1;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(0.5 / d) * D) * M) t_1 = fma(Float64(Float64(Float64(-0.5 * h) * t_0) / l), t_0, 1.0) tmp = 0.0 if (h <= -5e-310) tmp = Float64(Float64(1.0 - Float64(Float64(Float64(t_0 * 0.5) / (h ^ -1.0)) * Float64(t_0 / l))) * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d))); elseif (h <= 7.7e+136) tmp = Float64(t_1 * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * t_1); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(-0.5 * h), $MachinePrecision] * t$95$0), $MachinePrecision] / l), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]}, If[LessEqual[h, -5e-310], N[(N[(1.0 - N[(N[(N[(t$95$0 * 0.5), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 7.7e+136], N[(t$95$1 * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{0.5}{d} \cdot D\right) \cdot M\\
t_1 := \mathsf{fma}\left(\frac{\left(-0.5 \cdot h\right) \cdot t\_0}{\ell}, t\_0, 1\right)\\
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(1 - \frac{t\_0 \cdot 0.5}{{h}^{-1}} \cdot \frac{t\_0}{\ell}\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\
\mathbf{elif}\;h \leq 7.7 \cdot 10^{+136}:\\
\;\;\;\;t\_1 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_1\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 64.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
Taylor expanded in h around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6466.2
Applied rewrites66.2%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites78.0%
if -4.999999999999985e-310 < h < 7.7000000000000003e136Initial program 65.6%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6467.1
Applied rewrites67.1%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites67.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites68.0%
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
sqrt-divN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lower-/.f6484.8
Applied rewrites84.8%
if 7.7000000000000003e136 < h Initial program 63.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites63.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites72.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
lift-sqrt.f64N/A
lower-*.f6472.9
lift-/.f64N/A
metadata-eval72.9
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6472.9
Applied rewrites72.9%
Final simplification80.4%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (* (/ 0.5 d) D) M))
(t_1 (fma (/ (* (* -0.5 h) t_0) l) t_0 1.0)))
(if (<= h -5e-310)
(* t_1 (* (sqrt (/ 1.0 (* l h))) (- d)))
(if (<= h 7.7e+136)
(* t_1 (/ d (sqrt (* l h))))
(* (* (sqrt (/ d h)) (sqrt (/ d l))) t_1)))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((0.5 / d) * D) * M;
double t_1 = fma((((-0.5 * h) * t_0) / l), t_0, 1.0);
double tmp;
if (h <= -5e-310) {
tmp = t_1 * (sqrt((1.0 / (l * h))) * -d);
} else if (h <= 7.7e+136) {
tmp = t_1 * (d / sqrt((l * h)));
} else {
tmp = (sqrt((d / h)) * sqrt((d / l))) * t_1;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(0.5 / d) * D) * M) t_1 = fma(Float64(Float64(Float64(-0.5 * h) * t_0) / l), t_0, 1.0) tmp = 0.0 if (h <= -5e-310) tmp = Float64(t_1 * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d))); elseif (h <= 7.7e+136) tmp = Float64(t_1 * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))) * t_1); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(-0.5 * h), $MachinePrecision] * t$95$0), $MachinePrecision] / l), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]}, If[LessEqual[h, -5e-310], N[(t$95$1 * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 7.7e+136], N[(t$95$1 * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{0.5}{d} \cdot D\right) \cdot M\\
t_1 := \mathsf{fma}\left(\frac{\left(-0.5 \cdot h\right) \cdot t\_0}{\ell}, t\_0, 1\right)\\
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\
\mathbf{elif}\;h \leq 7.7 \cdot 10^{+136}:\\
\;\;\;\;t\_1 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_1\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 64.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites65.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites68.7%
Taylor expanded in h around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6477.3
Applied rewrites77.3%
if -4.999999999999985e-310 < h < 7.7000000000000003e136Initial program 65.6%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6467.1
Applied rewrites67.1%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites67.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites68.0%
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
sqrt-divN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lower-/.f6484.8
Applied rewrites84.8%
if 7.7000000000000003e136 < h Initial program 63.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites63.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites72.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
lift-sqrt.f64N/A
lower-*.f6472.9
lift-/.f64N/A
metadata-eval72.9
lift-pow.f64N/A
pow1/2N/A
lift-sqrt.f6472.9
Applied rewrites72.9%
Final simplification80.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (* (/ 0.5 d) D) M))
(t_1 (fma (/ (* (* -0.5 h) t_0) l) t_0 1.0)))
(if (<= h -5e-310)
(* t_1 (* (sqrt (/ 1.0 (* l h))) (- d)))
(if (<= h 3.6e+238)
(* t_1 (/ d (sqrt (* l h))))
(*
(* (fma (* (/ h l) t_0) (* -0.25 (/ (* M D) d)) 1.0) (sqrt (/ d l)))
(sqrt (/ d h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((0.5 / d) * D) * M;
double t_1 = fma((((-0.5 * h) * t_0) / l), t_0, 1.0);
double tmp;
if (h <= -5e-310) {
tmp = t_1 * (sqrt((1.0 / (l * h))) * -d);
} else if (h <= 3.6e+238) {
tmp = t_1 * (d / sqrt((l * h)));
} else {
tmp = (fma(((h / l) * t_0), (-0.25 * ((M * D) / d)), 1.0) * sqrt((d / l))) * sqrt((d / h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(0.5 / d) * D) * M) t_1 = fma(Float64(Float64(Float64(-0.5 * h) * t_0) / l), t_0, 1.0) tmp = 0.0 if (h <= -5e-310) tmp = Float64(t_1 * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d))); elseif (h <= 3.6e+238) tmp = Float64(t_1 * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(Float64(fma(Float64(Float64(h / l) * t_0), Float64(-0.25 * Float64(Float64(M * D) / d)), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(d / h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(-0.5 * h), $MachinePrecision] * t$95$0), $MachinePrecision] / l), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]}, If[LessEqual[h, -5e-310], N[(t$95$1 * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 3.6e+238], N[(t$95$1 * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(h / l), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(-0.25 * N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{0.5}{d} \cdot D\right) \cdot M\\
t_1 := \mathsf{fma}\left(\frac{\left(-0.5 \cdot h\right) \cdot t\_0}{\ell}, t\_0, 1\right)\\
\mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\
\mathbf{elif}\;h \leq 3.6 \cdot 10^{+238}:\\
\;\;\;\;t\_1 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{h}{\ell} \cdot t\_0, -0.25 \cdot \frac{M \cdot D}{d}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
\end{array}
\end{array}
if h < -4.999999999999985e-310Initial program 64.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites65.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites68.7%
Taylor expanded in h around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6477.3
Applied rewrites77.3%
if -4.999999999999985e-310 < h < 3.59999999999999971e238Initial program 64.6%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6466.0
Applied rewrites66.0%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites65.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites68.4%
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
sqrt-divN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lower-/.f6482.5
Applied rewrites82.5%
if 3.59999999999999971e238 < h Initial program 75.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites75.0%
lift-fma.f64N/A
*-commutativeN/A
lift-pow.f64N/A
metadata-evalN/A
pow-powN/A
inv-powN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
clear-numN/A
lift-/.f64N/A
lift-pow.f64N/A
Applied rewrites50.0%
Applied rewrites75.6%
Taylor expanded in M around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.6
Applied rewrites75.6%
Final simplification79.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (sqrt (/ 1.0 (* l h))) (- d))) (t_1 (* (* (/ 0.5 d) D) M)))
(if (<= d -1.5e+95)
t_0
(if (<= d -2.7e-151)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= d -2.05e-303)
(* (* (* (/ (/ (* M M) d) d) h) (/ (* (* D D) -0.125) l)) t_0)
(* (fma (/ (* (* -0.5 h) t_1) l) t_1 1.0) (/ d (sqrt (* l h)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h))) * -d;
double t_1 = ((0.5 / d) * D) * M;
double tmp;
if (d <= -1.5e+95) {
tmp = t_0;
} else if (d <= -2.7e-151) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (d <= -2.05e-303) {
tmp = (((((M * M) / d) / d) * h) * (((D * D) * -0.125) / l)) * t_0;
} else {
tmp = fma((((-0.5 * h) * t_1) / l), t_1, 1.0) * (d / sqrt((l * h)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) t_1 = Float64(Float64(Float64(0.5 / d) * D) * M) tmp = 0.0 if (d <= -1.5e+95) tmp = t_0; elseif (d <= -2.7e-151) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (d <= -2.05e-303) tmp = Float64(Float64(Float64(Float64(Float64(Float64(M * M) / d) / d) * h) * Float64(Float64(Float64(D * D) * -0.125) / l)) * t_0); else tmp = Float64(fma(Float64(Float64(Float64(-0.5 * h) * t_1) / l), t_1, 1.0) * Float64(d / sqrt(Float64(l * h)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]}, If[LessEqual[d, -1.5e+95], t$95$0, If[LessEqual[d, -2.7e-151], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.05e-303], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] * h), $MachinePrecision] * N[(N[(N[(D * D), $MachinePrecision] * -0.125), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(-0.5 * h), $MachinePrecision] * t$95$1), $MachinePrecision] / l), $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
t_1 := \left(\frac{0.5}{d} \cdot D\right) \cdot M\\
\mathbf{if}\;d \leq -1.5 \cdot 10^{+95}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq -2.7 \cdot 10^{-151}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq -2.05 \cdot 10^{-303}:\\
\;\;\;\;\left(\left(\frac{\frac{M \cdot M}{d}}{d} \cdot h\right) \cdot \frac{\left(D \cdot D\right) \cdot -0.125}{\ell}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(-0.5 \cdot h\right) \cdot t\_1}{\ell}, t\_1, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -1.49999999999999996e95Initial program 70.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6465.1
Applied rewrites65.1%
if -1.49999999999999996e95 < d < -2.70000000000000007e-151Initial program 76.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.1%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6461.4
Applied rewrites61.4%
if -2.70000000000000007e-151 < d < -2.05000000000000009e-303Initial program 32.9%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6432.9
Applied rewrites32.9%
Taylor expanded in h around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6454.5
Applied rewrites54.5%
Taylor expanded in h around inf
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6453.9
Applied rewrites53.9%
if -2.05000000000000009e-303 < d Initial program 65.3%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites66.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites68.8%
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
sqrt-divN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lower-/.f6478.1
Applied rewrites78.1%
Final simplification69.9%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (sqrt (/ 1.0 (* l h))) (- d))) (t_1 (* (* (/ 0.5 d) D) M)))
(if (<= d -1.5e+95)
t_0
(if (<= d -2.7e-151)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= d -2.05e-303)
(* (* (* (/ (/ (* M M) d) d) h) (/ (* (* D D) -0.125) l)) t_0)
(* (fma (* (* -0.5 (/ h l)) t_1) t_1 1.0) (/ d (sqrt (* l h)))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h))) * -d;
double t_1 = ((0.5 / d) * D) * M;
double tmp;
if (d <= -1.5e+95) {
tmp = t_0;
} else if (d <= -2.7e-151) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (d <= -2.05e-303) {
tmp = (((((M * M) / d) / d) * h) * (((D * D) * -0.125) / l)) * t_0;
} else {
tmp = fma(((-0.5 * (h / l)) * t_1), t_1, 1.0) * (d / sqrt((l * h)));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) t_1 = Float64(Float64(Float64(0.5 / d) * D) * M) tmp = 0.0 if (d <= -1.5e+95) tmp = t_0; elseif (d <= -2.7e-151) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (d <= -2.05e-303) tmp = Float64(Float64(Float64(Float64(Float64(Float64(M * M) / d) / d) * h) * Float64(Float64(Float64(D * D) * -0.125) / l)) * t_0); else tmp = Float64(fma(Float64(Float64(-0.5 * Float64(h / l)) * t_1), t_1, 1.0) * Float64(d / sqrt(Float64(l * h)))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]}, If[LessEqual[d, -1.5e+95], t$95$0, If[LessEqual[d, -2.7e-151], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -2.05e-303], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] * h), $MachinePrecision] * N[(N[(N[(D * D), $MachinePrecision] * -0.125), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$1 + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
t_1 := \left(\frac{0.5}{d} \cdot D\right) \cdot M\\
\mathbf{if}\;d \leq -1.5 \cdot 10^{+95}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq -2.7 \cdot 10^{-151}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq -2.05 \cdot 10^{-303}:\\
\;\;\;\;\left(\left(\frac{\frac{M \cdot M}{d}}{d} \cdot h\right) \cdot \frac{\left(D \cdot D\right) \cdot -0.125}{\ell}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(-0.5 \cdot \frac{h}{\ell}\right) \cdot t\_1, t\_1, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\end{array}
\end{array}
if d < -1.49999999999999996e95Initial program 70.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6465.1
Applied rewrites65.1%
if -1.49999999999999996e95 < d < -2.70000000000000007e-151Initial program 76.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.1%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6461.4
Applied rewrites61.4%
if -2.70000000000000007e-151 < d < -2.05000000000000009e-303Initial program 32.9%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6432.9
Applied rewrites32.9%
Taylor expanded in h around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6454.5
Applied rewrites54.5%
Taylor expanded in h around inf
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6453.9
Applied rewrites53.9%
if -2.05000000000000009e-303 < d Initial program 65.3%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites66.5%
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
lift-/.f64N/A
sqrt-divN/A
lift-/.f64N/A
sqrt-divN/A
frac-timesN/A
rem-square-sqrtN/A
sqrt-prodN/A
*-commutativeN/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f6475.1
Applied rewrites75.1%
Final simplification68.3%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (sqrt (/ 1.0 (* l h))) (- d))))
(if (<= d -1.5e+95)
t_0
(if (<= d -2.7e-151)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= d -5e-312)
(* (* (* (/ (/ (* M M) d) d) h) (/ (* (* D D) -0.125) l)) t_0)
(/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h))) * -d;
double tmp;
if (d <= -1.5e+95) {
tmp = t_0;
} else if (d <= -2.7e-151) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (d <= -5e-312) {
tmp = (((((M * M) / d) / d) * h) * (((D * D) * -0.125) / l)) * 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 = sqrt((1.0d0 / (l * h))) * -d
if (d <= (-1.5d+95)) then
tmp = t_0
else if (d <= (-2.7d-151)) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (d <= (-5d-312)) then
tmp = (((((m * m) / d) / d) * h) * (((d_1 * d_1) * (-0.125d0)) / l)) * 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 = Math.sqrt((1.0 / (l * h))) * -d;
double tmp;
if (d <= -1.5e+95) {
tmp = t_0;
} else if (d <= -2.7e-151) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (d <= -5e-312) {
tmp = (((((M * M) / d) / d) * h) * (((D * D) * -0.125) / l)) * t_0;
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (l * h))) * -d tmp = 0 if d <= -1.5e+95: tmp = t_0 elif d <= -2.7e-151: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif d <= -5e-312: tmp = (((((M * M) / d) / d) * h) * (((D * D) * -0.125) / l)) * t_0 else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) tmp = 0.0 if (d <= -1.5e+95) tmp = t_0; elseif (d <= -2.7e-151) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (d <= -5e-312) tmp = Float64(Float64(Float64(Float64(Float64(Float64(M * M) / d) / d) * h) * Float64(Float64(Float64(D * D) * -0.125) / l)) * 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 = sqrt((1.0 / (l * h))) * -d; tmp = 0.0; if (d <= -1.5e+95) tmp = t_0; elseif (d <= -2.7e-151) tmp = sqrt((d / l)) * sqrt((d / h)); elseif (d <= -5e-312) tmp = (((((M * M) / d) / d) * h) * (((D * D) * -0.125) / l)) * 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[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]}, If[LessEqual[d, -1.5e+95], t$95$0, If[LessEqual[d, -2.7e-151], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-312], N[(N[(N[(N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] * h), $MachinePrecision] * N[(N[(N[(D * D), $MachinePrecision] * -0.125), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{if}\;d \leq -1.5 \cdot 10^{+95}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq -2.7 \cdot 10^{-151}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-312}:\\
\;\;\;\;\left(\left(\frac{\frac{M \cdot M}{d}}{d} \cdot h\right) \cdot \frac{\left(D \cdot D\right) \cdot -0.125}{\ell}\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -1.49999999999999996e95Initial program 70.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6465.1
Applied rewrites65.1%
if -1.49999999999999996e95 < d < -2.70000000000000007e-151Initial program 76.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.1%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6461.4
Applied rewrites61.4%
if -2.70000000000000007e-151 < d < -5.0000000000022e-312Initial program 36.2%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6436.2
Applied rewrites36.2%
Taylor expanded in h around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
Taylor expanded in h around inf
associate-*r/N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6448.7
Applied rewrites48.7%
if -5.0000000000022e-312 < d Initial program 65.3%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6441.1
Applied rewrites41.1%
Applied rewrites41.1%
Applied rewrites49.0%
Final simplification54.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (* (/ 0.5 d) D) M))
(t_1 (fma (/ (* (* -0.5 h) t_0) l) t_0 1.0)))
(if (<= l -5e-310)
(* t_1 (* (sqrt (/ 1.0 (* l h))) (- d)))
(if (<= l 9.6e+160)
(* t_1 (/ d (sqrt (* l h))))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((0.5 / d) * D) * M;
double t_1 = fma((((-0.5 * h) * t_0) / l), t_0, 1.0);
double tmp;
if (l <= -5e-310) {
tmp = t_1 * (sqrt((1.0 / (l * h))) * -d);
} else if (l <= 9.6e+160) {
tmp = t_1 * (d / sqrt((l * h)));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(0.5 / d) * D) * M) t_1 = fma(Float64(Float64(Float64(-0.5 * h) * t_0) / l), t_0, 1.0) tmp = 0.0 if (l <= -5e-310) tmp = Float64(t_1 * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d))); elseif (l <= 9.6e+160) tmp = Float64(t_1 * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(-0.5 * h), $MachinePrecision] * t$95$0), $MachinePrecision] / l), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(t$95$1 * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.6e+160], N[(t$95$1 * N[(d / N[Sqrt[N[(l * h), $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 := \left(\frac{0.5}{d} \cdot D\right) \cdot M\\
t_1 := \mathsf{fma}\left(\frac{\left(-0.5 \cdot h\right) \cdot t\_0}{\ell}, t\_0, 1\right)\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\
\mathbf{elif}\;\ell \leq 9.6 \cdot 10^{+160}:\\
\;\;\;\;t\_1 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 64.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites65.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites68.7%
Taylor expanded in h around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6477.3
Applied rewrites77.3%
if -4.999999999999985e-310 < l < 9.6000000000000006e160Initial program 75.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6476.8
Applied rewrites76.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites75.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites78.0%
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
sqrt-divN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
if 9.6000000000000006e160 < l Initial program 35.9%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6458.1
Applied rewrites58.1%
Applied rewrites58.2%
Applied rewrites72.5%
Final simplification79.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (* (/ 0.5 d) D) M)))
(if (<= l -5e-310)
(*
(fma (* (* -0.5 (/ h l)) t_0) t_0 1.0)
(* (sqrt (/ 1.0 (* l h))) (- d)))
(if (<= l 9.6e+160)
(* (fma (/ (* (* -0.5 h) t_0) l) t_0 1.0) (/ d (sqrt (* l h))))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((0.5 / d) * D) * M;
double tmp;
if (l <= -5e-310) {
tmp = fma(((-0.5 * (h / l)) * t_0), t_0, 1.0) * (sqrt((1.0 / (l * h))) * -d);
} else if (l <= 9.6e+160) {
tmp = fma((((-0.5 * h) * t_0) / l), t_0, 1.0) * (d / sqrt((l * h)));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(0.5 / d) * D) * M) tmp = 0.0 if (l <= -5e-310) tmp = Float64(fma(Float64(Float64(-0.5 * Float64(h / l)) * t_0), t_0, 1.0) * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d))); elseif (l <= 9.6e+160) tmp = Float64(fma(Float64(Float64(Float64(-0.5 * h) * t_0) / l), t_0, 1.0) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.6e+160], N[(N[(N[(N[(N[(-0.5 * h), $MachinePrecision] * t$95$0), $MachinePrecision] / l), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $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 := \left(\frac{0.5}{d} \cdot D\right) \cdot M\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(\left(-0.5 \cdot \frac{h}{\ell}\right) \cdot t\_0, t\_0, 1\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\
\mathbf{elif}\;\ell \leq 9.6 \cdot 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(-0.5 \cdot h\right) \cdot t\_0}{\ell}, t\_0, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 64.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites65.4%
Taylor expanded in h around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6467.1
Applied rewrites67.1%
if -4.999999999999985e-310 < l < 9.6000000000000006e160Initial program 75.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6476.8
Applied rewrites76.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites75.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites78.0%
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
sqrt-divN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
if 9.6000000000000006e160 < l Initial program 35.9%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6458.1
Applied rewrites58.1%
Applied rewrites58.2%
Applied rewrites72.5%
Final simplification74.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* (* (/ 0.5 d) D) M)))
(if (<= l -5e-310)
(*
(fma
(* (* (* (* (* -0.5 (/ h l)) M) D) (/ 0.5 d)) (* M D))
(/ 0.5 d)
1.0)
(* (sqrt (/ 1.0 (* l h))) (- d)))
(if (<= l 9.6e+160)
(* (fma (/ (* (* -0.5 h) t_0) l) t_0 1.0) (/ d (sqrt (* l h))))
(/ d (* (sqrt l) (sqrt h)))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = ((0.5 / d) * D) * M;
double tmp;
if (l <= -5e-310) {
tmp = fma((((((-0.5 * (h / l)) * M) * D) * (0.5 / d)) * (M * D)), (0.5 / d), 1.0) * (sqrt((1.0 / (l * h))) * -d);
} else if (l <= 9.6e+160) {
tmp = fma((((-0.5 * h) * t_0) / l), t_0, 1.0) * (d / sqrt((l * h)));
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64(Float64(0.5 / d) * D) * M) tmp = 0.0 if (l <= -5e-310) tmp = Float64(fma(Float64(Float64(Float64(Float64(Float64(-0.5 * Float64(h / l)) * M) * D) * Float64(0.5 / d)) * Float64(M * D)), Float64(0.5 / d), 1.0) * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d))); elseif (l <= 9.6e+160) tmp = Float64(fma(Float64(Float64(Float64(-0.5 * h) * t_0) / l), t_0, 1.0) * Float64(d / sqrt(Float64(l * h)))); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(N[(N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision] * D), $MachinePrecision] * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] * N[(0.5 / d), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 9.6e+160], N[(N[(N[(N[(N[(-0.5 * h), $MachinePrecision] * t$95$0), $MachinePrecision] / l), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $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 := \left(\frac{0.5}{d} \cdot D\right) \cdot M\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\left(\left(-0.5 \cdot \frac{h}{\ell}\right) \cdot M\right) \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \left(M \cdot D\right), \frac{0.5}{d}, 1\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\
\mathbf{elif}\;\ell \leq 9.6 \cdot 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\left(-0.5 \cdot h\right) \cdot t\_0}{\ell}, t\_0, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 64.5%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
Taylor expanded in h around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6466.2
Applied rewrites66.2%
Applied rewrites65.7%
if -4.999999999999985e-310 < l < 9.6000000000000006e160Initial program 75.1%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6476.8
Applied rewrites76.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites75.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
associate-/r*N/A
lift-*.f64N/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites78.0%
lift-*.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-pow.f64N/A
pow1/2N/A
lift-/.f64N/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
sqrt-unprodN/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
sqrt-divN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
if 9.6000000000000006e160 < l Initial program 35.9%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6458.1
Applied rewrites58.1%
Applied rewrites58.2%
Applied rewrites72.5%
Final simplification74.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (* l h)))))
(if (<= d -1.5e+95)
(* t_0 (- d))
(if (<= d -2.8e-157)
(* (sqrt (/ d l)) (sqrt (/ d h)))
(if (<= d -5e-312) (* t_0 d) (/ d (* (sqrt l) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h)));
double tmp;
if (d <= -1.5e+95) {
tmp = t_0 * -d;
} else if (d <= -2.8e-157) {
tmp = sqrt((d / l)) * sqrt((d / h));
} else if (d <= -5e-312) {
tmp = t_0 * 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) :: t_0
real(8) :: tmp
t_0 = sqrt((1.0d0 / (l * h)))
if (d <= (-1.5d+95)) then
tmp = t_0 * -d
else if (d <= (-2.8d-157)) then
tmp = sqrt((d / l)) * sqrt((d / h))
else if (d <= (-5d-312)) then
tmp = t_0 * 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 t_0 = Math.sqrt((1.0 / (l * h)));
double tmp;
if (d <= -1.5e+95) {
tmp = t_0 * -d;
} else if (d <= -2.8e-157) {
tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
} else if (d <= -5e-312) {
tmp = t_0 * d;
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (l * h))) tmp = 0 if d <= -1.5e+95: tmp = t_0 * -d elif d <= -2.8e-157: tmp = math.sqrt((d / l)) * math.sqrt((d / h)) elif d <= -5e-312: tmp = t_0 * d else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(l * h))) tmp = 0.0 if (d <= -1.5e+95) tmp = Float64(t_0 * Float64(-d)); elseif (d <= -2.8e-157) tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))); elseif (d <= -5e-312) tmp = Float64(t_0 * d); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((1.0 / (l * h))); tmp = 0.0; if (d <= -1.5e+95) tmp = t_0 * -d; elseif (d <= -2.8e-157) tmp = sqrt((d / l)) * sqrt((d / h)); elseif (d <= -5e-312) tmp = t_0 * d; else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.5e+95], N[(t$95$0 * (-d)), $MachinePrecision], If[LessEqual[d, -2.8e-157], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-312], N[(t$95$0 * d), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{if}\;d \leq -1.5 \cdot 10^{+95}:\\
\;\;\;\;t\_0 \cdot \left(-d\right)\\
\mathbf{elif}\;d \leq -2.8 \cdot 10^{-157}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
\mathbf{elif}\;d \leq -5 \cdot 10^{-312}:\\
\;\;\;\;t\_0 \cdot d\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if d < -1.49999999999999996e95Initial program 70.8%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6465.1
Applied rewrites65.1%
if -1.49999999999999996e95 < d < -2.8000000000000001e-157Initial program 76.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.1%
Taylor expanded in h around 0
lower-sqrt.f64N/A
lower-/.f6461.4
Applied rewrites61.4%
if -2.8000000000000001e-157 < d < -5.0000000000022e-312Initial program 36.2%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6424.6
Applied rewrites24.6%
if -5.0000000000022e-312 < d Initial program 65.3%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6441.1
Applied rewrites41.1%
Applied rewrites41.1%
Applied rewrites49.0%
Final simplification51.2%
(FPCore (d h l M D)
:precision binary64
(if (<= l -1.3e-212)
(* (sqrt (/ 1.0 (* l h))) (- d))
(if (<= l 1.3e-223)
(/ (* (sqrt (/ h l)) (- d)) h)
(/ d (* (sqrt l) (sqrt h))))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.3e-212) {
tmp = sqrt((1.0 / (l * h))) * -d;
} else if (l <= 1.3e-223) {
tmp = (sqrt((h / l)) * -d) / h;
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= (-1.3d-212)) then
tmp = sqrt((1.0d0 / (l * h))) * -d
else if (l <= 1.3d-223) then
tmp = (sqrt((h / l)) * -d) / h
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= -1.3e-212) {
tmp = Math.sqrt((1.0 / (l * h))) * -d;
} else if (l <= 1.3e-223) {
tmp = (Math.sqrt((h / l)) * -d) / h;
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= -1.3e-212: tmp = math.sqrt((1.0 / (l * h))) * -d elif l <= 1.3e-223: tmp = (math.sqrt((h / l)) * -d) / h else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= -1.3e-212) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); elseif (l <= 1.3e-223) tmp = Float64(Float64(sqrt(Float64(h / l)) * Float64(-d)) / h); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= -1.3e-212) tmp = sqrt((1.0 / (l * h))) * -d; elseif (l <= 1.3e-223) tmp = (sqrt((h / l)) * -d) / h; else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, -1.3e-212], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[l, 1.3e-223], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] / h), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.3 \cdot 10^{-212}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{-223}:\\
\;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left(-d\right)}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < -1.3e-212Initial program 62.4%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
if -1.3e-212 < l < 1.3e-223Initial program 78.0%
Taylor expanded in h around 0
lower-/.f64N/A
Applied rewrites46.4%
Taylor expanded in l around -inf
Applied rewrites36.3%
if 1.3e-223 < l Initial program 62.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6446.4
Applied rewrites46.4%
Applied rewrites46.4%
Applied rewrites55.3%
Final simplification49.5%
(FPCore (d h l M D) :precision binary64 (if (<= l 9.8e-224) (* (sqrt (/ 1.0 (* l h))) (- d)) (/ d (* (sqrt l) (sqrt h)))))
double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 9.8e-224) {
tmp = sqrt((1.0 / (l * h))) * -d;
} else {
tmp = d / (sqrt(l) * sqrt(h));
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (l <= 9.8d-224) then
tmp = sqrt((1.0d0 / (l * h))) * -d
else
tmp = d / (sqrt(l) * sqrt(h))
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (l <= 9.8e-224) {
tmp = Math.sqrt((1.0 / (l * h))) * -d;
} else {
tmp = d / (Math.sqrt(l) * Math.sqrt(h));
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if l <= 9.8e-224: tmp = math.sqrt((1.0 / (l * h))) * -d else: tmp = d / (math.sqrt(l) * math.sqrt(h)) return tmp
function code(d, h, l, M, D) tmp = 0.0 if (l <= 9.8e-224) tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)); else tmp = Float64(d / Float64(sqrt(l) * sqrt(h))); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (l <= 9.8e-224) tmp = sqrt((1.0 / (l * h))) * -d; else tmp = d / (sqrt(l) * sqrt(h)); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[l, 9.8e-224], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 9.8 \cdot 10^{-224}:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
\end{array}
\end{array}
if l < 9.7999999999999992e-224Initial program 66.7%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6442.7
Applied rewrites42.7%
if 9.7999999999999992e-224 < l Initial program 62.4%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6446.4
Applied rewrites46.4%
Applied rewrites46.4%
Applied rewrites55.3%
Final simplification47.9%
(FPCore (d h l M D) :precision binary64 (let* ((t_0 (sqrt (/ 1.0 (* l h))))) (if (<= d -2.8e-157) (* t_0 (- d)) (* t_0 d))))
double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((1.0 / (l * h)));
double tmp;
if (d <= -2.8e-157) {
tmp = t_0 * -d;
} else {
tmp = t_0 * d;
}
return tmp;
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((1.0d0 / (l * h)))
if (d <= (-2.8d-157)) then
tmp = t_0 * -d
else
tmp = t_0 * d
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((1.0 / (l * h)));
double tmp;
if (d <= -2.8e-157) {
tmp = t_0 * -d;
} else {
tmp = t_0 * d;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((1.0 / (l * h))) tmp = 0 if d <= -2.8e-157: tmp = t_0 * -d else: tmp = t_0 * d return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(1.0 / Float64(l * h))) tmp = 0.0 if (d <= -2.8e-157) tmp = Float64(t_0 * Float64(-d)); else tmp = Float64(t_0 * d); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((1.0 / (l * h))); tmp = 0.0; if (d <= -2.8e-157) tmp = t_0 * -d; else tmp = t_0 * d; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -2.8e-157], N[(t$95$0 * (-d)), $MachinePrecision], N[(t$95$0 * d), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\
\mathbf{if}\;d \leq -2.8 \cdot 10^{-157}:\\
\;\;\;\;t\_0 \cdot \left(-d\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot d\\
\end{array}
\end{array}
if d < -2.8000000000000001e-157Initial program 73.9%
Taylor expanded in l around -inf
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6456.9
Applied rewrites56.9%
if -2.8000000000000001e-157 < d Initial program 59.7%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6437.9
Applied rewrites37.9%
Final simplification44.9%
(FPCore (d h l M D) :precision binary64 (* (sqrt (/ 1.0 (* l h))) d))
double code(double d, double h, double l, double M, double D) {
return sqrt((1.0 / (l * h))) * d;
}
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 = sqrt((1.0d0 / (l * h))) * d
end function
public static double code(double d, double h, double l, double M, double D) {
return Math.sqrt((1.0 / (l * h))) * d;
}
def code(d, h, l, M, D): return math.sqrt((1.0 / (l * h))) * d
function code(d, h, l, M, D) return Float64(sqrt(Float64(1.0 / Float64(l * h))) * d) end
function tmp = code(d, h, l, M, D) tmp = sqrt((1.0 / (l * h))) * d; end
code[d_, h_, l_, M_, D_] := N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{1}{\ell \cdot h}} \cdot d
\end{array}
Initial program 64.9%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6426.4
Applied rewrites26.4%
(FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
double code(double d, double h, double l, double M, double D) {
return d / sqrt((l * h));
}
real(8) function code(d, h, l, m, d_1)
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = d / sqrt((l * h))
end function
public static double code(double d, double h, double l, double M, double D) {
return d / Math.sqrt((l * h));
}
def code(d, h, l, M, D): return d / math.sqrt((l * h))
function code(d, h, l, M, D) return Float64(d / sqrt(Float64(l * h))) end
function tmp = code(d, h, l, M, D) tmp = d / sqrt((l * h)); end
code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{d}{\sqrt{\ell \cdot h}}
\end{array}
Initial program 64.9%
Taylor expanded in h around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6426.4
Applied rewrites26.4%
Applied rewrites26.4%
herbie shell --seed 2024244
(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)))))