
(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 9 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+17) (not (<= (* PI l) 40000000000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -1e+17) || !((((double) M_PI) * l) <= 40000000000.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+17) || !((Math.PI * l) <= 40000000000.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+17) or not ((math.pi * l) <= 40000000000.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+17) || !(Float64(pi * l) <= 40000000000.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+17) || ~(((pi * l) <= 40000000000.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+17], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 40000000000.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^{+17} \lor \neg \left(\pi \cdot \ell \leq 40000000000\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) < -1e17 or 4e10 < (*.f64 (PI.f64) l) Initial program 62.3%
associate-*l/62.3%
*-lft-identity62.3%
Simplified62.3%
Taylor expanded in l around 0 48.0%
unpow248.0%
Simplified48.0%
Taylor expanded in F around inf 99.7%
if -1e17 < (*.f64 (PI.f64) l) < 4e10Initial program 85.5%
associate-*l/86.1%
*-un-lft-identity86.1%
associate-/r*99.5%
Applied egg-rr99.5%
Final simplification99.6%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -200000000000.0) (not (<= (* PI l) 40000000000.0))) (* PI l) (- (* PI l) (/ PI (* F (/ F l))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -200000000000.0) || !((((double) M_PI) * l) <= 40000000000.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) <= -200000000000.0) || !((Math.PI * l) <= 40000000000.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) <= -200000000000.0) or not ((math.pi * l) <= 40000000000.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) <= -200000000000.0) || !(Float64(pi * l) <= 40000000000.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) <= -200000000000.0) || ~(((pi * l) <= 40000000000.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], -200000000000.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 40000000000.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 -200000000000 \lor \neg \left(\pi \cdot \ell \leq 40000000000\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) < -2e11 or 4e10 < (*.f64 (PI.f64) l) Initial program 62.9%
associate-*l/62.9%
*-lft-identity62.9%
Simplified62.9%
Taylor expanded in l around 0 48.0%
unpow248.0%
Simplified48.0%
Taylor expanded in F around inf 98.9%
if -2e11 < (*.f64 (PI.f64) l) < 4e10Initial program 85.3%
associate-*l/85.9%
*-un-lft-identity85.9%
associate-/r*99.5%
Applied egg-rr99.5%
Taylor expanded in l around 0 85.9%
*-commutative85.9%
unpow285.9%
times-frac99.7%
Simplified99.7%
*-commutative99.7%
clear-num99.6%
frac-times99.7%
*-un-lft-identity99.7%
Applied egg-rr99.7%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= l -17500000000.0) (not (<= l 67000000000.0))) (* PI l) (* l (+ PI (* (/ PI F) (/ -1.0 F))))))
double code(double F, double l) {
double tmp;
if ((l <= -17500000000.0) || !(l <= 67000000000.0)) {
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 <= -17500000000.0) || !(l <= 67000000000.0)) {
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 <= -17500000000.0) or not (l <= 67000000000.0): 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 <= -17500000000.0) || !(l <= 67000000000.0)) 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 <= -17500000000.0) || ~((l <= 67000000000.0))) tmp = pi * l; else tmp = l * (pi + ((pi / F) * (-1.0 / F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -17500000000.0], N[Not[LessEqual[l, 67000000000.0]], $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 -17500000000 \lor \neg \left(\ell \leq 67000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi + \frac{\pi}{F} \cdot \frac{-1}{F}\right)\\
\end{array}
\end{array}
if l < -1.75e10 or 6.7e10 < l Initial program 62.9%
associate-*l/62.9%
*-lft-identity62.9%
Simplified62.9%
Taylor expanded in l around 0 48.0%
unpow248.0%
Simplified48.0%
Taylor expanded in F around inf 98.9%
if -1.75e10 < l < 6.7e10Initial program 85.3%
associate-*l/85.9%
*-lft-identity85.9%
Simplified85.9%
Taylor expanded in l around 0 85.3%
unpow285.3%
Simplified85.3%
associate-/r*85.4%
div-inv85.3%
Applied egg-rr85.3%
Final simplification92.0%
(FPCore (F l) :precision binary64 (if (or (<= l -17500000000.0) (not (<= l 67000000000.0))) (* PI l) (- (* PI l) (* PI (/ l (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -17500000000.0) || !(l <= 67000000000.0)) {
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 <= -17500000000.0) || !(l <= 67000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = (Math.PI * l) - (Math.PI * (l / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -17500000000.0) or not (l <= 67000000000.0): 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 <= -17500000000.0) || !(l <= 67000000000.0)) 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 <= -17500000000.0) || ~((l <= 67000000000.0))) tmp = pi * l; else tmp = (pi * l) - (pi * (l / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -17500000000.0], N[Not[LessEqual[l, 67000000000.0]], $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 -17500000000 \lor \neg \left(\ell \leq 67000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\
\end{array}
\end{array}
if l < -1.75e10 or 6.7e10 < l Initial program 62.9%
associate-*l/62.9%
*-lft-identity62.9%
Simplified62.9%
Taylor expanded in l around 0 48.0%
unpow248.0%
Simplified48.0%
Taylor expanded in F around inf 98.9%
if -1.75e10 < l < 6.7e10Initial program 85.3%
Taylor expanded in l around 0 85.9%
associate-/l*85.9%
associate-/r/85.9%
unpow285.9%
Simplified85.9%
Final simplification92.3%
(FPCore (F l) :precision binary64 (if (or (<= l -17500000000.0) (not (<= l 67000000000.0))) (* PI l) (- (* PI l) (* (/ PI F) (/ l F)))))
double code(double F, double l) {
double tmp;
if ((l <= -17500000000.0) || !(l <= 67000000000.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 <= -17500000000.0) || !(l <= 67000000000.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 <= -17500000000.0) or not (l <= 67000000000.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 <= -17500000000.0) || !(l <= 67000000000.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 <= -17500000000.0) || ~((l <= 67000000000.0))) tmp = pi * l; else tmp = (pi * l) - ((pi / F) * (l / F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -17500000000.0], N[Not[LessEqual[l, 67000000000.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 -17500000000 \lor \neg \left(\ell \leq 67000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi}{F} \cdot \frac{\ell}{F}\\
\end{array}
\end{array}
if l < -1.75e10 or 6.7e10 < l Initial program 62.9%
associate-*l/62.9%
*-lft-identity62.9%
Simplified62.9%
Taylor expanded in l around 0 48.0%
unpow248.0%
Simplified48.0%
Taylor expanded in F around inf 98.9%
if -1.75e10 < l < 6.7e10Initial program 85.3%
associate-*l/85.9%
*-un-lft-identity85.9%
associate-/r*99.5%
Applied egg-rr99.5%
Taylor expanded in l around 0 85.9%
*-commutative85.9%
unpow285.9%
times-frac99.7%
Simplified99.7%
Final simplification99.3%
(FPCore (F l) :precision binary64 (if (or (<= l -17500000000.0) (not (<= l 67000000000.0))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -17500000000.0) || !(l <= 67000000000.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 <= -17500000000.0) || !(l <= 67000000000.0)) {
tmp = Math.PI * l;
} else {
tmp = l * (Math.PI - (Math.PI / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -17500000000.0) or not (l <= 67000000000.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 <= -17500000000.0) || !(l <= 67000000000.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 <= -17500000000.0) || ~((l <= 67000000000.0))) tmp = pi * l; else tmp = l * (pi - (pi / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -17500000000.0], N[Not[LessEqual[l, 67000000000.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 -17500000000 \lor \neg \left(\ell \leq 67000000000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\
\end{array}
\end{array}
if l < -1.75e10 or 6.7e10 < l Initial program 62.9%
associate-*l/62.9%
*-lft-identity62.9%
Simplified62.9%
Taylor expanded in l around 0 48.0%
unpow248.0%
Simplified48.0%
Taylor expanded in F around inf 98.9%
if -1.75e10 < l < 6.7e10Initial program 85.3%
associate-*l/85.9%
*-lft-identity85.9%
Simplified85.9%
Taylor expanded in l around 0 85.3%
unpow285.3%
Simplified85.3%
Final simplification92.0%
(FPCore (F l)
:precision binary64
(if (or (<= l -1e-5)
(and (not (<= l -1.55e-109)) (or (<= l 2.6e-126) (not (<= l 3e-50)))))
(* PI l)
(* l (/ (- PI) (* F F)))))
double code(double F, double l) {
double tmp;
if ((l <= -1e-5) || (!(l <= -1.55e-109) && ((l <= 2.6e-126) || !(l <= 3e-50)))) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * (-((double) M_PI) / (F * F));
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -1e-5) || (!(l <= -1.55e-109) && ((l <= 2.6e-126) || !(l <= 3e-50)))) {
tmp = Math.PI * l;
} else {
tmp = l * (-Math.PI / (F * F));
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -1e-5) or (not (l <= -1.55e-109) and ((l <= 2.6e-126) or not (l <= 3e-50))): tmp = math.pi * l else: tmp = l * (-math.pi / (F * F)) return tmp
function code(F, l) tmp = 0.0 if ((l <= -1e-5) || (!(l <= -1.55e-109) && ((l <= 2.6e-126) || !(l <= 3e-50)))) tmp = Float64(pi * l); else tmp = Float64(l * Float64(Float64(-pi) / Float64(F * F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -1e-5) || (~((l <= -1.55e-109)) && ((l <= 2.6e-126) || ~((l <= 3e-50))))) tmp = pi * l; else tmp = l * (-pi / (F * F)); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -1e-5], And[N[Not[LessEqual[l, -1.55e-109]], $MachinePrecision], Or[LessEqual[l, 2.6e-126], N[Not[LessEqual[l, 3e-50]], $MachinePrecision]]]], N[(Pi * l), $MachinePrecision], N[(l * N[((-Pi) / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{-5} \lor \neg \left(\ell \leq -1.55 \cdot 10^{-109}\right) \land \left(\ell \leq 2.6 \cdot 10^{-126} \lor \neg \left(\ell \leq 3 \cdot 10^{-50}\right)\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\
\end{array}
\end{array}
if l < -1.00000000000000008e-5 or -1.55e-109 < l < 2.59999999999999999e-126 or 2.9999999999999999e-50 < l Initial program 70.2%
associate-*l/70.6%
*-lft-identity70.6%
Simplified70.6%
Taylor expanded in l around 0 61.8%
unpow261.8%
Simplified61.8%
Taylor expanded in F around inf 78.3%
if -1.00000000000000008e-5 < l < -1.55e-109 or 2.59999999999999999e-126 < l < 2.9999999999999999e-50Initial program 99.7%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
Taylor expanded in l around 0 99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in F around 0 70.2%
associate-*r/70.2%
neg-mul-170.2%
unpow270.2%
Simplified70.2%
Final simplification77.2%
(FPCore (F l)
:precision binary64
(if (or (<= l -7e-9)
(not
(or (<= l -1.5e-109) (and (not (<= l 1.5e-127)) (<= l 2.05e-50)))))
(* PI l)
(* l (/ (/ PI F) (- F)))))
double code(double F, double l) {
double tmp;
if ((l <= -7e-9) || !((l <= -1.5e-109) || (!(l <= 1.5e-127) && (l <= 2.05e-50)))) {
tmp = ((double) M_PI) * l;
} else {
tmp = l * ((((double) M_PI) / F) / -F);
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((l <= -7e-9) || !((l <= -1.5e-109) || (!(l <= 1.5e-127) && (l <= 2.05e-50)))) {
tmp = Math.PI * l;
} else {
tmp = l * ((Math.PI / F) / -F);
}
return tmp;
}
def code(F, l): tmp = 0 if (l <= -7e-9) or not ((l <= -1.5e-109) or (not (l <= 1.5e-127) and (l <= 2.05e-50))): tmp = math.pi * l else: tmp = l * ((math.pi / F) / -F) return tmp
function code(F, l) tmp = 0.0 if ((l <= -7e-9) || !((l <= -1.5e-109) || (!(l <= 1.5e-127) && (l <= 2.05e-50)))) tmp = Float64(pi * l); else tmp = Float64(l * Float64(Float64(pi / F) / Float64(-F))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((l <= -7e-9) || ~(((l <= -1.5e-109) || (~((l <= 1.5e-127)) && (l <= 2.05e-50))))) tmp = pi * l; else tmp = l * ((pi / F) / -F); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[l, -7e-9], N[Not[Or[LessEqual[l, -1.5e-109], And[N[Not[LessEqual[l, 1.5e-127]], $MachinePrecision], LessEqual[l, 2.05e-50]]]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(N[(Pi / F), $MachinePrecision] / (-F)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7 \cdot 10^{-9} \lor \neg \left(\ell \leq -1.5 \cdot 10^{-109} \lor \neg \left(\ell \leq 1.5 \cdot 10^{-127}\right) \land \ell \leq 2.05 \cdot 10^{-50}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{\frac{\pi}{F}}{-F}\\
\end{array}
\end{array}
if l < -6.9999999999999998e-9 or -1.50000000000000011e-109 < l < 1.50000000000000004e-127 or 2.04999999999999993e-50 < l Initial program 70.2%
associate-*l/70.6%
*-lft-identity70.6%
Simplified70.6%
Taylor expanded in l around 0 61.8%
unpow261.8%
Simplified61.8%
Taylor expanded in F around inf 78.3%
if -6.9999999999999998e-9 < l < -1.50000000000000011e-109 or 1.50000000000000004e-127 < l < 2.04999999999999993e-50Initial program 99.7%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
Taylor expanded in l around 0 99.6%
unpow299.6%
Simplified99.6%
Taylor expanded in F around 0 70.2%
mul-1-neg70.2%
unpow270.2%
associate-/r*70.4%
*-lft-identity70.4%
associate-/l*70.3%
associate-/l*70.2%
unpow270.2%
associate-/r/70.2%
/-rgt-identity70.2%
unpow270.2%
associate-/l*70.2%
associate-/r/70.1%
unpow-170.1%
unpow-170.1%
pow-sqr70.3%
metadata-eval70.3%
distribute-rgt-neg-in70.3%
Simplified70.3%
add-sqr-sqrt0.0%
sqrt-unprod1.7%
sqr-neg1.7%
sqrt-unprod1.7%
add-sqr-sqrt1.7%
metadata-eval1.7%
pow-flip1.7%
pow21.7%
associate-/r/1.7%
associate-/l*1.7%
clear-num1.7%
frac-2neg1.7%
frac-2neg1.7%
add-sqr-sqrt0.0%
sqrt-unprod70.4%
sqr-neg70.4%
sqrt-unprod69.8%
add-sqr-sqrt70.4%
distribute-frac-neg70.4%
frac-2neg70.4%
Applied egg-rr70.4%
Final simplification77.2%
(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 74.4%
associate-*l/74.7%
*-lft-identity74.7%
Simplified74.7%
Taylor expanded in l around 0 67.1%
unpow267.1%
Simplified67.1%
Taylor expanded in F around inf 71.7%
Final simplification71.7%
herbie shell --seed 2023217
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))