
(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%
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.8%
Simplified99.8%
(FPCore (B x) :precision binary64 (if (<= x -4.2e-8) (/ (- 1.0 x) (tan B)) (if (<= x 5.3e-5) (/ 1.0 (sin B)) (- (/ 1.0 B) (/ x (tan B))))))
double code(double B, double x) {
double tmp;
if (x <= -4.2e-8) {
tmp = (1.0 - x) / tan(B);
} else if (x <= 5.3e-5) {
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 <= (-4.2d-8)) then
tmp = (1.0d0 - x) / tan(b)
else if (x <= 5.3d-5) 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 <= -4.2e-8) {
tmp = (1.0 - x) / Math.tan(B);
} else if (x <= 5.3e-5) {
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 <= -4.2e-8: tmp = (1.0 - x) / math.tan(B) elif x <= 5.3e-5: 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 <= -4.2e-8) tmp = Float64(Float64(1.0 - x) / tan(B)); elseif (x <= 5.3e-5) 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 <= -4.2e-8) tmp = (1.0 - x) / tan(B); elseif (x <= 5.3e-5) tmp = 1.0 / sin(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[B_, x_] := If[LessEqual[x, -4.2e-8], N[(N[(1.0 - x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.3e-5], 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 -4.2 \cdot 10^{-8}:\\
\;\;\;\;\frac{1 - x}{\tan B}\\
\mathbf{elif}\;x \leq 5.3 \cdot 10^{-5}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if x < -4.19999999999999989e-8Initial program 99.5%
distribute-lft-neg-inN/A
un-div-invN/A
*-lft-identityN/A
associate-/r*N/A
/-rgt-identityN/A
frac-addN/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Applied egg-rr99.7%
Taylor expanded in B around 0
--lowering--.f6496.6%
Simplified96.6%
if -4.19999999999999989e-8 < x < 5.3000000000000001e-5Initial program 99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
if 5.3000000000000001e-5 < x Initial program 99.6%
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.8%
Simplified99.8%
Taylor expanded in B around 0
/-lowering-/.f6498.9%
Simplified98.9%
(FPCore (B x) :precision binary64 (let* ((t_0 (/ (- 1.0 x) (tan B)))) (if (<= x -8.2e-9) t_0 (if (<= x 3.7e-8) (/ 1.0 (sin B)) t_0))))
double code(double B, double x) {
double t_0 = (1.0 - x) / tan(B);
double tmp;
if (x <= -8.2e-9) {
tmp = t_0;
} else if (x <= 3.7e-8) {
tmp = 1.0 / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = (1.0d0 - x) / tan(b)
if (x <= (-8.2d-9)) then
tmp = t_0
else if (x <= 3.7d-8) then
tmp = 1.0d0 / sin(b)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double B, double x) {
double t_0 = (1.0 - x) / Math.tan(B);
double tmp;
if (x <= -8.2e-9) {
tmp = t_0;
} else if (x <= 3.7e-8) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = t_0;
}
return tmp;
}
def code(B, x): t_0 = (1.0 - x) / math.tan(B) tmp = 0 if x <= -8.2e-9: tmp = t_0 elif x <= 3.7e-8: tmp = 1.0 / math.sin(B) else: tmp = t_0 return tmp
function code(B, x) t_0 = Float64(Float64(1.0 - x) / tan(B)) tmp = 0.0 if (x <= -8.2e-9) tmp = t_0; elseif (x <= 3.7e-8) tmp = Float64(1.0 / sin(B)); else tmp = t_0; end return tmp end
function tmp_2 = code(B, x) t_0 = (1.0 - x) / tan(B); tmp = 0.0; if (x <= -8.2e-9) tmp = t_0; elseif (x <= 3.7e-8) tmp = 1.0 / sin(B); else tmp = t_0; end tmp_2 = tmp; end
code[B_, x_] := Block[{t$95$0 = N[(N[(1.0 - x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.2e-9], t$95$0, If[LessEqual[x, 3.7e-8], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1 - x}{\tan B}\\
\mathbf{if}\;x \leq -8.2 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-8}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -8.2000000000000006e-9 or 3.7e-8 < x Initial program 99.6%
distribute-lft-neg-inN/A
un-div-invN/A
*-lft-identityN/A
associate-/r*N/A
/-rgt-identityN/A
frac-addN/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Applied egg-rr99.7%
Taylor expanded in B around 0
--lowering--.f6497.8%
Simplified97.8%
if -8.2000000000000006e-9 < x < 3.7e-8Initial program 99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
(FPCore (B x) :precision binary64 (let* ((t_0 (/ (- 0.0 x) (tan B)))) (if (<= x -1.7) t_0 (if (<= x 1.0) (/ 1.0 (sin B)) t_0))))
double code(double B, double x) {
double t_0 = (0.0 - x) / tan(B);
double tmp;
if (x <= -1.7) {
tmp = t_0;
} else if (x <= 1.0) {
tmp = 1.0 / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = (0.0d0 - x) / tan(b)
if (x <= (-1.7d0)) then
tmp = t_0
else if (x <= 1.0d0) then
tmp = 1.0d0 / sin(b)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double B, double x) {
double t_0 = (0.0 - x) / Math.tan(B);
double tmp;
if (x <= -1.7) {
tmp = t_0;
} else if (x <= 1.0) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = t_0;
}
return tmp;
}
def code(B, x): t_0 = (0.0 - x) / math.tan(B) tmp = 0 if x <= -1.7: tmp = t_0 elif x <= 1.0: tmp = 1.0 / math.sin(B) else: tmp = t_0 return tmp
function code(B, x) t_0 = Float64(Float64(0.0 - x) / tan(B)) tmp = 0.0 if (x <= -1.7) tmp = t_0; elseif (x <= 1.0) tmp = Float64(1.0 / sin(B)); else tmp = t_0; end return tmp end
function tmp_2 = code(B, x) t_0 = (0.0 - x) / tan(B); tmp = 0.0; if (x <= -1.7) tmp = t_0; elseif (x <= 1.0) tmp = 1.0 / sin(B); else tmp = t_0; end tmp_2 = tmp; end
code[B_, x_] := Block[{t$95$0 = N[(N[(0.0 - x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7], t$95$0, If[LessEqual[x, 1.0], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0 - x}{\tan B}\\
\mathbf{if}\;x \leq -1.7:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.69999999999999996 or 1 < x Initial program 99.6%
+-commutativeN/A
div-invN/A
sub-negN/A
clear-numN/A
frac-2negN/A
metadata-evalN/A
frac-subN/A
associate-/r*N/A
div-invN/A
clear-numN/A
*-lowering-*.f64N/A
Applied egg-rr99.7%
Taylor expanded in x around inf
Simplified97.2%
if -1.69999999999999996 < x < 1Initial program 99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6499.5%
Simplified99.5%
Final simplification98.3%
(FPCore (B x)
:precision binary64
(if (<= B 0.036)
(/
(+
1.0
(-
(*
(* B B)
(+
(*
(* B B)
(+
(* x 0.022222222222222223)
(* B (* B (* x 0.0021164021164021165)))))
(* x 0.3333333333333333)))
x))
B)
(/ 1.0 (sin B))))
double code(double B, double x) {
double tmp;
if (B <= 0.036) {
tmp = (1.0 + (((B * B) * (((B * B) * ((x * 0.022222222222222223) + (B * (B * (x * 0.0021164021164021165))))) + (x * 0.3333333333333333))) - 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.036d0) then
tmp = (1.0d0 + (((b * b) * (((b * b) * ((x * 0.022222222222222223d0) + (b * (b * (x * 0.0021164021164021165d0))))) + (x * 0.3333333333333333d0))) - 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.036) {
tmp = (1.0 + (((B * B) * (((B * B) * ((x * 0.022222222222222223) + (B * (B * (x * 0.0021164021164021165))))) + (x * 0.3333333333333333))) - x)) / B;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(B, x): tmp = 0 if B <= 0.036: tmp = (1.0 + (((B * B) * (((B * B) * ((x * 0.022222222222222223) + (B * (B * (x * 0.0021164021164021165))))) + (x * 0.3333333333333333))) - x)) / B else: tmp = 1.0 / math.sin(B) return tmp
function code(B, x) tmp = 0.0 if (B <= 0.036) tmp = Float64(Float64(1.0 + Float64(Float64(Float64(B * B) * Float64(Float64(Float64(B * B) * Float64(Float64(x * 0.022222222222222223) + Float64(B * Float64(B * Float64(x * 0.0021164021164021165))))) + Float64(x * 0.3333333333333333))) - 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.036) tmp = (1.0 + (((B * B) * (((B * B) * ((x * 0.022222222222222223) + (B * (B * (x * 0.0021164021164021165))))) + (x * 0.3333333333333333))) - x)) / B; else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[B_, x_] := If[LessEqual[B, 0.036], N[(N[(1.0 + N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(x * 0.022222222222222223), $MachinePrecision] + N[(B * N[(B * N[(x * 0.0021164021164021165), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.036:\\
\;\;\;\;\frac{1 + \left(\left(B \cdot B\right) \cdot \left(\left(B \cdot B\right) \cdot \left(x \cdot 0.022222222222222223 + B \cdot \left(B \cdot \left(x \cdot 0.0021164021164021165\right)\right)\right) + x \cdot 0.3333333333333333\right) - x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if B < 0.0359999999999999973Initial program 99.7%
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.8%
Simplified99.8%
div-invN/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in B around 0
/-lowering-/.f6481.2%
Simplified81.2%
Taylor expanded in B around 0
Simplified66.1%
if 0.0359999999999999973 < B Initial program 99.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6452.2%
Simplified52.2%
(FPCore (B x) :precision binary64 (let* ((t_0 (- 0.0 (/ x B)))) (if (<= x -4.9e-11) t_0 (if (<= x 1.0) (/ 1.0 B) t_0))))
double code(double B, double x) {
double t_0 = 0.0 - (x / B);
double tmp;
if (x <= -4.9e-11) {
tmp = t_0;
} else if (x <= 1.0) {
tmp = 1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(b, x)
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = 0.0d0 - (x / b)
if (x <= (-4.9d-11)) then
tmp = t_0
else if (x <= 1.0d0) then
tmp = 1.0d0 / b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double B, double x) {
double t_0 = 0.0 - (x / B);
double tmp;
if (x <= -4.9e-11) {
tmp = t_0;
} else if (x <= 1.0) {
tmp = 1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(B, x): t_0 = 0.0 - (x / B) tmp = 0 if x <= -4.9e-11: tmp = t_0 elif x <= 1.0: tmp = 1.0 / B else: tmp = t_0 return tmp
function code(B, x) t_0 = Float64(0.0 - Float64(x / B)) tmp = 0.0 if (x <= -4.9e-11) tmp = t_0; elseif (x <= 1.0) tmp = Float64(1.0 / B); else tmp = t_0; end return tmp end
function tmp_2 = code(B, x) t_0 = 0.0 - (x / B); tmp = 0.0; if (x <= -4.9e-11) tmp = t_0; elseif (x <= 1.0) tmp = 1.0 / B; else tmp = t_0; end tmp_2 = tmp; end
code[B_, x_] := Block[{t$95$0 = N[(0.0 - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.9e-11], t$95$0, If[LessEqual[x, 1.0], N[(1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0 - \frac{x}{B}\\
\mathbf{if}\;x \leq -4.9 \cdot 10^{-11}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;\frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -4.8999999999999999e-11 or 1 < x Initial program 99.6%
Taylor expanded in B around 0
/-lowering-/.f64N/A
--lowering--.f6456.9%
Simplified56.9%
Taylor expanded in x around inf
associate-*r/N/A
mul-1-negN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f6456.3%
Simplified56.3%
if -4.8999999999999999e-11 < x < 1Initial program 99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6499.8%
Simplified99.8%
Taylor expanded in B around 0
/-lowering-/.f6449.2%
Simplified49.2%
Final simplification53.0%
(FPCore (B x) :precision binary64 (if (<= x -5.1e+39) (/ B (* B B)) (/ 1.0 B)))
double code(double B, double x) {
double tmp;
if (x <= -5.1e+39) {
tmp = B / (B * 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.1d+39)) then
tmp = b / (b * 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.1e+39) {
tmp = B / (B * B);
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(B, x): tmp = 0 if x <= -5.1e+39: tmp = B / (B * B) else: tmp = 1.0 / B return tmp
function code(B, x) tmp = 0.0 if (x <= -5.1e+39) tmp = Float64(B / Float64(B * B)); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(B, x) tmp = 0.0; if (x <= -5.1e+39) tmp = B / (B * B); else tmp = 1.0 / B; end tmp_2 = tmp; end
code[B_, x_] := If[LessEqual[x, -5.1e+39], N[(B / N[(B * B), $MachinePrecision]), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.1 \cdot 10^{+39}:\\
\;\;\;\;\frac{B}{B \cdot B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if x < -5.0999999999999998e39Initial program 99.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f644.4%
Simplified4.4%
Taylor expanded in B around 0
/-lowering-/.f644.3%
Simplified4.3%
*-inversesN/A
associate-/r*N/A
/-lowering-/.f64N/A
*-lowering-*.f6424.9%
Applied egg-rr24.9%
if -5.0999999999999998e39 < x Initial program 99.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6460.8%
Simplified60.8%
Taylor expanded in B around 0
/-lowering-/.f6429.9%
Simplified29.9%
(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
/-lowering-/.f64N/A
--lowering--.f6453.3%
Simplified53.3%
(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 x around 0
/-lowering-/.f64N/A
sin-lowering-sin.f6448.7%
Simplified48.7%
Taylor expanded in B around 0
/-lowering-/.f6424.4%
Simplified24.4%
herbie shell --seed 2024164
(FPCore (B x)
:name "VandenBroeck and Keller, Equation (24)"
:precision binary64
(+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))