
(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));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(b, x)
use fmin_fmax_functions
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 11 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));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(b, x)
use fmin_fmax_functions
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 (+ (/ (- x) (tan B)) (/ 1.0 (sin B))))
double code(double B, double x) {
return (-x / tan(B)) + (1.0 / sin(B));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(b, x)
use fmin_fmax_functions
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-x / tan(b)) + (1.0d0 / sin(b))
end function
public static double code(double B, double x) {
return (-x / Math.tan(B)) + (1.0 / Math.sin(B));
}
def code(B, x): return (-x / math.tan(B)) + (1.0 / math.sin(B))
function code(B, x) return Float64(Float64(Float64(-x) / tan(B)) + Float64(1.0 / sin(B))) end
function tmp = code(B, x) tmp = (-x / tan(B)) + (1.0 / sin(B)); end
code[B_, x_] := N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{\tan B} + \frac{1}{\sin B}
\end{array}
Initial program 99.8%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.8
Applied rewrites99.8%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-neg-fracN/A
*-rgt-identityN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift-tan.f6499.8
Applied rewrites99.8%
(FPCore (B x) :precision binary64 (/ (- 1.0 (* (cos B) x)) (sin B)))
double code(double B, double x) {
return (1.0 - (cos(B) * x)) / sin(B);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(b, x)
use fmin_fmax_functions
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (1.0d0 - (cos(b) * x)) / sin(b)
end function
public static double code(double B, double x) {
return (1.0 - (Math.cos(B) * x)) / Math.sin(B);
}
def code(B, x): return (1.0 - (math.cos(B) * x)) / math.sin(B)
function code(B, x) return Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)) end
function tmp = code(B, x) tmp = (1.0 - (cos(B) * x)) / sin(B); end
code[B_, x_] := N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 - \cos B \cdot x}{\sin B}
\end{array}
Initial program 99.8%
Taylor expanded in B around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
(FPCore (B x)
:precision binary64
(if (<= x -0.31)
(+
(/ (- x) (tan B))
(/
1.0
(*
(fma
(-
(* (fma -0.0001984126984126984 (* B B) 0.008333333333333333) (* B B))
0.16666666666666666)
(* B B)
1.0)
B)))
(if (<= x 6e-11)
(+ (- (/ x B)) (/ 1.0 (sin B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))
double code(double B, double x) {
double tmp;
if (x <= -0.31) {
tmp = (-x / tan(B)) + (1.0 / (fma(((fma(-0.0001984126984126984, (B * B), 0.008333333333333333) * (B * B)) - 0.16666666666666666), (B * B), 1.0) * B));
} else if (x <= 6e-11) {
tmp = -(x / B) + (1.0 / sin(B));
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
}
return tmp;
}
function code(B, x) tmp = 0.0 if (x <= -0.31) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(1.0 / Float64(fma(Float64(Float64(fma(-0.0001984126984126984, Float64(B * B), 0.008333333333333333) * Float64(B * B)) - 0.16666666666666666), Float64(B * B), 1.0) * B))); elseif (x <= 6e-11) tmp = Float64(Float64(-Float64(x / B)) + Float64(1.0 / sin(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
code[B_, x_] := If[LessEqual[x, -0.31], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[(N[(N[(N[(-0.0001984126984126984 * N[(B * B), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e-11], N[((-N[(x / B), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.31:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(-0.0001984126984126984, B \cdot B, 0.008333333333333333\right) \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-11}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if x < -0.309999999999999998Initial program 99.7%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.9
Applied rewrites99.9%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-neg-fracN/A
*-rgt-identityN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift-tan.f6499.9
Applied rewrites99.9%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.4%
if -0.309999999999999998 < x < 6e-11Initial program 99.8%
Taylor expanded in B around 0
lower-/.f6498.7
Applied rewrites98.7%
if 6e-11 < x Initial program 99.8%
Taylor expanded in B around 0
Applied rewrites99.3%
Final simplification98.8%
(FPCore (B x)
:precision binary64
(if (<= x -1.36)
(+ (/ (- x) (tan B)) (/ 1.0 B))
(if (<= x 6e-11)
(+ (- (/ x B)) (/ 1.0 (sin B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))
double code(double B, double x) {
double tmp;
if (x <= -1.36) {
tmp = (-x / tan(B)) + (1.0 / B);
} else if (x <= 6e-11) {
tmp = -(x / B) + (1.0 / sin(B));
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(b, x)
use fmin_fmax_functions
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-1.36d0)) then
tmp = (-x / tan(b)) + (1.0d0 / b)
else if (x <= 6d-11) then
tmp = -(x / b) + (1.0d0 / sin(b))
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
end if
code = tmp
end function
public static double code(double B, double x) {
double tmp;
if (x <= -1.36) {
tmp = (-x / Math.tan(B)) + (1.0 / B);
} else if (x <= 6e-11) {
tmp = -(x / B) + (1.0 / Math.sin(B));
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
}
return tmp;
}
def code(B, x): tmp = 0 if x <= -1.36: tmp = (-x / math.tan(B)) + (1.0 / B) elif x <= 6e-11: tmp = -(x / B) + (1.0 / math.sin(B)) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) return tmp
function code(B, x) tmp = 0.0 if (x <= -1.36) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(1.0 / B)); elseif (x <= 6e-11) tmp = Float64(Float64(-Float64(x / B)) + Float64(1.0 / sin(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(B, x) tmp = 0.0; if (x <= -1.36) tmp = (-x / tan(B)) + (1.0 / B); elseif (x <= 6e-11) tmp = -(x / B) + (1.0 / sin(B)); else tmp = (x * (-1.0 / tan(B))) + (1.0 / B); end tmp_2 = tmp; end
code[B_, x_] := If[LessEqual[x, -1.36], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e-11], N[((-N[(x / B), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.36:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{1}{B}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-11}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if x < -1.3600000000000001Initial program 99.7%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.9
Applied rewrites99.9%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-neg-fracN/A
*-rgt-identityN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift-tan.f6499.9
Applied rewrites99.9%
Taylor expanded in B around 0
Applied rewrites98.8%
if -1.3600000000000001 < x < 6e-11Initial program 99.8%
Taylor expanded in B around 0
lower-/.f6498.2
Applied rewrites98.2%
if 6e-11 < x Initial program 99.8%
Taylor expanded in B around 0
Applied rewrites99.3%
Final simplification98.6%
(FPCore (B x) :precision binary64 (if (or (<= x -1.36) (not (<= x 6e-11))) (+ (/ (- x) (tan B)) (/ 1.0 B)) (+ (- (/ x B)) (/ 1.0 (sin B)))))
double code(double B, double x) {
double tmp;
if ((x <= -1.36) || !(x <= 6e-11)) {
tmp = (-x / tan(B)) + (1.0 / B);
} else {
tmp = -(x / B) + (1.0 / sin(B));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(b, x)
use fmin_fmax_functions
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-1.36d0)) .or. (.not. (x <= 6d-11))) then
tmp = (-x / tan(b)) + (1.0d0 / b)
else
tmp = -(x / b) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double B, double x) {
double tmp;
if ((x <= -1.36) || !(x <= 6e-11)) {
tmp = (-x / Math.tan(B)) + (1.0 / B);
} else {
tmp = -(x / B) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(B, x): tmp = 0 if (x <= -1.36) or not (x <= 6e-11): tmp = (-x / math.tan(B)) + (1.0 / B) else: tmp = -(x / B) + (1.0 / math.sin(B)) return tmp
function code(B, x) tmp = 0.0 if ((x <= -1.36) || !(x <= 6e-11)) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(1.0 / B)); else tmp = Float64(Float64(-Float64(x / B)) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(B, x) tmp = 0.0; if ((x <= -1.36) || ~((x <= 6e-11))) tmp = (-x / tan(B)) + (1.0 / B); else tmp = -(x / B) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[B_, x_] := If[Or[LessEqual[x, -1.36], N[Not[LessEqual[x, 6e-11]], $MachinePrecision]], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.36 \lor \neg \left(x \leq 6 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{-x}{\tan B} + \frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sin B}\\
\end{array}
\end{array}
if x < -1.3600000000000001 or 6e-11 < x Initial program 99.8%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.8
Applied rewrites99.8%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-neg-fracN/A
*-rgt-identityN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift-tan.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites99.0%
if -1.3600000000000001 < x < 6e-11Initial program 99.8%
Taylor expanded in B around 0
lower-/.f6498.2
Applied rewrites98.2%
Final simplification98.6%
(FPCore (B x) :precision binary64 (+ (- (/ x B)) (/ 1.0 (sin B))))
double code(double B, double x) {
return -(x / B) + (1.0 / sin(B));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(b, x)
use fmin_fmax_functions
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x / b) + (1.0d0 / sin(b))
end function
public static double code(double B, double x) {
return -(x / B) + (1.0 / Math.sin(B));
}
def code(B, x): return -(x / B) + (1.0 / math.sin(B))
function code(B, x) return Float64(Float64(-Float64(x / B)) + Float64(1.0 / sin(B))) end
function tmp = code(B, x) tmp = -(x / B) + (1.0 / sin(B)); end
code[B_, x_] := N[((-N[(x / B), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-\frac{x}{B}\right) + \frac{1}{\sin B}
\end{array}
Initial program 99.8%
Taylor expanded in B around 0
lower-/.f6477.2
Applied rewrites77.2%
(FPCore (B x)
:precision binary64
(if (<= B 0.57)
(/
(-
(fma
(+
(fma
(+
(fma
x
0.022222222222222223
(*
(+
(fma
-0.3333333333333333
(* x 0.022222222222222223)
(* x 0.009523809523809525))
0.00205026455026455)
(* B B)))
0.019444444444444445)
(* B B)
(* 0.3333333333333333 x))
0.16666666666666666)
(* B B)
1.0)
x)
B)
(/ 1.0 (sin B))))
double code(double B, double x) {
double tmp;
if (B <= 0.57) {
tmp = (fma((fma((fma(x, 0.022222222222222223, ((fma(-0.3333333333333333, (x * 0.022222222222222223), (x * 0.009523809523809525)) + 0.00205026455026455) * (B * B))) + 0.019444444444444445), (B * B), (0.3333333333333333 * x)) + 0.16666666666666666), (B * B), 1.0) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(B, x) tmp = 0.0 if (B <= 0.57) tmp = Float64(Float64(fma(Float64(fma(Float64(fma(x, 0.022222222222222223, Float64(Float64(fma(-0.3333333333333333, Float64(x * 0.022222222222222223), Float64(x * 0.009523809523809525)) + 0.00205026455026455) * Float64(B * B))) + 0.019444444444444445), Float64(B * B), Float64(0.3333333333333333 * x)) + 0.16666666666666666), Float64(B * B), 1.0) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[B_, x_] := If[LessEqual[B, 0.57], N[(N[(N[(N[(N[(N[(N[(x * 0.022222222222222223 + N[(N[(N[(-0.3333333333333333 * N[(x * 0.022222222222222223), $MachinePrecision] + N[(x * 0.009523809523809525), $MachinePrecision]), $MachinePrecision] + 0.00205026455026455), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.019444444444444445), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.57:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \left(\mathsf{fma}\left(-0.3333333333333333, x \cdot 0.022222222222222223, x \cdot 0.009523809523809525\right) + 0.00205026455026455\right) \cdot \left(B \cdot B\right)\right) + 0.019444444444444445, B \cdot B, 0.3333333333333333 \cdot x\right) + 0.16666666666666666, B \cdot B, 1\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if B < 0.569999999999999951Initial program 99.8%
Taylor expanded in B around 0
Applied rewrites71.7%
if 0.569999999999999951 < B Initial program 99.6%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-neg-fracN/A
*-rgt-identityN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
Taylor expanded in B around inf
associate-*r/N/A
mul-1-negN/A
distribute-lft-neg-outN/A
div-add-revN/A
lower-/.f64N/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lift-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
Taylor expanded in x around 0
Applied rewrites60.1%
Final simplification68.8%
(FPCore (B x)
:precision binary64
(+
(/ (fma (* (* B B) x) 0.3333333333333333 (- x)) B)
(/
1.0
(*
(fma
(-
(* (fma -0.0001984126984126984 (* B B) 0.008333333333333333) (* B B))
0.16666666666666666)
(* B B)
1.0)
B))))
double code(double B, double x) {
return (fma(((B * B) * x), 0.3333333333333333, -x) / B) + (1.0 / (fma(((fma(-0.0001984126984126984, (B * B), 0.008333333333333333) * (B * B)) - 0.16666666666666666), (B * B), 1.0) * B));
}
function code(B, x) return Float64(Float64(fma(Float64(Float64(B * B) * x), 0.3333333333333333, Float64(-x)) / B) + Float64(1.0 / Float64(fma(Float64(Float64(fma(-0.0001984126984126984, Float64(B * B), 0.008333333333333333) * Float64(B * B)) - 0.16666666666666666), Float64(B * B), 1.0) * B))) end
code[B_, x_] := N[(N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333 + (-x)), $MachinePrecision] / B), $MachinePrecision] + N[(1.0 / N[(N[(N[(N[(N[(-0.0001984126984126984 * N[(B * B), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, 0.3333333333333333, -x\right)}{B} + \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(-0.0001984126984126984, B \cdot B, 0.008333333333333333\right) \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B}
\end{array}
Initial program 99.8%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.8
Applied rewrites99.8%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-neg-fracN/A
*-rgt-identityN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift-tan.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.7%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6454.9
Applied rewrites54.9%
(FPCore (B x) :precision binary64 (if (or (<= x -1.0) (not (<= x 21000000000.0))) (/ (- x) B) (/ 1.0 B)))
double code(double B, double x) {
double tmp;
if ((x <= -1.0) || !(x <= 21000000000.0)) {
tmp = -x / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(b, x)
use fmin_fmax_functions
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-1.0d0)) .or. (.not. (x <= 21000000000.0d0))) 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 <= -1.0) || !(x <= 21000000000.0)) {
tmp = -x / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(B, x): tmp = 0 if (x <= -1.0) or not (x <= 21000000000.0): tmp = -x / B else: tmp = 1.0 / B return tmp
function code(B, x) tmp = 0.0 if ((x <= -1.0) || !(x <= 21000000000.0)) tmp = Float64(Float64(-x) / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(B, x) tmp = 0.0; if ((x <= -1.0) || ~((x <= 21000000000.0))) tmp = -x / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[B_, x_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 21000000000.0]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 21000000000\right):\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if x < -1 or 2.1e10 < x Initial program 99.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f6457.1
Applied rewrites57.1%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6457.1
Applied rewrites57.1%
if -1 < x < 2.1e10Initial program 99.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f6452.5
Applied rewrites52.5%
Taylor expanded in x around 0
Applied rewrites50.5%
Final simplification53.9%
(FPCore (B x) :precision binary64 (/ (- 1.0 x) B))
double code(double B, double x) {
return (1.0 - x) / B;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(b, x)
use fmin_fmax_functions
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.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f6454.8
Applied rewrites54.8%
(FPCore (B x) :precision binary64 (/ 1.0 B))
double code(double B, double x) {
return 1.0 / B;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(b, x)
use fmin_fmax_functions
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.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f6454.8
Applied rewrites54.8%
Taylor expanded in x around 0
Applied rewrites26.5%
herbie shell --seed 2025051
(FPCore (B x)
:name "VandenBroeck and Keller, Equation (24)"
:precision binary64
(+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))