
(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) -5e+18) (not (<= (* PI l) 1e+14))) (* PI l) (+ (* PI l) (* (/ (tan (* PI l)) F) (/ -1.0 F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+18) || !((((double) M_PI) * l) <= 1e+14)) {
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) <= -5e+18) || !((Math.PI * l) <= 1e+14)) {
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) <= -5e+18) or not ((math.pi * l) <= 1e+14): 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) <= -5e+18) || !(Float64(pi * l) <= 1e+14)) 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) <= -5e+18) || ~(((pi * l) <= 1e+14))) 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], -5e+18], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1e+14]], $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 -5 \cdot 10^{+18} \lor \neg \left(\pi \cdot \ell \leq 10^{+14}\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) < -5e18 or 1e14 < (*.f64 (PI.f64) l) Initial program 60.9%
Taylor expanded in F around 0 60.9%
unpow-160.9%
exp-to-pow33.5%
exp-prod33.5%
associate-*l*33.5%
metadata-eval33.5%
exp-to-pow60.9%
Simplified60.9%
metadata-eval60.9%
pow-flip60.9%
pow260.9%
associate-/r/60.9%
inv-pow60.9%
associate-/l*60.9%
exp-to-pow32.3%
add-sqr-sqrt4.8%
sqrt-unprod14.9%
*-commutative14.9%
*-commutative14.9%
swap-sqr14.9%
Applied egg-rr47.9%
*-inverses99.7%
Simplified99.7%
Taylor expanded in l around inf 99.7%
if -5e18 < (*.f64 (PI.f64) l) < 1e14Initial program 86.2%
associate-*l/86.2%
*-lft-identity86.2%
Simplified86.2%
associate-/r*98.4%
div-inv98.4%
Applied egg-rr98.4%
Final simplification99.0%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+18) (not (<= (* PI l) 1e+14))) (* PI l) (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+18) || !((((double) M_PI) * l) <= 1e+14)) {
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) <= -5e+18) || !((Math.PI * l) <= 1e+14)) {
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) <= -5e+18) or not ((math.pi * l) <= 1e+14): 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) <= -5e+18) || !(Float64(pi * l) <= 1e+14)) 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) <= -5e+18) || ~(((pi * l) <= 1e+14))) 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], -5e+18], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1e+14]], $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 -5 \cdot 10^{+18} \lor \neg \left(\pi \cdot \ell \leq 10^{+14}\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) < -5e18 or 1e14 < (*.f64 (PI.f64) l) Initial program 60.9%
Taylor expanded in F around 0 60.9%
unpow-160.9%
exp-to-pow33.5%
exp-prod33.5%
associate-*l*33.5%
metadata-eval33.5%
exp-to-pow60.9%
Simplified60.9%
metadata-eval60.9%
pow-flip60.9%
pow260.9%
associate-/r/60.9%
inv-pow60.9%
associate-/l*60.9%
exp-to-pow32.3%
add-sqr-sqrt4.8%
sqrt-unprod14.9%
*-commutative14.9%
*-commutative14.9%
swap-sqr14.9%
Applied egg-rr47.9%
*-inverses99.7%
Simplified99.7%
Taylor expanded in l around inf 99.7%
if -5e18 < (*.f64 (PI.f64) l) < 1e14Initial program 86.2%
associate-*l/86.2%
*-un-lft-identity86.2%
associate-/r*98.4%
Applied egg-rr98.4%
Final simplification99.0%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+18) (not (<= (* PI l) 0.01))) (* PI l) (- (* PI l) (* (/ l F) (/ PI F)))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+18) || !((((double) M_PI) * l) <= 0.01)) {
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) <= -5e+18) || !((Math.PI * l) <= 0.01)) {
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) <= -5e+18) or not ((math.pi * l) <= 0.01): 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) <= -5e+18) || !(Float64(pi * l) <= 0.01)) 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) <= -5e+18) || ~(((pi * l) <= 0.01))) 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], -5e+18], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 0.01]], $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 -5 \cdot 10^{+18} \lor \neg \left(\pi \cdot \ell \leq 0.01\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) < -5e18 or 0.0100000000000000002 < (*.f64 (PI.f64) l) Initial program 61.5%
Taylor expanded in F around 0 61.5%
unpow-161.5%
exp-to-pow34.0%
exp-prod34.0%
associate-*l*34.0%
metadata-eval34.0%
exp-to-pow61.5%
Simplified61.5%
metadata-eval61.5%
pow-flip61.5%
pow261.5%
associate-/r/61.5%
inv-pow61.5%
associate-/l*61.5%
exp-to-pow32.1%
add-sqr-sqrt4.7%
sqrt-unprod14.5%
*-commutative14.5%
*-commutative14.5%
swap-sqr14.5%
Applied egg-rr46.7%
*-inverses97.5%
Simplified97.5%
Taylor expanded in l around inf 98.9%
if -5e18 < (*.f64 (PI.f64) l) < 0.0100000000000000002Initial program 86.3%
Taylor expanded in l around 0 84.7%
unpow284.7%
times-frac97.3%
Simplified97.3%
Final simplification98.1%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+18) (not (<= (* PI l) 0.01))) (* PI l) (- (* PI l) (/ PI (* F (/ F l))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+18) || !((((double) M_PI) * l) <= 0.01)) {
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) <= -5e+18) || !((Math.PI * l) <= 0.01)) {
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) <= -5e+18) or not ((math.pi * l) <= 0.01): 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) <= -5e+18) || !(Float64(pi * l) <= 0.01)) 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) <= -5e+18) || ~(((pi * l) <= 0.01))) 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], -5e+18], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 0.01]], $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 -5 \cdot 10^{+18} \lor \neg \left(\pi \cdot \ell \leq 0.01\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) < -5e18 or 0.0100000000000000002 < (*.f64 (PI.f64) l) Initial program 61.5%
Taylor expanded in F around 0 61.5%
unpow-161.5%
exp-to-pow34.0%
exp-prod34.0%
associate-*l*34.0%
metadata-eval34.0%
exp-to-pow61.5%
Simplified61.5%
metadata-eval61.5%
pow-flip61.5%
pow261.5%
associate-/r/61.5%
inv-pow61.5%
associate-/l*61.5%
exp-to-pow32.1%
add-sqr-sqrt4.7%
sqrt-unprod14.5%
*-commutative14.5%
*-commutative14.5%
swap-sqr14.5%
Applied egg-rr46.7%
*-inverses97.5%
Simplified97.5%
Taylor expanded in l around inf 98.9%
if -5e18 < (*.f64 (PI.f64) l) < 0.0100000000000000002Initial program 86.3%
Taylor expanded in l around 0 84.7%
unpow284.7%
times-frac97.3%
Simplified97.3%
clear-num97.2%
frac-times97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
Final simplification98.2%
(FPCore (F l) :precision binary64 (if (or (<= (* PI l) -5e+18) (not (<= (* PI l) 0.01))) (* PI l) (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -5e+18) || !((((double) M_PI) * l) <= 0.01)) {
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) <= -5e+18) || !((Math.PI * l) <= 0.01)) {
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) <= -5e+18) or not ((math.pi * l) <= 0.01): 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) <= -5e+18) || !(Float64(pi * l) <= 0.01)) 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) <= -5e+18) || ~(((pi * l) <= 0.01))) 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], -5e+18], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 0.01]], $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 -5 \cdot 10^{+18} \lor \neg \left(\pi \cdot \ell \leq 0.01\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) < -5e18 or 0.0100000000000000002 < (*.f64 (PI.f64) l) Initial program 61.5%
Taylor expanded in F around 0 61.5%
unpow-161.5%
exp-to-pow34.0%
exp-prod34.0%
associate-*l*34.0%
metadata-eval34.0%
exp-to-pow61.5%
Simplified61.5%
metadata-eval61.5%
pow-flip61.5%
pow261.5%
associate-/r/61.5%
inv-pow61.5%
associate-/l*61.5%
exp-to-pow32.1%
add-sqr-sqrt4.7%
sqrt-unprod14.5%
*-commutative14.5%
*-commutative14.5%
swap-sqr14.5%
Applied egg-rr46.7%
*-inverses97.5%
Simplified97.5%
Taylor expanded in l around inf 98.9%
if -5e18 < (*.f64 (PI.f64) l) < 0.0100000000000000002Initial program 86.3%
Taylor expanded in l around 0 84.7%
unpow284.7%
times-frac97.3%
Simplified97.3%
*-commutative97.3%
clear-num97.2%
un-div-inv97.3%
Applied egg-rr97.3%
Taylor expanded in l around 0 84.7%
unpow284.7%
Simplified84.7%
Final simplification92.0%
(FPCore (F l) :precision binary64 (if (<= (* F F) 1.7e-184) (+ (* PI l) -1.0) (if (<= (* F F) 6.4e-76) (- (/ l (/ (* F F) PI))) (* PI l))))
double code(double F, double l) {
double tmp;
if ((F * F) <= 1.7e-184) {
tmp = (((double) M_PI) * l) + -1.0;
} else if ((F * F) <= 6.4e-76) {
tmp = -(l / ((F * F) / ((double) M_PI)));
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F * F) <= 1.7e-184) {
tmp = (Math.PI * l) + -1.0;
} else if ((F * F) <= 6.4e-76) {
tmp = -(l / ((F * F) / Math.PI));
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if (F * F) <= 1.7e-184: tmp = (math.pi * l) + -1.0 elif (F * F) <= 6.4e-76: tmp = -(l / ((F * F) / math.pi)) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if (Float64(F * F) <= 1.7e-184) tmp = Float64(Float64(pi * l) + -1.0); elseif (Float64(F * F) <= 6.4e-76) tmp = Float64(-Float64(l / Float64(Float64(F * F) / pi))); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 1.7e-184) tmp = (pi * l) + -1.0; elseif ((F * F) <= 6.4e-76) tmp = -(l / ((F * F) / pi)); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 1.7e-184], N[(N[(Pi * l), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[N[(F * F), $MachinePrecision], 6.4e-76], (-N[(l / N[(N[(F * F), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]), N[(Pi * l), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 1.7 \cdot 10^{-184}:\\
\;\;\;\;\pi \cdot \ell + -1\\
\mathbf{elif}\;F \cdot F \leq 6.4 \cdot 10^{-76}:\\
\;\;\;\;-\frac{\ell}{\frac{F \cdot F}{\pi}}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if (*.f64 F F) < 1.70000000000000002e-184Initial program 34.1%
Taylor expanded in F around 0 34.1%
unpow-134.1%
exp-to-pow22.0%
exp-prod22.0%
associate-*l*22.0%
metadata-eval22.0%
exp-to-pow34.1%
Simplified34.1%
metadata-eval34.1%
pow-flip34.1%
pow234.1%
associate-/r/34.1%
inv-pow34.1%
associate-/l*50.7%
exp-to-pow24.1%
add-sqr-sqrt22.9%
sqrt-unprod23.2%
*-commutative23.2%
*-commutative23.2%
swap-sqr23.2%
Applied egg-rr24.1%
*-inverses52.6%
Simplified52.6%
if 1.70000000000000002e-184 < (*.f64 F F) < 6.3999999999999995e-76Initial program 79.9%
Taylor expanded in l around 0 66.3%
unpow266.3%
times-frac66.3%
Simplified66.3%
*-commutative66.3%
clear-num66.3%
un-div-inv66.3%
Applied egg-rr66.3%
Taylor expanded in F around 0 66.3%
mul-1-neg66.3%
unpow266.3%
associate-/l*66.2%
Simplified66.2%
if 6.3999999999999995e-76 < (*.f64 F F) Initial program 98.7%
Taylor expanded in F around 0 98.7%
unpow-198.7%
exp-to-pow48.1%
exp-prod48.1%
associate-*l*48.1%
metadata-eval48.1%
exp-to-pow98.7%
Simplified98.7%
metadata-eval98.7%
pow-flip98.7%
pow298.7%
associate-/r/98.7%
inv-pow98.7%
associate-/l*98.7%
exp-to-pow49.0%
add-sqr-sqrt1.4%
sqrt-unprod10.4%
*-commutative10.4%
*-commutative10.4%
swap-sqr10.4%
Applied egg-rr26.2%
*-inverses53.3%
Simplified53.3%
Taylor expanded in l around inf 97.7%
Final simplification79.1%
(FPCore (F l) :precision binary64 (if (<= (* F F) 2e-190) (+ (* PI l) -1.0) (if (<= (* F F) 2e-80) (* (/ l F) (/ (- PI) F)) (* PI l))))
double code(double F, double l) {
double tmp;
if ((F * F) <= 2e-190) {
tmp = (((double) M_PI) * l) + -1.0;
} else if ((F * F) <= 2e-80) {
tmp = (l / F) * (-((double) M_PI) / F);
} else {
tmp = ((double) M_PI) * l;
}
return tmp;
}
public static double code(double F, double l) {
double tmp;
if ((F * F) <= 2e-190) {
tmp = (Math.PI * l) + -1.0;
} else if ((F * F) <= 2e-80) {
tmp = (l / F) * (-Math.PI / F);
} else {
tmp = Math.PI * l;
}
return tmp;
}
def code(F, l): tmp = 0 if (F * F) <= 2e-190: tmp = (math.pi * l) + -1.0 elif (F * F) <= 2e-80: tmp = (l / F) * (-math.pi / F) else: tmp = math.pi * l return tmp
function code(F, l) tmp = 0.0 if (Float64(F * F) <= 2e-190) tmp = Float64(Float64(pi * l) + -1.0); elseif (Float64(F * F) <= 2e-80) tmp = Float64(Float64(l / F) * Float64(Float64(-pi) / F)); else tmp = Float64(pi * l); end return tmp end
function tmp_2 = code(F, l) tmp = 0.0; if ((F * F) <= 2e-190) tmp = (pi * l) + -1.0; elseif ((F * F) <= 2e-80) tmp = (l / F) * (-pi / F); else tmp = pi * l; end tmp_2 = tmp; end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 2e-190], N[(N[(Pi * l), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[N[(F * F), $MachinePrecision], 2e-80], N[(N[(l / F), $MachinePrecision] * N[((-Pi) / F), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2 \cdot 10^{-190}:\\
\;\;\;\;\pi \cdot \ell + -1\\
\mathbf{elif}\;F \cdot F \leq 2 \cdot 10^{-80}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{-\pi}{F}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\
\end{array}
\end{array}
if (*.f64 F F) < 2e-190Initial program 34.1%
Taylor expanded in F around 0 34.1%
unpow-134.1%
exp-to-pow22.0%
exp-prod22.0%
associate-*l*22.0%
metadata-eval22.0%
exp-to-pow34.1%
Simplified34.1%
metadata-eval34.1%
pow-flip34.1%
pow234.1%
associate-/r/34.1%
inv-pow34.1%
associate-/l*50.7%
exp-to-pow24.1%
add-sqr-sqrt22.9%
sqrt-unprod23.2%
*-commutative23.2%
*-commutative23.2%
swap-sqr23.2%
Applied egg-rr24.1%
*-inverses52.6%
Simplified52.6%
if 2e-190 < (*.f64 F F) < 1.99999999999999992e-80Initial program 79.9%
Taylor expanded in l around 0 66.3%
unpow266.3%
times-frac66.3%
Simplified66.3%
*-commutative66.3%
clear-num66.3%
un-div-inv66.3%
Applied egg-rr66.3%
Taylor expanded in F around 0 66.3%
mul-1-neg66.3%
unpow266.3%
times-frac66.3%
distribute-rgt-neg-in66.3%
distribute-frac-neg66.3%
Simplified66.3%
if 1.99999999999999992e-80 < (*.f64 F F) Initial program 98.7%
Taylor expanded in F around 0 98.7%
unpow-198.7%
exp-to-pow48.1%
exp-prod48.1%
associate-*l*48.1%
metadata-eval48.1%
exp-to-pow98.7%
Simplified98.7%
metadata-eval98.7%
pow-flip98.7%
pow298.7%
associate-/r/98.7%
inv-pow98.7%
associate-/l*98.7%
exp-to-pow49.0%
add-sqr-sqrt1.4%
sqrt-unprod10.4%
*-commutative10.4%
*-commutative10.4%
swap-sqr10.4%
Applied egg-rr26.2%
*-inverses53.3%
Simplified53.3%
Taylor expanded in l around inf 97.7%
Final simplification79.1%
(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.6%
Taylor expanded in F around 0 73.6%
unpow-173.6%
exp-to-pow37.8%
exp-prod37.8%
associate-*l*37.8%
metadata-eval37.8%
exp-to-pow73.6%
Simplified73.6%
metadata-eval73.6%
pow-flip73.6%
pow273.6%
associate-/r/73.7%
inv-pow73.7%
associate-/l*79.8%
exp-to-pow39.5%
add-sqr-sqrt10.8%
sqrt-unprod16.1%
*-commutative16.1%
*-commutative16.1%
swap-sqr16.1%
Applied egg-rr24.8%
*-inverses52.1%
Simplified52.1%
Taylor expanded in l around inf 77.1%
Final simplification77.1%
(FPCore (F l) :precision binary64 -1.0)
double code(double F, double l) {
return -1.0;
}
real(8) function code(f, l)
real(8), intent (in) :: f
real(8), intent (in) :: l
code = -1.0d0
end function
public static double code(double F, double l) {
return -1.0;
}
def code(F, l): return -1.0
function code(F, l) return -1.0 end
function tmp = code(F, l) tmp = -1.0; end
code[F_, l_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 73.6%
Taylor expanded in F around 0 73.6%
unpow-173.6%
exp-to-pow37.8%
exp-prod37.8%
associate-*l*37.8%
metadata-eval37.8%
exp-to-pow73.6%
Simplified73.6%
metadata-eval73.6%
pow-flip73.6%
pow273.6%
associate-/r/73.7%
inv-pow73.7%
associate-/l*79.8%
exp-to-pow39.5%
add-sqr-sqrt10.8%
sqrt-unprod16.1%
*-commutative16.1%
*-commutative16.1%
swap-sqr16.1%
Applied egg-rr24.8%
*-inverses52.1%
Simplified52.1%
Taylor expanded in l around 0 3.3%
Final simplification3.3%
herbie shell --seed 2023178
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))