
(FPCore (a b) :precision binary64 (* (* (/ PI 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))
double code(double a, double b) {
return ((((double) M_PI) / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
public static double code(double a, double b) {
return ((Math.PI / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
def code(a, b): return ((math.pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b))
function code(a, b) return Float64(Float64(Float64(pi / 2.0) * Float64(1.0 / Float64(Float64(b * b) - Float64(a * a)))) * Float64(Float64(1.0 / a) - Float64(1.0 / b))) end
function tmp = code(a, b) tmp = ((pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b)); end
code[a_, b_] := N[(N[(N[(Pi / 2.0), $MachinePrecision] * N[(1.0 / N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / a), $MachinePrecision] - N[(1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)
\end{array}
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b) :precision binary64 (* (* (/ PI 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))
double code(double a, double b) {
return ((((double) M_PI) / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
public static double code(double a, double b) {
return ((Math.PI / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b));
}
def code(a, b): return ((math.pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b))
function code(a, b) return Float64(Float64(Float64(pi / 2.0) * Float64(1.0 / Float64(Float64(b * b) - Float64(a * a)))) * Float64(Float64(1.0 / a) - Float64(1.0 / b))) end
function tmp = code(a, b) tmp = ((pi / 2.0) * (1.0 / ((b * b) - (a * a)))) * ((1.0 / a) - (1.0 / b)); end
code[a_, b_] := N[(N[(N[(Pi / 2.0), $MachinePrecision] * N[(1.0 / N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / a), $MachinePrecision] - N[(1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\pi}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)
\end{array}
(FPCore (a b) :precision binary64 (/ (/ (* PI 0.5) (+ a b)) (* a b)))
double code(double a, double b) {
return ((((double) M_PI) * 0.5) / (a + b)) / (a * b);
}
public static double code(double a, double b) {
return ((Math.PI * 0.5) / (a + b)) / (a * b);
}
def code(a, b): return ((math.pi * 0.5) / (a + b)) / (a * b)
function code(a, b) return Float64(Float64(Float64(pi * 0.5) / Float64(a + b)) / Float64(a * b)) end
function tmp = code(a, b) tmp = ((pi * 0.5) / (a + b)) / (a * b); end
code[a_, b_] := N[(N[(N[(Pi * 0.5), $MachinePrecision] / N[(a + b), $MachinePrecision]), $MachinePrecision] / N[(a * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\pi \cdot 0.5}{a + b}}{a \cdot b}
\end{array}
Initial program 78.6%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites87.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squaresN/A
associate-/r/N/A
lift--.f64N/A
flip-+N/A
lift-+.f64N/A
lower-/.f6499.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
Applied rewrites99.7%
(FPCore (a b) :precision binary64 (/ (* (/ 0.5 (+ b a)) PI) (* a b)))
double code(double a, double b) {
return ((0.5 / (b + a)) * ((double) M_PI)) / (a * b);
}
public static double code(double a, double b) {
return ((0.5 / (b + a)) * Math.PI) / (a * b);
}
def code(a, b): return ((0.5 / (b + a)) * math.pi) / (a * b)
function code(a, b) return Float64(Float64(Float64(0.5 / Float64(b + a)) * pi) / Float64(a * b)) end
function tmp = code(a, b) tmp = ((0.5 / (b + a)) * pi) / (a * b); end
code[a_, b_] := N[(N[(N[(0.5 / N[(b + a), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision] / N[(a * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{0.5}{b + a} \cdot \pi}{a \cdot b}
\end{array}
Initial program 78.6%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites87.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
Taylor expanded in a around 0
lower-PI.f6499.6
Applied rewrites99.6%
(FPCore (a b) :precision binary64 (if (<= b 2.4e+106) (/ (* 0.5 PI) (* (* (+ b a) b) a)) (/ (/ (* PI 0.5) (* a b)) b)))
double code(double a, double b) {
double tmp;
if (b <= 2.4e+106) {
tmp = (0.5 * ((double) M_PI)) / (((b + a) * b) * a);
} else {
tmp = ((((double) M_PI) * 0.5) / (a * b)) / b;
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 2.4e+106) {
tmp = (0.5 * Math.PI) / (((b + a) * b) * a);
} else {
tmp = ((Math.PI * 0.5) / (a * b)) / b;
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 2.4e+106: tmp = (0.5 * math.pi) / (((b + a) * b) * a) else: tmp = ((math.pi * 0.5) / (a * b)) / b return tmp
function code(a, b) tmp = 0.0 if (b <= 2.4e+106) tmp = Float64(Float64(0.5 * pi) / Float64(Float64(Float64(b + a) * b) * a)); else tmp = Float64(Float64(Float64(pi * 0.5) / Float64(a * b)) / b); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 2.4e+106) tmp = (0.5 * pi) / (((b + a) * b) * a); else tmp = ((pi * 0.5) / (a * b)) / b; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 2.4e+106], N[(N[(0.5 * Pi), $MachinePrecision] / N[(N[(N[(b + a), $MachinePrecision] * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi * 0.5), $MachinePrecision] / N[(a * b), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.4 \cdot 10^{+106}:\\
\;\;\;\;\frac{0.5 \cdot \pi}{\left(\left(b + a\right) \cdot b\right) \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi \cdot 0.5}{a \cdot b}}{b}\\
\end{array}
\end{array}
if b < 2.4000000000000001e106Initial program 78.6%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites87.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squaresN/A
associate-/r/N/A
lift--.f64N/A
flip-+N/A
lift-+.f64N/A
lower-/.f6499.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
Applied rewrites99.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6493.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.1
Applied rewrites93.1%
if 2.4000000000000001e106 < b Initial program 78.6%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-pow.f6456.9
Applied rewrites56.9%
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6462.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.7
Applied rewrites62.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
(FPCore (a b) :precision binary64 (if (<= b 2.2e+106) (* PI (/ 0.5 (* (* (+ b a) b) a))) (/ (/ (* PI 0.5) (* a b)) b)))
double code(double a, double b) {
double tmp;
if (b <= 2.2e+106) {
tmp = ((double) M_PI) * (0.5 / (((b + a) * b) * a));
} else {
tmp = ((((double) M_PI) * 0.5) / (a * b)) / b;
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 2.2e+106) {
tmp = Math.PI * (0.5 / (((b + a) * b) * a));
} else {
tmp = ((Math.PI * 0.5) / (a * b)) / b;
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 2.2e+106: tmp = math.pi * (0.5 / (((b + a) * b) * a)) else: tmp = ((math.pi * 0.5) / (a * b)) / b return tmp
function code(a, b) tmp = 0.0 if (b <= 2.2e+106) tmp = Float64(pi * Float64(0.5 / Float64(Float64(Float64(b + a) * b) * a))); else tmp = Float64(Float64(Float64(pi * 0.5) / Float64(a * b)) / b); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 2.2e+106) tmp = pi * (0.5 / (((b + a) * b) * a)); else tmp = ((pi * 0.5) / (a * b)) / b; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 2.2e+106], N[(Pi * N[(0.5 / N[(N[(N[(b + a), $MachinePrecision] * b), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi * 0.5), $MachinePrecision] / N[(a * b), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.2 \cdot 10^{+106}:\\
\;\;\;\;\pi \cdot \frac{0.5}{\left(\left(b + a\right) \cdot b\right) \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi \cdot 0.5}{a \cdot b}}{b}\\
\end{array}
\end{array}
if b < 2.19999999999999992e106Initial program 78.6%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites87.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squaresN/A
associate-/r/N/A
lift--.f64N/A
flip-+N/A
lift-+.f64N/A
lower-/.f6499.7
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.7
Applied rewrites99.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6493.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6493.1
Applied rewrites93.1%
if 2.19999999999999992e106 < b Initial program 78.6%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-pow.f6456.9
Applied rewrites56.9%
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6462.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.7
Applied rewrites62.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
(FPCore (a b) :precision binary64 (if (<= b 3e-87) (/ (* 0.5 (/ PI a)) (* a b)) (/ (/ (* PI 0.5) (* a b)) b)))
double code(double a, double b) {
double tmp;
if (b <= 3e-87) {
tmp = (0.5 * (((double) M_PI) / a)) / (a * b);
} else {
tmp = ((((double) M_PI) * 0.5) / (a * b)) / b;
}
return tmp;
}
public static double code(double a, double b) {
double tmp;
if (b <= 3e-87) {
tmp = (0.5 * (Math.PI / a)) / (a * b);
} else {
tmp = ((Math.PI * 0.5) / (a * b)) / b;
}
return tmp;
}
def code(a, b): tmp = 0 if b <= 3e-87: tmp = (0.5 * (math.pi / a)) / (a * b) else: tmp = ((math.pi * 0.5) / (a * b)) / b return tmp
function code(a, b) tmp = 0.0 if (b <= 3e-87) tmp = Float64(Float64(0.5 * Float64(pi / a)) / Float64(a * b)); else tmp = Float64(Float64(Float64(pi * 0.5) / Float64(a * b)) / b); end return tmp end
function tmp_2 = code(a, b) tmp = 0.0; if (b <= 3e-87) tmp = (0.5 * (pi / a)) / (a * b); else tmp = ((pi * 0.5) / (a * b)) / b; end tmp_2 = tmp; end
code[a_, b_] := If[LessEqual[b, 3e-87], N[(N[(0.5 * N[(Pi / a), $MachinePrecision]), $MachinePrecision] / N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi * 0.5), $MachinePrecision] / N[(a * b), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-87}:\\
\;\;\;\;\frac{0.5 \cdot \frac{\pi}{a}}{a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\pi \cdot 0.5}{a \cdot b}}{b}\\
\end{array}
\end{array}
if b < 3.00000000000000016e-87Initial program 78.6%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-subN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites87.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f6462.8
Applied rewrites62.8%
if 3.00000000000000016e-87 < b Initial program 78.6%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-pow.f6456.9
Applied rewrites56.9%
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6462.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.7
Applied rewrites62.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
(FPCore (a b) :precision binary64 (/ (/ (* PI 0.5) (* a b)) b))
double code(double a, double b) {
return ((((double) M_PI) * 0.5) / (a * b)) / b;
}
public static double code(double a, double b) {
return ((Math.PI * 0.5) / (a * b)) / b;
}
def code(a, b): return ((math.pi * 0.5) / (a * b)) / b
function code(a, b) return Float64(Float64(Float64(pi * 0.5) / Float64(a * b)) / b) end
function tmp = code(a, b) tmp = ((pi * 0.5) / (a * b)) / b; end
code[a_, b_] := N[(N[(N[(Pi * 0.5), $MachinePrecision] / N[(a * b), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\pi \cdot 0.5}{a \cdot b}}{b}
\end{array}
Initial program 78.6%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-pow.f6456.9
Applied rewrites56.9%
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6462.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.7
Applied rewrites62.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
(FPCore (a b) :precision binary64 (* (/ PI (* a b)) (/ 0.5 b)))
double code(double a, double b) {
return (((double) M_PI) / (a * b)) * (0.5 / b);
}
public static double code(double a, double b) {
return (Math.PI / (a * b)) * (0.5 / b);
}
def code(a, b): return (math.pi / (a * b)) * (0.5 / b)
function code(a, b) return Float64(Float64(pi / Float64(a * b)) * Float64(0.5 / b)) end
function tmp = code(a, b) tmp = (pi / (a * b)) * (0.5 / b); end
code[a_, b_] := N[(N[(Pi / N[(a * b), $MachinePrecision]), $MachinePrecision] * N[(0.5 / b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\pi}{a \cdot b} \cdot \frac{0.5}{b}
\end{array}
Initial program 78.6%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-pow.f6456.9
Applied rewrites56.9%
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6462.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.7
Applied rewrites62.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f64N/A
lower-/.f6462.9
Applied rewrites62.9%
(FPCore (a b) :precision binary64 (* PI (/ 0.5 (* (* a b) b))))
double code(double a, double b) {
return ((double) M_PI) * (0.5 / ((a * b) * b));
}
public static double code(double a, double b) {
return Math.PI * (0.5 / ((a * b) * b));
}
def code(a, b): return math.pi * (0.5 / ((a * b) * b))
function code(a, b) return Float64(pi * Float64(0.5 / Float64(Float64(a * b) * b))) end
function tmp = code(a, b) tmp = pi * (0.5 / ((a * b) * b)); end
code[a_, b_] := N[(Pi * N[(0.5 / N[(N[(a * b), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\pi \cdot \frac{0.5}{\left(a \cdot b\right) \cdot b}
\end{array}
Initial program 78.6%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-pow.f6456.9
Applied rewrites56.9%
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6462.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.7
Applied rewrites62.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6462.7
lift-*.f64N/A
*-commutativeN/A
lift-*.f6462.7
Applied rewrites62.7%
(FPCore (a b) :precision binary64 (* 0.5 (/ PI (* (* b a) b))))
double code(double a, double b) {
return 0.5 * (((double) M_PI) / ((b * a) * b));
}
public static double code(double a, double b) {
return 0.5 * (Math.PI / ((b * a) * b));
}
def code(a, b): return 0.5 * (math.pi / ((b * a) * b))
function code(a, b) return Float64(0.5 * Float64(pi / Float64(Float64(b * a) * b))) end
function tmp = code(a, b) tmp = 0.5 * (pi / ((b * a) * b)); end
code[a_, b_] := N[(0.5 * N[(Pi / N[(N[(b * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \frac{\pi}{\left(b \cdot a\right) \cdot b}
\end{array}
Initial program 78.6%
Taylor expanded in a around 0
lower-*.f64N/A
lower-/.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-pow.f6456.9
Applied rewrites56.9%
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6462.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.7
Applied rewrites62.7%
herbie shell --seed 2025150
(FPCore (a b)
:name "NMSE Section 6.1 mentioned, B"
:precision binary64
(* (* (/ PI 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))