
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (tan k) (sin k))))
(if (<= (* l l) 5e-211)
(/ 2.0 (* (* t (* (/ (* k k) l) t_1)) (/ 1.0 l)))
(if (<= (* l l) 5e+190)
(* (* l (+ l l)) (/ (cos k) (* k (* k (* t (pow (sin k) 2.0))))))
(/ 2.0 (* (/ t l) (* (/ k l) (* k t_1))))))))
double code(double t, double l, double k) {
double t_1 = tan(k) * sin(k);
double tmp;
if ((l * l) <= 5e-211) {
tmp = 2.0 / ((t * (((k * k) / l) * t_1)) * (1.0 / l));
} else if ((l * l) <= 5e+190) {
tmp = (l * (l + l)) * (cos(k) / (k * (k * (t * pow(sin(k), 2.0)))));
} else {
tmp = 2.0 / ((t / l) * ((k / l) * (k * t_1)));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = tan(k) * sin(k)
if ((l * l) <= 5d-211) then
tmp = 2.0d0 / ((t * (((k * k) / l) * t_1)) * (1.0d0 / l))
else if ((l * l) <= 5d+190) then
tmp = (l * (l + l)) * (cos(k) / (k * (k * (t * (sin(k) ** 2.0d0)))))
else
tmp = 2.0d0 / ((t / l) * ((k / l) * (k * t_1)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.tan(k) * Math.sin(k);
double tmp;
if ((l * l) <= 5e-211) {
tmp = 2.0 / ((t * (((k * k) / l) * t_1)) * (1.0 / l));
} else if ((l * l) <= 5e+190) {
tmp = (l * (l + l)) * (Math.cos(k) / (k * (k * (t * Math.pow(Math.sin(k), 2.0)))));
} else {
tmp = 2.0 / ((t / l) * ((k / l) * (k * t_1)));
}
return tmp;
}
def code(t, l, k): t_1 = math.tan(k) * math.sin(k) tmp = 0 if (l * l) <= 5e-211: tmp = 2.0 / ((t * (((k * k) / l) * t_1)) * (1.0 / l)) elif (l * l) <= 5e+190: tmp = (l * (l + l)) * (math.cos(k) / (k * (k * (t * math.pow(math.sin(k), 2.0))))) else: tmp = 2.0 / ((t / l) * ((k / l) * (k * t_1))) return tmp
function code(t, l, k) t_1 = Float64(tan(k) * sin(k)) tmp = 0.0 if (Float64(l * l) <= 5e-211) tmp = Float64(2.0 / Float64(Float64(t * Float64(Float64(Float64(k * k) / l) * t_1)) * Float64(1.0 / l))); elseif (Float64(l * l) <= 5e+190) tmp = Float64(Float64(l * Float64(l + l)) * Float64(cos(k) / Float64(k * Float64(k * Float64(t * (sin(k) ^ 2.0)))))); else tmp = Float64(2.0 / Float64(Float64(t / l) * Float64(Float64(k / l) * Float64(k * t_1)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = tan(k) * sin(k); tmp = 0.0; if ((l * l) <= 5e-211) tmp = 2.0 / ((t * (((k * k) / l) * t_1)) * (1.0 / l)); elseif ((l * l) <= 5e+190) tmp = (l * (l + l)) * (cos(k) / (k * (k * (t * (sin(k) ^ 2.0))))); else tmp = 2.0 / ((t / l) * ((k / l) * (k * t_1))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 5e-211], N[(2.0 / N[(N[(t * N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 5e+190], N[(N[(l * N[(l + l), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(k * N[(k * N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t / l), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \tan k \cdot \sin k\\
\mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{-211}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\frac{k \cdot k}{\ell} \cdot t\_1\right)\right) \cdot \frac{1}{\ell}}\\
\mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+190}:\\
\;\;\;\;\left(\ell \cdot \left(\ell + \ell\right)\right) \cdot \frac{\cos k}{k \cdot \left(k \cdot \left(t \cdot {\sin k}^{2}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t}{\ell} \cdot \left(\frac{k}{\ell} \cdot \left(k \cdot t\_1\right)\right)}\\
\end{array}
\end{array}
if (*.f64 l l) < 5.0000000000000002e-211Initial program 31.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites42.4%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-cos.f6470.6
Applied rewrites70.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lower-*.f64N/A
Applied rewrites85.7%
if 5.0000000000000002e-211 < (*.f64 l l) < 5.00000000000000036e190Initial program 41.8%
Taylor expanded in t around 0
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
count-2N/A
lower-+.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6497.6
Applied rewrites97.6%
if 5.00000000000000036e190 < (*.f64 l l) Initial program 35.4%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites30.0%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-cos.f6482.0
Applied rewrites82.0%
Applied rewrites93.5%
(FPCore (t l k) :precision binary64 (if (<= k 5.8e-74) (* (/ (+ l l) (* t (* k k))) (/ l (* k k))) (* l (/ 2.0 (* t (* (* (tan k) (sin k)) (* k (/ k l))))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 5.8e-74) {
tmp = ((l + l) / (t * (k * k))) * (l / (k * k));
} else {
tmp = l * (2.0 / (t * ((tan(k) * sin(k)) * (k * (k / l)))));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 5.8d-74) then
tmp = ((l + l) / (t * (k * k))) * (l / (k * k))
else
tmp = l * (2.0d0 / (t * ((tan(k) * sin(k)) * (k * (k / l)))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 5.8e-74) {
tmp = ((l + l) / (t * (k * k))) * (l / (k * k));
} else {
tmp = l * (2.0 / (t * ((Math.tan(k) * Math.sin(k)) * (k * (k / l)))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 5.8e-74: tmp = ((l + l) / (t * (k * k))) * (l / (k * k)) else: tmp = l * (2.0 / (t * ((math.tan(k) * math.sin(k)) * (k * (k / l))))) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 5.8e-74) tmp = Float64(Float64(Float64(l + l) / Float64(t * Float64(k * k))) * Float64(l / Float64(k * k))); else tmp = Float64(l * Float64(2.0 / Float64(t * Float64(Float64(tan(k) * sin(k)) * Float64(k * Float64(k / l)))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 5.8e-74) tmp = ((l + l) / (t * (k * k))) * (l / (k * k)); else tmp = l * (2.0 / (t * ((tan(k) * sin(k)) * (k * (k / l))))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 5.8e-74], N[(N[(N[(l + l), $MachinePrecision] / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(2.0 / N[(t * N[(N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(k * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{\ell + \ell}{t \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{2}{t \cdot \left(\left(\tan k \cdot \sin k\right) \cdot \left(k \cdot \frac{k}{\ell}\right)\right)}\\
\end{array}
\end{array}
if k < 5.8e-74Initial program 39.6%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
count-2N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6465.1
Applied rewrites65.1%
Applied rewrites78.9%
if 5.8e-74 < k Initial program 28.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites33.8%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-cos.f6485.1
Applied rewrites85.1%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites84.2%
Applied rewrites92.5%
Final simplification83.2%
(FPCore (t l k) :precision binary64 (/ (+ l l) (* t (* (sin k) (* (/ (* k k) l) (tan k))))))
double code(double t, double l, double k) {
return (l + l) / (t * (sin(k) * (((k * k) / l) * tan(k))));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l + l) / (t * (sin(k) * (((k * k) / l) * tan(k))))
end function
public static double code(double t, double l, double k) {
return (l + l) / (t * (Math.sin(k) * (((k * k) / l) * Math.tan(k))));
}
def code(t, l, k): return (l + l) / (t * (math.sin(k) * (((k * k) / l) * math.tan(k))))
function code(t, l, k) return Float64(Float64(l + l) / Float64(t * Float64(sin(k) * Float64(Float64(Float64(k * k) / l) * tan(k))))) end
function tmp = code(t, l, k) tmp = (l + l) / (t * (sin(k) * (((k * k) / l) * tan(k)))); end
code[t_, l_, k_] := N[(N[(l + l), $MachinePrecision] / N[(t * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell + \ell}{t \cdot \left(\sin k \cdot \left(\frac{k \cdot k}{\ell} \cdot \tan k\right)\right)}
\end{array}
Initial program 36.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
Applied rewrites35.4%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-cos.f6478.2
Applied rewrites78.2%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites85.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
count-2N/A
lift-+.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
(FPCore (t l k) :precision binary64 (if (<= t 10000000000000.0) (* (/ (+ l l) (* k k)) (/ (/ l t) (* k k))) (* (/ (+ l l) (* t (* k k))) (/ l (* k k)))))
double code(double t, double l, double k) {
double tmp;
if (t <= 10000000000000.0) {
tmp = ((l + l) / (k * k)) * ((l / t) / (k * k));
} else {
tmp = ((l + l) / (t * (k * k))) * (l / (k * k));
}
return tmp;
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t <= 10000000000000.0d0) then
tmp = ((l + l) / (k * k)) * ((l / t) / (k * k))
else
tmp = ((l + l) / (t * (k * k))) * (l / (k * k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 10000000000000.0) {
tmp = ((l + l) / (k * k)) * ((l / t) / (k * k));
} else {
tmp = ((l + l) / (t * (k * k))) * (l / (k * k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 10000000000000.0: tmp = ((l + l) / (k * k)) * ((l / t) / (k * k)) else: tmp = ((l + l) / (t * (k * k))) * (l / (k * k)) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 10000000000000.0) tmp = Float64(Float64(Float64(l + l) / Float64(k * k)) * Float64(Float64(l / t) / Float64(k * k))); else tmp = Float64(Float64(Float64(l + l) / Float64(t * Float64(k * k))) * Float64(l / Float64(k * k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 10000000000000.0) tmp = ((l + l) / (k * k)) * ((l / t) / (k * k)); else tmp = ((l + l) / (t * (k * k))) * (l / (k * k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 10000000000000.0], N[(N[(N[(l + l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l + l), $MachinePrecision] / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10000000000000:\\
\;\;\;\;\frac{\ell + \ell}{k \cdot k} \cdot \frac{\frac{\ell}{t}}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell + \ell}{t \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{k \cdot k}\\
\end{array}
\end{array}
if t < 1e13Initial program 37.4%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
count-2N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6461.6
Applied rewrites61.6%
Applied rewrites42.0%
Applied rewrites38.0%
Applied rewrites70.9%
if 1e13 < t Initial program 31.4%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
count-2N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.9
Applied rewrites68.9%
Applied rewrites81.3%
(FPCore (t l k) :precision binary64 (* (/ (+ l l) (* t (* k k))) (/ l (* k k))))
double code(double t, double l, double k) {
return ((l + l) / (t * (k * k))) * (l / (k * k));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l + l) / (t * (k * k))) * (l / (k * k))
end function
public static double code(double t, double l, double k) {
return ((l + l) / (t * (k * k))) * (l / (k * k));
}
def code(t, l, k): return ((l + l) / (t * (k * k))) * (l / (k * k))
function code(t, l, k) return Float64(Float64(Float64(l + l) / Float64(t * Float64(k * k))) * Float64(l / Float64(k * k))) end
function tmp = code(t, l, k) tmp = ((l + l) / (t * (k * k))) * (l / (k * k)); end
code[t_, l_, k_] := N[(N[(N[(l + l), $MachinePrecision] / N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell + \ell}{t \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{k \cdot k}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
count-2N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
Applied rewrites73.6%
(FPCore (t l k) :precision binary64 (* (/ (+ l l) (* t k)) (/ l (* k (* k k)))))
double code(double t, double l, double k) {
return ((l + l) / (t * k)) * (l / (k * (k * k)));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l + l) / (t * k)) * (l / (k * (k * k)))
end function
public static double code(double t, double l, double k) {
return ((l + l) / (t * k)) * (l / (k * (k * k)));
}
def code(t, l, k): return ((l + l) / (t * k)) * (l / (k * (k * k)))
function code(t, l, k) return Float64(Float64(Float64(l + l) / Float64(t * k)) * Float64(l / Float64(k * Float64(k * k)))) end
function tmp = code(t, l, k) tmp = ((l + l) / (t * k)) * (l / (k * (k * k))); end
code[t_, l_, k_] := N[(N[(N[(l + l), $MachinePrecision] / N[(t * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell + \ell}{t \cdot k} \cdot \frac{\ell}{k \cdot \left(k \cdot k\right)}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
count-2N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
Applied rewrites46.0%
Applied rewrites40.9%
Applied rewrites71.0%
(FPCore (t l k) :precision binary64 (* (+ l l) (/ l (* k (* t (* k (* k k)))))))
double code(double t, double l, double k) {
return (l + l) * (l / (k * (t * (k * (k * k)))));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l + l) * (l / (k * (t * (k * (k * k)))))
end function
public static double code(double t, double l, double k) {
return (l + l) * (l / (k * (t * (k * (k * k)))));
}
def code(t, l, k): return (l + l) * (l / (k * (t * (k * (k * k)))))
function code(t, l, k) return Float64(Float64(l + l) * Float64(l / Float64(k * Float64(t * Float64(k * Float64(k * k)))))) end
function tmp = code(t, l, k) tmp = (l + l) * (l / (k * (t * (k * (k * k))))); end
code[t_, l_, k_] := N[(N[(l + l), $MachinePrecision] * N[(l / N[(k * N[(t * N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\ell + \ell\right) \cdot \frac{\ell}{k \cdot \left(t \cdot \left(k \cdot \left(k \cdot k\right)\right)\right)}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
count-2N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
Applied rewrites46.0%
Applied rewrites40.9%
Applied rewrites69.5%
Final simplification69.5%
(FPCore (t l k) :precision binary64 (* l (/ (+ l l) (* t (* k (* k k))))))
double code(double t, double l, double k) {
return l * ((l + l) / (t * (k * (k * k))));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = l * ((l + l) / (t * (k * (k * k))))
end function
public static double code(double t, double l, double k) {
return l * ((l + l) / (t * (k * (k * k))));
}
def code(t, l, k): return l * ((l + l) / (t * (k * (k * k))))
function code(t, l, k) return Float64(l * Float64(Float64(l + l) / Float64(t * Float64(k * Float64(k * k))))) end
function tmp = code(t, l, k) tmp = l * ((l + l) / (t * (k * (k * k)))); end
code[t_, l_, k_] := N[(l * N[(N[(l + l), $MachinePrecision] / N[(t * N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell \cdot \frac{\ell + \ell}{t \cdot \left(k \cdot \left(k \cdot k\right)\right)}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
count-2N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
Applied rewrites46.0%
Applied rewrites40.9%
Applied rewrites45.8%
Final simplification45.8%
(FPCore (t l k) :precision binary64 (/ (+ l l) (* t (* k (* k k)))))
double code(double t, double l, double k) {
return (l + l) / (t * (k * (k * k)));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l + l) / (t * (k * (k * k)))
end function
public static double code(double t, double l, double k) {
return (l + l) / (t * (k * (k * k)));
}
def code(t, l, k): return (l + l) / (t * (k * (k * k)))
function code(t, l, k) return Float64(Float64(l + l) / Float64(t * Float64(k * Float64(k * k)))) end
function tmp = code(t, l, k) tmp = (l + l) / (t * (k * (k * k))); end
code[t_, l_, k_] := N[(N[(l + l), $MachinePrecision] / N[(t * N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell + \ell}{t \cdot \left(k \cdot \left(k \cdot k\right)\right)}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
count-2N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
Applied rewrites46.0%
Applied rewrites40.9%
Applied rewrites42.9%
Final simplification42.9%
(FPCore (t l k) :precision binary64 (/ 2.0 (* k (* t (* k k)))))
double code(double t, double l, double k) {
return 2.0 / (k * (t * (k * k)));
}
real(8) function code(t, l, k)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (k * (t * (k * k)))
end function
public static double code(double t, double l, double k) {
return 2.0 / (k * (t * (k * k)));
}
def code(t, l, k): return 2.0 / (k * (t * (k * k)))
function code(t, l, k) return Float64(2.0 / Float64(k * Float64(t * Float64(k * k)))) end
function tmp = code(t, l, k) tmp = 2.0 / (k * (t * (k * k))); end
code[t_, l_, k_] := N[(2.0 / N[(k * N[(t * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot \left(t \cdot \left(k \cdot k\right)\right)}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
count-2N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
Applied rewrites46.0%
Applied rewrites40.9%
Taylor expanded in k around 0
Applied rewrites39.2%
Final simplification39.2%
herbie shell --seed 2024223
(FPCore (t l k)
:name "Toniolo and Linder, Equation (10-)"
:precision binary64
(/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))