
(FPCore (F l) :precision binary64 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
double code(double F, double l) {
return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan((((double) M_PI) * l)));
}
public static double code(double F, double l) {
return (Math.PI * l) - ((1.0 / (F * F)) * Math.tan((Math.PI * l)));
}
def code(F, l): return (math.pi * l) - ((1.0 / (F * F)) * math.tan((math.pi * l)))
function code(F, l) return Float64(Float64(pi * l) - Float64(Float64(1.0 / Float64(F * F)) * tan(Float64(pi * l)))) end
function tmp = code(F, l) tmp = (pi * l) - ((1.0 / (F * F)) * tan((pi * l))); end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F l) :precision binary64 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
double code(double F, double l) {
return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan((((double) M_PI) * l)));
}
public static double code(double F, double l) {
return (Math.PI * l) - ((1.0 / (F * F)) * Math.tan((Math.PI * l)));
}
def code(F, l): return (math.pi * l) - ((1.0 / (F * F)) * math.tan((math.pi * l)))
function code(F, l) return Float64(Float64(pi * l) - Float64(Float64(1.0 / Float64(F * F)) * tan(Float64(pi * l)))) end
function tmp = code(F, l) tmp = (pi * l) - ((1.0 / (F * F)) * tan((pi * l))); end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\end{array}
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+37) (not (<= (* PI l) 2e+14))) (* PI l) (+ (* PI l) (/ -1.0 (/ F (/ (tan (* PI l)) F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+37) || !((((double) M_PI) * l) <= 2e+14)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + (-1.0 / (F / (tan((((double) M_PI) * l)) / F)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -2e+37) || !((Math.PI * l) <= 2e+14)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + (-1.0 / (F / (Math.tan((Math.PI * l)) / F)));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -2e+37) or not ((math.pi * l) <= 2e+14): tmp = math.pi * l else: tmp = (math.pi * l) + (-1.0 / (F / (math.tan((math.pi * l)) / F))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -2e+37) || !(Float64(pi * l) <= 2e+14)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(-1.0 / Float64(F / Float64(tan(Float64(pi * l)) / F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -2e+37) || ~(((pi * l) <= 2e+14))) tmp = pi * l; else tmp = (pi * l) + (-1.0 / (F / (tan((pi * l)) / F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -2e+37], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2e+14]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(F / N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+37} \lor \neg \left(\pi \cdot \ell \leq 2 \cdot 10^{+14}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1.99999999999999991e37 or 2e14 < (*.f64 (PI.f64) l) Initial program 65.1%
associate-*l/65.1%
*-lft-identity65.1%
Simplified65.1%
Taylor expanded in l around 0 51.6%
unpow251.6%
Simplified51.6%
Taylor expanded in F around inf 99.6%
if -1.99999999999999991e37 < (*.f64 (PI.f64) l) < 2e14Initial program 89.1%
associate-/r/89.3%
associate-/l*99.1%
Applied egg-rr99.1%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+37) (not (<= (* PI l) 2e+14))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+37) || !((((double) M_PI) * l) <= 2e+14)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((tan((((double) M_PI) * l)) / F) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -2e+37) || !((Math.PI * l) <= 2e+14)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.tan((Math.PI * l)) / F) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -2e+37) or not ((math.pi * l) <= 2e+14): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.tan((math.pi * l)) / F) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -2e+37) || !(Float64(pi * l) <= 2e+14)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(tan(Float64(pi * l)) / F) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -2e+37) || ~(((pi * l) <= 2e+14))) tmp = pi * l; else tmp = (pi * l) - ((tan((pi * l)) / F) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -2e+37], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2e+14]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+37} \lor \neg \left(\pi \cdot \ell \leq 2 \cdot 10^{+14}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1.99999999999999991e37 or 2e14 < (*.f64 (PI.f64) l) Initial program 65.1%
associate-*l/65.1%
*-lft-identity65.1%
Simplified65.1%
Taylor expanded in l around 0 51.6%
unpow251.6%
Simplified51.6%
Taylor expanded in F around inf 99.6%
if -1.99999999999999991e37 < (*.f64 (PI.f64) l) < 2e14Initial program 89.1%
associate-*l/89.2%
*-un-lft-identity89.2%
associate-/r*99.1%
Applied egg-rr99.1%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -40000000000000.0) (not (<= (* PI l) 0.05))) (* PI l) (- (* PI l) (/ (/ (* PI l) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -40000000000000.0) || !((((double) M_PI) * l) <= 0.05)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - (((((double) M_PI) * l) / F) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -40000000000000.0) || !((Math.PI * l) <= 0.05)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (((Math.PI * l) / F) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -40000000000000.0) or not ((math.pi * l) <= 0.05): tmp = math.pi * l else: tmp = (math.pi * l) - (((math.pi * l) / F) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -40000000000000.0) || !(Float64(pi * l) <= 0.05)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(Float64(pi * l) / F) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -40000000000000.0) || ~(((pi * l) <= 0.05))) tmp = pi * l; else tmp = (pi * l) - (((pi * l) / F) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -40000000000000.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 0.05]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[(Pi * l), $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -40000000000000 \lor \neg \left(\pi \cdot \ell \leq 0.05\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\pi \cdot \ell}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -4e13 or 0.050000000000000003 < (*.f64 (PI.f64) l) Initial program 66.2%
associate-*l/66.2%
*-lft-identity66.2%
Simplified66.2%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.2%
if -4e13 < (*.f64 (PI.f64) l) < 0.050000000000000003Initial program 89.1%
associate-/r*89.1%
metadata-eval89.1%
add-sqr-sqrt47.7%
sqrt-prod68.6%
sqrt-div68.6%
associate-*l/68.6%
sqrt-div68.8%
metadata-eval68.8%
sqrt-prod54.9%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
Taylor expanded in l around 0 98.3%
Final simplification98.3%
(FPCore (F l) :precision binary64 (if (or (<= l -620000000000.0) (not (<= l 0.5))) (* PI l) (- (* PI l) (* PI (/ l (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -620000000000.0) || !(l <= 0.5)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - (((double) M_PI) * (l / (F * F)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -620000000000.0) || !(l <= 0.5)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (Math.PI * (l / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -620000000000.0) or not (l <= 0.5): tmp = math.pi * l else: tmp = (math.pi * l) - (math.pi * (l / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -620000000000.0) || !(l <= 0.5)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(pi * Float64(l / Float64(F * F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -620000000000.0) || ~((l <= 0.5))) tmp = pi * l; else tmp = (pi * l) - (pi * (l / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -620000000000.0], N[Not[LessEqual[l, 0.5]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(Pi * N[(l / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -620000000000 \lor \neg \left(\ell \leq 0.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\
\end{array}
\end{array}
if l < -6.2e11 or 0.5 < l Initial program 66.2%
associate-*l/66.2%
*-lft-identity66.2%
Simplified66.2%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.2%
if -6.2e11 < l < 0.5Initial program 89.1%
Taylor expanded in l around 0 87.9%
associate-/l*88.0%
associate-/r/88.0%
unpow288.0%
Simplified88.0%
Final simplification93.6%
(FPCore (F l) :precision binary64 (if (or (<= l -620000000000.0) (not (<= l 0.5))) (* PI l) (- (* PI l) (/ (* PI (/ l F)) F))))
double code(double F, double l) {
double tmp;
if ((l <= -620000000000.0) || !(l <= 0.5)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((((double) M_PI) * (l / F)) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -620000000000.0) || !(l <= 0.5)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI * (l / F)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -620000000000.0) or not (l <= 0.5): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.pi * (l / F)) / F) return tmp
function code(F, l) tmp = 0.0 if ((l <= -620000000000.0) || !(l <= 0.5)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(pi * Float64(l / F)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -620000000000.0) || ~((l <= 0.5))) tmp = pi * l; else tmp = (pi * l) - ((pi * (l / F)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -620000000000.0], N[Not[LessEqual[l, 0.5]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi * N[(l / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -620000000000 \lor \neg \left(\ell \leq 0.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \frac{\ell}{F}}{F}\\
\end{array}
\end{array}
if l < -6.2e11 or 0.5 < l Initial program 66.2%
associate-*l/66.2%
*-lft-identity66.2%
Simplified66.2%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.2%
if -6.2e11 < l < 0.5Initial program 89.1%
associate-/r*89.1%
metadata-eval89.1%
add-sqr-sqrt47.7%
sqrt-prod68.6%
sqrt-div68.6%
associate-*l/68.6%
sqrt-div68.8%
metadata-eval68.8%
sqrt-prod54.9%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
Taylor expanded in l around 0 98.3%
associate-/l*98.2%
associate-/r/98.2%
Simplified98.2%
Final simplification98.2%
(FPCore (F l) :precision binary64 (if (or (<= l -620000000000.0) (not (<= l 0.5))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -620000000000.0) || !(l <= 0.5)) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (((double) M_PI) - (((double) M_PI) / (F * F)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -620000000000.0) || !(l <= 0.5)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI - (Math.PI / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -620000000000.0) or not (l <= 0.5): tmp = math.pi * l else: tmp = l * (math.pi - (math.pi / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -620000000000.0) || !(l <= 0.5)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(pi - Float64(pi / Float64(F * F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -620000000000.0) || ~((l <= 0.5))) tmp = pi * l; else tmp = l * (pi - (pi / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -620000000000.0], N[Not[LessEqual[l, 0.5]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi - N[(Pi / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -620000000000 \lor \neg \left(\ell \leq 0.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\end{array}
\end{array}
if l < -6.2e11 or 0.5 < l Initial program 66.2%
associate-*l/66.2%
*-lft-identity66.2%
Simplified66.2%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.2%
if -6.2e11 < l < 0.5Initial program 89.1%
associate-*l/89.2%
*-lft-identity89.2%
Simplified89.2%
Taylor expanded in l around 0 87.8%
unpow287.8%
Simplified87.8%
Final simplification93.5%
(FPCore (F l) :precision binary64 (if (or (<= l -620000000000.0) (not (<= l 0.5))) (* PI l) (* PI (- l (* l (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if ((l <= -620000000000.0) || !(l <= 0.5)) {
tmp = ((double) M_PI) * l;
} else {
tmp = ((double) M_PI) * (l - (l * pow(F, -2.0)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -620000000000.0) || !(l <= 0.5)) {
tmp = Math.PI * l;
} else {
tmp = Math.PI * (l - (l * Math.pow(F, -2.0)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -620000000000.0) or not (l <= 0.5): tmp = math.pi * l else: tmp = math.pi * (l - (l * math.pow(F, -2.0))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -620000000000.0) || !(l <= 0.5)) tmp = Float64(pi * l); else tmp = Float64(pi * Float64(l - Float64(l * (F ^ -2.0)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -620000000000.0) || ~((l <= 0.5))) tmp = pi * l; else tmp = pi * (l - (l * (F ^ -2.0))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -620000000000.0], N[Not[LessEqual[l, 0.5]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(Pi * N[(l - N[(l * N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -620000000000 \lor \neg \left(\ell \leq 0.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \left(\ell - \ell \cdot {F}^{-2}\right)\\
\end{array}
\end{array}
if l < -6.2e11 or 0.5 < l Initial program 66.2%
associate-*l/66.2%
*-lft-identity66.2%
Simplified66.2%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.2%
if -6.2e11 < l < 0.5Initial program 89.1%
associate-*l/89.2%
*-lft-identity89.2%
Simplified89.2%
Taylor expanded in l around 0 87.8%
unpow287.8%
Simplified87.8%
associate-/r*87.9%
div-inv87.8%
Applied egg-rr87.8%
Taylor expanded in l around 0 87.8%
unpow287.8%
/-rgt-identity87.8%
associate-/l*87.8%
associate-/r/87.8%
*-rgt-identity87.8%
associate-*l/87.8%
associate-*r/87.8%
associate-*r*87.7%
unpow-187.7%
unpow-187.7%
pow-sqr87.9%
metadata-eval87.9%
distribute-rgt-out--87.9%
associate-*r*87.8%
distribute-lft-out--87.9%
*-commutative87.9%
Simplified87.9%
Final simplification93.5%
(FPCore (F l) :precision binary64 (if (or (<= F 6.2e-280) (not (<= F 8.2e-206))) (* PI l) (* PI (* (/ l F) (/ -1.0 F)))))
double code(double F, double l) {
double tmp;
if ((F <= 6.2e-280) || !(F <= 8.2e-206)) {
tmp = ((double) M_PI) * l;
} else {
tmp = ((double) M_PI) * ((l / F) * (-1.0 / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F <= 6.2e-280) || !(F <= 8.2e-206)) {
tmp = Math.PI * l;
} else {
tmp = Math.PI * ((l / F) * (-1.0 / F));
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 6.2e-280) or not (F <= 8.2e-206): tmp = math.pi * l else: tmp = math.pi * ((l / F) * (-1.0 / F)) return tmp
function code(F, l) tmp = 0.0 if ((F <= 6.2e-280) || !(F <= 8.2e-206)) tmp = Float64(pi * l); else tmp = Float64(pi * Float64(Float64(l / F) * Float64(-1.0 / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 6.2e-280) || ~((F <= 8.2e-206))) tmp = pi * l; else tmp = pi * ((l / F) * (-1.0 / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 6.2e-280], N[Not[LessEqual[F, 8.2e-206]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(Pi * N[(N[(l / F), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 6.2 \cdot 10^{-280} \lor \neg \left(F \leq 8.2 \cdot 10^{-206}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \left(\frac{\ell}{F} \cdot \frac{-1}{F}\right)\\
\end{array}
\end{array}
if F < 6.20000000000000042e-280 or 8.20000000000000032e-206 < F Initial program 78.4%
associate-*l/78.5%
*-lft-identity78.5%
Simplified78.5%
Taylor expanded in l around 0 69.8%
unpow269.8%
Simplified69.8%
Taylor expanded in F around inf 78.8%
if 6.20000000000000042e-280 < F < 8.20000000000000032e-206Initial program 50.0%
associate-*l/50.0%
*-lft-identity50.0%
Simplified50.0%
Taylor expanded in l around 0 49.4%
unpow249.4%
Simplified49.4%
associate-/r*49.4%
div-inv49.4%
Applied egg-rr49.4%
Taylor expanded in F around 0 49.4%
mul-1-neg49.4%
unpow249.4%
associate-/l*49.4%
associate-*r/49.4%
Simplified49.4%
associate-/r*76.2%
associate-/l*76.2%
div-inv76.3%
*-commutative76.3%
associate-*l*76.5%
Applied egg-rr76.5%
Final simplification78.7%
(FPCore (F l) :precision binary64 (if (or (<= F 2.8e-282) (not (<= F 9e-208))) (* PI l) (* (/ l F) (/ (- PI) F))))
double code(double F, double l) {
double tmp;
if ((F <= 2.8e-282) || !(F <= 9e-208)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (l / F) * (-((double) M_PI) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F <= 2.8e-282) || !(F <= 9e-208)) {
tmp = Math.PI * l;
} else {
tmp = (l / F) * (-Math.PI / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 2.8e-282) or not (F <= 9e-208): tmp = math.pi * l else: tmp = (l / F) * (-math.pi / F) return tmp
function code(F, l) tmp = 0.0 if ((F <= 2.8e-282) || !(F <= 9e-208)) tmp = Float64(pi * l); else tmp = Float64(Float64(l / F) * Float64(Float64(-pi) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 2.8e-282) || ~((F <= 9e-208))) tmp = pi * l; else tmp = (l / F) * (-pi / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 2.8e-282], N[Not[LessEqual[F, 9e-208]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(l / F), $MachinePrecision] * N[((-Pi) / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.8 \cdot 10^{-282} \lor \neg \left(F \leq 9 \cdot 10^{-208}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{-\pi}{F}\\
\end{array}
\end{array}
if F < 2.7999999999999999e-282 or 8.9999999999999992e-208 < F Initial program 78.4%
associate-*l/78.5%
*-lft-identity78.5%
Simplified78.5%
Taylor expanded in l around 0 69.8%
unpow269.8%
Simplified69.8%
Taylor expanded in F around inf 78.8%
if 2.7999999999999999e-282 < F < 8.9999999999999992e-208Initial program 50.0%
associate-*l/50.0%
*-lft-identity50.0%
Simplified50.0%
Taylor expanded in l around 0 49.4%
unpow249.4%
Simplified49.4%
associate-/r*49.4%
div-inv49.4%
Applied egg-rr49.4%
Taylor expanded in F around 0 49.4%
mul-1-neg49.4%
unpow249.4%
associate-/l*49.4%
associate-*r/49.4%
Simplified49.4%
*-un-lft-identity49.4%
*-commutative49.4%
times-frac76.2%
clear-num76.2%
Applied egg-rr76.2%
Final simplification78.6%
(FPCore (F l) :precision binary64 (if (or (<= F 3.3e-282) (not (<= F 5.8e-205))) (* PI l) (* PI (- (/ (/ l F) F)))))
double code(double F, double l) {
double tmp;
if ((F <= 3.3e-282) || !(F <= 5.8e-205)) {
tmp = ((double) M_PI) * l;
} else {
tmp = ((double) M_PI) * -((l / F) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F <= 3.3e-282) || !(F <= 5.8e-205)) {
tmp = Math.PI * l;
} else {
tmp = Math.PI * -((l / F) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 3.3e-282) or not (F <= 5.8e-205): tmp = math.pi * l else: tmp = math.pi * -((l / F) / F) return tmp
function code(F, l) tmp = 0.0 if ((F <= 3.3e-282) || !(F <= 5.8e-205)) tmp = Float64(pi * l); else tmp = Float64(pi * Float64(-Float64(Float64(l / F) / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F <= 3.3e-282) || ~((F <= 5.8e-205))) tmp = pi * l; else tmp = pi * -((l / F) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 3.3e-282], N[Not[LessEqual[F, 5.8e-205]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(Pi * (-N[(N[(l / F), $MachinePrecision] / F), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.3 \cdot 10^{-282} \lor \neg \left(F \leq 5.8 \cdot 10^{-205}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \left(-\frac{\frac{\ell}{F}}{F}\right)\\
\end{array}
\end{array}
if F < 3.3e-282 or 5.80000000000000036e-205 < F Initial program 78.4%
associate-*l/78.5%
*-lft-identity78.5%
Simplified78.5%
Taylor expanded in l around 0 69.8%
unpow269.8%
Simplified69.8%
Taylor expanded in F around inf 78.8%
if 3.3e-282 < F < 5.80000000000000036e-205Initial program 50.0%
associate-*l/50.0%
*-lft-identity50.0%
Simplified50.0%
Taylor expanded in l around 0 49.4%
unpow249.4%
Simplified49.4%
associate-/r*49.4%
div-inv49.4%
Applied egg-rr49.4%
Taylor expanded in F around 0 49.4%
mul-1-neg49.4%
unpow249.4%
associate-/l*49.4%
associate-*r/49.4%
Simplified49.4%
associate-/r*76.2%
associate-/r/76.4%
Applied egg-rr76.4%
Final simplification78.7%
(FPCore (F l) :precision binary64 (* PI l))
double code(double F, double l) {
return ((double) M_PI) * l;
}
public static double code(double F, double l) {
return Math.PI * l;
}
def code(F, l): return math.pi * l
function code(F, l) return Float64(pi * l) end
function tmp = code(F, l) tmp = pi * l; end
code[F_, l_] := N[(Pi * l), $MachinePrecision]
\begin{array}{l}
\\
\pi \cdot \ell
\end{array}
Initial program 76.6%
associate-*l/76.6%
*-lft-identity76.6%
Simplified76.6%
Taylor expanded in l around 0 68.4%
unpow268.4%
Simplified68.4%
Taylor expanded in F around inf 75.2%
Final simplification75.2%
herbie shell --seed 2023242
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))