
(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 13 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) -1e+18) (not (<= (* PI l) 2000000000.0))) (* PI l) (+ (* PI l) (/ (* (tan (* PI l)) (/ -1.0 F)) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+18) || !((((double) M_PI) * l) <= 2000000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + ((tan((((double) M_PI) * l)) * (-1.0 / F)) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -1e+18) || !((Math.PI * l) <= 2000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + ((Math.tan((Math.PI * l)) * (-1.0 / F)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -1e+18) or not ((math.pi * l) <= 2000000000.0): tmp = math.pi * l else: tmp = (math.pi * l) + ((math.tan((math.pi * l)) * (-1.0 / F)) / F) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -1e+18) || !(Float64(pi * l) <= 2000000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(Float64(tan(Float64(pi * l)) * Float64(-1.0 / F)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -1e+18) || ~(((pi * l) <= 2000000000.0))) tmp = pi * l; else tmp = (pi * l) + ((tan((pi * l)) * (-1.0 / F)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -1e+18], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+18} \lor \neg \left(\pi \cdot \ell \leq 2000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right) \cdot \frac{-1}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1e18 or 2e9 < (*.f64 (PI.f64) l) Initial program 59.8%
associate-*l/59.8%
*-lft-identity59.8%
Simplified59.8%
Taylor expanded in l around 0 47.6%
unpow247.6%
Simplified47.6%
Taylor expanded in F around inf 99.5%
if -1e18 < (*.f64 (PI.f64) l) < 2e9Initial program 88.4%
associate-/r*88.5%
metadata-eval88.5%
add-sqr-sqrt46.2%
sqrt-prod69.9%
sqrt-div69.9%
associate-*l/69.9%
sqrt-div69.9%
metadata-eval69.9%
sqrt-prod51.0%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
Final simplification99.2%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -1e+18) (not (<= (* PI l) 2000000000.0))) (* PI l) (+ (* PI l) (/ -1.0 (/ F (/ (tan (* PI l)) F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+18) || !((((double) M_PI) * l) <= 2000000000.0)) {
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) <= -1e+18) || !((Math.PI * l) <= 2000000000.0)) {
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) <= -1e+18) or not ((math.pi * l) <= 2000000000.0): 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) <= -1e+18) || !(Float64(pi * l) <= 2000000000.0)) 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) <= -1e+18) || ~(((pi * l) <= 2000000000.0))) 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], -1e+18], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2000000000.0]], $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 -1 \cdot 10^{+18} \lor \neg \left(\pi \cdot \ell \leq 2000000000\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) < -1e18 or 2e9 < (*.f64 (PI.f64) l) Initial program 59.8%
associate-*l/59.8%
*-lft-identity59.8%
Simplified59.8%
Taylor expanded in l around 0 47.6%
unpow247.6%
Simplified47.6%
Taylor expanded in F around inf 99.5%
if -1e18 < (*.f64 (PI.f64) l) < 2e9Initial program 88.4%
associate-/r/88.5%
associate-/l*98.8%
Applied egg-rr98.8%
Final simplification99.2%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -1e+18) (not (<= (* PI l) 2000000000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+18) || !((((double) M_PI) * l) <= 2000000000.0)) {
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) <= -1e+18) || !((Math.PI * l) <= 2000000000.0)) {
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) <= -1e+18) or not ((math.pi * l) <= 2000000000.0): 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) <= -1e+18) || !(Float64(pi * l) <= 2000000000.0)) 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) <= -1e+18) || ~(((pi * l) <= 2000000000.0))) 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], -1e+18], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2000000000.0]], $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 -1 \cdot 10^{+18} \lor \neg \left(\pi \cdot \ell \leq 2000000000\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) < -1e18 or 2e9 < (*.f64 (PI.f64) l) Initial program 59.8%
associate-*l/59.8%
*-lft-identity59.8%
Simplified59.8%
Taylor expanded in l around 0 47.6%
unpow247.6%
Simplified47.6%
Taylor expanded in F around inf 99.5%
if -1e18 < (*.f64 (PI.f64) l) < 2e9Initial program 88.4%
associate-*l/88.5%
*-un-lft-identity88.5%
associate-/r*98.8%
Applied egg-rr98.8%
Final simplification99.2%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -50000000000.0) (not (<= (* PI l) 500000.0))) (* PI l) (- (* PI l) (/ PI (* F (/ F l))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -50000000000.0) || !((((double) M_PI) * l) <= 500000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - (((double) M_PI) / (F * (F / l)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -50000000000.0) || !((Math.PI * l) <= 500000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (Math.PI / (F * (F / l)));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -50000000000.0) or not ((math.pi * l) <= 500000.0): tmp = math.pi * l else: tmp = (math.pi * l) - (math.pi / (F * (F / l))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -50000000000.0) || !(Float64(pi * l) <= 500000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(pi / Float64(F * Float64(F / l)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -50000000000.0) || ~(((pi * l) <= 500000.0))) tmp = pi * l; else tmp = (pi * l) - (pi / (F * (F / l))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -50000000000.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 500000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(Pi / N[(F * N[(F / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -50000000000 \lor \neg \left(\pi \cdot \ell \leq 500000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi}{F \cdot \frac{F}{\ell}}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -5e10 or 5e5 < (*.f64 (PI.f64) l) Initial program 60.1%
associate-*l/60.1%
*-lft-identity60.1%
Simplified60.1%
Taylor expanded in l around 0 46.4%
unpow246.4%
Simplified46.4%
Taylor expanded in F around inf 97.2%
if -5e10 < (*.f64 (PI.f64) l) < 5e5Initial program 88.8%
inv-pow88.8%
unpow-prod-down88.8%
pow-prod-up88.8%
pow-to-exp45.6%
metadata-eval45.6%
Applied egg-rr45.6%
Taylor expanded in l around 0 88.4%
*-commutative88.4%
unpow288.4%
times-frac98.9%
Simplified98.9%
*-commutative98.9%
clear-num98.9%
frac-times99.0%
*-un-lft-identity99.0%
Applied egg-rr99.0%
Final simplification98.1%
(FPCore (F l) :precision binary64 (if (or (<= l -70000000.0) (not (<= l 260000000.0))) (* PI l) (- (* PI l) (* (/ PI F) (/ l F)))))
double code(double F, double l) {
double tmp;
if ((l <= -70000000.0) || !(l <= 260000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((((double) M_PI) / F) * (l / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -70000000.0) || !(l <= 260000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI / F) * (l / F));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -70000000.0) or not (l <= 260000000.0): tmp = math.pi * l else: tmp = (math.pi * l) - ((math.pi / F) * (l / F)) return tmp
function code(F, l) tmp = 0.0 if ((l <= -70000000.0) || !(l <= 260000000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(pi / F) * Float64(l / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -70000000.0) || ~((l <= 260000000.0))) tmp = pi * l; else tmp = (pi * l) - ((pi / F) * (l / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -70000000.0], N[Not[LessEqual[l, 260000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi / F), $MachinePrecision] * N[(l / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -70000000 \lor \neg \left(\ell \leq 260000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi}{F} \cdot \frac{\ell}{F}\\
\end{array}
\end{array}
if l < -7e7 or 2.6e8 < l Initial program 60.1%
associate-*l/60.1%
*-lft-identity60.1%
Simplified60.1%
Taylor expanded in l around 0 46.4%
unpow246.4%
Simplified46.4%
Taylor expanded in F around inf 97.2%
if -7e7 < l < 2.6e8Initial program 88.8%
inv-pow88.8%
unpow-prod-down88.8%
pow-prod-up88.8%
pow-to-exp45.6%
metadata-eval45.6%
Applied egg-rr45.6%
Taylor expanded in l around 0 88.4%
*-commutative88.4%
unpow288.4%
times-frac98.9%
Simplified98.9%
Final simplification98.1%
(FPCore (F l) :precision binary64 (if (or (<= l -70000000.0) (not (<= l 260000000.0))) (* PI l) (* l (* PI (- 1.0 (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if ((l <= -70000000.0) || !(l <= 260000000.0)) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (((double) M_PI) * (1.0 - pow(F, -2.0)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -70000000.0) || !(l <= 260000000.0)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI * (1.0 - Math.pow(F, -2.0)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -70000000.0) or not (l <= 260000000.0): tmp = math.pi * l else: tmp = l * (math.pi * (1.0 - math.pow(F, -2.0))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -70000000.0) || !(l <= 260000000.0)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(pi * Float64(1.0 - (F ^ -2.0)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -70000000.0) || ~((l <= 260000000.0))) tmp = pi * l; else tmp = l * (pi * (1.0 - (F ^ -2.0))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -70000000.0], N[Not[LessEqual[l, 260000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi * N[(1.0 - N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -70000000 \lor \neg \left(\ell \leq 260000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\
\end{array}
\end{array}
if l < -7e7 or 2.6e8 < l Initial program 60.1%
associate-*l/60.1%
*-lft-identity60.1%
Simplified60.1%
Taylor expanded in l around 0 46.4%
unpow246.4%
Simplified46.4%
Taylor expanded in F around inf 97.2%
if -7e7 < l < 2.6e8Initial program 88.8%
associate-*l/88.8%
*-lft-identity88.8%
Simplified88.8%
Taylor expanded in l around 0 88.4%
unpow288.4%
Simplified88.4%
Taylor expanded in l around 0 88.4%
*-lft-identity88.4%
*-lft-identity88.4%
unpow288.4%
times-frac88.3%
*-lft-identity88.3%
associate-*l/88.3%
associate-*l*88.3%
unpow-188.3%
unpow-188.3%
pow-sqr88.4%
metadata-eval88.4%
distribute-rgt-out--88.4%
Simplified88.4%
Final simplification92.6%
(FPCore (F l) :precision binary64 (if (or (<= l -70000000.0) (not (<= l 260000000.0))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -70000000.0) || !(l <= 260000000.0)) {
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 <= -70000000.0) || !(l <= 260000000.0)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI - (Math.PI / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -70000000.0) or not (l <= 260000000.0): tmp = math.pi * l else: tmp = l * (math.pi - (math.pi / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -70000000.0) || !(l <= 260000000.0)) 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 <= -70000000.0) || ~((l <= 260000000.0))) tmp = pi * l; else tmp = l * (pi - (pi / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -70000000.0], N[Not[LessEqual[l, 260000000.0]], $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 -70000000 \lor \neg \left(\ell \leq 260000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\end{array}
\end{array}
if l < -7e7 or 2.6e8 < l Initial program 60.1%
associate-*l/60.1%
*-lft-identity60.1%
Simplified60.1%
Taylor expanded in l around 0 46.4%
unpow246.4%
Simplified46.4%
Taylor expanded in F around inf 97.2%
if -7e7 < l < 2.6e8Initial program 88.8%
associate-*l/88.8%
*-lft-identity88.8%
Simplified88.8%
Taylor expanded in l around 0 88.4%
unpow288.4%
Simplified88.4%
Final simplification92.6%
(FPCore (F l) :precision binary64 (if (or (<= l -70000000.0) (not (<= l 260000000.0))) (* PI l) (* PI (- l (* l (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if ((l <= -70000000.0) || !(l <= 260000000.0)) {
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 <= -70000000.0) || !(l <= 260000000.0)) {
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 <= -70000000.0) or not (l <= 260000000.0): 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 <= -70000000.0) || !(l <= 260000000.0)) 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 <= -70000000.0) || ~((l <= 260000000.0))) tmp = pi * l; else tmp = pi * (l - (l * (F ^ -2.0))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -70000000.0], N[Not[LessEqual[l, 260000000.0]], $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 -70000000 \lor \neg \left(\ell \leq 260000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \left(\ell - \ell \cdot {F}^{-2}\right)\\
\end{array}
\end{array}
if l < -7e7 or 2.6e8 < l Initial program 60.1%
associate-*l/60.1%
*-lft-identity60.1%
Simplified60.1%
Taylor expanded in l around 0 46.4%
unpow246.4%
Simplified46.4%
Taylor expanded in F around inf 97.2%
if -7e7 < l < 2.6e8Initial program 88.8%
associate-/r*88.8%
metadata-eval88.8%
add-sqr-sqrt46.5%
sqrt-prod70.7%
sqrt-div70.7%
associate-*l/70.7%
sqrt-div70.7%
metadata-eval70.7%
sqrt-prod51.4%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
Taylor expanded in l around 0 99.0%
associate-/l*98.9%
associate-/r/98.9%
Simplified98.9%
sub-neg98.9%
associate-*l/99.0%
associate-/r*88.4%
div-inv88.3%
*-commutative88.3%
distribute-rgt-neg-in88.3%
pow288.3%
pow-flip88.4%
metadata-eval88.4%
Applied egg-rr88.4%
distribute-rgt-neg-out88.4%
associate-*r*88.4%
sub-neg88.4%
distribute-lft-out--88.4%
Simplified88.4%
Final simplification92.6%
(FPCore (F l)
:precision binary64
(if (or (<= (* F F) 2.25e-304)
(not
(or (<= (* F F) 1.08e-197)
(and (not (<= (* F F) 3.5e-133)) (<= (* F F) 9.5e-52)))))
(* PI l)
(* PI (/ (- l) (* F F)))))
double code(double F, double l) {
double tmp;
if (((F * F) <= 2.25e-304) || !(((F * F) <= 1.08e-197) || (!((F * F) <= 3.5e-133) && ((F * F) <= 9.5e-52)))) {
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 * F) <= 2.25e-304) || !(((F * F) <= 1.08e-197) || (!((F * F) <= 3.5e-133) && ((F * F) <= 9.5e-52)))) {
tmp = Math.PI * l;
} else {
tmp = Math.PI * (-l / (F * F));
}
return tmp;
}
def code(F, l): tmp = 0 if ((F * F) <= 2.25e-304) or not (((F * F) <= 1.08e-197) or (not ((F * F) <= 3.5e-133) and ((F * F) <= 9.5e-52))): tmp = math.pi * l else: tmp = math.pi * (-l / (F * F)) return tmp
function code(F, l) tmp = 0.0 if ((Float64(F * F) <= 2.25e-304) || !((Float64(F * F) <= 1.08e-197) || (!(Float64(F * F) <= 3.5e-133) && (Float64(F * F) <= 9.5e-52)))) tmp = Float64(pi * l); else tmp = Float64(pi * Float64(Float64(-l) / Float64(F * F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((F * F) <= 2.25e-304) || ~((((F * F) <= 1.08e-197) || (~(((F * F) <= 3.5e-133)) && ((F * F) <= 9.5e-52))))) tmp = pi * l; else tmp = pi * (-l / (F * F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(F * F), $MachinePrecision], 2.25e-304], N[Not[Or[LessEqual[N[(F * F), $MachinePrecision], 1.08e-197], And[N[Not[LessEqual[N[(F * F), $MachinePrecision], 3.5e-133]], $MachinePrecision], LessEqual[N[(F * F), $MachinePrecision], 9.5e-52]]]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(Pi * N[((-l) / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2.25 \cdot 10^{-304} \lor \neg \left(F \cdot F \leq 1.08 \cdot 10^{-197} \lor \neg \left(F \cdot F \leq 3.5 \cdot 10^{-133}\right) \land F \cdot F \leq 9.5 \cdot 10^{-52}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \frac{-\ell}{F \cdot F}\\
\end{array}
\end{array}
if (*.f64 F F) < 2.2499999999999999e-304 or 1.0800000000000001e-197 < (*.f64 F F) < 3.50000000000000003e-133 or 9.50000000000000007e-52 < (*.f64 F F) Initial program 73.6%
associate-*l/73.6%
*-lft-identity73.6%
Simplified73.6%
Taylor expanded in l around 0 67.5%
unpow267.5%
Simplified67.5%
Taylor expanded in F around inf 78.9%
if 2.2499999999999999e-304 < (*.f64 F F) < 1.0800000000000001e-197 or 3.50000000000000003e-133 < (*.f64 F F) < 9.50000000000000007e-52Initial program 85.5%
associate-*l/85.7%
*-lft-identity85.7%
Simplified85.7%
Taylor expanded in l around 0 73.4%
unpow273.4%
Simplified73.4%
Taylor expanded in F around 0 73.3%
mul-1-neg73.3%
unpow273.3%
Simplified73.3%
associate-/l*73.2%
associate-/r/73.4%
Applied egg-rr73.4%
Final simplification78.3%
(FPCore (F l)
:precision binary64
(if (or (<= l -1.9e-48)
(not
(or (<= l -1.25e-199)
(and (not (<= l -2.95e-232))
(or (<= l 4.3e-276)
(and (not (<= l 9.5e-258)) (<= l 1.75e-124)))))))
(* PI l)
(* (/ PI F) (- (/ l F)))))
double code(double F, double l) {
double tmp;
if ((l <= -1.9e-48) || !((l <= -1.25e-199) || (!(l <= -2.95e-232) && ((l <= 4.3e-276) || (!(l <= 9.5e-258) && (l <= 1.75e-124)))))) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) / F) * -(l / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -1.9e-48) || !((l <= -1.25e-199) || (!(l <= -2.95e-232) && ((l <= 4.3e-276) || (!(l <= 9.5e-258) && (l <= 1.75e-124)))))) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI / F) * -(l / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -1.9e-48) or not ((l <= -1.25e-199) or (not (l <= -2.95e-232) and ((l <= 4.3e-276) or (not (l <= 9.5e-258) and (l <= 1.75e-124))))): tmp = math.pi * l else: tmp = (math.pi / F) * -(l / F) return tmp
function code(F, l) tmp = 0.0 if ((l <= -1.9e-48) || !((l <= -1.25e-199) || (!(l <= -2.95e-232) && ((l <= 4.3e-276) || (!(l <= 9.5e-258) && (l <= 1.75e-124)))))) tmp = Float64(pi * l); else tmp = Float64(Float64(pi / F) * Float64(-Float64(l / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -1.9e-48) || ~(((l <= -1.25e-199) || (~((l <= -2.95e-232)) && ((l <= 4.3e-276) || (~((l <= 9.5e-258)) && (l <= 1.75e-124))))))) tmp = pi * l; else tmp = (pi / F) * -(l / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -1.9e-48], N[Not[Or[LessEqual[l, -1.25e-199], And[N[Not[LessEqual[l, -2.95e-232]], $MachinePrecision], Or[LessEqual[l, 4.3e-276], And[N[Not[LessEqual[l, 9.5e-258]], $MachinePrecision], LessEqual[l, 1.75e-124]]]]]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi / F), $MachinePrecision] * (-N[(l / F), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.9 \cdot 10^{-48} \lor \neg \left(\ell \leq -1.25 \cdot 10^{-199} \lor \neg \left(\ell \leq -2.95 \cdot 10^{-232}\right) \land \left(\ell \leq 4.3 \cdot 10^{-276} \lor \neg \left(\ell \leq 9.5 \cdot 10^{-258}\right) \land \ell \leq 1.75 \cdot 10^{-124}\right)\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi}{F} \cdot \left(-\frac{\ell}{F}\right)\\
\end{array}
\end{array}
if l < -1.90000000000000001e-48 or -1.2499999999999999e-199 < l < -2.95000000000000008e-232 or 4.2999999999999996e-276 < l < 9.5000000000000009e-258 or 1.7499999999999999e-124 < l Initial program 72.1%
associate-*l/72.1%
*-lft-identity72.1%
Simplified72.1%
Taylor expanded in l around 0 62.5%
unpow262.5%
Simplified62.5%
Taylor expanded in F around inf 88.4%
if -1.90000000000000001e-48 < l < -1.2499999999999999e-199 or -2.95000000000000008e-232 < l < 4.2999999999999996e-276 or 9.5000000000000009e-258 < l < 1.7499999999999999e-124Initial program 82.0%
associate-*l/82.0%
*-lft-identity82.0%
Simplified82.0%
Taylor expanded in l around 0 82.1%
unpow282.1%
Simplified82.1%
Taylor expanded in F around 0 50.4%
mul-1-neg50.4%
unpow250.4%
Simplified50.4%
*-commutative50.4%
times-frac67.9%
Applied egg-rr67.9%
Final simplification82.4%
(FPCore (F l)
:precision binary64
(if (or (<= l -1.75e-48)
(and (not (<= l -6e-203))
(or (<= l -2.35e-232)
(and (not (<= l 5.2e-276))
(or (<= l 1.65e-255) (not (<= l 7e-125)))))))
(* PI l)
(/ (/ (- PI) (/ F l)) F)))
double code(double F, double l) {
double tmp;
if ((l <= -1.75e-48) || (!(l <= -6e-203) && ((l <= -2.35e-232) || (!(l <= 5.2e-276) && ((l <= 1.65e-255) || !(l <= 7e-125)))))) {
tmp = ((double) M_PI) * l;
} else {
tmp = (-((double) M_PI) / (F / l)) / F;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -1.75e-48) || (!(l <= -6e-203) && ((l <= -2.35e-232) || (!(l <= 5.2e-276) && ((l <= 1.65e-255) || !(l <= 7e-125)))))) {
tmp = Math.PI * l;
} else {
tmp = (-Math.PI / (F / l)) / F;
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -1.75e-48) or (not (l <= -6e-203) and ((l <= -2.35e-232) or (not (l <= 5.2e-276) and ((l <= 1.65e-255) or not (l <= 7e-125))))): tmp = math.pi * l else: tmp = (-math.pi / (F / l)) / F return tmp
function code(F, l) tmp = 0.0 if ((l <= -1.75e-48) || (!(l <= -6e-203) && ((l <= -2.35e-232) || (!(l <= 5.2e-276) && ((l <= 1.65e-255) || !(l <= 7e-125)))))) tmp = Float64(pi * l); else tmp = Float64(Float64(Float64(-pi) / Float64(F / l)) / F); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -1.75e-48) || (~((l <= -6e-203)) && ((l <= -2.35e-232) || (~((l <= 5.2e-276)) && ((l <= 1.65e-255) || ~((l <= 7e-125))))))) tmp = pi * l; else tmp = (-pi / (F / l)) / F; end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -1.75e-48], And[N[Not[LessEqual[l, -6e-203]], $MachinePrecision], Or[LessEqual[l, -2.35e-232], And[N[Not[LessEqual[l, 5.2e-276]], $MachinePrecision], Or[LessEqual[l, 1.65e-255], N[Not[LessEqual[l, 7e-125]], $MachinePrecision]]]]]], N[(Pi * l), $MachinePrecision], N[(N[((-Pi) / N[(F / l), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.75 \cdot 10^{-48} \lor \neg \left(\ell \leq -6 \cdot 10^{-203}\right) \land \left(\ell \leq -2.35 \cdot 10^{-232} \lor \neg \left(\ell \leq 5.2 \cdot 10^{-276}\right) \land \left(\ell \leq 1.65 \cdot 10^{-255} \lor \neg \left(\ell \leq 7 \cdot 10^{-125}\right)\right)\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-\pi}{\frac{F}{\ell}}}{F}\\
\end{array}
\end{array}
if l < -1.74999999999999996e-48 or -6.0000000000000002e-203 < l < -2.35000000000000017e-232 or 5.19999999999999969e-276 < l < 1.64999999999999994e-255 or 6.99999999999999995e-125 < l Initial program 72.1%
associate-*l/72.1%
*-lft-identity72.1%
Simplified72.1%
Taylor expanded in l around 0 62.5%
unpow262.5%
Simplified62.5%
Taylor expanded in F around inf 88.4%
if -1.74999999999999996e-48 < l < -6.0000000000000002e-203 or -2.35000000000000017e-232 < l < 5.19999999999999969e-276 or 1.64999999999999994e-255 < l < 6.99999999999999995e-125Initial program 82.0%
associate-*l/82.0%
*-lft-identity82.0%
Simplified82.0%
Taylor expanded in l around 0 82.1%
unpow282.1%
Simplified82.1%
Taylor expanded in F around 0 50.4%
mul-1-neg50.4%
unpow250.4%
Simplified50.4%
Taylor expanded in l around 0 50.4%
*-commutative50.4%
unpow250.4%
associate-/r*68.0%
associate-/l*68.0%
Simplified68.0%
Final simplification82.4%
(FPCore (F l)
:precision binary64
(let* ((t_0 (/ (/ (- PI) (/ F l)) F)))
(if (<= l -2.15e-48)
(* PI l)
(if (<= l -4.6e-201)
t_0
(if (<= l -3.15e-232)
(* PI l)
(if (<= l 4.8e-276)
t_0
(if (or (<= l 2.9e-258) (not (<= l 1.75e-124)))
(* PI l)
(* PI (- (/ (/ l F) F))))))))))
double code(double F, double l) {
double t_0 = (-((double) M_PI) / (F / l)) / F;
double tmp;
if (l <= -2.15e-48) {
tmp = ((double) M_PI) * l;
} else if (l <= -4.6e-201) {
tmp = t_0;
} else if (l <= -3.15e-232) {
tmp = ((double) M_PI) * l;
} else if (l <= 4.8e-276) {
tmp = t_0;
} else if ((l <= 2.9e-258) || !(l <= 1.75e-124)) {
tmp = ((double) M_PI) * l;
} else {
tmp = ((double) M_PI) * -((l / F) / F);
}
return tmp;
}
public static double code(double F, double l) {
double t_0 = (-Math.PI / (F / l)) / F;
double tmp;
if (l <= -2.15e-48) {
tmp = Math.PI * l;
} else if (l <= -4.6e-201) {
tmp = t_0;
} else if (l <= -3.15e-232) {
tmp = Math.PI * l;
} else if (l <= 4.8e-276) {
tmp = t_0;
} else if ((l <= 2.9e-258) || !(l <= 1.75e-124)) {
tmp = Math.PI * l;
} else {
tmp = Math.PI * -((l / F) / F);
}
return tmp;
}
def code(F, l): t_0 = (-math.pi / (F / l)) / F tmp = 0 if l <= -2.15e-48: tmp = math.pi * l elif l <= -4.6e-201: tmp = t_0 elif l <= -3.15e-232: tmp = math.pi * l elif l <= 4.8e-276: tmp = t_0 elif (l <= 2.9e-258) or not (l <= 1.75e-124): tmp = math.pi * l else: tmp = math.pi * -((l / F) / F) return tmp
function code(F, l) t_0 = Float64(Float64(Float64(-pi) / Float64(F / l)) / F) tmp = 0.0 if (l <= -2.15e-48) tmp = Float64(pi * l); elseif (l <= -4.6e-201) tmp = t_0; elseif (l <= -3.15e-232) tmp = Float64(pi * l); elseif (l <= 4.8e-276) tmp = t_0; elseif ((l <= 2.9e-258) || !(l <= 1.75e-124)) tmp = Float64(pi * l); else tmp = Float64(pi * Float64(-Float64(Float64(l / F) / F))); end return tmp end
function tmp_2 = code(F, l) t_0 = (-pi / (F / l)) / F; tmp = 0.0; if (l <= -2.15e-48) tmp = pi * l; elseif (l <= -4.6e-201) tmp = t_0; elseif (l <= -3.15e-232) tmp = pi * l; elseif (l <= 4.8e-276) tmp = t_0; elseif ((l <= 2.9e-258) || ~((l <= 1.75e-124))) tmp = pi * l; else tmp = pi * -((l / F) / F); end tmp_2 = tmp; end
code[F_, l_] := Block[{t$95$0 = N[(N[((-Pi) / N[(F / l), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]}, If[LessEqual[l, -2.15e-48], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -4.6e-201], t$95$0, If[LessEqual[l, -3.15e-232], N[(Pi * l), $MachinePrecision], If[LessEqual[l, 4.8e-276], t$95$0, If[Or[LessEqual[l, 2.9e-258], N[Not[LessEqual[l, 1.75e-124]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(Pi * (-N[(N[(l / F), $MachinePrecision] / F), $MachinePrecision])), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{-\pi}{\frac{F}{\ell}}}{F}\\
\mathbf{if}\;\ell \leq -2.15 \cdot 10^{-48}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-201}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -3.15 \cdot 10^{-232}:\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{elif}\;\ell \leq 4.8 \cdot 10^{-276}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{-258} \lor \neg \left(\ell \leq 1.75 \cdot 10^{-124}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \left(-\frac{\frac{\ell}{F}}{F}\right)\\
\end{array}
\end{array}
if l < -2.15e-48 or -4.59999999999999971e-201 < l < -3.15000000000000005e-232 or 4.79999999999999965e-276 < l < 2.9e-258 or 1.7499999999999999e-124 < l Initial program 72.1%
associate-*l/72.1%
*-lft-identity72.1%
Simplified72.1%
Taylor expanded in l around 0 62.5%
unpow262.5%
Simplified62.5%
Taylor expanded in F around inf 88.4%
if -2.15e-48 < l < -4.59999999999999971e-201 or -3.15000000000000005e-232 < l < 4.79999999999999965e-276Initial program 82.1%
associate-*l/82.1%
*-lft-identity82.1%
Simplified82.1%
Taylor expanded in l around 0 82.2%
unpow282.2%
Simplified82.2%
Taylor expanded in F around 0 50.4%
mul-1-neg50.4%
unpow250.4%
Simplified50.4%
Taylor expanded in l around 0 50.4%
*-commutative50.4%
unpow250.4%
associate-/r*68.0%
associate-/l*67.9%
Simplified67.9%
if 2.9e-258 < l < 1.7499999999999999e-124Initial program 81.6%
associate-/r*81.8%
metadata-eval81.8%
add-sqr-sqrt48.1%
sqrt-prod58.0%
sqrt-div57.9%
associate-*l/57.9%
sqrt-div58.0%
metadata-eval58.0%
sqrt-prod61.4%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
Taylor expanded in l around 0 99.6%
associate-/l*99.6%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in F around 0 50.3%
mul-1-neg50.3%
unpow250.3%
associate-*l/50.4%
*-commutative50.4%
distribute-rgt-neg-in50.4%
associate-/r*68.3%
Simplified68.3%
Final simplification82.4%
(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 75.0%
associate-*l/75.0%
*-lft-identity75.0%
Simplified75.0%
Taylor expanded in l around 0 68.2%
unpow268.2%
Simplified68.2%
Taylor expanded in F around inf 72.6%
Final simplification72.6%
herbie shell --seed 2023174
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))