
(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 10 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+18) (not (<= (* PI l) 1e-11))) (* PI l) (+ (* PI l) (* (/ (tan (* PI l)) F) (/ -1.0 F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+18) || !((((double) M_PI) * l) <= 1e-11)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) + ((tan((((double) M_PI) * l)) / F) * (-1.0 / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -2e+18) || !((Math.PI * l) <= 1e-11)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) + ((Math.tan((Math.PI * l)) / F) * (-1.0 / F));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -2e+18) or not ((math.pi * l) <= 1e-11): tmp = math.pi * l else: tmp = (math.pi * l) + ((math.tan((math.pi * l)) / F) * (-1.0 / F)) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -2e+18) || !(Float64(pi * l) <= 1e-11)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) + Float64(Float64(tan(Float64(pi * l)) / F) * Float64(-1.0 / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -2e+18) || ~(((pi * l) <= 1e-11))) tmp = pi * l; else tmp = (pi * l) + ((tan((pi * l)) / F) * (-1.0 / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -2e+18], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1e-11]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+18} \lor \neg \left(\pi \cdot \ell \leq 10^{-11}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{-1}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -2e18 or 9.99999999999999939e-12 < (*.f64 (PI.f64) l) Initial program 69.3%
associate-*l/69.3%
*-lft-identity69.3%
Simplified69.3%
Taylor expanded in l around 0 53.0%
unpow253.0%
Simplified53.0%
Taylor expanded in F around inf 99.6%
if -2e18 < (*.f64 (PI.f64) l) < 9.99999999999999939e-12Initial program 90.3%
associate-*l/90.5%
*-lft-identity90.5%
Simplified90.5%
associate-/r*99.1%
div-inv99.1%
Applied egg-rr99.1%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+18) (not (<= (* PI l) 1e-11))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+18) || !((((double) M_PI) * l) <= 1e-11)) {
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+18) || !((Math.PI * l) <= 1e-11)) {
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+18) or not ((math.pi * l) <= 1e-11): 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+18) || !(Float64(pi * l) <= 1e-11)) 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+18) || ~(((pi * l) <= 1e-11))) 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+18], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1e-11]], $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^{+18} \lor \neg \left(\pi \cdot \ell \leq 10^{-11}\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) < -2e18 or 9.99999999999999939e-12 < (*.f64 (PI.f64) l) Initial program 69.3%
associate-*l/69.3%
*-lft-identity69.3%
Simplified69.3%
Taylor expanded in l around 0 53.0%
unpow253.0%
Simplified53.0%
Taylor expanded in F around inf 99.6%
if -2e18 < (*.f64 (PI.f64) l) < 9.99999999999999939e-12Initial program 90.3%
associate-*l/90.5%
*-un-lft-identity90.5%
associate-/r*99.1%
Applied egg-rr99.1%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -1e+14) (not (<= (* PI l) 1e-11))) (* PI l) (* l (+ PI (* (/ PI F) (/ -1.0 F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+14) || !((((double) M_PI) * l) <= 1e-11)) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (((double) M_PI) + ((((double) M_PI) / F) * (-1.0 / F)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -1e+14) || !((Math.PI * l) <= 1e-11)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI + ((Math.PI / F) * (-1.0 / F)));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -1e+14) or not ((math.pi * l) <= 1e-11): tmp = math.pi * l else: tmp = l * (math.pi + ((math.pi / F) * (-1.0 / F))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -1e+14) || !(Float64(pi * l) <= 1e-11)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(pi + Float64(Float64(pi / F) * Float64(-1.0 / F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -1e+14) || ~(((pi * l) <= 1e-11))) tmp = pi * l; else tmp = l * (pi + ((pi / F) * (-1.0 / F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -1e+14], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1e-11]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi + N[(N[(Pi / F), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+14} \lor \neg \left(\pi \cdot \ell \leq 10^{-11}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi + \frac{\pi}{F} \cdot \frac{-1}{F}\right)\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1e14 or 9.99999999999999939e-12 < (*.f64 (PI.f64) l) Initial program 68.9%
associate-*l/68.9%
*-lft-identity68.9%
Simplified68.9%
Taylor expanded in l around 0 52.6%
unpow252.6%
Simplified52.6%
Taylor expanded in F around inf 98.8%
if -1e14 < (*.f64 (PI.f64) l) < 9.99999999999999939e-12Initial program 90.8%
associate-*l/91.0%
*-lft-identity91.0%
Simplified91.0%
Taylor expanded in l around 0 90.0%
unpow290.0%
Simplified90.0%
associate-/r*90.1%
div-inv90.1%
Applied egg-rr90.1%
Final simplification94.1%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -1e+14) (not (<= (* PI l) 1e-11))) (* PI l) (- (* PI l) (* PI (/ l (* F F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+14) || !((((double) M_PI) * l) <= 1e-11)) {
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) <= -1e+14) || !((Math.PI * l) <= 1e-11)) {
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) <= -1e+14) or not ((math.pi * l) <= 1e-11): 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) <= -1e+14) || !(Float64(pi * l) <= 1e-11)) 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 (((pi * l) <= -1e+14) || ~(((pi * l) <= 1e-11))) 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], -1e+14], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1e-11]], $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}\;\pi \cdot \ell \leq -1 \cdot 10^{+14} \lor \neg \left(\pi \cdot \ell \leq 10^{-11}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1e14 or 9.99999999999999939e-12 < (*.f64 (PI.f64) l) Initial program 68.9%
associate-*l/68.9%
*-lft-identity68.9%
Simplified68.9%
Taylor expanded in l around 0 52.6%
unpow252.6%
Simplified52.6%
Taylor expanded in F around inf 98.8%
if -1e14 < (*.f64 (PI.f64) l) < 9.99999999999999939e-12Initial program 90.8%
Taylor expanded in l around 0 90.3%
associate-/l*90.2%
associate-/r/90.3%
unpow290.3%
Simplified90.3%
Final simplification94.2%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -1e+14) (not (<= (* PI l) 1e-11))) (* PI l) (- (* PI l) (* (/ l F) (/ PI F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+14) || !((((double) M_PI) * l) <= 1e-11)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((l / F) * (((double) M_PI) / F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if (((Math.PI * l) <= -1e+14) || !((Math.PI * l) <= 1e-11)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l / F) * (Math.PI / F));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -1e+14) or not ((math.pi * l) <= 1e-11): tmp = math.pi * l else: tmp = (math.pi * l) - ((l / F) * (math.pi / F)) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -1e+14) || !(Float64(pi * l) <= 1e-11)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(l / F) * Float64(pi / F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -1e+14) || ~(((pi * l) <= 1e-11))) tmp = pi * l; else tmp = (pi * l) - ((l / F) * (pi / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -1e+14], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1e-11]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l / F), $MachinePrecision] * N[(Pi / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+14} \lor \neg \left(\pi \cdot \ell \leq 10^{-11}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1e14 or 9.99999999999999939e-12 < (*.f64 (PI.f64) l) Initial program 68.9%
associate-*l/68.9%
*-lft-identity68.9%
Simplified68.9%
Taylor expanded in l around 0 52.6%
unpow252.6%
Simplified52.6%
Taylor expanded in F around inf 98.8%
if -1e14 < (*.f64 (PI.f64) l) < 9.99999999999999939e-12Initial program 90.8%
associate-*l/91.0%
*-lft-identity91.0%
Simplified91.0%
associate-/r*99.6%
div-inv99.6%
Applied egg-rr99.6%
clear-num99.6%
frac-times99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in l around 0 90.3%
unpow290.3%
times-frac98.9%
*-commutative98.9%
Simplified98.9%
Final simplification98.9%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -1e+14) (not (<= (* PI l) 1e-11))) (* PI l) (- (* PI l) (/ PI (/ F (/ l F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+14) || !((((double) M_PI) * l) <= 1e-11)) {
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 (((Math.PI * l) <= -1e+14) || !((Math.PI * l) <= 1e-11)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (Math.PI / (F / (l / F)));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -1e+14) or not ((math.pi * l) <= 1e-11): tmp = math.pi * l else: tmp = (math.pi * l) - (math.pi / (F / (l / F))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -1e+14) || !(Float64(pi * l) <= 1e-11)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(pi / Float64(F / Float64(l / F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -1e+14) || ~(((pi * l) <= 1e-11))) tmp = pi * l; else tmp = (pi * l) - (pi / (F / (l / F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -1e+14], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1e-11]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(Pi / N[(F / N[(l / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+14} \lor \neg \left(\pi \cdot \ell \leq 10^{-11}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi}{\frac{F}{\frac{\ell}{F}}}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1e14 or 9.99999999999999939e-12 < (*.f64 (PI.f64) l) Initial program 68.9%
associate-*l/68.9%
*-lft-identity68.9%
Simplified68.9%
Taylor expanded in l around 0 52.6%
unpow252.6%
Simplified52.6%
Taylor expanded in F around inf 98.8%
if -1e14 < (*.f64 (PI.f64) l) < 9.99999999999999939e-12Initial program 90.8%
associate-*l/91.0%
*-lft-identity91.0%
Simplified91.0%
associate-/r*99.6%
div-inv99.6%
Applied egg-rr99.6%
clear-num99.6%
frac-times99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in l around 0 90.3%
unpow290.3%
times-frac98.9%
*-commutative98.9%
Simplified98.9%
associate-*l/98.9%
associate-/l*99.0%
Applied egg-rr99.0%
Final simplification98.9%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -1e+14) (not (<= (* PI l) 1e-11))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+14) || !((((double) M_PI) * l) <= 1e-11)) {
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 (((Math.PI * l) <= -1e+14) || !((Math.PI * l) <= 1e-11)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI - (Math.PI / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if ((math.pi * l) <= -1e+14) or not ((math.pi * l) <= 1e-11): tmp = math.pi * l else: tmp = l * (math.pi - (math.pi / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(pi * l) <= -1e+14) || !(Float64(pi * l) <= 1e-11)) 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 (((pi * l) <= -1e+14) || ~(((pi * l) <= 1e-11))) tmp = pi * l; else tmp = l * (pi - (pi / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -1e+14], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1e-11]], $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}\;\pi \cdot \ell \leq -1 \cdot 10^{+14} \lor \neg \left(\pi \cdot \ell \leq 10^{-11}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -1e14 or 9.99999999999999939e-12 < (*.f64 (PI.f64) l) Initial program 68.9%
associate-*l/68.9%
*-lft-identity68.9%
Simplified68.9%
Taylor expanded in l around 0 52.6%
unpow252.6%
Simplified52.6%
Taylor expanded in F around inf 98.8%
if -1e14 < (*.f64 (PI.f64) l) < 9.99999999999999939e-12Initial program 90.8%
associate-*l/91.0%
*-lft-identity91.0%
Simplified91.0%
Taylor expanded in l around 0 90.0%
unpow290.0%
Simplified90.0%
Final simplification94.1%
(FPCore (F l) :precision binary64 (if (or (<= l -15500000000.0) (not (<= l 0.5))) (* PI l) (* l (* PI (+ 1.0 (/ -1.0 (* F F)))))))
double code(double F, double l) {
double tmp;
if ((l <= -15500000000.0) || !(l <= 0.5)) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (((double) M_PI) * (1.0 + (-1.0 / (F * F))));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -15500000000.0) || !(l <= 0.5)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI * (1.0 + (-1.0 / (F * F))));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -15500000000.0) or not (l <= 0.5): tmp = math.pi * l else: tmp = l * (math.pi * (1.0 + (-1.0 / (F * F)))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -15500000000.0) || !(l <= 0.5)) tmp = Float64(pi * l); else tmp = Float64(l * Float64(pi * Float64(1.0 + Float64(-1.0 / Float64(F * F))))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -15500000000.0) || ~((l <= 0.5))) tmp = pi * l; else tmp = l * (pi * (1.0 + (-1.0 / (F * F)))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -15500000000.0], N[Not[LessEqual[l, 0.5]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi * N[(1.0 + N[(-1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -15500000000 \lor \neg \left(\ell \leq 0.5\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot \left(1 + \frac{-1}{F \cdot F}\right)\right)\\
\end{array}
\end{array}
if l < -1.55e10 or 0.5 < l Initial program 68.9%
associate-*l/68.9%
*-lft-identity68.9%
Simplified68.9%
Taylor expanded in l around 0 52.6%
unpow252.6%
Simplified52.6%
Taylor expanded in F around inf 98.8%
if -1.55e10 < l < 0.5Initial program 90.8%
associate-*l/91.0%
*-lft-identity91.0%
Simplified91.0%
Taylor expanded in l around 0 90.0%
unpow290.0%
Simplified90.0%
add-cube-cbrt88.4%
pow388.5%
div-inv88.5%
pow288.5%
pow-flip88.6%
metadata-eval88.6%
Applied egg-rr88.6%
rem-cube-cbrt90.1%
*-commutative90.1%
add-sqr-sqrt41.7%
associate-*r*41.7%
*-un-lft-identity41.7%
*-commutative41.7%
distribute-rgt-out--41.7%
Applied egg-rr41.7%
Taylor expanded in l around 0 90.0%
*-commutative90.0%
unpow290.0%
Simplified90.0%
Final simplification94.1%
(FPCore (F l) :precision binary64 (if (or (<= F 8.5e-225) (not (<= F 6.5e-97))) (* PI l) (* (/ l F) (/ (- PI) F))))
double code(double F, double l) {
double tmp;
if ((F <= 8.5e-225) || !(F <= 6.5e-97)) {
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 <= 8.5e-225) || !(F <= 6.5e-97)) {
tmp = Math.PI * l;
} else {
tmp = (l / F) * (-Math.PI / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (F <= 8.5e-225) or not (F <= 6.5e-97): tmp = math.pi * l else: tmp = (l / F) * (-math.pi / F) return tmp
function code(F, l) tmp = 0.0 if ((F <= 8.5e-225) || !(F <= 6.5e-97)) 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 <= 8.5e-225) || ~((F <= 6.5e-97))) tmp = pi * l; else tmp = (l / F) * (-pi / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[F, 8.5e-225], N[Not[LessEqual[F, 6.5e-97]], $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 8.5 \cdot 10^{-225} \lor \neg \left(F \leq 6.5 \cdot 10^{-97}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{-\pi}{F}\\
\end{array}
\end{array}
if F < 8.4999999999999998e-225 or 6.5000000000000004e-97 < F Initial program 83.0%
associate-*l/83.0%
*-lft-identity83.0%
Simplified83.0%
Taylor expanded in l around 0 74.3%
unpow274.3%
Simplified74.3%
Taylor expanded in F around inf 81.4%
if 8.4999999999999998e-225 < F < 6.5000000000000004e-97Initial program 54.2%
associate-*l/55.9%
*-lft-identity55.9%
Simplified55.9%
Taylor expanded in l around 0 53.4%
unpow253.4%
Simplified53.4%
Taylor expanded in F around 0 55.1%
mul-1-neg55.1%
unpow255.1%
associate-/l*54.8%
Simplified54.8%
associate-/l*55.1%
*-commutative55.1%
frac-times80.7%
Applied egg-rr80.7%
Final simplification81.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 80.6%
associate-*l/80.8%
*-lft-identity80.8%
Simplified80.8%
Taylor expanded in l around 0 72.6%
unpow272.6%
Simplified72.6%
Taylor expanded in F around inf 76.4%
Final simplification76.4%
herbie shell --seed 2023255
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))