
(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 (<= (* l V) (- INFINITY))
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* l V) -1e-253)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 1e-294)
(/ 1.0 (/ (sqrt (/ V (/ A l))) c0))
(if (<= (* l V) 1e+285)
(/ c0 (* (sqrt (* l V)) (sqrt (/ 1.0 A))))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((l * V) <= -1e-253) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 1e-294) {
tmp = 1.0 / (sqrt((V / (A / l))) / c0);
} else if ((l * V) <= 1e+285) {
tmp = c0 / (sqrt((l * V)) * sqrt((1.0 / A)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((l * V) <= -1e-253) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 1e-294) {
tmp = 1.0 / (Math.sqrt((V / (A / l))) / c0);
} else if ((l * V) <= 1e+285) {
tmp = c0 / (Math.sqrt((l * V)) * Math.sqrt((1.0 / A)));
} 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): tmp = 0 if (l * V) <= -math.inf: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (l * V) <= -1e-253: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 1e-294: tmp = 1.0 / (math.sqrt((V / (A / l))) / c0) elif (l * V) <= 1e+285: tmp = c0 / (math.sqrt((l * V)) * math.sqrt((1.0 / A))) 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) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(l * V) <= -1e-253) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 1e-294) tmp = Float64(1.0 / Float64(sqrt(Float64(V / Float64(A / l))) / c0)); elseif (Float64(l * V) <= 1e+285) tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) * sqrt(Float64(1.0 / A)))); 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)
tmp = 0.0;
if ((l * V) <= -Inf)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((l * V) <= -1e-253)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 1e-294)
tmp = 1.0 / (sqrt((V / (A / l))) / c0);
elseif ((l * V) <= 1e+285)
tmp = c0 / (sqrt((l * V)) * sqrt((1.0 / A)));
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_] := If[LessEqual[N[(l * V), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-253], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e-294], N[(1.0 / N[(N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e+285], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / A), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-253}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{-294}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{+285}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot V} \cdot \sqrt{\frac{1}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 45.9%
associate-/r*75.0%
div-inv75.1%
Applied egg-rr75.1%
associate-*l/75.0%
div-inv75.0%
frac-2neg75.0%
sqrt-div43.6%
distribute-neg-frac243.6%
Applied egg-rr43.6%
distribute-frac-neg243.6%
distribute-frac-neg43.6%
Simplified43.6%
if -inf.0 < (*.f64 V l) < -1.0000000000000001e-253Initial program 84.9%
frac-2neg84.9%
sqrt-div99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
if -1.0000000000000001e-253 < (*.f64 V l) < 1.00000000000000002e-294Initial program 52.8%
associate-/r*68.8%
div-inv68.8%
Applied egg-rr68.8%
un-div-inv68.8%
sqrt-div44.1%
clear-num44.2%
un-div-inv44.2%
clear-num44.1%
sqrt-undiv70.9%
clear-num68.9%
associate-/r*52.9%
associate-/l/66.1%
clear-num68.0%
Applied egg-rr68.0%
if 1.00000000000000002e-294 < (*.f64 V l) < 9.9999999999999998e284Initial program 81.6%
associate-/r*77.3%
div-inv77.2%
Applied egg-rr77.2%
un-div-inv77.3%
sqrt-div51.4%
clear-num51.4%
un-div-inv51.4%
sqrt-undiv77.2%
clear-num77.2%
associate-/r*81.6%
associate-/l/73.7%
clear-num73.7%
Applied egg-rr73.7%
associate-/r/77.0%
Simplified77.0%
Taylor expanded in V around 0 81.6%
pow1/281.6%
div-inv81.6%
unpow-prod-down99.5%
pow1/299.5%
Applied egg-rr99.5%
unpow1/299.5%
Simplified99.5%
if 9.9999999999999998e284 < (*.f64 V l) Initial program 38.2%
*-commutative38.2%
associate-/l/85.9%
Simplified85.9%
Final simplification89.3%
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 (* c0 (sqrt (/ A (* l V))))))
(if (or (<= t_0 5e-252) (not (<= t_0 5e+266)))
(/ c0 (sqrt (* V (/ l A))))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if ((t_0 <= 5e-252) || !(t_0 <= 5e+266)) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = 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 = c0 * sqrt((a / (l * v)))
if ((t_0 <= 5d-252) .or. (.not. (t_0 <= 5d+266))) then
tmp = c0 / sqrt((v * (l / a)))
else
tmp = 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 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if ((t_0 <= 5e-252) || !(t_0 <= 5e+266)) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if (t_0 <= 5e-252) or not (t_0 <= 5e+266): tmp = c0 / math.sqrt((V * (l / A))) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if ((t_0 <= 5e-252) || !(t_0 <= 5e+266)) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = 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 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if ((t_0 <= 5e-252) || ~((t_0 <= 5e+266)))
tmp = c0 / sqrt((V * (l / A)));
else
tmp = 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[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 5e-252], N[Not[LessEqual[t$95$0, 5e+266]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-252} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+266}\right):\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000008e-252 or 4.9999999999999999e266 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.6%
associate-/r*73.3%
div-inv73.3%
Applied egg-rr73.3%
un-div-inv73.3%
sqrt-div43.4%
clear-num43.4%
un-div-inv43.5%
sqrt-undiv73.3%
clear-num72.9%
associate-/r*66.2%
associate-/l/71.0%
clear-num71.4%
Applied egg-rr71.4%
associate-/r/73.8%
associate-*l/66.2%
associate-/l*72.1%
Simplified72.1%
if 5.00000000000000008e-252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999999e266Initial program 99.6%
Final simplification77.3%
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 (* c0 (sqrt (/ A (* l V))))))
(if (or (<= t_0 5e-252) (not (<= t_0 2e+134)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if ((t_0 <= 5e-252) || !(t_0 <= 2e+134)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = 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 = c0 * sqrt((a / (l * v)))
if ((t_0 <= 5d-252) .or. (.not. (t_0 <= 2d+134))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = 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 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if ((t_0 <= 5e-252) || !(t_0 <= 2e+134)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if (t_0 <= 5e-252) or not (t_0 <= 2e+134): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if ((t_0 <= 5e-252) || !(t_0 <= 2e+134)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = 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 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if ((t_0 <= 5e-252) || ~((t_0 <= 2e+134)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = 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[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 5e-252], N[Not[LessEqual[t$95$0, 2e+134]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-252} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+134}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000008e-252 or 1.99999999999999984e134 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 68.1%
*-commutative68.1%
associate-/l/74.5%
Simplified74.5%
if 5.00000000000000008e-252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999984e134Initial program 99.5%
Final simplification78.2%
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 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 5e-252)
(* c0 (sqrt (* (/ A V) (/ 1.0 l))))
(if (<= t_0 1e+145) t_0 (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 5e-252) {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
} else if (t_0 <= 1e+145) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / A)));
}
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 = c0 * sqrt((a / (l * v)))
if (t_0 <= 5d-252) then
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
else if (t_0 <= 1d+145) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / a)))
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 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 5e-252) {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
} else if (t_0 <= 1e+145) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 5e-252: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) elif t_0 <= 1e+145: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 5e-252) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); elseif (t_0 <= 1e+145) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 5e-252)
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
elseif (t_0 <= 1e+145)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / A)));
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[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-252], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+145], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-252}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+145}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000008e-252Initial program 68.5%
associate-/r*75.3%
div-inv75.3%
Applied egg-rr75.3%
if 5.00000000000000008e-252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999999e144Initial program 99.5%
if 9.9999999999999999e144 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.4%
associate-/r*71.1%
div-inv71.1%
Applied egg-rr71.1%
un-div-inv71.1%
sqrt-div37.5%
clear-num37.5%
un-div-inv37.6%
sqrt-undiv72.7%
clear-num71.0%
associate-/r*66.4%
associate-/l/68.7%
clear-num70.3%
Applied egg-rr70.3%
associate-/r/72.7%
Simplified72.7%
Final simplification78.5%
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 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 5e-252)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_0 1e+145) t_0 (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 5e-252) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_0 <= 1e+145) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / A)));
}
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 = c0 * sqrt((a / (l * v)))
if (t_0 <= 5d-252) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_0 <= 1d+145) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / a)))
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 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 5e-252) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_0 <= 1e+145) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 5e-252: tmp = c0 / math.sqrt((V * (l / A))) elif t_0 <= 1e+145: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 5e-252) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 1e+145) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 5e-252)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_0 <= 1e+145)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / A)));
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[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-252], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+145], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-252}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t\_0 \leq 10^{+145}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000008e-252Initial program 68.5%
associate-/r*75.3%
div-inv75.3%
Applied egg-rr75.3%
un-div-inv75.3%
sqrt-div45.1%
clear-num45.1%
un-div-inv45.1%
sqrt-undiv74.9%
clear-num74.8%
associate-/r*68.0%
associate-/l/72.7%
clear-num72.7%
Applied egg-rr72.7%
associate-/r/75.5%
associate-*l/68.1%
associate-/l*73.6%
Simplified73.6%
if 5.00000000000000008e-252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999999e144Initial program 99.5%
if 9.9999999999999999e144 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.4%
associate-/r*71.1%
div-inv71.1%
Applied egg-rr71.1%
un-div-inv71.1%
sqrt-div37.5%
clear-num37.5%
un-div-inv37.6%
sqrt-undiv72.7%
clear-num71.0%
associate-/r*66.4%
associate-/l/68.7%
clear-num70.3%
Applied egg-rr70.3%
associate-/r/72.7%
Simplified72.7%
Final simplification77.3%
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 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+134) 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 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+134) {
tmp = 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 = c0 * sqrt((a / (l * v)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+134) then
tmp = 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 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+134) {
tmp = 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 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+134: tmp = 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(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+134) tmp = 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 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+134)
tmp = 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[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+134], t$95$0, 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 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+134}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 68.3%
Taylor expanded in c0 around 0 68.3%
*-commutative68.3%
associate-/r*72.5%
Simplified72.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999984e134Initial program 99.5%
if 1.99999999999999984e134 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.4%
*-commutative66.4%
associate-/l/71.1%
Simplified71.1%
Final simplification76.4%
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 -4e-310) (* c0 (/ 1.0 (/ (sqrt l) (/ (sqrt (- A)) (sqrt (- V)))))) (/ c0 (* (sqrt (* l V)) (sqrt (/ 1.0 A))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * (1.0 / (sqrt(l) / (sqrt(-A) / sqrt(-V))));
} else {
tmp = c0 / (sqrt((l * V)) * sqrt((1.0 / A)));
}
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 <= (-4d-310)) then
tmp = c0 * (1.0d0 / (sqrt(l) / (sqrt(-a) / sqrt(-v))))
else
tmp = c0 / (sqrt((l * v)) * sqrt((1.0d0 / a)))
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 <= -4e-310) {
tmp = c0 * (1.0 / (Math.sqrt(l) / (Math.sqrt(-A) / Math.sqrt(-V))));
} else {
tmp = c0 / (Math.sqrt((l * V)) * Math.sqrt((1.0 / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 * (1.0 / (math.sqrt(l) / (math.sqrt(-A) / math.sqrt(-V)))) else: tmp = c0 / (math.sqrt((l * V)) * math.sqrt((1.0 / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(l) / Float64(sqrt(Float64(-A)) / sqrt(Float64(-V)))))); else tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) * sqrt(Float64(1.0 / A)))); 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 <= -4e-310)
tmp = c0 * (1.0 / (sqrt(l) / (sqrt(-A) / sqrt(-V))));
else
tmp = c0 / (sqrt((l * V)) * sqrt((1.0 / A)));
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, -4e-310], N[(c0 * N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] / N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{1}{\frac{\sqrt{\ell}}{\frac{\sqrt{-A}}{\sqrt{-V}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot V} \cdot \sqrt{\frac{1}{A}}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 74.1%
associate-/r*76.5%
sqrt-div44.9%
div-inv44.8%
Applied egg-rr44.8%
*-commutative44.8%
associate-/r/44.8%
Simplified44.8%
frac-2neg44.8%
sqrt-div52.0%
Applied egg-rr52.0%
if -3.999999999999988e-310 < A Initial program 71.3%
associate-/r*77.9%
div-inv77.9%
Applied egg-rr77.9%
un-div-inv77.9%
sqrt-div47.8%
clear-num47.7%
un-div-inv47.8%
sqrt-undiv77.9%
clear-num77.8%
associate-/r*71.3%
associate-/l/75.5%
clear-num75.4%
Applied egg-rr75.4%
associate-/r/77.7%
Simplified77.7%
Taylor expanded in V around 0 71.3%
pow1/271.3%
div-inv71.3%
unpow-prod-down83.5%
pow1/283.5%
Applied egg-rr83.5%
unpow1/283.5%
Simplified83.5%
Final simplification67.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -1e-253)
(/ (* c0 (/ (sqrt (- A)) (sqrt (- V)))) (sqrt l))
(if (<= (* l V) 1e-294)
(/ 1.0 (/ (sqrt (/ V (/ A l))) c0))
(if (<= (* l V) 1e+285)
(/ c0 (* (sqrt (* l V)) (sqrt (/ 1.0 A))))
(* c0 (sqrt (/ (/ A V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e-253) {
tmp = (c0 * (sqrt(-A) / sqrt(-V))) / sqrt(l);
} else if ((l * V) <= 1e-294) {
tmp = 1.0 / (sqrt((V / (A / l))) / c0);
} else if ((l * V) <= 1e+285) {
tmp = c0 / (sqrt((l * V)) * sqrt((1.0 / A)));
} 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) :: tmp
if ((l * v) <= (-1d-253)) then
tmp = (c0 * (sqrt(-a) / sqrt(-v))) / sqrt(l)
else if ((l * v) <= 1d-294) then
tmp = 1.0d0 / (sqrt((v / (a / l))) / c0)
else if ((l * v) <= 1d+285) then
tmp = c0 / (sqrt((l * v)) * sqrt((1.0d0 / a)))
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 tmp;
if ((l * V) <= -1e-253) {
tmp = (c0 * (Math.sqrt(-A) / Math.sqrt(-V))) / Math.sqrt(l);
} else if ((l * V) <= 1e-294) {
tmp = 1.0 / (Math.sqrt((V / (A / l))) / c0);
} else if ((l * V) <= 1e+285) {
tmp = c0 / (Math.sqrt((l * V)) * Math.sqrt((1.0 / A)));
} 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): tmp = 0 if (l * V) <= -1e-253: tmp = (c0 * (math.sqrt(-A) / math.sqrt(-V))) / math.sqrt(l) elif (l * V) <= 1e-294: tmp = 1.0 / (math.sqrt((V / (A / l))) / c0) elif (l * V) <= 1e+285: tmp = c0 / (math.sqrt((l * V)) * math.sqrt((1.0 / A))) 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) tmp = 0.0 if (Float64(l * V) <= -1e-253) tmp = Float64(Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-V)))) / sqrt(l)); elseif (Float64(l * V) <= 1e-294) tmp = Float64(1.0 / Float64(sqrt(Float64(V / Float64(A / l))) / c0)); elseif (Float64(l * V) <= 1e+285) tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) * sqrt(Float64(1.0 / A)))); 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)
tmp = 0.0;
if ((l * V) <= -1e-253)
tmp = (c0 * (sqrt(-A) / sqrt(-V))) / sqrt(l);
elseif ((l * V) <= 1e-294)
tmp = 1.0 / (sqrt((V / (A / l))) / c0);
elseif ((l * V) <= 1e+285)
tmp = c0 / (sqrt((l * V)) * sqrt((1.0 / A)));
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_] := If[LessEqual[N[(l * V), $MachinePrecision], -1e-253], N[(N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e-294], N[(1.0 / N[(N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e+285], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / A), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;\ell \cdot V \leq -1 \cdot 10^{-253}:\\
\;\;\;\;\frac{c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{-294}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{+285}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot V} \cdot \sqrt{\frac{1}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.0000000000000001e-253Initial program 77.4%
*-commutative77.4%
associate-/r*78.2%
sqrt-div43.5%
associate-*l/43.4%
Applied egg-rr43.4%
frac-2neg43.5%
sqrt-div51.3%
Applied egg-rr52.0%
if -1.0000000000000001e-253 < (*.f64 V l) < 1.00000000000000002e-294Initial program 52.8%
associate-/r*68.8%
div-inv68.8%
Applied egg-rr68.8%
un-div-inv68.8%
sqrt-div44.1%
clear-num44.2%
un-div-inv44.2%
clear-num44.1%
sqrt-undiv70.9%
clear-num68.9%
associate-/r*52.9%
associate-/l/66.1%
clear-num68.0%
Applied egg-rr68.0%
if 1.00000000000000002e-294 < (*.f64 V l) < 9.9999999999999998e284Initial program 81.6%
associate-/r*77.3%
div-inv77.2%
Applied egg-rr77.2%
un-div-inv77.3%
sqrt-div51.4%
clear-num51.4%
un-div-inv51.4%
sqrt-undiv77.2%
clear-num77.2%
associate-/r*81.6%
associate-/l/73.7%
clear-num73.7%
Applied egg-rr73.7%
associate-/r/77.0%
Simplified77.0%
Taylor expanded in V around 0 81.6%
pow1/281.6%
div-inv81.6%
unpow-prod-down99.5%
pow1/299.5%
Applied egg-rr99.5%
unpow1/299.5%
Simplified99.5%
if 9.9999999999999998e284 < (*.f64 V l) Initial program 38.2%
*-commutative38.2%
associate-/l/85.9%
Simplified85.9%
Final simplification72.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 (<= (* l V) (- INFINITY))
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* l V) -1e-253)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 1e-294)
(/ 1.0 (/ (sqrt (/ V (/ A l))) c0))
(if (<= (* l V) 4e+283)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(/ c0 (sqrt (* V (/ l A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((l * V) <= -1e-253) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 1e-294) {
tmp = 1.0 / (sqrt((V / (A / l))) / c0);
} else if ((l * V) <= 4e+283) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((l * V) <= -1e-253) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 1e-294) {
tmp = 1.0 / (Math.sqrt((V / (A / l))) / c0);
} else if ((l * V) <= 4e+283) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -math.inf: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (l * V) <= -1e-253: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 1e-294: tmp = 1.0 / (math.sqrt((V / (A / l))) / c0) elif (l * V) <= 4e+283: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(l * V) <= -1e-253) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 1e-294) tmp = Float64(1.0 / Float64(sqrt(Float64(V / Float64(A / l))) / c0)); elseif (Float64(l * V) <= 4e+283) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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 ((l * V) <= -Inf)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((l * V) <= -1e-253)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 1e-294)
tmp = 1.0 / (sqrt((V / (A / l))) / c0);
elseif ((l * V) <= 4e+283)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 / sqrt((V * (l / A)));
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[(l * V), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-253], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e-294], N[(1.0 / N[(N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 4e+283], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-253}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{-294}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{+283}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 45.9%
associate-/r*75.0%
div-inv75.1%
Applied egg-rr75.1%
associate-*l/75.0%
div-inv75.0%
frac-2neg75.0%
sqrt-div43.6%
distribute-neg-frac243.6%
Applied egg-rr43.6%
distribute-frac-neg243.6%
distribute-frac-neg43.6%
Simplified43.6%
if -inf.0 < (*.f64 V l) < -1.0000000000000001e-253Initial program 84.9%
frac-2neg84.9%
sqrt-div99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
if -1.0000000000000001e-253 < (*.f64 V l) < 1.00000000000000002e-294Initial program 52.8%
associate-/r*68.8%
div-inv68.8%
Applied egg-rr68.8%
un-div-inv68.8%
sqrt-div44.1%
clear-num44.2%
un-div-inv44.2%
clear-num44.1%
sqrt-undiv70.9%
clear-num68.9%
associate-/r*52.9%
associate-/l/66.1%
clear-num68.0%
Applied egg-rr68.0%
if 1.00000000000000002e-294 < (*.f64 V l) < 3.99999999999999982e283Initial program 81.4%
sqrt-div99.5%
associate-*r/97.4%
Applied egg-rr97.4%
associate-/l*99.5%
Simplified99.5%
if 3.99999999999999982e283 < (*.f64 V l) Initial program 41.4%
associate-/r*86.6%
div-inv86.6%
Applied egg-rr86.6%
un-div-inv86.6%
sqrt-div47.4%
clear-num47.4%
un-div-inv47.6%
sqrt-undiv86.7%
clear-num86.7%
associate-/r*41.5%
associate-/l/86.8%
clear-num86.8%
Applied egg-rr86.8%
associate-/r/86.7%
associate-*l/41.5%
associate-/l*86.7%
Simplified86.7%
Final simplification89.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) (- INFINITY))
(/ (/ c0 (sqrt l)) (sqrt (/ V A)))
(if (<= (* l V) -1e-253)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 1e-294)
(/ 1.0 (/ (sqrt (/ V (/ A l))) c0))
(if (<= (* l V) 4e+283)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(/ c0 (sqrt (* V (/ l A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = (c0 / sqrt(l)) / sqrt((V / A));
} else if ((l * V) <= -1e-253) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 1e-294) {
tmp = 1.0 / (sqrt((V / (A / l))) / c0);
} else if ((l * V) <= 4e+283) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 / Math.sqrt(l)) / Math.sqrt((V / A));
} else if ((l * V) <= -1e-253) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 1e-294) {
tmp = 1.0 / (Math.sqrt((V / (A / l))) / c0);
} else if ((l * V) <= 4e+283) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -math.inf: tmp = (c0 / math.sqrt(l)) / math.sqrt((V / A)) elif (l * V) <= -1e-253: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 1e-294: tmp = 1.0 / (math.sqrt((V / (A / l))) / c0) elif (l * V) <= 4e+283: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = Float64(Float64(c0 / sqrt(l)) / sqrt(Float64(V / A))); elseif (Float64(l * V) <= -1e-253) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 1e-294) tmp = Float64(1.0 / Float64(sqrt(Float64(V / Float64(A / l))) / c0)); elseif (Float64(l * V) <= 4e+283) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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 ((l * V) <= -Inf)
tmp = (c0 / sqrt(l)) / sqrt((V / A));
elseif ((l * V) <= -1e-253)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 1e-294)
tmp = 1.0 / (sqrt((V / (A / l))) / c0);
elseif ((l * V) <= 4e+283)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 / sqrt((V * (l / A)));
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[(l * V), $MachinePrecision], (-Infinity)], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-253], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e-294], N[(1.0 / N[(N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 4e+283], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-253}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{-294}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{+283}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 45.9%
associate-/r*75.0%
div-inv75.1%
Applied egg-rr75.1%
un-div-inv75.0%
sqrt-div39.5%
clear-num39.5%
un-div-inv39.5%
div-inv39.3%
associate-/r*39.5%
pow1/239.5%
pow-flip39.6%
metadata-eval39.6%
Applied egg-rr39.6%
Taylor expanded in A around 0 39.6%
if -inf.0 < (*.f64 V l) < -1.0000000000000001e-253Initial program 84.9%
frac-2neg84.9%
sqrt-div99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
if -1.0000000000000001e-253 < (*.f64 V l) < 1.00000000000000002e-294Initial program 52.8%
associate-/r*68.8%
div-inv68.8%
Applied egg-rr68.8%
un-div-inv68.8%
sqrt-div44.1%
clear-num44.2%
un-div-inv44.2%
clear-num44.1%
sqrt-undiv70.9%
clear-num68.9%
associate-/r*52.9%
associate-/l/66.1%
clear-num68.0%
Applied egg-rr68.0%
if 1.00000000000000002e-294 < (*.f64 V l) < 3.99999999999999982e283Initial program 81.4%
sqrt-div99.5%
associate-*r/97.4%
Applied egg-rr97.4%
associate-/l*99.5%
Simplified99.5%
if 3.99999999999999982e283 < (*.f64 V l) Initial program 41.4%
associate-/r*86.6%
div-inv86.6%
Applied egg-rr86.6%
un-div-inv86.6%
sqrt-div47.4%
clear-num47.4%
un-div-inv47.6%
sqrt-undiv86.7%
clear-num86.7%
associate-/r*41.5%
associate-/l/86.8%
clear-num86.8%
Applied egg-rr86.8%
associate-/r/86.7%
associate-*l/41.5%
associate-/l*86.7%
Simplified86.7%
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
(let* ((t_0 (* V (/ l A))))
(if (<= (* l V) 1e-294)
(* c0 (pow t_0 -0.5))
(if (<= (* l V) 4e+283)
(* c0 (/ (sqrt A) (sqrt (* l 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 = V * (l / A);
double tmp;
if ((l * V) <= 1e-294) {
tmp = c0 * pow(t_0, -0.5);
} else if ((l * V) <= 4e+283) {
tmp = c0 * (sqrt(A) / sqrt((l * 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 = v * (l / a)
if ((l * v) <= 1d-294) then
tmp = c0 * (t_0 ** (-0.5d0))
else if ((l * v) <= 4d+283) then
tmp = c0 * (sqrt(a) / sqrt((l * 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 = V * (l / A);
double tmp;
if ((l * V) <= 1e-294) {
tmp = c0 * Math.pow(t_0, -0.5);
} else if ((l * V) <= 4e+283) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * 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 = V * (l / A) tmp = 0 if (l * V) <= 1e-294: tmp = c0 * math.pow(t_0, -0.5) elif (l * V) <= 4e+283: tmp = c0 * (math.sqrt(A) / math.sqrt((l * 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(V * Float64(l / A)) tmp = 0.0 if (Float64(l * V) <= 1e-294) tmp = Float64(c0 * (t_0 ^ -0.5)); elseif (Float64(l * V) <= 4e+283) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * 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 = V * (l / A);
tmp = 0.0;
if ((l * V) <= 1e-294)
tmp = c0 * (t_0 ^ -0.5);
elseif ((l * V) <= 4e+283)
tmp = c0 * (sqrt(A) / sqrt((l * 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[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], 1e-294], N[(c0 * N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 4e+283], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * 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 := V \cdot \frac{\ell}{A}\\
\mathbf{if}\;\ell \cdot V \leq 10^{-294}:\\
\;\;\;\;c0 \cdot {t\_0}^{-0.5}\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{+283}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{t\_0}}\\
\end{array}
\end{array}
if (*.f64 V l) < 1.00000000000000002e-294Initial program 72.0%
associate-/r*76.1%
div-inv76.1%
Applied egg-rr76.1%
un-div-inv76.1%
sqrt-div43.7%
clear-num43.6%
un-div-inv43.7%
sqrt-undiv76.1%
clear-num75.5%
associate-/r*71.4%
associate-/l/73.8%
clear-num74.3%
Applied egg-rr74.3%
associate-/r/76.7%
Simplified76.7%
clear-num76.6%
associate-/r/76.6%
pow1/276.6%
pow-flip76.8%
associate-*l/71.5%
associate-*r/75.1%
metadata-eval75.1%
Applied egg-rr75.1%
if 1.00000000000000002e-294 < (*.f64 V l) < 3.99999999999999982e283Initial program 81.4%
sqrt-div99.5%
associate-*r/97.4%
Applied egg-rr97.4%
associate-/l*99.5%
Simplified99.5%
if 3.99999999999999982e283 < (*.f64 V l) Initial program 41.4%
associate-/r*86.6%
div-inv86.6%
Applied egg-rr86.6%
un-div-inv86.6%
sqrt-div47.4%
clear-num47.4%
un-div-inv47.6%
sqrt-undiv86.7%
clear-num86.7%
associate-/r*41.5%
associate-/l/86.8%
clear-num86.8%
Applied egg-rr86.8%
associate-/r/86.7%
associate-*l/41.5%
associate-/l*86.7%
Simplified86.7%
Final simplification83.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 (<= l -2e-310) (* (sqrt A) (/ c0 (sqrt (* l V)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -2e-310) {
tmp = sqrt(A) * (c0 / sqrt((l * V)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(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) :: tmp
if (l <= (-2d-310)) then
tmp = sqrt(a) * (c0 / sqrt((l * v)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(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 tmp;
if (l <= -2e-310) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((l * V)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -2e-310: tmp = math.sqrt(A) * (c0 / math.sqrt((l * V))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -2e-310) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(l * V)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); 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 (l <= -2e-310)
tmp = sqrt(A) * (c0 / sqrt((l * V)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(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_] := If[LessEqual[l, -2e-310], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 73.4%
sqrt-div40.4%
associate-*r/37.6%
Applied egg-rr37.6%
*-commutative37.6%
associate-/l*40.4%
Simplified40.4%
if -1.999999999999994e-310 < l Initial program 72.2%
associate-/r*75.3%
div-inv75.3%
Applied egg-rr75.3%
un-div-inv75.3%
sqrt-div87.7%
add-sqr-sqrt87.5%
associate-/l*87.6%
pow1/287.6%
sqrt-pow187.6%
metadata-eval87.6%
pow1/287.6%
sqrt-pow187.6%
metadata-eval87.6%
Applied egg-rr87.6%
associate-*r/87.6%
pow-sqr87.7%
metadata-eval87.7%
unpow1/287.7%
Simplified87.7%
Final simplification65.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -2e-310) (* c0 (/ (sqrt A) (sqrt (* l V)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -2e-310) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(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) :: tmp
if (l <= (-2d-310)) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(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 tmp;
if (l <= -2e-310) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -2e-310: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -2e-310) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); 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 (l <= -2e-310)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(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_] := If[LessEqual[l, -2e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -1.999999999999994e-310Initial program 73.4%
sqrt-div40.4%
associate-*r/37.6%
Applied egg-rr37.6%
associate-/l*40.4%
Simplified40.4%
if -1.999999999999994e-310 < l Initial program 72.2%
associate-/r*75.3%
div-inv75.3%
Applied egg-rr75.3%
un-div-inv75.3%
sqrt-div87.7%
add-sqr-sqrt87.5%
associate-/l*87.6%
pow1/287.6%
sqrt-pow187.6%
metadata-eval87.6%
pow1/287.6%
sqrt-pow187.6%
metadata-eval87.6%
Applied egg-rr87.6%
associate-*r/87.6%
pow-sqr87.7%
metadata-eval87.7%
unpow1/287.7%
Simplified87.7%
Final simplification65.3%
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 (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
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 / (l * v)))
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 / (l * V)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 72.8%
Final simplification72.8%
herbie shell --seed 2024150
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))