
(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) -4e+32) (not (<= (* PI l) 100.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -4e+32) || !((((double) M_PI) * l) <= 100.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) <= -4e+32) || !((Math.PI * l) <= 100.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) <= -4e+32) or not ((math.pi * l) <= 100.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) <= -4e+32) || !(Float64(pi * l) <= 100.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) <= -4e+32) || ~(((pi * l) <= 100.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], -4e+32], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 100.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 -4 \cdot 10^{+32} \lor \neg \left(\pi \cdot \ell \leq 100\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) < -4.00000000000000021e32 or 100 < (*.f64 (PI.f64) l) Initial program 63.2%
associate-*l/63.2%
*-lft-identity63.2%
Simplified63.2%
Taylor expanded in l around 0 52.0%
unpow252.0%
Simplified52.0%
Taylor expanded in F around inf 99.6%
if -4.00000000000000021e32 < (*.f64 (PI.f64) l) < 100Initial program 88.7%
associate-*l/89.2%
*-un-lft-identity89.2%
associate-/r*99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -4e+32) (not (<= (* PI l) 1e-16))) (* PI l) (- (* PI l) (/ (/ l (/ F PI)) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -4e+32) || !((((double) M_PI) * l) <= 1e-16)) {
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) <= -4e+32) || !((Math.PI * l) <= 1e-16)) {
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) <= -4e+32) or not ((math.pi * l) <= 1e-16): 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) <= -4e+32) || !(Float64(pi * l) <= 1e-16)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(l / Float64(F / pi)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -4e+32) || ~(((pi * l) <= 1e-16))) 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], -4e+32], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1e-16]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l / N[(F / Pi), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -4 \cdot 10^{+32} \lor \neg \left(\pi \cdot \ell \leq 10^{-16}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\ell}{\frac{F}{\pi}}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -4.00000000000000021e32 or 9.9999999999999998e-17 < (*.f64 (PI.f64) l) Initial program 64.1%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.8%
if -4.00000000000000021e32 < (*.f64 (PI.f64) l) < 9.9999999999999998e-17Initial program 88.5%
associate-*l/89.0%
*-un-lft-identity89.0%
associate-/r*99.6%
Applied egg-rr99.6%
Taylor expanded in l around 0 98.8%
associate-/l*98.9%
Simplified98.9%
Final simplification98.9%
(FPCore (F l) :precision binary64 (if (or (<= l -7200000000000.0) (not (<= l 0.017))) (* PI l) (* l (+ PI (* (/ PI F) (/ -1.0 F))))))
double code(double F, double l) {
double tmp;
if ((l <= -7200000000000.0) || !(l <= 0.017)) {
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 ((l <= -7200000000000.0) || !(l <= 0.017)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI + ((Math.PI / F) * (-1.0 / F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -7200000000000.0) or not (l <= 0.017): 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 ((l <= -7200000000000.0) || !(l <= 0.017)) 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 ((l <= -7200000000000.0) || ~((l <= 0.017))) tmp = pi * l; else tmp = l * (pi + ((pi / F) * (-1.0 / F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -7200000000000.0], N[Not[LessEqual[l, 0.017]], $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}\;\ell \leq -7200000000000 \lor \neg \left(\ell \leq 0.017\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi + \frac{\pi}{F} \cdot \frac{-1}{F}\right)\\
\end{array}
\end{array}
if l < -7.2e12 or 0.017000000000000001 < l Initial program 64.1%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.8%
if -7.2e12 < l < 0.017000000000000001Initial program 88.5%
associate-*l/89.0%
*-lft-identity89.0%
Simplified89.0%
Taylor expanded in l around 0 87.8%
unpow287.8%
Simplified87.8%
associate-/r*87.8%
div-inv87.8%
Applied egg-rr87.8%
Final simplification93.0%
(FPCore (F l) :precision binary64 (if (or (<= l -460000000000.0) (not (<= l 0.017))) (* PI l) (- (* PI l) (* PI (/ l (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -460000000000.0) || !(l <= 0.017)) {
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 <= -460000000000.0) || !(l <= 0.017)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (Math.PI * (l / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -460000000000.0) or not (l <= 0.017): 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 <= -460000000000.0) || !(l <= 0.017)) 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 <= -460000000000.0) || ~((l <= 0.017))) tmp = pi * l; else tmp = (pi * l) - (pi * (l / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -460000000000.0], N[Not[LessEqual[l, 0.017]], $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 -460000000000 \lor \neg \left(\ell \leq 0.017\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\
\end{array}
\end{array}
if l < -4.6e11 or 0.017000000000000001 < l Initial program 64.1%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.8%
if -4.6e11 < l < 0.017000000000000001Initial program 88.5%
Taylor expanded in l around 0 88.2%
associate-/l*88.1%
associate-/r/88.2%
unpow288.2%
Simplified88.2%
Final simplification93.2%
(FPCore (F l) :precision binary64 (if (or (<= l -7200000000000.0) (not (<= l 0.017))) (* PI l) (- (* PI l) (* (/ PI F) (/ l F)))))
double code(double F, double l) {
double tmp;
if ((l <= -7200000000000.0) || !(l <= 0.017)) {
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 <= -7200000000000.0) || !(l <= 0.017)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((Math.PI / F) * (l / F));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -7200000000000.0) or not (l <= 0.017): 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 <= -7200000000000.0) || !(l <= 0.017)) 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 <= -7200000000000.0) || ~((l <= 0.017))) tmp = pi * l; else tmp = (pi * l) - ((pi / F) * (l / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -7200000000000.0], N[Not[LessEqual[l, 0.017]], $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 -7200000000000 \lor \neg \left(\ell \leq 0.017\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi}{F} \cdot \frac{\ell}{F}\\
\end{array}
\end{array}
if l < -7.2e12 or 0.017000000000000001 < l Initial program 64.1%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.8%
if -7.2e12 < l < 0.017000000000000001Initial program 88.5%
associate-*l/89.0%
*-lft-identity89.0%
Simplified89.0%
add-cbrt-cube59.4%
pow1/338.3%
pow338.3%
pow-to-exp25.9%
pow-exp38.0%
Applied egg-rr38.0%
Taylor expanded in l around 0 88.2%
*-commutative88.2%
unpow288.2%
times-frac98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (F l) :precision binary64 (if (or (<= l -7200000000000.0) (not (<= l 0.017))) (* PI l) (- (* PI l) (/ (* l (/ PI F)) F))))
double code(double F, double l) {
double tmp;
if ((l <= -7200000000000.0) || !(l <= 0.017)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((l * (((double) M_PI) / F)) / F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -7200000000000.0) || !(l <= 0.017)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - ((l * (Math.PI / F)) / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -7200000000000.0) or not (l <= 0.017): tmp = math.pi * l else: tmp = (math.pi * l) - ((l * (math.pi / F)) / F) return tmp
function code(F, l) tmp = 0.0 if ((l <= -7200000000000.0) || !(l <= 0.017)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(l * Float64(pi / F)) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -7200000000000.0) || ~((l <= 0.017))) tmp = pi * l; else tmp = (pi * l) - ((l * (pi / F)) / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -7200000000000.0], N[Not[LessEqual[l, 0.017]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l * N[(Pi / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7200000000000 \lor \neg \left(\ell \leq 0.017\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\ell \cdot \frac{\pi}{F}}{F}\\
\end{array}
\end{array}
if l < -7.2e12 or 0.017000000000000001 < l Initial program 64.1%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.8%
if -7.2e12 < l < 0.017000000000000001Initial program 88.5%
associate-*l/89.0%
*-un-lft-identity89.0%
associate-/r*99.6%
Applied egg-rr99.6%
Taylor expanded in l around 0 98.8%
*-un-lft-identity98.8%
times-frac98.9%
Applied egg-rr98.9%
Taylor expanded in l around 0 98.8%
associate-*r/98.9%
Simplified98.9%
Final simplification98.8%
(FPCore (F l) :precision binary64 (if (or (<= l -7200000000000.0) (not (<= l 0.017))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -7200000000000.0) || !(l <= 0.017)) {
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 <= -7200000000000.0) || !(l <= 0.017)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI - (Math.PI / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -7200000000000.0) or not (l <= 0.017): tmp = math.pi * l else: tmp = l * (math.pi - (math.pi / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -7200000000000.0) || !(l <= 0.017)) 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 <= -7200000000000.0) || ~((l <= 0.017))) tmp = pi * l; else tmp = l * (pi - (pi / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -7200000000000.0], N[Not[LessEqual[l, 0.017]], $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 -7200000000000 \lor \neg \left(\ell \leq 0.017\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\end{array}
\end{array}
if l < -7.2e12 or 0.017000000000000001 < l Initial program 64.1%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.8%
if -7.2e12 < l < 0.017000000000000001Initial program 88.5%
associate-*l/89.0%
*-lft-identity89.0%
Simplified89.0%
Taylor expanded in l around 0 87.8%
unpow287.8%
Simplified87.8%
Final simplification93.0%
(FPCore (F l)
:precision binary64
(if (or (<= l -4e-18)
(not
(or (<= l -4.3e-216) (and (not (<= l -2.45e-238)) (<= l 8.5e-13)))))
(* PI l)
(* (/ PI F) (/ (- l) F))))
double code(double F, double l) {
double tmp;
if ((l <= -4e-18) || !((l <= -4.3e-216) || (!(l <= -2.45e-238) && (l <= 8.5e-13)))) {
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 <= -4e-18) || !((l <= -4.3e-216) || (!(l <= -2.45e-238) && (l <= 8.5e-13)))) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI / F) * (-l / F);
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -4e-18) or not ((l <= -4.3e-216) or (not (l <= -2.45e-238) and (l <= 8.5e-13))): tmp = math.pi * l else: tmp = (math.pi / F) * (-l / F) return tmp
function code(F, l) tmp = 0.0 if ((l <= -4e-18) || !((l <= -4.3e-216) || (!(l <= -2.45e-238) && (l <= 8.5e-13)))) 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 <= -4e-18) || ~(((l <= -4.3e-216) || (~((l <= -2.45e-238)) && (l <= 8.5e-13))))) tmp = pi * l; else tmp = (pi / F) * (-l / F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -4e-18], N[Not[Or[LessEqual[l, -4.3e-216], And[N[Not[LessEqual[l, -2.45e-238]], $MachinePrecision], LessEqual[l, 8.5e-13]]]], $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 -4 \cdot 10^{-18} \lor \neg \left(\ell \leq -4.3 \cdot 10^{-216} \lor \neg \left(\ell \leq -2.45 \cdot 10^{-238}\right) \land \ell \leq 8.5 \cdot 10^{-13}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\
\end{array}
\end{array}
if l < -4.0000000000000003e-18 or -4.2999999999999997e-216 < l < -2.4499999999999999e-238 or 8.5000000000000001e-13 < l Initial program 68.0%
associate-*l/68.0%
*-lft-identity68.0%
Simplified68.0%
Taylor expanded in l around 0 57.1%
unpow257.1%
Simplified57.1%
Taylor expanded in F around inf 96.8%
if -4.0000000000000003e-18 < l < -4.2999999999999997e-216 or -2.4499999999999999e-238 < l < 8.5000000000000001e-13Initial program 87.5%
associate-*l/88.1%
*-lft-identity88.1%
Simplified88.1%
Taylor expanded in l around 0 87.6%
unpow287.6%
Simplified87.6%
sub-neg87.6%
distribute-lft-in87.5%
*-commutative87.5%
div-inv87.5%
distribute-rgt-neg-in87.5%
pow287.5%
pow-flip87.5%
metadata-eval87.5%
Applied egg-rr87.5%
*-commutative87.5%
distribute-lft-in87.5%
distribute-rgt-neg-out87.5%
sub-neg87.5%
*-rgt-identity87.5%
distribute-lft-out--87.5%
Simplified87.5%
Taylor expanded in F around 0 54.3%
mul-1-neg54.3%
associate-/l*54.2%
unpow254.2%
Simplified54.2%
associate-/l*54.1%
associate-/r/65.7%
Applied egg-rr65.7%
Final simplification82.7%
(FPCore (F l) :precision binary64 (if (or (<= l -7200000000000.0) (not (<= l 0.017))) (* PI l) (* l (* PI (+ 1.0 (/ -1.0 (* F F)))))))
double code(double F, double l) {
double tmp;
if ((l <= -7200000000000.0) || !(l <= 0.017)) {
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 <= -7200000000000.0) || !(l <= 0.017)) {
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 <= -7200000000000.0) or not (l <= 0.017): 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 <= -7200000000000.0) || !(l <= 0.017)) 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 <= -7200000000000.0) || ~((l <= 0.017))) 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, -7200000000000.0], N[Not[LessEqual[l, 0.017]], $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 -7200000000000 \lor \neg \left(\ell \leq 0.017\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 < -7.2e12 or 0.017000000000000001 < l Initial program 64.1%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.8%
if -7.2e12 < l < 0.017000000000000001Initial program 88.5%
associate-*l/89.0%
*-lft-identity89.0%
Simplified89.0%
Taylor expanded in l around 0 87.8%
unpow287.8%
Simplified87.8%
sub-neg87.8%
distribute-lft-in87.7%
*-commutative87.7%
div-inv87.7%
distribute-rgt-neg-in87.7%
pow287.7%
pow-flip87.7%
metadata-eval87.7%
Applied egg-rr87.7%
*-commutative87.7%
distribute-lft-in87.7%
distribute-rgt-neg-out87.7%
sub-neg87.7%
*-rgt-identity87.7%
distribute-lft-out--87.7%
Simplified87.7%
Taylor expanded in l around 0 87.7%
*-commutative87.7%
/-rgt-identity87.7%
unpow287.7%
associate-/l*87.7%
associate-/r/87.6%
unpow-187.6%
unpow-187.6%
pow-sqr87.7%
metadata-eval87.7%
metadata-eval87.7%
pow-sqr87.6%
unpow-187.6%
unpow-187.6%
associate-/r/87.7%
associate-/l*87.7%
unpow287.7%
/-rgt-identity87.7%
unpow287.7%
Simplified87.7%
Final simplification93.0%
(FPCore (F l) :precision binary64 (if (or (<= l -7200000000000.0) (not (<= l 0.017))) (* PI l) (* (* PI l) (+ 1.0 (/ -1.0 (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -7200000000000.0) || !(l <= 0.017)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) * (1.0 + (-1.0 / (F * F)));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -7200000000000.0) || !(l <= 0.017)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) * (1.0 + (-1.0 / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -7200000000000.0) or not (l <= 0.017): tmp = math.pi * l else: tmp = (math.pi * l) * (1.0 + (-1.0 / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((l <= -7200000000000.0) || !(l <= 0.017)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) * Float64(1.0 + Float64(-1.0 / Float64(F * F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -7200000000000.0) || ~((l <= 0.017))) tmp = pi * l; else tmp = (pi * l) * (1.0 + (-1.0 / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -7200000000000.0], N[Not[LessEqual[l, 0.017]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] * N[(1.0 + N[(-1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7200000000000 \lor \neg \left(\ell \leq 0.017\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot \ell\right) \cdot \left(1 + \frac{-1}{F \cdot F}\right)\\
\end{array}
\end{array}
if l < -7.2e12 or 0.017000000000000001 < l Initial program 64.1%
associate-*l/64.1%
*-lft-identity64.1%
Simplified64.1%
Taylor expanded in l around 0 52.3%
unpow252.3%
Simplified52.3%
Taylor expanded in F around inf 98.8%
if -7.2e12 < l < 0.017000000000000001Initial program 88.5%
associate-*l/89.0%
*-lft-identity89.0%
Simplified89.0%
Taylor expanded in l around 0 87.8%
unpow287.8%
Simplified87.8%
sub-neg87.8%
distribute-lft-in87.7%
*-commutative87.7%
div-inv87.7%
distribute-rgt-neg-in87.7%
pow287.7%
pow-flip87.7%
metadata-eval87.7%
Applied egg-rr87.7%
*-commutative87.7%
distribute-lft-in87.7%
distribute-rgt-neg-out87.7%
sub-neg87.7%
*-rgt-identity87.7%
distribute-lft-out--87.7%
Simplified87.7%
Taylor expanded in l around 0 87.7%
*-commutative87.7%
/-rgt-identity87.7%
unpow287.7%
associate-/l*87.7%
associate-/r/87.6%
unpow-187.6%
unpow-187.6%
pow-sqr87.7%
metadata-eval87.7%
metadata-eval87.7%
pow-sqr87.6%
unpow-187.6%
unpow-187.6%
associate-/r/87.7%
associate-/l*87.7%
unpow287.7%
/-rgt-identity87.7%
unpow287.7%
Simplified87.7%
Taylor expanded in l around 0 87.7%
*-commutative87.7%
associate-*l*87.8%
sub-neg87.8%
distribute-neg-frac87.8%
metadata-eval87.8%
unpow287.8%
*-commutative87.8%
Simplified87.8%
Final simplification93.0%
(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.9%
associate-*l/77.1%
*-lft-identity77.1%
Simplified77.1%
Taylor expanded in l around 0 70.9%
unpow270.9%
Simplified70.9%
Taylor expanded in F around inf 68.3%
Final simplification68.3%
herbie shell --seed 2023238
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))