
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
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(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
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(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= x 4.3e-47)
(/
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(fma z (* (/ (- y -0.0007936500793651) x) z) (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.3e-47) {
tmp = fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(z, (((y - -0.0007936500793651) / x) * z), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 4.3e-47) tmp = Float64(fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(z, Float64(Float64(Float64(y - -0.0007936500793651) / x) * z), Float64(0.083333333333333 / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 4.3e-47], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(z * N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.3 \cdot 10^{-47}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(z, \frac{y - -0.0007936500793651}{x} \cdot z, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if x < 4.2999999999999998e-47Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lower-fma.f64N/A
sub-flipN/A
+-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6463.2
Applied rewrites63.2%
if 4.2999999999999998e-47 < x Initial program 94.2%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-/l*N/A
mult-flip-revN/A
lower-fma.f64N/A
Applied rewrites97.6%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.3
Applied rewrites84.3%
Taylor expanded in z around inf
associate-/l*N/A
div-addN/A
mult-flip-revN/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f6493.9
Applied rewrites93.9%
(FPCore (x y z)
:precision binary64
(if (<= x 3.65e-10)
(/
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(fma z (* y (/ z x)) (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.65e-10) {
tmp = fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(z, (y * (z / x)), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 3.65e-10) tmp = Float64(fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(z, Float64(y * Float64(z / x)), Float64(0.083333333333333 / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 3.65e-10], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(z * N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.65 \cdot 10^{-10}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(z, y \cdot \frac{z}{x}, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if x < 3.6499999999999998e-10Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lower-fma.f64N/A
sub-flipN/A
+-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6463.2
Applied rewrites63.2%
if 3.6499999999999998e-10 < x Initial program 94.2%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-/l*N/A
mult-flip-revN/A
lower-fma.f64N/A
Applied rewrites97.6%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.3
Applied rewrites84.3%
(FPCore (x y z)
:precision binary64
(if (<= x 4.5e-17)
(/
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(if (<= x 9.2e+145)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ (* (* z z) (- y -0.0007936500793651)) x))
(-
(+
(fma
z
(/ (* 0.0007936500793651 z) x)
(fma (log x) (- x 0.5) (/ 0.083333333333333 x)))
0.91893853320467)
x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.5e-17) {
tmp = fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else if (x <= 9.2e+145) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((z * z) * (y - -0.0007936500793651)) / x);
} else {
tmp = (fma(z, ((0.0007936500793651 * z) / x), fma(log(x), (x - 0.5), (0.083333333333333 / x))) + 0.91893853320467) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 4.5e-17) tmp = Float64(fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); elseif (x <= 9.2e+145) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(z * z) * Float64(y - -0.0007936500793651)) / x)); else tmp = Float64(Float64(fma(z, Float64(Float64(0.0007936500793651 * z) / x), fma(log(x), Float64(x - 0.5), Float64(0.083333333333333 / x))) + 0.91893853320467) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 4.5e-17], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 9.2e+145], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(z * z), $MachinePrecision] * N[(y - -0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] / x), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.5 \cdot 10^{-17}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+145}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot z\right) \cdot \left(y - -0.0007936500793651\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(z, \frac{0.0007936500793651 \cdot z}{x}, \mathsf{fma}\left(\log x, x - 0.5, \frac{0.083333333333333}{x}\right)\right) + 0.91893853320467\right) - x\\
\end{array}
\end{array}
if x < 4.49999999999999978e-17Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lower-fma.f64N/A
sub-flipN/A
+-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6463.2
Applied rewrites63.2%
if 4.49999999999999978e-17 < x < 9.2e145Initial program 94.2%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6472.9
Applied rewrites72.9%
if 9.2e145 < x Initial program 94.2%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites94.4%
Taylor expanded in y around 0
lower-fma.f64N/A
associate-*r/N/A
mult-flip-revN/A
div-subN/A
lower-/.f64N/A
sub-flipN/A
metadata-evalN/A
lower-fma.f64N/A
lower-fma.f64N/A
lift-log.f64N/A
lift--.f64N/A
mult-flip-revN/A
lift-/.f6481.0
Applied rewrites81.0%
Taylor expanded in z around inf
lower-*.f6480.5
Applied rewrites80.5%
(FPCore (x y z)
:precision binary64
(if (<= x 4.5e-17)
(/
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(if (<= x 9.2e+145)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ (* (* z z) (- y -0.0007936500793651)) x))
(* (- (log x) 1.0) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.5e-17) {
tmp = fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else if (x <= 9.2e+145) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((z * z) * (y - -0.0007936500793651)) / x);
} else {
tmp = (log(x) - 1.0) * x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 4.5e-17) tmp = Float64(fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); elseif (x <= 9.2e+145) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(z * z) * Float64(y - -0.0007936500793651)) / x)); else tmp = Float64(Float64(log(x) - 1.0) * x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 4.5e-17], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 9.2e+145], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(z * z), $MachinePrecision] * N[(y - -0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.5 \cdot 10^{-17}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+145}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot z\right) \cdot \left(y - -0.0007936500793651\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 4.49999999999999978e-17Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lower-fma.f64N/A
sub-flipN/A
+-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6463.2
Applied rewrites63.2%
if 4.49999999999999978e-17 < x < 9.2e145Initial program 94.2%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6472.9
Applied rewrites72.9%
if 9.2e145 < x Initial program 94.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
log-recN/A
lower-neg.f64N/A
lift-log.f6435.0
Applied rewrites35.0%
lift-neg.f64N/A
lift-log.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lift-log.f6435.0
Applied rewrites35.0%
(FPCore (x y z)
:precision binary64
(if (<= x 85.0)
(/
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(-
(- (fma (log x) (- x 0.5) (/ 0.083333333333333 x)) -0.91893853320467)
x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 85.0) {
tmp = fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = (fma(log(x), (x - 0.5), (0.083333333333333 / x)) - -0.91893853320467) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 85.0) tmp = Float64(fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(fma(log(x), Float64(x - 0.5), Float64(0.083333333333333 / x)) - -0.91893853320467) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 85.0], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] - -0.91893853320467), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 85:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log x, x - 0.5, \frac{0.083333333333333}{x}\right) - -0.91893853320467\right) - x\\
\end{array}
\end{array}
if x < 85Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lower-fma.f64N/A
sub-flipN/A
+-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6463.2
Applied rewrites63.2%
if 85 < x Initial program 94.2%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-log.f64N/A
lift--.f64N/A
mult-flip-revN/A
lower-/.f6457.5
Applied rewrites57.5%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
lift-log.f64N/A
add-flipN/A
mult-flip-revN/A
lower--.f64N/A
lower-fma.f64N/A
lift-log.f64N/A
lift--.f64N/A
mult-flip-revN/A
lift-/.f64N/A
metadata-eval57.5
Applied rewrites57.5%
(FPCore (x y z)
:precision binary64
(if (<= x 1.25e+20)
(/
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(* (- (log x) 1.0) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.25e+20) {
tmp = fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = (log(x) - 1.0) * x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.25e+20) tmp = Float64(fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(log(x) - 1.0) * x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.25e+20], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.25 \cdot 10^{+20}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 1.25e20Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
lower-fma.f64N/A
sub-flipN/A
+-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f6463.2
Applied rewrites63.2%
if 1.25e20 < x Initial program 94.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
log-recN/A
lower-neg.f64N/A
lift-log.f6435.0
Applied rewrites35.0%
lift-neg.f64N/A
lift-log.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lift-log.f6435.0
Applied rewrites35.0%
(FPCore (x y z)
:precision binary64
(if (<= x 1.65e-18)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(if (<= x 7.4e+19)
(* (/ (- y -0.0007936500793651) x) (* z z))
(* (- (log x) 1.0) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.65e-18) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else if (x <= 7.4e+19) {
tmp = ((y - -0.0007936500793651) / x) * (z * z);
} else {
tmp = (log(x) - 1.0) * x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.65e-18) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); elseif (x <= 7.4e+19) tmp = Float64(Float64(Float64(y - -0.0007936500793651) / x) * Float64(z * z)); else tmp = Float64(Float64(log(x) - 1.0) * x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.65e-18], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 7.4e+19], N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.65 \cdot 10^{-18}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{+19}:\\
\;\;\;\;\frac{y - -0.0007936500793651}{x} \cdot \left(z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 1.6500000000000001e-18Initial program 94.2%
Taylor expanded in z around -inf
Applied rewrites59.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites50.6%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.8
Applied rewrites29.8%
if 1.6500000000000001e-18 < x < 7.4e19Initial program 94.2%
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
div-addN/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
associate-/l*N/A
mult-flip-revN/A
lower-fma.f64N/A
Applied rewrites97.6%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.3
Applied rewrites84.3%
Taylor expanded in z around inf
associate-*r/N/A
metadata-evalN/A
add-flipN/A
metadata-evalN/A
sub-flipN/A
*-commutativeN/A
div-addN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites41.8%
if 7.4e19 < x Initial program 94.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
log-recN/A
lower-neg.f64N/A
lift-log.f6435.0
Applied rewrites35.0%
lift-neg.f64N/A
lift-log.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lift-log.f6435.0
Applied rewrites35.0%
(FPCore (x y z)
:precision binary64
(if (<= x 1.65e-18)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(if (<= x 7.4e+19)
(/ (* (* z z) (- y -0.0007936500793651)) x)
(* (- (log x) 1.0) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.65e-18) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else if (x <= 7.4e+19) {
tmp = ((z * z) * (y - -0.0007936500793651)) / x;
} else {
tmp = (log(x) - 1.0) * x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.65e-18) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); elseif (x <= 7.4e+19) tmp = Float64(Float64(Float64(z * z) * Float64(y - -0.0007936500793651)) / x); else tmp = Float64(Float64(log(x) - 1.0) * x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.65e-18], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 7.4e+19], N[(N[(N[(z * z), $MachinePrecision] * N[(y - -0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.65 \cdot 10^{-18}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{+19}:\\
\;\;\;\;\frac{\left(z \cdot z\right) \cdot \left(y - -0.0007936500793651\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 1.6500000000000001e-18Initial program 94.2%
Taylor expanded in z around -inf
Applied rewrites59.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites50.6%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.8
Applied rewrites29.8%
if 1.6500000000000001e-18 < x < 7.4e19Initial program 94.2%
Taylor expanded in z around -inf
Applied rewrites59.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites50.6%
Taylor expanded in z around inf
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lift--.f6441.8
Applied rewrites41.8%
if 7.4e19 < x Initial program 94.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
log-recN/A
lower-neg.f64N/A
lift-log.f6435.0
Applied rewrites35.0%
lift-neg.f64N/A
lift-log.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lift-log.f6435.0
Applied rewrites35.0%
(FPCore (x y z) :precision binary64 (if (<= x 1.5e-10) (/ (fma -0.0027777777777778 z 0.083333333333333) x) (* (- (log x) 1.0) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.5e-10) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = (log(x) - 1.0) * x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.5e-10) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(log(x) - 1.0) * x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.5e-10], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.5 \cdot 10^{-10}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 1.5e-10Initial program 94.2%
Taylor expanded in z around -inf
Applied rewrites59.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites50.6%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.8
Applied rewrites29.8%
if 1.5e-10 < x Initial program 94.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
log-recN/A
lower-neg.f64N/A
lift-log.f6435.0
Applied rewrites35.0%
lift-neg.f64N/A
lift-log.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lift-log.f6435.0
Applied rewrites35.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z))
(t_1 (* y (* z (/ z x)))))
(if (<= t_0 -4e+49)
t_1
(if (<= t_0 0.01)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
t_1))))
double code(double x, double y, double z) {
double t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z;
double t_1 = y * (z * (z / x));
double tmp;
if (t_0 <= -4e+49) {
tmp = t_1;
} else if (t_0 <= 0.01) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) t_1 = Float64(y * Float64(z * Float64(z / x))) tmp = 0.0 if (t_0 <= -4e+49) tmp = t_1; elseif (t_0 <= 0.01) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = t_1; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e+49], t$95$1, If[LessEqual[t$95$0, 0.01], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z\\
t_1 := y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0.01:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -3.99999999999999979e49 or 0.0100000000000000002 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 94.2%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.9
Applied rewrites29.9%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f6429.4
Applied rewrites29.4%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6432.1
Applied rewrites32.1%
if -3.99999999999999979e49 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 0.0100000000000000002Initial program 94.2%
Taylor expanded in z around -inf
Applied rewrites59.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites50.6%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.8
Applied rewrites29.8%
(FPCore (x y z) :precision binary64 (/ (fma -0.0027777777777778 z 0.083333333333333) x))
double code(double x, double y, double z) {
return fma(-0.0027777777777778, z, 0.083333333333333) / x;
}
function code(x, y, z) return Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x) end
code[x_, y_, z_] := N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}
\end{array}
Initial program 94.2%
Taylor expanded in z around -inf
Applied rewrites59.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites50.6%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.8
Applied rewrites29.8%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
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(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 94.2%
Taylor expanded in z around -inf
Applied rewrites59.6%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites50.6%
Taylor expanded in z around 0
Applied rewrites23.8%
herbie shell --seed 2025134
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))