
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e+241)
(/ (* (sqrt (/ A V)) c0) (sqrt l))
(if (<= (* V l) -5e-324)
(* c0 (/ (sqrt (- A)) (sqrt (* (- V) l))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* (/ V A) l)))
(if (<= (* V l) 2e+296)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(/ c0 (* (sqrt (/ (- l) A)) (sqrt (- V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+241) {
tmp = (sqrt((A / V)) * c0) / sqrt(l);
} else if ((V * l) <= -5e-324) {
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt(((V / A) * l));
} else if ((V * l) <= 2e+296) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 / (sqrt((-l / A)) * sqrt(-V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-4d+241)) then
tmp = (sqrt((a / v)) * c0) / sqrt(l)
else if ((v * l) <= (-5d-324)) then
tmp = c0 * (sqrt(-a) / sqrt((-v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt(((v / a) * l))
else if ((v * l) <= 2d+296) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 / (sqrt((-l / a)) * sqrt(-v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+241) {
tmp = (Math.sqrt((A / V)) * c0) / Math.sqrt(l);
} else if ((V * l) <= -5e-324) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt(((V / A) * l));
} else if ((V * l) <= 2e+296) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 / (Math.sqrt((-l / A)) * Math.sqrt(-V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -4e+241: tmp = (math.sqrt((A / V)) * c0) / math.sqrt(l) elif (V * l) <= -5e-324: tmp = c0 * (math.sqrt(-A) / math.sqrt((-V * l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt(((V / A) * l)) elif (V * l) <= 2e+296: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 / (math.sqrt((-l / A)) * math.sqrt(-V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -4e+241) tmp = Float64(Float64(sqrt(Float64(A / V)) * c0) / sqrt(l)); elseif (Float64(V * l) <= -5e-324) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(Float64(-V) * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(Float64(V / A) * l))); elseif (Float64(V * l) <= 2e+296) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 / Float64(sqrt(Float64(Float64(-l) / A)) * sqrt(Float64(-V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -4e+241)
tmp = (sqrt((A / V)) * c0) / sqrt(l);
elseif ((V * l) <= -5e-324)
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt(((V / A) * l));
elseif ((V * l) <= 2e+296)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 / (sqrt((-l / A)) * sqrt(-V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -4e+241], N[(N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * c0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-324], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[((-V) * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(N[(V / A), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+296], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[((-l) / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+241}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-324}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\left(-V\right) \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A} \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+296}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{-\ell}{A}} \cdot \sqrt{-V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.0000000000000002e241Initial program 36.6%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6451.8
Applied rewrites51.8%
if -4.0000000000000002e241 < (*.f64 V l) < -4.94066e-324Initial program 86.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6477.3
Applied rewrites77.3%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/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
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6498.6
Applied rewrites98.6%
if -4.94066e-324 < (*.f64 V l) < -0.0Initial program 43.4%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6443.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.4
Applied rewrites43.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
if -0.0 < (*.f64 V l) < 1.99999999999999996e296Initial program 86.9%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6499.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.3
Applied rewrites99.3%
if 1.99999999999999996e296 < (*.f64 V l) Initial program 27.7%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6427.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6427.7
Applied rewrites27.7%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
frac-2negN/A
associate-/r/N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
frac-2negN/A
remove-double-negN/A
lower-/.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6450.8
Applied rewrites50.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-310) (* c0 (/ (* (sqrt (- A)) (pow (- V) -0.5)) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-310) {
tmp = c0 * ((sqrt(-A) * pow(-V, -0.5)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-1d-310)) then
tmp = c0 * ((sqrt(-a) * (-v ** (-0.5d0))) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-310) {
tmp = c0 * ((Math.sqrt(-A) * Math.pow(-V, -0.5)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-310: tmp = c0 * ((math.sqrt(-A) * math.pow(-V, -0.5)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-310) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) * (Float64(-V) ^ -0.5)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -1e-310)
tmp = c0 * ((sqrt(-A) * (-V ^ -0.5)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -1e-310], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] * N[Power[(-V), -0.5], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A} \cdot {\left(-V\right)}^{-0.5}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -9.999999999999969e-311Initial program 74.5%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6453.6
Applied rewrites53.6%
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
pow1/2N/A
inv-powN/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-neg.f64N/A
metadata-eval61.8
Applied rewrites61.8%
if -9.999999999999969e-311 < A Initial program 75.7%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6485.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.4
Applied rewrites85.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 1e-304)
(* c0 (/ A (sqrt (* (* l A) V))))
(if (<= t_0 1e+278)
(/ c0 (sqrt (/ (* l V) A)))
(/ c0 (sqrt (* (/ V A) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-304) {
tmp = c0 * (A / sqrt(((l * A) * V)));
} else if (t_0 <= 1e+278) {
tmp = c0 / sqrt(((l * V) / A));
} else {
tmp = c0 / sqrt(((V / A) * l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 1d-304) then
tmp = c0 * (a / sqrt(((l * a) * v)))
else if (t_0 <= 1d+278) then
tmp = c0 / sqrt(((l * v) / a))
else
tmp = c0 / sqrt(((v / a) * l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-304) {
tmp = c0 * (A / Math.sqrt(((l * A) * V)));
} else if (t_0 <= 1e+278) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else {
tmp = c0 / Math.sqrt(((V / A) * l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-304: tmp = c0 * (A / math.sqrt(((l * A) * V))) elif t_0 <= 1e+278: tmp = c0 / math.sqrt(((l * V) / A)) else: tmp = c0 / math.sqrt(((V / A) * l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-304) tmp = Float64(c0 * Float64(A / sqrt(Float64(Float64(l * A) * V)))); elseif (t_0 <= 1e+278) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); else tmp = Float64(c0 / sqrt(Float64(Float64(V / A) * l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-304)
tmp = c0 * (A / sqrt(((l * A) * V)));
elseif (t_0 <= 1e+278)
tmp = c0 / sqrt(((l * V) / A));
else
tmp = c0 / sqrt(((V / A) * l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-304], N[(c0 * N[(A / N[Sqrt[N[(N[(l * A), $MachinePrecision] * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+278], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(N[(V / A), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{A}{\sqrt{\left(\ell \cdot A\right) \cdot V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+278}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A} \cdot \ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.99999999999999971e-305Initial program 38.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6449.2
Applied rewrites49.2%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
sqrt-divN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
lift-*.f64N/A
*-lft-identityN/A
associate-*r/N/A
sqrt-divN/A
associate-*l/N/A
frac-timesN/A
sqrt-divN/A
*-lft-identityN/A
lift-*.f64N/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
lower-/.f64N/A
lower-sqrt.f64N/A
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6453.1
Applied rewrites53.1%
if 9.99999999999999971e-305 < (/.f64 A (*.f64 V l)) < 9.99999999999999964e277Initial program 99.5%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6499.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.5
Applied rewrites99.5%
if 9.99999999999999964e277 < (/.f64 A (*.f64 V l)) Initial program 50.4%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6450.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6450.4
Applied rewrites50.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.4
Applied rewrites58.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 4e-309)
(* c0 (/ A (sqrt (* (* l A) V))))
(if (<= t_0 1e+286) (* c0 (sqrt t_0)) (/ c0 (sqrt (* (/ V A) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * (A / sqrt(((l * A) * V)));
} else if (t_0 <= 1e+286) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt(((V / A) * l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 4d-309) then
tmp = c0 * (a / sqrt(((l * a) * v)))
else if (t_0 <= 1d+286) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt(((v / a) * l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * (A / Math.sqrt(((l * A) * V)));
} else if (t_0 <= 1e+286) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt(((V / A) * l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 4e-309: tmp = c0 * (A / math.sqrt(((l * A) * V))) elif t_0 <= 1e+286: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt(((V / A) * l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 4e-309) tmp = Float64(c0 * Float64(A / sqrt(Float64(Float64(l * A) * V)))); elseif (t_0 <= 1e+286) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(Float64(V / A) * l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 4e-309)
tmp = c0 * (A / sqrt(((l * A) * V)));
elseif (t_0 <= 1e+286)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt(((V / A) * l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-309], N[(c0 * N[(A / N[Sqrt[N[(N[(l * A), $MachinePrecision] * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+286], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(N[(V / A), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \frac{A}{\sqrt{\left(\ell \cdot A\right) \cdot V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+286}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A} \cdot \ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.9999999999999977e-309Initial program 37.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6450.0
Applied rewrites50.0%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
sqrt-divN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
lift-*.f64N/A
*-lft-identityN/A
associate-*r/N/A
sqrt-divN/A
associate-*l/N/A
frac-timesN/A
sqrt-divN/A
*-lft-identityN/A
lift-*.f64N/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
lower-/.f64N/A
lower-sqrt.f64N/A
Applied rewrites49.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6454.0
Applied rewrites54.0%
if 3.9999999999999977e-309 < (/.f64 A (*.f64 V l)) < 1.00000000000000003e286Initial program 99.5%
if 1.00000000000000003e286 < (/.f64 A (*.f64 V l)) Initial program 49.5%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6449.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6449.5
Applied rewrites49.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6459.4
Applied rewrites59.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 4e-309)
(* c0 (/ A (sqrt (* (* l A) V))))
(if (<= t_0 1e+278) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * (A / sqrt(((l * A) * V)));
} else if (t_0 <= 1e+278) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 4d-309) then
tmp = c0 * (a / sqrt(((l * a) * v)))
else if (t_0 <= 1d+278) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * (A / Math.sqrt(((l * A) * V)));
} else if (t_0 <= 1e+278) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 4e-309: tmp = c0 * (A / math.sqrt(((l * A) * V))) elif t_0 <= 1e+278: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 4e-309) tmp = Float64(c0 * Float64(A / sqrt(Float64(Float64(l * A) * V)))); elseif (t_0 <= 1e+278) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 4e-309)
tmp = c0 * (A / sqrt(((l * A) * V)));
elseif (t_0 <= 1e+278)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-309], N[(c0 * N[(A / N[Sqrt[N[(N[(l * A), $MachinePrecision] * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+278], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \frac{A}{\sqrt{\left(\ell \cdot A\right) \cdot V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+278}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.9999999999999977e-309Initial program 37.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6450.0
Applied rewrites50.0%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
sqrt-divN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
lift-*.f64N/A
*-lft-identityN/A
associate-*r/N/A
sqrt-divN/A
associate-*l/N/A
frac-timesN/A
sqrt-divN/A
*-lft-identityN/A
lift-*.f64N/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
lower-/.f64N/A
lower-sqrt.f64N/A
Applied rewrites49.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6454.0
Applied rewrites54.0%
if 3.9999999999999977e-309 < (/.f64 A (*.f64 V l)) < 9.99999999999999964e277Initial program 99.5%
if 9.99999999999999964e277 < (/.f64 A (*.f64 V l)) Initial program 50.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6457.6
Applied rewrites57.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e+241)
(/ (* (sqrt (/ A V)) c0) (sqrt l))
(if (<= (* V l) -5e-324)
(* c0 (/ (sqrt (- A)) (sqrt (* (- V) l))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* (/ V A) l)))
(* c0 (/ (sqrt A) (sqrt (* l V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+241) {
tmp = (sqrt((A / V)) * c0) / sqrt(l);
} else if ((V * l) <= -5e-324) {
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt(((V / A) * l));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-4d+241)) then
tmp = (sqrt((a / v)) * c0) / sqrt(l)
else if ((v * l) <= (-5d-324)) then
tmp = c0 * (sqrt(-a) / sqrt((-v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt(((v / a) * l))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+241) {
tmp = (Math.sqrt((A / V)) * c0) / Math.sqrt(l);
} else if ((V * l) <= -5e-324) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt(((V / A) * l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -4e+241: tmp = (math.sqrt((A / V)) * c0) / math.sqrt(l) elif (V * l) <= -5e-324: tmp = c0 * (math.sqrt(-A) / math.sqrt((-V * l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt(((V / A) * l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -4e+241) tmp = Float64(Float64(sqrt(Float64(A / V)) * c0) / sqrt(l)); elseif (Float64(V * l) <= -5e-324) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(Float64(-V) * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(Float64(V / A) * l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -4e+241)
tmp = (sqrt((A / V)) * c0) / sqrt(l);
elseif ((V * l) <= -5e-324)
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt(((V / A) * l));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -4e+241], N[(N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * c0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-324], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[((-V) * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(N[(V / A), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+241}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}} \cdot c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-324}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\left(-V\right) \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A} \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.0000000000000002e241Initial program 36.6%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6451.8
Applied rewrites51.8%
if -4.0000000000000002e241 < (*.f64 V l) < -4.94066e-324Initial program 86.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6477.3
Applied rewrites77.3%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/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
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6498.6
Applied rewrites98.6%
if -4.94066e-324 < (*.f64 V l) < -0.0Initial program 43.4%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6443.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.4
Applied rewrites43.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
if -0.0 < (*.f64 V l) Initial program 80.9%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6492.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.1
Applied rewrites92.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e+241)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -5e-324)
(* c0 (/ (sqrt (- A)) (sqrt (* (- V) l))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* (/ V A) l)))
(* c0 (/ (sqrt A) (sqrt (* l V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+241) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -5e-324) {
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt(((V / A) * l));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-4d+241)) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((v * l) <= (-5d-324)) then
tmp = c0 * (sqrt(-a) / sqrt((-v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt(((v / a) * l))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+241) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -5e-324) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt(((V / A) * l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -4e+241: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= -5e-324: tmp = c0 * (math.sqrt(-A) / math.sqrt((-V * l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt(((V / A) * l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -4e+241) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -5e-324) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(Float64(-V) * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(Float64(V / A) * l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -4e+241)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= -5e-324)
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt(((V / A) * l));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -4e+241], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-324], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[((-V) * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(N[(V / A), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+241}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-324}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\left(-V\right) \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A} \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.0000000000000002e241Initial program 36.6%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-/.f6451.7
Applied rewrites51.7%
if -4.0000000000000002e241 < (*.f64 V l) < -4.94066e-324Initial program 86.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6477.3
Applied rewrites77.3%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/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
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6498.6
Applied rewrites98.6%
if -4.94066e-324 < (*.f64 V l) < -0.0Initial program 43.4%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6443.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.4
Applied rewrites43.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
if -0.0 < (*.f64 V l) Initial program 80.9%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6492.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.1
Applied rewrites92.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e+241)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-324)
(* c0 (/ (sqrt (- A)) (sqrt (* (- V) l))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* (/ V A) l)))
(* c0 (/ (sqrt A) (sqrt (* l V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+241) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-324) {
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt(((V / A) * l));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-4d+241)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-324)) then
tmp = c0 * (sqrt(-a) / sqrt((-v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt(((v / a) * l))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+241) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-324) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt(((V / A) * l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -4e+241: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-324: tmp = c0 * (math.sqrt(-A) / math.sqrt((-V * l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt(((V / A) * l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -4e+241) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-324) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(Float64(-V) * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(Float64(V / A) * l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -4e+241)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-324)
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt(((V / A) * l));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -4e+241], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-324], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[((-V) * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(N[(V / A), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+241}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-324}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\left(-V\right) \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A} \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.0000000000000002e241Initial program 36.6%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6451.6
Applied rewrites51.6%
if -4.0000000000000002e241 < (*.f64 V l) < -4.94066e-324Initial program 86.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6477.3
Applied rewrites77.3%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/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
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6498.6
Applied rewrites98.6%
if -4.94066e-324 < (*.f64 V l) < -0.0Initial program 43.4%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6443.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.4
Applied rewrites43.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
if -0.0 < (*.f64 V l) Initial program 80.9%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6492.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.1
Applied rewrites92.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(/ c0 (sqrt (* (* (/ -1.0 A) V) (- l))))
(if (<= (* V l) -5e-324)
(* c0 (/ (sqrt (- A)) (sqrt (* (- V) l))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* (/ V A) l)))
(* c0 (/ (sqrt A) (sqrt (* l V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 / sqrt((((-1.0 / A) * V) * -l));
} else if ((V * l) <= -5e-324) {
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt(((V / A) * l));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 / Math.sqrt((((-1.0 / A) * V) * -l));
} else if ((V * l) <= -5e-324) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt(((V / A) * l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 / math.sqrt((((-1.0 / A) * V) * -l)) elif (V * l) <= -5e-324: tmp = c0 * (math.sqrt(-A) / math.sqrt((-V * l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt(((V / A) * l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 / sqrt(Float64(Float64(Float64(-1.0 / A) * V) * Float64(-l)))); elseif (Float64(V * l) <= -5e-324) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(Float64(-V) * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(Float64(V / A) * l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 / sqrt((((-1.0 / A) * V) * -l));
elseif ((V * l) <= -5e-324)
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt(((V / A) * l));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 / N[Sqrt[N[(N[(N[(-1.0 / A), $MachinePrecision] * V), $MachinePrecision] * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-324], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[((-V) * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(N[(V / A), $MachinePrecision] * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\left(\frac{-1}{A} \cdot V\right) \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-324}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\left(-V\right) \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A} \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 23.7%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6423.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6423.7
Applied rewrites23.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.6
Applied rewrites54.6%
lift-/.f64N/A
clear-numN/A
frac-2negN/A
lift-neg.f64N/A
associate-/r/N/A
lower-*.f64N/A
neg-mul-1N/A
associate-/r*N/A
metadata-evalN/A
lower-/.f6454.7
Applied rewrites54.7%
if -inf.0 < (*.f64 V l) < -4.94066e-324Initial program 86.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6477.5
Applied rewrites77.5%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/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
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6498.6
Applied rewrites98.6%
if -4.94066e-324 < (*.f64 V l) < -0.0Initial program 43.4%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6443.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6443.4
Applied rewrites43.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
if -0.0 < (*.f64 V l) Initial program 80.9%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6492.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.1
Applied rewrites92.1%
Final simplification88.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-310) (/ (* (sqrt (- A)) (/ c0 (sqrt l))) (sqrt (- V))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-310) {
tmp = (sqrt(-A) * (c0 / sqrt(l))) / sqrt(-V);
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-1d-310)) then
tmp = (sqrt(-a) * (c0 / sqrt(l))) / sqrt(-v)
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-310) {
tmp = (Math.sqrt(-A) * (c0 / Math.sqrt(l))) / Math.sqrt(-V);
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-310: tmp = (math.sqrt(-A) * (c0 / math.sqrt(l))) / math.sqrt(-V) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-310) tmp = Float64(Float64(sqrt(Float64(-A)) * Float64(c0 / sqrt(l))) / sqrt(Float64(-V))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -1e-310)
tmp = (sqrt(-A) * (c0 / sqrt(l))) / sqrt(-V);
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -1e-310], N[(N[(N[Sqrt[(-A)], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-A} \cdot \frac{c0}{\sqrt{\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -9.999999999999969e-311Initial program 74.5%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6474.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.4
Applied rewrites74.4%
lift-/.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
associate-/r/N/A
lift-/.f64N/A
sqrt-undivN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-/r/N/A
*-lft-identityN/A
associate-*l/N/A
inv-powN/A
lift-sqrt.f64N/A
sqrt-pow2N/A
*-commutativeN/A
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*l/N/A
Applied rewrites57.2%
if -9.999999999999969e-311 < A Initial program 75.7%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6485.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.4
Applied rewrites85.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* V l)))) (if (<= t_0 4e-309) (* c0 (/ A (sqrt (* (* l A) V)))) (* c0 (sqrt t_0)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * (A / sqrt(((l * A) * V)));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 4d-309) then
tmp = c0 * (a / sqrt(((l * a) * v)))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * (A / Math.sqrt(((l * A) * V)));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 4e-309: tmp = c0 * (A / math.sqrt(((l * A) * V))) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 4e-309) tmp = Float64(c0 * Float64(A / sqrt(Float64(Float64(l * A) * V)))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 4e-309)
tmp = c0 * (A / sqrt(((l * A) * V)));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-309], N[(c0 * N[(A / N[Sqrt[N[(N[(l * A), $MachinePrecision] * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \frac{A}{\sqrt{\left(\ell \cdot A\right) \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.9999999999999977e-309Initial program 37.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6450.0
Applied rewrites50.0%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
sqrt-divN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
lift-*.f64N/A
*-lft-identityN/A
associate-*r/N/A
sqrt-divN/A
associate-*l/N/A
frac-timesN/A
sqrt-divN/A
*-lft-identityN/A
lift-*.f64N/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
lower-/.f64N/A
lower-sqrt.f64N/A
Applied rewrites49.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6454.0
Applied rewrites54.0%
if 3.9999999999999977e-309 < (/.f64 A (*.f64 V l)) Initial program 86.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* V l)))) (if (<= t_0 4e-309) (* c0 (/ A (sqrt (* A (* V l))))) (* c0 (sqrt t_0)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * (A / sqrt((A * (V * l))));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 4d-309) then
tmp = c0 * (a / sqrt((a * (v * l))))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * (A / Math.sqrt((A * (V * l))));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 4e-309: tmp = c0 * (A / math.sqrt((A * (V * l)))) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 4e-309) tmp = Float64(c0 * Float64(A / sqrt(Float64(A * Float64(V * l))))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 4e-309)
tmp = c0 * (A / sqrt((A * (V * l))));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-309], N[(c0 * N[(A / N[Sqrt[N[(A * N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \frac{A}{\sqrt{A \cdot \left(V \cdot \ell\right)}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.9999999999999977e-309Initial program 37.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6450.0
Applied rewrites50.0%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
sqrt-divN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
lift-*.f64N/A
*-lft-identityN/A
associate-*r/N/A
sqrt-divN/A
associate-*l/N/A
frac-timesN/A
sqrt-divN/A
*-lft-identityN/A
lift-*.f64N/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
lower-/.f64N/A
lower-sqrt.f64N/A
Applied rewrites49.3%
if 3.9999999999999977e-309 < (/.f64 A (*.f64 V l)) Initial program 86.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= (* V l) 0.0) (/ c0 (sqrt (* (/ l A) V))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / sqrt(((l / A) * V));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt(((l / a) * v))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt(((l / A) * V));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 / math.sqrt(((l / A) * V)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(Float64(l / A) * V))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 / sqrt(((l / A) * V));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(N[(l / A), $MachinePrecision] * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{A} \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -0.0Initial program 70.1%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6470.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6470.1
Applied rewrites70.1%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6470.8
Applied rewrites70.8%
if -0.0 < (*.f64 V l) Initial program 80.9%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6492.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.1
Applied rewrites92.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 75.1%
herbie shell --seed 2024322
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))