
(FPCore (B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))
double code(double B, double x) {
return -(x * (1.0 / tan(B))) + (1.0 / sin(B));
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + (1.0d0 / sin(b))
end function
public static double code(double B, double x) {
return -(x * (1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
def code(B, x): return -(x * (1.0 / math.tan(B))) + (1.0 / math.sin(B))
function code(B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(1.0 / sin(B))) end
function tmp = code(B, x) tmp = -(x * (1.0 / tan(B))) + (1.0 / sin(B)); end
code[B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))
double code(double B, double x) {
return -(x * (1.0 / tan(B))) + (1.0 / sin(B));
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + (1.0d0 / sin(b))
end function
public static double code(double B, double x) {
return -(x * (1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
def code(B, x): return -(x * (1.0 / math.tan(B))) + (1.0 / math.sin(B))
function code(B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(1.0 / sin(B))) end
function tmp = code(B, x) tmp = -(x * (1.0 / tan(B))) + (1.0 / sin(B)); end
code[B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}
\end{array}
(FPCore (B x) :precision binary64 (- (/ 1.0 (sin B)) (/ x (tan B))))
double code(double B, double x) {
return (1.0 / sin(B)) - (x / tan(B));
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (1.0d0 / sin(b)) - (x / tan(b))
end function
public static double code(double B, double x) {
return (1.0 / Math.sin(B)) - (x / Math.tan(B));
}
def code(B, x): return (1.0 / math.sin(B)) - (x / math.tan(B))
function code(B, x) return Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))) end
function tmp = code(B, x) tmp = (1.0 / sin(B)) - (x / tan(B)); end
code[B_, x_] := N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\sin B} - \frac{x}{\tan B}
\end{array}
Initial program 99.7%
distribute-lft-neg-in99.7%
+-commutative99.7%
*-commutative99.7%
remove-double-neg99.7%
distribute-frac-neg299.7%
tan-neg99.7%
cancel-sign-sub-inv99.7%
*-commutative99.7%
associate-*r/99.8%
*-rgt-identity99.8%
tan-neg99.8%
distribute-neg-frac299.8%
distribute-neg-frac99.8%
remove-double-neg99.8%
Simplified99.8%
(FPCore (B x) :precision binary64 (if (<= x -1.2) (* x (/ (cos B) (- (sin B)))) (if (<= x 6.8e-7) (/ 1.0 (sin B)) (- (/ 1.0 B) (/ x (tan B))))))
double code(double B, double x) {
double tmp;
if (x <= -1.2) {
tmp = x * (cos(B) / -sin(B));
} else if (x <= 6.8e-7) {
tmp = 1.0 / sin(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-1.2d0)) then
tmp = x * (cos(b) / -sin(b))
else if (x <= 6.8d-7) then
tmp = 1.0d0 / sin(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double B, double x) {
double tmp;
if (x <= -1.2) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (x <= 6.8e-7) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(B, x): tmp = 0 if x <= -1.2: tmp = x * (math.cos(B) / -math.sin(B)) elif x <= 6.8e-7: tmp = 1.0 / math.sin(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(B, x) tmp = 0.0 if (x <= -1.2) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (x <= 6.8e-7) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(B, x) tmp = 0.0; if (x <= -1.2) tmp = x * (cos(B) / -sin(B)); elseif (x <= 6.8e-7) tmp = 1.0 / sin(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[B_, x_] := If[LessEqual[x, -1.2], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.8e-7], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if x < -1.19999999999999996Initial program 99.7%
Taylor expanded in x around inf 99.1%
mul-1-neg99.1%
associate-/l*99.2%
distribute-rgt-neg-in99.2%
distribute-neg-frac299.2%
Simplified99.2%
if -1.19999999999999996 < x < 6.79999999999999948e-7Initial program 99.8%
Taylor expanded in x around 0 98.0%
if 6.79999999999999948e-7 < x Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
*-commutative99.5%
remove-double-neg99.5%
distribute-frac-neg299.5%
tan-neg99.5%
cancel-sign-sub-inv99.5%
*-commutative99.5%
associate-*r/99.9%
*-rgt-identity99.9%
tan-neg99.9%
distribute-neg-frac299.9%
distribute-neg-frac99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in B around 0 99.4%
(FPCore (B x) :precision binary64 (if (<= x -1.75) (/ -1.0 (/ (tan B) x)) (if (<= x 1.8e-6) (/ 1.0 (sin B)) (- (/ 1.0 B) (/ x (tan B))))))
double code(double B, double x) {
double tmp;
if (x <= -1.75) {
tmp = -1.0 / (tan(B) / x);
} else if (x <= 1.8e-6) {
tmp = 1.0 / sin(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-1.75d0)) then
tmp = (-1.0d0) / (tan(b) / x)
else if (x <= 1.8d-6) then
tmp = 1.0d0 / sin(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double B, double x) {
double tmp;
if (x <= -1.75) {
tmp = -1.0 / (Math.tan(B) / x);
} else if (x <= 1.8e-6) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(B, x): tmp = 0 if x <= -1.75: tmp = -1.0 / (math.tan(B) / x) elif x <= 1.8e-6: tmp = 1.0 / math.sin(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(B, x) tmp = 0.0 if (x <= -1.75) tmp = Float64(-1.0 / Float64(tan(B) / x)); elseif (x <= 1.8e-6) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(B, x) tmp = 0.0; if (x <= -1.75) tmp = -1.0 / (tan(B) / x); elseif (x <= 1.8e-6) tmp = 1.0 / sin(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[B_, x_] := If[LessEqual[x, -1.75], N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e-6], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if x < -1.75Initial program 99.7%
Taylor expanded in x around inf 99.1%
mul-1-neg99.1%
associate-/l*99.2%
distribute-rgt-neg-in99.2%
distribute-neg-frac299.2%
Simplified99.2%
distribute-frac-neg299.2%
clear-num99.1%
tan-quot99.1%
neg-sub099.1%
Applied egg-rr99.1%
neg-sub099.1%
distribute-neg-frac99.1%
metadata-eval99.1%
Simplified99.1%
div-inv99.1%
mul-1-neg99.1%
distribute-rgt-neg-in99.1%
div-inv99.1%
remove-double-div99.1%
distribute-neg-frac99.1%
metadata-eval99.1%
clear-num99.2%
Applied egg-rr99.2%
if -1.75 < x < 1.79999999999999992e-6Initial program 99.8%
Taylor expanded in x around 0 98.0%
if 1.79999999999999992e-6 < x Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
*-commutative99.5%
remove-double-neg99.5%
distribute-frac-neg299.5%
tan-neg99.5%
cancel-sign-sub-inv99.5%
*-commutative99.5%
associate-*r/99.9%
*-rgt-identity99.9%
tan-neg99.9%
distribute-neg-frac299.9%
distribute-neg-frac99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in B around 0 99.4%
(FPCore (B x) :precision binary64 (if (or (<= x -2.0) (not (<= x 1.05))) (/ (- x) (tan B)) (/ 1.0 (sin B))))
double code(double B, double x) {
double tmp;
if ((x <= -2.0) || !(x <= 1.05)) {
tmp = -x / tan(B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-2.0d0)) .or. (.not. (x <= 1.05d0))) then
tmp = -x / tan(b)
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double B, double x) {
double tmp;
if ((x <= -2.0) || !(x <= 1.05)) {
tmp = -x / Math.tan(B);
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(B, x): tmp = 0 if (x <= -2.0) or not (x <= 1.05): tmp = -x / math.tan(B) else: tmp = 1.0 / math.sin(B) return tmp
function code(B, x) tmp = 0.0 if ((x <= -2.0) || !(x <= 1.05)) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(B, x) tmp = 0.0; if ((x <= -2.0) || ~((x <= 1.05))) tmp = -x / tan(B); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[B_, x_] := If[Or[LessEqual[x, -2.0], N[Not[LessEqual[x, 1.05]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \lor \neg \left(x \leq 1.05\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if x < -2 or 1.05000000000000004 < x Initial program 99.6%
Taylor expanded in x around inf 97.6%
mul-1-neg97.6%
associate-/l*97.6%
distribute-rgt-neg-in97.6%
distribute-neg-frac297.6%
Simplified97.6%
distribute-frac-neg297.6%
clear-num97.5%
tan-quot97.5%
neg-sub097.5%
Applied egg-rr97.5%
neg-sub097.5%
distribute-neg-frac97.5%
metadata-eval97.5%
Simplified97.5%
associate-*r/97.7%
*-commutative97.7%
neg-mul-197.7%
Applied egg-rr97.7%
if -2 < x < 1.05000000000000004Initial program 99.8%
Taylor expanded in x around 0 98.0%
Final simplification97.9%
(FPCore (B x) :precision binary64 (if (<= x -1.7) (/ -1.0 (/ (tan B) x)) (if (<= x 1.0) (/ 1.0 (sin B)) (/ (- x) (tan B)))))
double code(double B, double x) {
double tmp;
if (x <= -1.7) {
tmp = -1.0 / (tan(B) / x);
} else if (x <= 1.0) {
tmp = 1.0 / sin(B);
} else {
tmp = -x / tan(B);
}
return tmp;
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-1.7d0)) then
tmp = (-1.0d0) / (tan(b) / x)
else if (x <= 1.0d0) then
tmp = 1.0d0 / sin(b)
else
tmp = -x / tan(b)
end if
code = tmp
end function
public static double code(double B, double x) {
double tmp;
if (x <= -1.7) {
tmp = -1.0 / (Math.tan(B) / x);
} else if (x <= 1.0) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = -x / Math.tan(B);
}
return tmp;
}
def code(B, x): tmp = 0 if x <= -1.7: tmp = -1.0 / (math.tan(B) / x) elif x <= 1.0: tmp = 1.0 / math.sin(B) else: tmp = -x / math.tan(B) return tmp
function code(B, x) tmp = 0.0 if (x <= -1.7) tmp = Float64(-1.0 / Float64(tan(B) / x)); elseif (x <= 1.0) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
function tmp_2 = code(B, x) tmp = 0.0; if (x <= -1.7) tmp = -1.0 / (tan(B) / x); elseif (x <= 1.0) tmp = 1.0 / sin(B); else tmp = -x / tan(B); end tmp_2 = tmp; end
code[B_, x_] := If[LessEqual[x, -1.7], N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.0], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if x < -1.69999999999999996Initial program 99.7%
Taylor expanded in x around inf 99.1%
mul-1-neg99.1%
associate-/l*99.2%
distribute-rgt-neg-in99.2%
distribute-neg-frac299.2%
Simplified99.2%
distribute-frac-neg299.2%
clear-num99.1%
tan-quot99.1%
neg-sub099.1%
Applied egg-rr99.1%
neg-sub099.1%
distribute-neg-frac99.1%
metadata-eval99.1%
Simplified99.1%
div-inv99.1%
mul-1-neg99.1%
distribute-rgt-neg-in99.1%
div-inv99.1%
remove-double-div99.1%
distribute-neg-frac99.1%
metadata-eval99.1%
clear-num99.2%
Applied egg-rr99.2%
if -1.69999999999999996 < x < 1Initial program 99.8%
Taylor expanded in x around 0 98.0%
if 1 < x Initial program 99.5%
Taylor expanded in x around inf 96.3%
mul-1-neg96.3%
associate-/l*96.2%
distribute-rgt-neg-in96.2%
distribute-neg-frac296.2%
Simplified96.2%
distribute-frac-neg296.2%
clear-num96.2%
tan-quot96.2%
neg-sub096.2%
Applied egg-rr96.2%
neg-sub096.2%
distribute-neg-frac96.2%
metadata-eval96.2%
Simplified96.2%
associate-*r/96.5%
*-commutative96.5%
neg-mul-196.5%
Applied egg-rr96.5%
(FPCore (B x) :precision binary64 (if (<= B 0.00031) (/ (- 1.0 x) B) (/ 1.0 (sin B))))
double code(double B, double x) {
double tmp;
if (B <= 0.00031) {
tmp = (1.0 - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (b <= 0.00031d0) then
tmp = (1.0d0 - x) / b
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double B, double x) {
double tmp;
if (B <= 0.00031) {
tmp = (1.0 - x) / B;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(B, x): tmp = 0 if B <= 0.00031: tmp = (1.0 - x) / B else: tmp = 1.0 / math.sin(B) return tmp
function code(B, x) tmp = 0.0 if (B <= 0.00031) tmp = Float64(Float64(1.0 - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(B, x) tmp = 0.0; if (B <= 0.00031) tmp = (1.0 - x) / B; else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[B_, x_] := If[LessEqual[B, 0.00031], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.00031:\\
\;\;\;\;\frac{1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if B < 3.1e-4Initial program 99.7%
Taylor expanded in B around 0 66.4%
if 3.1e-4 < B Initial program 99.5%
Taylor expanded in x around 0 56.0%
(FPCore (B x) :precision binary64 (if (or (<= x -5.8e+26) (not (<= x 6.5e-12))) (/ x (- B)) (/ 1.0 B)))
double code(double B, double x) {
double tmp;
if ((x <= -5.8e+26) || !(x <= 6.5e-12)) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-5.8d+26)) .or. (.not. (x <= 6.5d-12))) then
tmp = x / -b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double B, double x) {
double tmp;
if ((x <= -5.8e+26) || !(x <= 6.5e-12)) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(B, x): tmp = 0 if (x <= -5.8e+26) or not (x <= 6.5e-12): tmp = x / -B else: tmp = 1.0 / B return tmp
function code(B, x) tmp = 0.0 if ((x <= -5.8e+26) || !(x <= 6.5e-12)) tmp = Float64(x / Float64(-B)); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(B, x) tmp = 0.0; if ((x <= -5.8e+26) || ~((x <= 6.5e-12))) tmp = x / -B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[B_, x_] := If[Or[LessEqual[x, -5.8e+26], N[Not[LessEqual[x, 6.5e-12]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+26} \lor \neg \left(x \leq 6.5 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if x < -5.8e26 or 6.5000000000000002e-12 < x Initial program 99.6%
Taylor expanded in B around 0 53.3%
Taylor expanded in x around inf 51.8%
neg-mul-151.8%
distribute-neg-frac251.8%
Simplified51.8%
if -5.8e26 < x < 6.5000000000000002e-12Initial program 99.8%
Taylor expanded in B around 0 50.6%
Taylor expanded in x around 0 50.3%
Final simplification51.1%
(FPCore (B x) :precision binary64 (/ (- 1.0 x) B))
double code(double B, double x) {
return (1.0 - x) / B;
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (1.0d0 - x) / b
end function
public static double code(double B, double x) {
return (1.0 - x) / B;
}
def code(B, x): return (1.0 - x) / B
function code(B, x) return Float64(Float64(1.0 - x) / B) end
function tmp = code(B, x) tmp = (1.0 - x) / B; end
code[B_, x_] := N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 - x}{B}
\end{array}
Initial program 99.7%
Taylor expanded in B around 0 52.0%
(FPCore (B x) :precision binary64 (/ 1.0 B))
double code(double B, double x) {
return 1.0 / B;
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
code = 1.0d0 / b
end function
public static double code(double B, double x) {
return 1.0 / B;
}
def code(B, x): return 1.0 / B
function code(B, x) return Float64(1.0 / B) end
function tmp = code(B, x) tmp = 1.0 / B; end
code[B_, x_] := N[(1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{B}
\end{array}
Initial program 99.7%
Taylor expanded in B around 0 52.0%
Taylor expanded in x around 0 25.5%
herbie shell --seed 2024096
(FPCore (B x)
:name "VandenBroeck and Keller, Equation (24)"
:precision binary64
(+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))