
(FPCore (l Om kx ky)
:precision binary64
(sqrt
(*
(/ 1.0 2.0)
(+
1.0
(/
1.0
(sqrt
(+
1.0
(*
(pow (/ (* 2.0 l) Om) 2.0)
(+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))))))
double code(double l, double Om, double kx, double ky) {
return sqrt(((1.0 / 2.0) * (1.0 + (1.0 / sqrt((1.0 + (pow(((2.0 * l) / Om), 2.0) * (pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))))))));
}
real(8) function code(l, om, kx, ky)
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: kx
real(8), intent (in) :: ky
code = sqrt(((1.0d0 / 2.0d0) * (1.0d0 + (1.0d0 / sqrt((1.0d0 + ((((2.0d0 * l) / om) ** 2.0d0) * ((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))))))))
end function
public static double code(double l, double Om, double kx, double ky) {
return Math.sqrt(((1.0 / 2.0) * (1.0 + (1.0 / Math.sqrt((1.0 + (Math.pow(((2.0 * l) / Om), 2.0) * (Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))))))));
}
def code(l, Om, kx, ky): return math.sqrt(((1.0 / 2.0) * (1.0 + (1.0 / math.sqrt((1.0 + (math.pow(((2.0 * l) / Om), 2.0) * (math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))))))))
function code(l, Om, kx, ky) return sqrt(Float64(Float64(1.0 / 2.0) * Float64(1.0 + Float64(1.0 / sqrt(Float64(1.0 + Float64((Float64(Float64(2.0 * l) / Om) ^ 2.0) * Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0))))))))) end
function tmp = code(l, Om, kx, ky) tmp = sqrt(((1.0 / 2.0) * (1.0 + (1.0 / sqrt((1.0 + ((((2.0 * l) / Om) ^ 2.0) * ((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0))))))))); end
code[l_, Om_, kx_, ky_] := N[Sqrt[N[(N[(1.0 / 2.0), $MachinePrecision] * N[(1.0 + N[(1.0 / N[Sqrt[N[(1.0 + N[(N[Power[N[(N[(2.0 * l), $MachinePrecision] / Om), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\sqrt{1 + {\left(\frac{2 \cdot \ell}{Om}\right)}^{2} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)}}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (l Om kx ky)
:precision binary64
(sqrt
(*
(/ 1.0 2.0)
(+
1.0
(/
1.0
(sqrt
(+
1.0
(*
(pow (/ (* 2.0 l) Om) 2.0)
(+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))))))
double code(double l, double Om, double kx, double ky) {
return sqrt(((1.0 / 2.0) * (1.0 + (1.0 / sqrt((1.0 + (pow(((2.0 * l) / Om), 2.0) * (pow(sin(kx), 2.0) + pow(sin(ky), 2.0)))))))));
}
real(8) function code(l, om, kx, ky)
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: kx
real(8), intent (in) :: ky
code = sqrt(((1.0d0 / 2.0d0) * (1.0d0 + (1.0d0 / sqrt((1.0d0 + ((((2.0d0 * l) / om) ** 2.0d0) * ((sin(kx) ** 2.0d0) + (sin(ky) ** 2.0d0)))))))))
end function
public static double code(double l, double Om, double kx, double ky) {
return Math.sqrt(((1.0 / 2.0) * (1.0 + (1.0 / Math.sqrt((1.0 + (Math.pow(((2.0 * l) / Om), 2.0) * (Math.pow(Math.sin(kx), 2.0) + Math.pow(Math.sin(ky), 2.0)))))))));
}
def code(l, Om, kx, ky): return math.sqrt(((1.0 / 2.0) * (1.0 + (1.0 / math.sqrt((1.0 + (math.pow(((2.0 * l) / Om), 2.0) * (math.pow(math.sin(kx), 2.0) + math.pow(math.sin(ky), 2.0)))))))))
function code(l, Om, kx, ky) return sqrt(Float64(Float64(1.0 / 2.0) * Float64(1.0 + Float64(1.0 / sqrt(Float64(1.0 + Float64((Float64(Float64(2.0 * l) / Om) ^ 2.0) * Float64((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0))))))))) end
function tmp = code(l, Om, kx, ky) tmp = sqrt(((1.0 / 2.0) * (1.0 + (1.0 / sqrt((1.0 + ((((2.0 * l) / Om) ^ 2.0) * ((sin(kx) ^ 2.0) + (sin(ky) ^ 2.0))))))))); end
code[l_, Om_, kx_, ky_] := N[Sqrt[N[(N[(1.0 / 2.0), $MachinePrecision] * N[(1.0 + N[(1.0 / N[Sqrt[N[(1.0 + N[(N[Power[N[(N[(2.0 * l), $MachinePrecision] / Om), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[N[Sin[kx], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[ky], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{1}{2} \cdot \left(1 + \frac{1}{\sqrt{1 + {\left(\frac{2 \cdot \ell}{Om}\right)}^{2} \cdot \left({\sin kx}^{2} + {\sin ky}^{2}\right)}}\right)}
\end{array}
(FPCore (l Om kx ky) :precision binary64 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 (* (* (/ l Om) 2.0) (hypot (sin kx) (sin ky))))))))
double code(double l, double Om, double kx, double ky) {
return sqrt((0.5 + (0.5 / hypot(1.0, (((l / Om) * 2.0) * hypot(sin(kx), sin(ky)))))));
}
public static double code(double l, double Om, double kx, double ky) {
return Math.sqrt((0.5 + (0.5 / Math.hypot(1.0, (((l / Om) * 2.0) * Math.hypot(Math.sin(kx), Math.sin(ky)))))));
}
def code(l, Om, kx, ky): return math.sqrt((0.5 + (0.5 / math.hypot(1.0, (((l / Om) * 2.0) * math.hypot(math.sin(kx), math.sin(ky)))))))
function code(l, Om, kx, ky) return sqrt(Float64(0.5 + Float64(0.5 / hypot(1.0, Float64(Float64(Float64(l / Om) * 2.0) * hypot(sin(kx), sin(ky))))))) end
function tmp = code(l, Om, kx, ky) tmp = sqrt((0.5 + (0.5 / hypot(1.0, (((l / Om) * 2.0) * hypot(sin(kx), sin(ky))))))); end
code[l_, Om_, kx_, ky_] := N[Sqrt[N[(0.5 + N[(0.5 / N[Sqrt[1.0 ^ 2 + N[(N[(N[(l / Om), $MachinePrecision] * 2.0), $MachinePrecision] * N[Sqrt[N[Sin[kx], $MachinePrecision] ^ 2 + N[Sin[ky], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, \left(\frac{\ell}{Om} \cdot 2\right) \cdot \mathsf{hypot}\left(\sin kx, \sin ky\right)\right)}}
\end{array}
Initial program 97.3%
Simplified97.3%
expm1-log1p-u97.3%
expm1-udef97.2%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
*-commutative100.0%
hypot-def98.3%
unpow298.3%
unpow298.3%
associate-*l*98.3%
unpow298.3%
unpow298.3%
hypot-def100.0%
Simplified100.0%
expm1-log1p-u99.3%
expm1-udef99.3%
associate-*l/99.3%
metadata-eval99.3%
Applied egg-rr99.3%
expm1-def99.3%
expm1-log1p100.0%
associate-*r*100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (l Om kx ky) :precision binary64 (if (<= kx 2.65e-151) (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 (/ (* 2.0 (* l ky)) Om))))) (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 (* (/ l Om) (* 2.0 (sin kx)))))))))
double code(double l, double Om, double kx, double ky) {
double tmp;
if (kx <= 2.65e-151) {
tmp = sqrt((0.5 + (0.5 / hypot(1.0, ((2.0 * (l * ky)) / Om)))));
} else {
tmp = sqrt((0.5 + (0.5 / hypot(1.0, ((l / Om) * (2.0 * sin(kx)))))));
}
return tmp;
}
public static double code(double l, double Om, double kx, double ky) {
double tmp;
if (kx <= 2.65e-151) {
tmp = Math.sqrt((0.5 + (0.5 / Math.hypot(1.0, ((2.0 * (l * ky)) / Om)))));
} else {
tmp = Math.sqrt((0.5 + (0.5 / Math.hypot(1.0, ((l / Om) * (2.0 * Math.sin(kx)))))));
}
return tmp;
}
def code(l, Om, kx, ky): tmp = 0 if kx <= 2.65e-151: tmp = math.sqrt((0.5 + (0.5 / math.hypot(1.0, ((2.0 * (l * ky)) / Om))))) else: tmp = math.sqrt((0.5 + (0.5 / math.hypot(1.0, ((l / Om) * (2.0 * math.sin(kx))))))) return tmp
function code(l, Om, kx, ky) tmp = 0.0 if (kx <= 2.65e-151) tmp = sqrt(Float64(0.5 + Float64(0.5 / hypot(1.0, Float64(Float64(2.0 * Float64(l * ky)) / Om))))); else tmp = sqrt(Float64(0.5 + Float64(0.5 / hypot(1.0, Float64(Float64(l / Om) * Float64(2.0 * sin(kx))))))); end return tmp end
function tmp_2 = code(l, Om, kx, ky) tmp = 0.0; if (kx <= 2.65e-151) tmp = sqrt((0.5 + (0.5 / hypot(1.0, ((2.0 * (l * ky)) / Om))))); else tmp = sqrt((0.5 + (0.5 / hypot(1.0, ((l / Om) * (2.0 * sin(kx))))))); end tmp_2 = tmp; end
code[l_, Om_, kx_, ky_] := If[LessEqual[kx, 2.65e-151], N[Sqrt[N[(0.5 + N[(0.5 / N[Sqrt[1.0 ^ 2 + N[(N[(2.0 * N[(l * ky), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(0.5 + N[(0.5 / N[Sqrt[1.0 ^ 2 + N[(N[(l / Om), $MachinePrecision] * N[(2.0 * N[Sin[kx], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;kx \leq 2.65 \cdot 10^{-151}:\\
\;\;\;\;\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, \frac{2 \cdot \left(\ell \cdot ky\right)}{Om}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, \frac{\ell}{Om} \cdot \left(2 \cdot \sin kx\right)\right)}}\\
\end{array}
\end{array}
if kx < 2.64999999999999989e-151Initial program 95.6%
Simplified95.6%
expm1-log1p-u95.6%
expm1-udef95.6%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
*-commutative100.0%
hypot-def97.2%
unpow297.2%
unpow297.2%
associate-*l*97.2%
unpow297.2%
unpow297.2%
hypot-def100.0%
Simplified100.0%
expm1-log1p-u99.3%
expm1-udef99.3%
associate-*l/99.3%
metadata-eval99.3%
Applied egg-rr99.3%
expm1-def99.3%
expm1-log1p100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in kx around 0 95.6%
associate-*r/95.6%
Simplified95.6%
Taylor expanded in ky around 0 89.5%
*-commutative89.5%
Simplified89.5%
if 2.64999999999999989e-151 < kx Initial program 100.0%
Simplified100.0%
Taylor expanded in ky around 0 86.4%
associate-/l*84.4%
associate-/r/86.4%
associate-*l*86.4%
metadata-eval86.4%
unpow286.4%
unpow286.4%
times-frac96.8%
swap-sqr96.8%
unpow296.8%
swap-sqr96.8%
*-commutative96.8%
*-commutative96.8%
hypot-1-def96.8%
*-commutative96.8%
Simplified96.8%
*-commutative96.8%
div-inv96.8%
*-commutative96.8%
associate-*l*96.8%
Applied egg-rr96.8%
Final simplification92.2%
(FPCore (l Om kx ky) :precision binary64 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 (/ (* 2.0 (* l (sin ky))) Om))))))
double code(double l, double Om, double kx, double ky) {
return sqrt((0.5 + (0.5 / hypot(1.0, ((2.0 * (l * sin(ky))) / Om)))));
}
public static double code(double l, double Om, double kx, double ky) {
return Math.sqrt((0.5 + (0.5 / Math.hypot(1.0, ((2.0 * (l * Math.sin(ky))) / Om)))));
}
def code(l, Om, kx, ky): return math.sqrt((0.5 + (0.5 / math.hypot(1.0, ((2.0 * (l * math.sin(ky))) / Om)))))
function code(l, Om, kx, ky) return sqrt(Float64(0.5 + Float64(0.5 / hypot(1.0, Float64(Float64(2.0 * Float64(l * sin(ky))) / Om))))) end
function tmp = code(l, Om, kx, ky) tmp = sqrt((0.5 + (0.5 / hypot(1.0, ((2.0 * (l * sin(ky))) / Om))))); end
code[l_, Om_, kx_, ky_] := N[Sqrt[N[(0.5 + N[(0.5 / N[Sqrt[1.0 ^ 2 + N[(N[(2.0 * N[(l * N[Sin[ky], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, \frac{2 \cdot \left(\ell \cdot \sin ky\right)}{Om}\right)}}
\end{array}
Initial program 97.3%
Simplified97.3%
expm1-log1p-u97.3%
expm1-udef97.2%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
*-commutative100.0%
hypot-def98.3%
unpow298.3%
unpow298.3%
associate-*l*98.3%
unpow298.3%
unpow298.3%
hypot-def100.0%
Simplified100.0%
expm1-log1p-u99.3%
expm1-udef99.3%
associate-*l/99.3%
metadata-eval99.3%
Applied egg-rr99.3%
expm1-def99.3%
expm1-log1p100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in kx around 0 94.1%
associate-*r/94.1%
Simplified94.1%
Final simplification94.1%
(FPCore (l Om kx ky) :precision binary64 (if (<= l 5.5e-129) 1.0 (sqrt (+ 0.5 (/ 0.5 (hypot 1.0 (/ (* 2.0 (* l ky)) Om)))))))
double code(double l, double Om, double kx, double ky) {
double tmp;
if (l <= 5.5e-129) {
tmp = 1.0;
} else {
tmp = sqrt((0.5 + (0.5 / hypot(1.0, ((2.0 * (l * ky)) / Om)))));
}
return tmp;
}
public static double code(double l, double Om, double kx, double ky) {
double tmp;
if (l <= 5.5e-129) {
tmp = 1.0;
} else {
tmp = Math.sqrt((0.5 + (0.5 / Math.hypot(1.0, ((2.0 * (l * ky)) / Om)))));
}
return tmp;
}
def code(l, Om, kx, ky): tmp = 0 if l <= 5.5e-129: tmp = 1.0 else: tmp = math.sqrt((0.5 + (0.5 / math.hypot(1.0, ((2.0 * (l * ky)) / Om))))) return tmp
function code(l, Om, kx, ky) tmp = 0.0 if (l <= 5.5e-129) tmp = 1.0; else tmp = sqrt(Float64(0.5 + Float64(0.5 / hypot(1.0, Float64(Float64(2.0 * Float64(l * ky)) / Om))))); end return tmp end
function tmp_2 = code(l, Om, kx, ky) tmp = 0.0; if (l <= 5.5e-129) tmp = 1.0; else tmp = sqrt((0.5 + (0.5 / hypot(1.0, ((2.0 * (l * ky)) / Om))))); end tmp_2 = tmp; end
code[l_, Om_, kx_, ky_] := If[LessEqual[l, 5.5e-129], 1.0, N[Sqrt[N[(0.5 + N[(0.5 / N[Sqrt[1.0 ^ 2 + N[(N[(2.0 * N[(l * ky), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.5 \cdot 10^{-129}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, \frac{2 \cdot \left(\ell \cdot ky\right)}{Om}\right)}}\\
\end{array}
\end{array}
if l < 5.50000000000000023e-129Initial program 97.6%
Simplified97.6%
expm1-log1p-u97.6%
expm1-udef97.6%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
*-commutative100.0%
hypot-def97.9%
unpow297.9%
unpow297.9%
associate-*l*97.9%
unpow297.9%
unpow297.9%
hypot-def100.0%
Simplified100.0%
expm1-log1p-u99.4%
expm1-udef99.4%
associate-*l/99.4%
metadata-eval99.4%
Applied egg-rr99.4%
expm1-def99.4%
expm1-log1p100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in l around 0 68.0%
if 5.50000000000000023e-129 < l Initial program 96.6%
Simplified96.6%
expm1-log1p-u96.6%
expm1-udef96.6%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
*-commutative100.0%
hypot-def98.9%
unpow298.9%
unpow298.9%
associate-*l*98.9%
unpow298.9%
unpow298.9%
hypot-def100.0%
Simplified100.0%
expm1-log1p-u99.1%
expm1-udef99.1%
associate-*l/99.1%
metadata-eval99.1%
Applied egg-rr99.1%
expm1-def99.1%
expm1-log1p100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in kx around 0 93.1%
associate-*r/93.1%
Simplified93.1%
Taylor expanded in ky around 0 86.7%
*-commutative86.7%
Simplified86.7%
Final simplification74.6%
(FPCore (l Om kx ky) :precision binary64 (if (<= l 1.3e-45) 1.0 (if (<= l 8.2e-17) (sqrt 0.5) (if (<= l 6e+79) 1.0 (sqrt 0.5)))))
double code(double l, double Om, double kx, double ky) {
double tmp;
if (l <= 1.3e-45) {
tmp = 1.0;
} else if (l <= 8.2e-17) {
tmp = sqrt(0.5);
} else if (l <= 6e+79) {
tmp = 1.0;
} else {
tmp = sqrt(0.5);
}
return tmp;
}
real(8) function code(l, om, kx, ky)
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: kx
real(8), intent (in) :: ky
real(8) :: tmp
if (l <= 1.3d-45) then
tmp = 1.0d0
else if (l <= 8.2d-17) then
tmp = sqrt(0.5d0)
else if (l <= 6d+79) then
tmp = 1.0d0
else
tmp = sqrt(0.5d0)
end if
code = tmp
end function
public static double code(double l, double Om, double kx, double ky) {
double tmp;
if (l <= 1.3e-45) {
tmp = 1.0;
} else if (l <= 8.2e-17) {
tmp = Math.sqrt(0.5);
} else if (l <= 6e+79) {
tmp = 1.0;
} else {
tmp = Math.sqrt(0.5);
}
return tmp;
}
def code(l, Om, kx, ky): tmp = 0 if l <= 1.3e-45: tmp = 1.0 elif l <= 8.2e-17: tmp = math.sqrt(0.5) elif l <= 6e+79: tmp = 1.0 else: tmp = math.sqrt(0.5) return tmp
function code(l, Om, kx, ky) tmp = 0.0 if (l <= 1.3e-45) tmp = 1.0; elseif (l <= 8.2e-17) tmp = sqrt(0.5); elseif (l <= 6e+79) tmp = 1.0; else tmp = sqrt(0.5); end return tmp end
function tmp_2 = code(l, Om, kx, ky) tmp = 0.0; if (l <= 1.3e-45) tmp = 1.0; elseif (l <= 8.2e-17) tmp = sqrt(0.5); elseif (l <= 6e+79) tmp = 1.0; else tmp = sqrt(0.5); end tmp_2 = tmp; end
code[l_, Om_, kx_, ky_] := If[LessEqual[l, 1.3e-45], 1.0, If[LessEqual[l, 8.2e-17], N[Sqrt[0.5], $MachinePrecision], If[LessEqual[l, 6e+79], 1.0, N[Sqrt[0.5], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.3 \cdot 10^{-45}:\\
\;\;\;\;1\\
\mathbf{elif}\;\ell \leq 8.2 \cdot 10^{-17}:\\
\;\;\;\;\sqrt{0.5}\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+79}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5}\\
\end{array}
\end{array}
if l < 1.29999999999999993e-45 or 8.2000000000000001e-17 < l < 5.99999999999999948e79Initial program 97.1%
Simplified97.1%
expm1-log1p-u97.1%
expm1-udef97.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
*-commutative100.0%
hypot-def98.3%
unpow298.3%
unpow298.3%
associate-*l*98.3%
unpow298.3%
unpow298.3%
hypot-def100.0%
Simplified100.0%
expm1-log1p-u99.4%
expm1-udef99.4%
associate-*l/99.4%
metadata-eval99.4%
Applied egg-rr99.4%
expm1-def99.4%
expm1-log1p100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in l around 0 69.7%
if 1.29999999999999993e-45 < l < 8.2000000000000001e-17 or 5.99999999999999948e79 < l Initial program 98.0%
Simplified98.0%
Taylor expanded in Om around 0 79.3%
associate-*r*79.3%
*-commutative79.3%
associate-*l*79.3%
unpow279.3%
unpow279.3%
hypot-def81.2%
Simplified81.2%
Taylor expanded in l around inf 83.9%
Final simplification72.6%
(FPCore (l Om kx ky) :precision binary64 1.0)
double code(double l, double Om, double kx, double ky) {
return 1.0;
}
real(8) function code(l, om, kx, ky)
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: kx
real(8), intent (in) :: ky
code = 1.0d0
end function
public static double code(double l, double Om, double kx, double ky) {
return 1.0;
}
def code(l, Om, kx, ky): return 1.0
function code(l, Om, kx, ky) return 1.0 end
function tmp = code(l, Om, kx, ky) tmp = 1.0; end
code[l_, Om_, kx_, ky_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 97.3%
Simplified97.3%
expm1-log1p-u97.3%
expm1-udef97.2%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
*-commutative100.0%
hypot-def98.3%
unpow298.3%
unpow298.3%
associate-*l*98.3%
unpow298.3%
unpow298.3%
hypot-def100.0%
Simplified100.0%
expm1-log1p-u99.3%
expm1-udef99.3%
associate-*l/99.3%
metadata-eval99.3%
Applied egg-rr99.3%
expm1-def99.3%
expm1-log1p100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in l around 0 62.2%
Final simplification62.2%
herbie shell --seed 2024026
(FPCore (l Om kx ky)
:name "Toniolo and Linder, Equation (3a)"
:precision binary64
(sqrt (* (/ 1.0 2.0) (+ 1.0 (/ 1.0 (sqrt (+ 1.0 (* (pow (/ (* 2.0 l) Om) 2.0) (+ (pow (sin kx) 2.0) (pow (sin ky) 2.0))))))))))