
(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 8 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+16) (not (<= (* PI l) 2000000000000.0))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+16) || !((((double) M_PI) * l) <= 2000000000000.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) <= -2e+16) || !((Math.PI * l) <= 2000000000000.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) <= -2e+16) or not ((math.pi * l) <= 2000000000000.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) <= -2e+16) || !(Float64(pi * l) <= 2000000000000.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) <= -2e+16) || ~(((pi * l) <= 2000000000000.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], -2e+16], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 2000000000000.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 -2 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 2000000000000\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) < -2e16 or 2e12 < (*.f64 (PI.f64) l) Initial program 56.4%
associate-*l/56.4%
*-lft-identity56.4%
Simplified56.4%
Taylor expanded in l around 0 41.2%
unpow241.2%
Simplified41.2%
Taylor expanded in F around inf 99.7%
if -2e16 < (*.f64 (PI.f64) l) < 2e12Initial program 88.4%
associate-*l/88.4%
*-un-lft-identity88.4%
associate-/r*99.1%
Applied egg-rr99.1%
Final simplification99.4%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+16) (not (<= (* PI l) 500000.0))) (* PI l) (- (* PI l) (* PI (/ l (* F F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+16) || !((((double) M_PI) * l) <= 500000.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 (((Math.PI * l) <= -2e+16) || !((Math.PI * l) <= 500000.0)) {
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) <= -2e+16) or not ((math.pi * l) <= 500000.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 ((Float64(pi * l) <= -2e+16) || !(Float64(pi * l) <= 500000.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 (((pi * l) <= -2e+16) || ~(((pi * l) <= 500000.0))) 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], -2e+16], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 500000.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}\;\pi \cdot \ell \leq -2 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 500000\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) < -2e16 or 5e5 < (*.f64 (PI.f64) l) Initial program 56.8%
associate-*l/56.8%
*-lft-identity56.8%
Simplified56.8%
Taylor expanded in l around 0 40.9%
unpow240.9%
Simplified40.9%
Taylor expanded in F around inf 98.9%
if -2e16 < (*.f64 (PI.f64) l) < 5e5Initial program 88.3%
Taylor expanded in l around 0 86.9%
associate-/l*86.9%
associate-/r/86.9%
unpow286.9%
Simplified86.9%
Final simplification92.5%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+16) (not (<= (* PI l) 500000.0))) (* PI l) (- (* PI l) (* (/ PI F) (/ l F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+16) || !((((double) M_PI) * l) <= 500000.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 (((Math.PI * l) <= -2e+16) || !((Math.PI * l) <= 500000.0)) {
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) <= -2e+16) or not ((math.pi * l) <= 500000.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 ((Float64(pi * l) <= -2e+16) || !(Float64(pi * l) <= 500000.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 (((pi * l) <= -2e+16) || ~(((pi * l) <= 500000.0))) 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], -2e+16], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 500000.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}\;\pi \cdot \ell \leq -2 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 500000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\pi}{F} \cdot \frac{\ell}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -2e16 or 5e5 < (*.f64 (PI.f64) l) Initial program 56.8%
associate-*l/56.8%
*-lft-identity56.8%
Simplified56.8%
Taylor expanded in l around 0 40.9%
unpow240.9%
Simplified40.9%
Taylor expanded in F around inf 98.9%
if -2e16 < (*.f64 (PI.f64) l) < 5e5Initial program 88.3%
associate-/r/88.3%
associate-/l*99.1%
Applied egg-rr99.1%
Taylor expanded in l around 0 86.9%
*-commutative86.9%
unpow286.9%
times-frac97.6%
Simplified97.6%
Final simplification98.2%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+16) (not (<= (* PI l) 500000.0))) (* PI l) (- (* PI l) (/ (/ (* PI l) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+16) || !((((double) M_PI) * l) <= 500000.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 (((Math.PI * l) <= -2e+16) || !((Math.PI * l) <= 500000.0)) {
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) <= -2e+16) or not ((math.pi * l) <= 500000.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 ((Float64(pi * l) <= -2e+16) || !(Float64(pi * l) <= 500000.0)) tmp = Float64(pi * l); else tmp = Float64(Float64(pi * l) - Float64(Float64(Float64(pi * l) / F) / F)); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((pi * l) <= -2e+16) || ~(((pi * l) <= 500000.0))) 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], -2e+16], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 500000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[(Pi * l), $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 500000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\pi \cdot \ell}{F}}{F}\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -2e16 or 5e5 < (*.f64 (PI.f64) l) Initial program 56.8%
associate-*l/56.8%
*-lft-identity56.8%
Simplified56.8%
Taylor expanded in l around 0 40.9%
unpow240.9%
Simplified40.9%
Taylor expanded in F around inf 98.9%
if -2e16 < (*.f64 (PI.f64) l) < 5e5Initial program 88.3%
associate-/r*88.3%
metadata-eval88.3%
add-sqr-sqrt49.6%
sqrt-prod72.7%
sqrt-div72.7%
associate-*l/72.7%
sqrt-div72.7%
metadata-eval72.7%
sqrt-prod54.3%
add-sqr-sqrt99.0%
Applied egg-rr99.0%
Taylor expanded in l around 0 97.6%
Final simplification98.2%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -2e+16) (not (<= (* PI l) 500000.0))) (* PI l) (* l (* PI (- 1.0 (pow F -2.0))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2e+16) || !((((double) M_PI) * l) <= 500000.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 (((Math.PI * l) <= -2e+16) || !((Math.PI * l) <= 500000.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 ((math.pi * l) <= -2e+16) or not ((math.pi * l) <= 500000.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 ((Float64(pi * l) <= -2e+16) || !(Float64(pi * l) <= 500000.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 (((pi * l) <= -2e+16) || ~(((pi * l) <= 500000.0))) tmp = pi * l; else tmp = l * (pi * (1.0 - (F ^ -2.0))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -2e+16], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 500000.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}\;\pi \cdot \ell \leq -2 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 500000\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (PI.f64) l) < -2e16 or 5e5 < (*.f64 (PI.f64) l) Initial program 56.8%
associate-*l/56.8%
*-lft-identity56.8%
Simplified56.8%
Taylor expanded in l around 0 40.9%
unpow240.9%
Simplified40.9%
Taylor expanded in F around inf 98.9%
if -2e16 < (*.f64 (PI.f64) l) < 5e5Initial program 88.3%
associate-*l/88.3%
*-lft-identity88.3%
Simplified88.3%
Taylor expanded in l around 0 86.9%
unpow286.9%
Simplified86.9%
sub-neg86.9%
distribute-lft-in86.9%
*-commutative86.9%
div-inv86.8%
pow286.8%
pow-flip86.9%
metadata-eval86.9%
distribute-rgt-neg-in86.9%
Applied egg-rr86.9%
*-commutative86.9%
distribute-rgt-out86.9%
distribute-rgt-neg-out86.9%
sub-neg86.9%
*-rgt-identity86.9%
distribute-lft-out--86.9%
Simplified86.9%
Final simplification92.5%
(FPCore (F l) :precision binary64 (if (or (<= (* F F) 4e-163) (not (<= (* F F) 4e-16))) (* PI l) (- (* PI (/ l (* F F))))))
double code(double F, double l) {
double tmp;
if (((F * F) <= 4e-163) || !((F * F) <= 4e-16)) {
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) <= 4e-163) || !((F * F) <= 4e-16)) {
tmp = Math.PI * l;
} else {
tmp = -(Math.PI * (l / (F * F)));
}
return tmp;
}
def code(F, l): tmp = 0 if ((F * F) <= 4e-163) or not ((F * F) <= 4e-16): tmp = math.pi * l else: tmp = -(math.pi * (l / (F * F))) return tmp
function code(F, l) tmp = 0.0 if ((Float64(F * F) <= 4e-163) || !(Float64(F * F) <= 4e-16)) tmp = Float64(pi * l); else tmp = Float64(-Float64(pi * Float64(l / Float64(F * F)))); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if (((F * F) <= 4e-163) || ~(((F * F) <= 4e-16))) tmp = pi * l; else tmp = -(pi * (l / (F * F))); end tmp_2 = tmp; end
code[F_, l_] := If[Or[LessEqual[N[(F * F), $MachinePrecision], 4e-163], N[Not[LessEqual[N[(F * F), $MachinePrecision], 4e-16]], $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 4 \cdot 10^{-163} \lor \neg \left(F \cdot F \leq 4 \cdot 10^{-16}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;-\pi \cdot \frac{\ell}{F \cdot F}\\
\end{array}
\end{array}
if (*.f64 F F) < 3.99999999999999969e-163 or 3.9999999999999999e-16 < (*.f64 F F) Initial program 69.8%
associate-*l/69.8%
*-lft-identity69.8%
Simplified69.8%
Taylor expanded in l around 0 63.7%
unpow263.7%
Simplified63.7%
Taylor expanded in F around inf 81.3%
if 3.99999999999999969e-163 < (*.f64 F F) < 3.9999999999999999e-16Initial program 97.8%
associate-*l/97.9%
*-lft-identity97.9%
Simplified97.9%
Taylor expanded in l around 0 76.0%
unpow276.0%
Simplified76.0%
Taylor expanded in F around 0 76.1%
mul-1-neg76.1%
associate-/l*76.0%
unpow276.0%
Simplified76.0%
Taylor expanded in l around 0 76.1%
/-rgt-identity76.1%
associate-/r/75.9%
unpow275.9%
rem-square-sqrt40.7%
associate-*r/40.8%
*-commutative40.8%
associate-*r/40.8%
associate-/r/40.8%
/-rgt-identity40.8%
*-commutative40.8%
associate-*l*40.8%
*-commutative40.8%
associate-*l/40.7%
rem-square-sqrt76.1%
Simplified76.1%
Final simplification80.6%
(FPCore (F l) :precision binary64 (if (or (<= l -4.7e+14) (not (<= l 520000000000.0))) (* PI l) (* (* PI l) (+ 1.0 (/ -1.0 (* F F))))))
double code(double F, double l) {
double tmp;
if ((l <= -4.7e+14) || !(l <= 520000000000.0)) {
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 <= -4.7e+14) || !(l <= 520000000000.0)) {
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 <= -4.7e+14) or not (l <= 520000000000.0): 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 <= -4.7e+14) || !(l <= 520000000000.0)) 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 <= -4.7e+14) || ~((l <= 520000000000.0))) 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, -4.7e+14], N[Not[LessEqual[l, 520000000000.0]], $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 -4.7 \cdot 10^{+14} \lor \neg \left(\ell \leq 520000000000\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 < -4.7e14 or 5.2e11 < l Initial program 56.8%
associate-*l/56.8%
*-lft-identity56.8%
Simplified56.8%
Taylor expanded in l around 0 40.9%
unpow240.9%
Simplified40.9%
Taylor expanded in F around inf 98.9%
if -4.7e14 < l < 5.2e11Initial program 88.3%
associate-*l/88.3%
*-lft-identity88.3%
Simplified88.3%
Taylor expanded in l around 0 86.9%
unpow286.9%
Simplified86.9%
sub-neg86.9%
distribute-lft-in86.9%
*-commutative86.9%
div-inv86.8%
pow286.8%
pow-flip86.9%
metadata-eval86.9%
distribute-rgt-neg-in86.9%
Applied egg-rr86.9%
*-commutative86.9%
distribute-rgt-out86.9%
distribute-rgt-neg-out86.9%
sub-neg86.9%
*-rgt-identity86.9%
distribute-lft-out--86.9%
Simplified86.9%
Taylor expanded in l around 0 86.8%
*-commutative86.8%
associate-*l*86.8%
sub-neg86.8%
distribute-neg-frac86.8%
metadata-eval86.8%
unpow286.8%
*-commutative86.8%
Simplified86.8%
Final simplification92.5%
(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 73.5%
associate-*l/73.5%
*-lft-identity73.5%
Simplified73.5%
Taylor expanded in l around 0 65.3%
unpow265.3%
Simplified65.3%
Taylor expanded in F around inf 73.9%
Final simplification73.9%
herbie shell --seed 2023200
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))