
(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 19 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 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (fma z (/ (fma (- y -0.0007936500793651) z -0.0027777777777778) x) (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(z, (fma((y - -0.0007936500793651), z, -0.0027777777777778) / x), (0.083333333333333 / x));
}
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(z, Float64(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778) / x), Float64(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[(z * N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(z, \frac{\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right)}{x}, \frac{0.083333333333333}{x}\right)
\end{array}
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.8%
(FPCore (x y z)
:precision binary64
(if (<= x 2e+209)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
(+
(+ (- (* (log x) x) x) 0.91893853320467)
(fma z (/ (* y z) x) (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2e+209) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = (((log(x) * x) - x) + 0.91893853320467) + fma(z, ((y * z) / x), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2e+209) tmp = 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)); else tmp = Float64(Float64(Float64(Float64(log(x) * x) - x) + 0.91893853320467) + fma(z, Float64(Float64(y * z) / x), Float64(0.083333333333333 / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2e+209], 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], N[(N[(N[(N[(N[Log[x], $MachinePrecision] * x), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(z * N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{+209}:\\
\;\;\;\;\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}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\log x \cdot x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(z, \frac{y \cdot z}{x}, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if x < 2.0000000000000001e209Initial program 94.2%
if 2.0000000000000001e209 < 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.8%
Taylor expanded in y around inf
lower-*.f6483.3
Applied rewrites83.3%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
neg-logN/A
lift-neg.f64N/A
lift-log.f6482.3
Applied rewrites82.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lift-log.f6482.3
Applied rewrites82.3%
(FPCore (x y z)
:precision binary64
(if (<= x 4.3e-32)
(/
(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 <= 4.3e-32) {
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 <= 4.3e-32) 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(y * z) / x), Float64(0.083333333333333 / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 4.3e-32], 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[(y * z), $MachinePrecision] / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.3 \cdot 10^{-32}:\\
\;\;\;\;\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 \cdot z}{x}, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if x < 4.2999999999999999e-32Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
if 4.2999999999999999e-32 < 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.8%
Taylor expanded in y around inf
lower-*.f6483.3
Applied rewrites83.3%
(FPCore (x y z)
:precision binary64
(if (<= x 6.6e-6)
(/
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(+
(+ (- (* (log x) x) x) 0.91893853320467)
(fma z (/ (* y z) x) (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 6.6e-6) {
tmp = fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = (((log(x) * x) - x) + 0.91893853320467) + fma(z, ((y * z) / x), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 6.6e-6) tmp = Float64(fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(Float64(log(x) * x) - x) + 0.91893853320467) + fma(z, Float64(Float64(y * z) / x), Float64(0.083333333333333 / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 6.6e-6], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(N[Log[x], $MachinePrecision] * x), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(z * N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.6 \cdot 10^{-6}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\log x \cdot x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(z, \frac{y \cdot z}{x}, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if x < 6.60000000000000034e-6Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
if 6.60000000000000034e-6 < 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.8%
Taylor expanded in y around inf
lower-*.f6483.3
Applied rewrites83.3%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
neg-logN/A
lift-neg.f64N/A
lift-log.f6482.3
Applied rewrites82.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lift-log.f6482.3
Applied rewrites82.3%
(FPCore (x y z)
:precision binary64
(if (<= x 6.3)
(/
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (* (* z z) y) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 6.3) {
tmp = fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((z * z) * y) / x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 6.3) 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) + Float64(Float64(Float64(z * z) * y) / x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 6.3], 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[(N[(N[(z * z), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.3:\\
\;\;\;\;\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) + \frac{\left(z \cdot z\right) \cdot y}{x}\\
\end{array}
\end{array}
if x < 6.29999999999999982Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
if 6.29999999999999982 < x Initial program 94.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6461.8
Applied rewrites61.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))))
(if (<= t_0 -1e+79)
(- (* (- (* z (/ z x))) y))
(if (<= t_0 2e+306)
(-
(fma (- x 0.5) (log x) (+ (/ 0.083333333333333 x) 0.91893853320467))
x)
(fma
(/ (fma (- y -0.0007936500793651) z -0.0027777777777778) x)
z
(/ 0.083333333333333 x))))))
double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
double tmp;
if (t_0 <= -1e+79) {
tmp = -(-(z * (z / x)) * y);
} else if (t_0 <= 2e+306) {
tmp = fma((x - 0.5), log(x), ((0.083333333333333 / x) + 0.91893853320467)) - x;
} else {
tmp = fma((fma((y - -0.0007936500793651), z, -0.0027777777777778) / x), z, (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) t_0 = 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)) tmp = 0.0 if (t_0 <= -1e+79) tmp = Float64(-Float64(Float64(-Float64(z * Float64(z / x))) * y)); elseif (t_0 <= 2e+306) tmp = Float64(fma(Float64(x - 0.5), log(x), Float64(Float64(0.083333333333333 / x) + 0.91893853320467)) - x); else tmp = fma(Float64(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778) / x), z, Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -1e+79], (-N[((-N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]) * y), $MachinePrecision]), If[LessEqual[t$95$0, 2e+306], N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(N[(0.083333333333333 / x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] * z + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+79}:\\
\;\;\;\;-\left(-z \cdot \frac{z}{x}\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\mathsf{fma}\left(x - 0.5, \log x, \frac{0.083333333333333}{x} + 0.91893853320467\right) - x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right)}{x}, z, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -9.99999999999999967e78Initial program 94.2%
Taylor expanded in y around -inf
Applied rewrites65.3%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
Applied rewrites49.1%
Taylor expanded in y around inf
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6432.2
Applied rewrites32.2%
if -9.99999999999999967e78 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 2.00000000000000003e306Initial 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
mult-flip-revN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-log.f64N/A
lower-+.f64N/A
mult-flip-revN/A
lift-/.f6457.5
Applied rewrites57.5%
if 2.00000000000000003e306 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
lift-/.f64N/A
lift-fma.f64N/A
lift--.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
mult-flip-revN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
lift--.f64N/A
mult-flip-revN/A
lift-/.f6463.8
Applied rewrites63.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))))
(if (<= t_0 -1e+79)
(- (* (- (* z (/ z x))) y))
(if (<= t_0 2e+306)
(-
(- (fma (log x) (- x 0.5) (/ 0.083333333333333 x)) -0.91893853320467)
x)
(fma
(/ (fma (- y -0.0007936500793651) z -0.0027777777777778) x)
z
(/ 0.083333333333333 x))))))
double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
double tmp;
if (t_0 <= -1e+79) {
tmp = -(-(z * (z / x)) * y);
} else if (t_0 <= 2e+306) {
tmp = (fma(log(x), (x - 0.5), (0.083333333333333 / x)) - -0.91893853320467) - x;
} else {
tmp = fma((fma((y - -0.0007936500793651), z, -0.0027777777777778) / x), z, (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) t_0 = 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)) tmp = 0.0 if (t_0 <= -1e+79) tmp = Float64(-Float64(Float64(-Float64(z * Float64(z / x))) * y)); elseif (t_0 <= 2e+306) tmp = Float64(Float64(fma(log(x), Float64(x - 0.5), Float64(0.083333333333333 / x)) - -0.91893853320467) - x); else tmp = fma(Float64(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778) / x), z, Float64(0.083333333333333 / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -1e+79], (-N[((-N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]) * y), $MachinePrecision]), If[LessEqual[t$95$0, 2e+306], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] - -0.91893853320467), $MachinePrecision] - x), $MachinePrecision], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] * z + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+79}:\\
\;\;\;\;-\left(-z \cdot \frac{z}{x}\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log x, x - 0.5, \frac{0.083333333333333}{x}\right) - -0.91893853320467\right) - x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right)}{x}, z, \frac{0.083333333333333}{x}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -9.99999999999999967e78Initial program 94.2%
Taylor expanded in y around -inf
Applied rewrites65.3%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
Applied rewrites49.1%
Taylor expanded in y around inf
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6432.2
Applied rewrites32.2%
if -9.99999999999999967e78 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 2.00000000000000003e306Initial 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%
Applied rewrites57.5%
if 2.00000000000000003e306 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
lift-/.f64N/A
lift-fma.f64N/A
lift--.f64N/A
lift-fma.f64N/A
div-addN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
mult-flip-revN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-fma.f64N/A
lift--.f64N/A
mult-flip-revN/A
lift-/.f6463.8
Applied rewrites63.8%
(FPCore (x y z)
:precision binary64
(if (<= x 2900000000.0)
(/
(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 <= 2900000000.0) {
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 <= 2900000000.0) 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, 2900000000.0], 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 2900000000:\\
\;\;\;\;\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 < 2.9e9Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
if 2.9e9 < 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.8%
Taylor expanded in y around inf
lower-*.f6483.3
Applied rewrites83.3%
Taylor expanded in x around inf
associate-*r/N/A
*-commutativeN/A
metadata-evalN/A
add-flipN/A
metadata-evalN/A
sub-flipN/A
div-addN/A
*-commutativeN/A
Applied rewrites35.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))))
(if (<= t_0 -1e+79)
(- (* (- (* z (/ z x))) y))
(if (<= t_0 2e+134)
(/
(fma
(fma 0.0007936500793651 z -0.0027777777777778)
z
0.083333333333333)
x)
(if (<= t_0 1e+305)
(* (- (log x) 1.0) x)
(* (* (/ (- y -0.0007936500793651) x) z) z))))))
double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
double tmp;
if (t_0 <= -1e+79) {
tmp = -(-(z * (z / x)) * y);
} else if (t_0 <= 2e+134) {
tmp = fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x;
} else if (t_0 <= 1e+305) {
tmp = (log(x) - 1.0) * x;
} else {
tmp = (((y - -0.0007936500793651) / x) * z) * z;
}
return tmp;
}
function code(x, y, z) t_0 = 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)) tmp = 0.0 if (t_0 <= -1e+79) tmp = Float64(-Float64(Float64(-Float64(z * Float64(z / x))) * y)); elseif (t_0 <= 2e+134) tmp = Float64(fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x); elseif (t_0 <= 1e+305) tmp = Float64(Float64(log(x) - 1.0) * x); else tmp = Float64(Float64(Float64(Float64(y - -0.0007936500793651) / x) * z) * z); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -1e+79], (-N[((-N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]) * y), $MachinePrecision]), If[LessEqual[t$95$0, 2e+134], N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+79}:\\
\;\;\;\;-\left(-z \cdot \frac{z}{x}\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+134}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -9.99999999999999967e78Initial program 94.2%
Taylor expanded in y around -inf
Applied rewrites65.3%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
Applied rewrites49.1%
Taylor expanded in y around inf
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6432.2
Applied rewrites32.2%
if -9.99999999999999967e78 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 1.99999999999999984e134Initial program 94.2%
Taylor expanded in y around 0
lower--.f64N/A
Applied rewrites79.0%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-flipN/A
metadata-evalN/A
lower-fma.f6446.7
Applied rewrites46.7%
if 1.99999999999999984e134 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 9.9999999999999994e304Initial 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.8%
Taylor expanded in y around inf
lower-*.f6483.3
Applied rewrites83.3%
Taylor expanded in x around inf
associate-*r/N/A
*-commutativeN/A
metadata-evalN/A
add-flipN/A
metadata-evalN/A
sub-flipN/A
div-addN/A
*-commutativeN/A
Applied rewrites35.8%
if 9.9999999999999994e304 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 94.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
unpow2N/A
lower-*.f6442.0
Applied rewrites42.0%
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*r*N/A
metadata-evalN/A
add-flipN/A
+-commutativeN/A
div-addN/A
mult-flip-revN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites43.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))))
(if (<= t_0 -1e+79)
(- (* (- (* z (/ z x))) y))
(if (<= t_0 2e+134)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(if (<= t_0 1e+305)
(* (- (log x) 1.0) x)
(* (* (/ (- y -0.0007936500793651) x) z) z))))))
double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
double tmp;
if (t_0 <= -1e+79) {
tmp = -(-(z * (z / x)) * y);
} else if (t_0 <= 2e+134) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else if (t_0 <= 1e+305) {
tmp = (log(x) - 1.0) * x;
} else {
tmp = (((y - -0.0007936500793651) / x) * z) * z;
}
return tmp;
}
function code(x, y, z) t_0 = 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)) tmp = 0.0 if (t_0 <= -1e+79) tmp = Float64(-Float64(Float64(-Float64(z * Float64(z / x))) * y)); elseif (t_0 <= 2e+134) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); elseif (t_0 <= 1e+305) tmp = Float64(Float64(log(x) - 1.0) * x); else tmp = Float64(Float64(Float64(Float64(y - -0.0007936500793651) / x) * z) * z); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -1e+79], (-N[((-N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]) * y), $MachinePrecision]), If[LessEqual[t$95$0, 2e+134], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+79}:\\
\;\;\;\;-\left(-z \cdot \frac{z}{x}\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+134}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y - -0.0007936500793651}{x} \cdot z\right) \cdot z\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -9.99999999999999967e78Initial program 94.2%
Taylor expanded in y around -inf
Applied rewrites65.3%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
Applied rewrites49.1%
Taylor expanded in y around inf
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6432.2
Applied rewrites32.2%
if -9.99999999999999967e78 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 1.99999999999999984e134Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.0
Applied rewrites29.0%
if 1.99999999999999984e134 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 9.9999999999999994e304Initial 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.8%
Taylor expanded in y around inf
lower-*.f6483.3
Applied rewrites83.3%
Taylor expanded in x around inf
associate-*r/N/A
*-commutativeN/A
metadata-evalN/A
add-flipN/A
metadata-evalN/A
sub-flipN/A
div-addN/A
*-commutativeN/A
Applied rewrites35.8%
if 9.9999999999999994e304 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 94.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
unpow2N/A
lower-*.f6442.0
Applied rewrites42.0%
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
associate-*r*N/A
metadata-evalN/A
add-flipN/A
+-commutativeN/A
div-addN/A
mult-flip-revN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites43.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))))
(if (<= t_0 -1e+79)
(- (* (- (* z (/ z x))) y))
(if (<= t_0 2e+134)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(if (<= t_0 1e+305)
(* (- (log x) 1.0) x)
(* (/ 0.0007936500793651 x) (* z z)))))))
double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
double tmp;
if (t_0 <= -1e+79) {
tmp = -(-(z * (z / x)) * y);
} else if (t_0 <= 2e+134) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else if (t_0 <= 1e+305) {
tmp = (log(x) - 1.0) * x;
} else {
tmp = (0.0007936500793651 / x) * (z * z);
}
return tmp;
}
function code(x, y, z) t_0 = 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)) tmp = 0.0 if (t_0 <= -1e+79) tmp = Float64(-Float64(Float64(-Float64(z * Float64(z / x))) * y)); elseif (t_0 <= 2e+134) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); elseif (t_0 <= 1e+305) tmp = Float64(Float64(log(x) - 1.0) * x); else tmp = Float64(Float64(0.0007936500793651 / x) * Float64(z * z)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[t$95$0, -1e+79], (-N[((-N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]) * y), $MachinePrecision]), If[LessEqual[t$95$0, 2e+134], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$0, 1e+305], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision], N[(N[(0.0007936500793651 / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+79}:\\
\;\;\;\;-\left(-z \cdot \frac{z}{x}\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+134}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{+305}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{0.0007936500793651}{x} \cdot \left(z \cdot z\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -9.99999999999999967e78Initial program 94.2%
Taylor expanded in y around -inf
Applied rewrites65.3%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
Applied rewrites49.1%
Taylor expanded in y around inf
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6432.2
Applied rewrites32.2%
if -9.99999999999999967e78 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 1.99999999999999984e134Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.0
Applied rewrites29.0%
if 1.99999999999999984e134 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 9.9999999999999994e304Initial 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.8%
Taylor expanded in y around inf
lower-*.f6483.3
Applied rewrites83.3%
Taylor expanded in x around inf
associate-*r/N/A
*-commutativeN/A
metadata-evalN/A
add-flipN/A
metadata-evalN/A
sub-flipN/A
div-addN/A
*-commutativeN/A
Applied rewrites35.8%
if 9.9999999999999994e304 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 94.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
unpow2N/A
lower-*.f6442.0
Applied rewrites42.0%
Taylor expanded in y around 0
Applied rewrites26.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)))
(if (<= t_0 -1e+51)
(- (* (- (* z (/ z x))) y))
(if (<= t_0 0.01)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(* (/ 0.0007936500793651 x) (* z z))))))
double code(double x, double y, double z) {
double t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z;
double tmp;
if (t_0 <= -1e+51) {
tmp = -(-(z * (z / x)) * y);
} else if (t_0 <= 0.01) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = (0.0007936500793651 / x) * (z * z);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) tmp = 0.0 if (t_0 <= -1e+51) tmp = Float64(-Float64(Float64(-Float64(z * Float64(z / x))) * y)); elseif (t_0 <= 0.01) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(0.0007936500793651 / x) * Float64(z * z)); 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]}, If[LessEqual[t$95$0, -1e+51], (-N[((-N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]) * y), $MachinePrecision]), If[LessEqual[t$95$0, 0.01], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.0007936500793651 / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+51}:\\
\;\;\;\;-\left(-z \cdot \frac{z}{x}\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 0.01:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.0007936500793651}{x} \cdot \left(z \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -1e51Initial program 94.2%
Taylor expanded in y around -inf
Applied rewrites65.3%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
Applied rewrites49.1%
Taylor expanded in y around inf
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6432.2
Applied rewrites32.2%
if -1e51 < (*.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 x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.0
Applied rewrites29.0%
if 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 z around inf
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
unpow2N/A
lower-*.f6442.0
Applied rewrites42.0%
Taylor expanded in y around 0
Applied rewrites26.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_0 -1e+51)
(* y (/ (* z z) x))
(if (<= t_0 0.1)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(* (/ 0.0007936500793651 x) (* z z))))))
double code(double x, double y, double z) {
double t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_0 <= -1e+51) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 0.1) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = (0.0007936500793651 / x) * (z * z);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_0 <= -1e+51) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 0.1) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(0.0007936500793651 / x) * Float64(z * z)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+51], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.1], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.0007936500793651 / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+51}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 0.1:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.0007936500793651}{x} \cdot \left(z \cdot z\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -1e51Initial program 94.2%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6430.1
Applied rewrites30.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6431.7
Applied rewrites31.7%
if -1e51 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 0.10000000000000001Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.0
Applied rewrites29.0%
if 0.10000000000000001 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 94.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
add-flipN/A
metadata-evalN/A
lower--.f64N/A
unpow2N/A
lower-*.f6442.0
Applied rewrites42.0%
Taylor expanded in y around 0
Applied rewrites26.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_0 -1e+51)
(* y (/ (* z z) x))
(if (<= t_0 0.1)
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(/ (* (* z z) 0.0007936500793651) x)))))
double code(double x, double y, double z) {
double t_0 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_0 <= -1e+51) {
tmp = y * ((z * z) / x);
} else if (t_0 <= 0.1) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = ((z * z) * 0.0007936500793651) / x;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_0 <= -1e+51) tmp = Float64(y * Float64(Float64(z * z) / x)); elseif (t_0 <= 0.1) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(z * z) * 0.0007936500793651) / x); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+51], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.1], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(z * z), $MachinePrecision] * 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+51}:\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{elif}\;t\_0 \leq 0.1:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(z \cdot z\right) \cdot 0.0007936500793651}{x}\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -1e51Initial program 94.2%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6430.1
Applied rewrites30.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6431.7
Applied rewrites31.7%
if -1e51 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 0.10000000000000001Initial program 94.2%
Taylor expanded in x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.0
Applied rewrites29.0%
if 0.10000000000000001 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 94.2%
Taylor expanded in y around 0
lower--.f64N/A
Applied rewrites79.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6426.2
Applied rewrites26.2%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
pow2N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6426.2
Applied rewrites26.2%
(FPCore (x y z) :precision binary64 (if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.01) (/ (fma -0.0027777777777778 z 0.083333333333333) x) (/ (* (* z z) 0.0007936500793651) x)))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 0.01) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = ((z * z) * 0.0007936500793651) / x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 0.01) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(z * z) * 0.0007936500793651) / x); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 0.01], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(z * z), $MachinePrecision] * 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z \leq 0.01:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(z \cdot z\right) \cdot 0.0007936500793651}{x}\\
\end{array}
\end{array}
if (*.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 x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.0
Applied rewrites29.0%
if 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 0
lower--.f64N/A
Applied rewrites79.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6426.2
Applied rewrites26.2%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
pow2N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6426.2
Applied rewrites26.2%
(FPCore (x y z) :precision binary64 (if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.01) (/ (fma -0.0027777777777778 z 0.083333333333333) x) (* (/ (* z z) x) 0.0007936500793651)))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 0.01) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = ((z * z) / x) * 0.0007936500793651;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 0.01) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(z * z) / x) * 0.0007936500793651); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 0.01], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision] * 0.0007936500793651), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z \leq 0.01:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot z}{x} \cdot 0.0007936500793651\\
\end{array}
\end{array}
if (*.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 x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.0
Applied rewrites29.0%
if 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 0
lower--.f64N/A
Applied rewrites79.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6426.2
Applied rewrites26.2%
(FPCore (x y z) :precision binary64 (if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.01) (/ (fma -0.0027777777777778 z 0.083333333333333) x) (* (* z (/ z x)) 0.0007936500793651)))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 0.01) {
tmp = fma(-0.0027777777777778, z, 0.083333333333333) / x;
} else {
tmp = (z * (z / x)) * 0.0007936500793651;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 0.01) tmp = Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x); else tmp = Float64(Float64(z * Float64(z / x)) * 0.0007936500793651); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 0.01], N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision] * 0.0007936500793651), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z \leq 0.01:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \frac{z}{x}\right) \cdot 0.0007936500793651\\
\end{array}
\end{array}
if (*.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 x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.0
Applied rewrites29.0%
if 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 0
lower--.f64N/A
Applied rewrites79.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6426.2
Applied rewrites26.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6426.3
Applied rewrites26.3%
(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 x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6429.0
Applied rewrites29.0%
(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 x around 0
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites62.7%
Taylor expanded in z around 0
Applied rewrites23.1%
herbie shell --seed 2025136
(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)))