
(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 26 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 (fma z (- y -0.0007936500793651) -0.0027777777777778) (/ z x) (/ 1.0 (* x 12.000000000000048)))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(fma(z, (y - -0.0007936500793651), -0.0027777777777778), (z / x), (1.0 / (x * 12.000000000000048)));
}
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(fma(z, Float64(y - -0.0007936500793651), -0.0027777777777778), Float64(z / x), Float64(1.0 / Float64(x * 12.000000000000048)))) 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[(z * N[(y - -0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), \frac{z}{x}, \frac{1}{x \cdot 12.000000000000048}\right)
\end{array}
Initial program 94.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
lift-/.f64N/A
div-flipN/A
lower-/.f64N/A
mult-flipN/A
lower-*.f64N/A
metadata-eval98.8
Applied rewrites98.8%
(FPCore (x y z) :precision binary64 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (fma (fma z 0.0007936500793651 (fma y z -0.0027777777777778)) (/ z x) (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(fma(z, 0.0007936500793651, fma(y, z, -0.0027777777777778)), (z / x), (0.083333333333333 / x));
}
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(fma(z, 0.0007936500793651, fma(y, z, -0.0027777777777778)), Float64(z / 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[(N[(z * 0.0007936500793651 + N[(y * z + -0.0027777777777778), $MachinePrecision]), $MachinePrecision] * N[(z / 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(\mathsf{fma}\left(z, 0.0007936500793651, \mathsf{fma}\left(y, z, -0.0027777777777778\right)\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right)
\end{array}
Initial program 94.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
lift-fma.f64N/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
distribute-rgt-inN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-fma.f6498.7
Applied rewrites98.7%
(FPCore (x y z) :precision binary64 (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (fma (fma z (- y -0.0007936500793651) -0.0027777777777778) (/ z x) (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(fma(z, (y - -0.0007936500793651), -0.0027777777777778), (z / x), (0.083333333333333 / x));
}
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(fma(z, Float64(y - -0.0007936500793651), -0.0027777777777778), Float64(z / 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[(N[(z * N[(y - -0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / 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(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right)
\end{array}
Initial program 94.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
(FPCore (x y z) :precision binary64 (fma (fma z (- y -0.0007936500793651) -0.0027777777777778) (/ z x) (+ (/ 0.083333333333333 x) (- (- (* (log x) (- x 0.5)) x) -0.91893853320467))))
double code(double x, double y, double z) {
return fma(fma(z, (y - -0.0007936500793651), -0.0027777777777778), (z / x), ((0.083333333333333 / x) + (((log(x) * (x - 0.5)) - x) - -0.91893853320467)));
}
function code(x, y, z) return fma(fma(z, Float64(y - -0.0007936500793651), -0.0027777777777778), Float64(z / x), Float64(Float64(0.083333333333333 / x) + Float64(Float64(Float64(log(x) * Float64(x - 0.5)) - x) - -0.91893853320467))) end
code[x_, y_, z_] := N[(N[(z * N[(y - -0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] - -0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x} + \left(\left(\log x \cdot \left(x - 0.5\right) - x\right) - -0.91893853320467\right)\right)
\end{array}
Initial program 94.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
associate-+l+N/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites98.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(fma (* y z) (/ z x) (/ 0.083333333333333 x)))))
(if (<= y -0.00078)
t_0
(if (<= y 8e-8)
(fma
z
(/ (fma 0.0007936500793651 z -0.0027777777777778) x)
(+
(/ 0.083333333333333 x)
(- (- (* (log x) (- x 0.5)) x) -0.91893853320467)))
t_0))))
double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + fma((y * z), (z / x), (0.083333333333333 / x));
double tmp;
if (y <= -0.00078) {
tmp = t_0;
} else if (y <= 8e-8) {
tmp = fma(z, (fma(0.0007936500793651, z, -0.0027777777777778) / x), ((0.083333333333333 / x) + (((log(x) * (x - 0.5)) - x) - -0.91893853320467)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(Float64(y * z), Float64(z / x), Float64(0.083333333333333 / x))) tmp = 0.0 if (y <= -0.00078) tmp = t_0; elseif (y <= 8e-8) tmp = fma(z, Float64(fma(0.0007936500793651, z, -0.0027777777777778) / x), Float64(Float64(0.083333333333333 / x) + Float64(Float64(Float64(log(x) * Float64(x - 0.5)) - x) - -0.91893853320467))); else tmp = t_0; 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[(y * z), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.00078], t$95$0, If[LessEqual[y, 8e-8], N[(z * N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] + N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] - -0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(y \cdot z, \frac{z}{x}, \frac{0.083333333333333}{x}\right)\\
\mathbf{if}\;y \leq -0.00078:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}{x}, \frac{0.083333333333333}{x} + \left(\left(\log x \cdot \left(x - 0.5\right) - x\right) - -0.91893853320467\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -7.79999999999999986e-4 or 8.0000000000000002e-8 < y Initial program 94.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
Taylor expanded in y around inf
lower-*.f6484.7
Applied rewrites84.7%
if -7.79999999999999986e-4 < y < 8.0000000000000002e-8Initial program 94.1%
Taylor expanded in y around 0
Applied rewrites78.5%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-/.f64N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites80.9%
(FPCore (x y z) :precision binary64 (fma z (/ (fma z (- y -0.0007936500793651) -0.0027777777777778) x) (+ (/ 0.083333333333333 x) (- (- (* (log x) (- x 0.5)) x) -0.91893853320467))))
double code(double x, double y, double z) {
return fma(z, (fma(z, (y - -0.0007936500793651), -0.0027777777777778) / x), ((0.083333333333333 / x) + (((log(x) * (x - 0.5)) - x) - -0.91893853320467)));
}
function code(x, y, z) return fma(z, Float64(fma(z, Float64(y - -0.0007936500793651), -0.0027777777777778) / x), Float64(Float64(0.083333333333333 / x) + Float64(Float64(Float64(log(x) * Float64(x - 0.5)) - x) - -0.91893853320467))) end
code[x_, y_, z_] := N[(z * N[(N[(z * N[(y - -0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] + N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] - -0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, \frac{\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right)}{x}, \frac{0.083333333333333}{x} + \left(\left(\log x \cdot \left(x - 0.5\right) - x\right) - -0.91893853320467\right)\right)
\end{array}
Initial program 94.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites97.9%
(FPCore (x y z)
:precision binary64
(if (<=
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
1e+271)
(-
(* (log x) (- x 0.5))
(-
(- x 0.91893853320467)
(/
(fma
(fma z (- y -0.0007936500793651) -0.0027777777777778)
z
0.083333333333333)
x)))
(+
(+ (* -0.5 (log x)) 0.91893853320467)
(fma
(fma z 0.0007936500793651 (fma y z -0.0027777777777778))
(/ z x)
(/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double tmp;
if ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) <= 1e+271) {
tmp = (log(x) * (x - 0.5)) - ((x - 0.91893853320467) - (fma(fma(z, (y - -0.0007936500793651), -0.0027777777777778), z, 0.083333333333333) / x));
} else {
tmp = ((-0.5 * log(x)) + 0.91893853320467) + fma(fma(z, 0.0007936500793651, fma(y, z, -0.0027777777777778)), (z / x), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) <= 1e+271) tmp = Float64(Float64(log(x) * Float64(x - 0.5)) - Float64(Float64(x - 0.91893853320467) - Float64(fma(fma(z, Float64(y - -0.0007936500793651), -0.0027777777777778), z, 0.083333333333333) / x))); else tmp = Float64(Float64(Float64(-0.5 * log(x)) + 0.91893853320467) + fma(fma(z, 0.0007936500793651, fma(y, z, -0.0027777777777778)), Float64(z / x), Float64(0.083333333333333 / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision], 1e+271], N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(x - 0.91893853320467), $MachinePrecision] - N[(N[(N[(z * N[(y - -0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(z * 0.0007936500793651 + N[(y * z + -0.0027777777777778), $MachinePrecision]), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333 \leq 10^{+271}:\\
\;\;\;\;\log x \cdot \left(x - 0.5\right) - \left(\left(x - 0.91893853320467\right) - \frac{\mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-0.5 \cdot \log x + 0.91893853320467\right) + \mathsf{fma}\left(\mathsf{fma}\left(z, 0.0007936500793651, \mathsf{fma}\left(y, z, -0.0027777777777778\right)\right), \frac{z}{x}, \frac{0.083333333333333}{x}\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)) < 9.99999999999999953e270Initial program 94.1%
lift-+.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
associate-+l-N/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6494.1
Applied rewrites94.1%
if 9.99999999999999953e270 < (+.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.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
lift-fma.f64N/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
distribute-rgt-inN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-fma.f6498.7
Applied rewrites98.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f6464.9
Applied rewrites64.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fma z (- y -0.0007936500793651) -0.0027777777777778)))
(if (<=
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
1e+271)
(-
(* (log x) (- x 0.5))
(- (- x 0.91893853320467) (/ (fma t_0 z 0.083333333333333) x)))
(+
(+ (* -0.5 (log x)) 0.91893853320467)
(fma t_0 (/ z x) (/ 0.083333333333333 x))))))
double code(double x, double y, double z) {
double t_0 = fma(z, (y - -0.0007936500793651), -0.0027777777777778);
double tmp;
if ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) <= 1e+271) {
tmp = (log(x) * (x - 0.5)) - ((x - 0.91893853320467) - (fma(t_0, z, 0.083333333333333) / x));
} else {
tmp = ((-0.5 * log(x)) + 0.91893853320467) + fma(t_0, (z / x), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) t_0 = fma(z, Float64(y - -0.0007936500793651), -0.0027777777777778) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) <= 1e+271) tmp = Float64(Float64(log(x) * Float64(x - 0.5)) - Float64(Float64(x - 0.91893853320467) - Float64(fma(t_0, z, 0.083333333333333) / x))); else tmp = Float64(Float64(Float64(-0.5 * log(x)) + 0.91893853320467) + fma(t_0, Float64(z / x), Float64(0.083333333333333 / x))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y - -0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision], 1e+271], N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(x - 0.91893853320467), $MachinePrecision] - N[(N[(t$95$0 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(t$95$0 * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right)\\
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333 \leq 10^{+271}:\\
\;\;\;\;\log x \cdot \left(x - 0.5\right) - \left(\left(x - 0.91893853320467\right) - \frac{\mathsf{fma}\left(t\_0, z, 0.083333333333333\right)}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-0.5 \cdot \log x + 0.91893853320467\right) + \mathsf{fma}\left(t\_0, \frac{z}{x}, \frac{0.083333333333333}{x}\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)) < 9.99999999999999953e270Initial program 94.1%
lift-+.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
associate-+l-N/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6494.1
Applied rewrites94.1%
if 9.99999999999999953e270 < (+.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.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f6464.9
Applied rewrites64.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_0 -1e+69)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(fma (* y z) (/ z x) (/ 0.083333333333333 x)))
(if (<= t_0 1e+180)
(-
(/
(fma
(fma 0.0007936500793651 z -0.0027777777777778)
z
0.083333333333333)
x)
(- -0.91893853320467 (- (* (log x) (- x 0.5)) x)))
(+
(+ (* -0.5 (log x)) 0.91893853320467)
(fma
(fma z (- y -0.0007936500793651) -0.0027777777777778)
(/ z x)
(/ 0.083333333333333 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+69) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + fma((y * z), (z / x), (0.083333333333333 / x));
} else if (t_0 <= 1e+180) {
tmp = (fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x) - (-0.91893853320467 - ((log(x) * (x - 0.5)) - x));
} else {
tmp = ((-0.5 * log(x)) + 0.91893853320467) + fma(fma(z, (y - -0.0007936500793651), -0.0027777777777778), (z / x), (0.083333333333333 / 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+69) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + fma(Float64(y * z), Float64(z / x), Float64(0.083333333333333 / x))); elseif (t_0 <= 1e+180) tmp = Float64(Float64(fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x) - Float64(-0.91893853320467 - Float64(Float64(log(x) * Float64(x - 0.5)) - x))); else tmp = Float64(Float64(Float64(-0.5 * log(x)) + 0.91893853320467) + fma(fma(z, Float64(y - -0.0007936500793651), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / 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+69], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+180], N[(N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(-0.91893853320467 - N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(z * N[(y - -0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $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^{+69}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(y \cdot z, \frac{z}{x}, \frac{0.083333333333333}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 10^{+180}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} - \left(-0.91893853320467 - \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-0.5 \cdot \log x + 0.91893853320467\right) + \mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\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)) < -1.0000000000000001e69Initial program 94.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
Taylor expanded in y around inf
lower-*.f6484.7
Applied rewrites84.7%
if -1.0000000000000001e69 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 1e180Initial program 94.1%
Taylor expanded in y around 0
Applied rewrites78.5%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
metadata-evalN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
Applied rewrites78.5%
if 1e180 < (+.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.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f6464.9
Applied rewrites64.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (log x) (- x 0.5)))
(t_1
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_1 -1e+69)
(- t_0 (- (- x 0.91893853320467) (/ (fma (* y z) z 0.083333333333333) x)))
(if (<= t_1 1e+180)
(-
(/
(fma
(fma 0.0007936500793651 z -0.0027777777777778)
z
0.083333333333333)
x)
(- -0.91893853320467 (- t_0 x)))
(+
(+ (* -0.5 (log x)) 0.91893853320467)
(fma
(fma z (- y -0.0007936500793651) -0.0027777777777778)
(/ z x)
(/ 0.083333333333333 x)))))))
double code(double x, double y, double z) {
double t_0 = log(x) * (x - 0.5);
double t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_1 <= -1e+69) {
tmp = t_0 - ((x - 0.91893853320467) - (fma((y * z), z, 0.083333333333333) / x));
} else if (t_1 <= 1e+180) {
tmp = (fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x) - (-0.91893853320467 - (t_0 - x));
} else {
tmp = ((-0.5 * log(x)) + 0.91893853320467) + fma(fma(z, (y - -0.0007936500793651), -0.0027777777777778), (z / x), (0.083333333333333 / x));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(log(x) * Float64(x - 0.5)) t_1 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_1 <= -1e+69) tmp = Float64(t_0 - Float64(Float64(x - 0.91893853320467) - Float64(fma(Float64(y * z), z, 0.083333333333333) / x))); elseif (t_1 <= 1e+180) tmp = Float64(Float64(fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x) - Float64(-0.91893853320467 - Float64(t_0 - x))); else tmp = Float64(Float64(Float64(-0.5 * log(x)) + 0.91893853320467) + fma(fma(z, Float64(y - -0.0007936500793651), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / x))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+69], N[(t$95$0 - N[(N[(x - 0.91893853320467), $MachinePrecision] - N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+180], N[(N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(-0.91893853320467 - N[(t$95$0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(z * N[(y - -0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log x \cdot \left(x - 0.5\right)\\
t_1 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+69}:\\
\;\;\;\;t\_0 - \left(\left(x - 0.91893853320467\right) - \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x}\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+180}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} - \left(-0.91893853320467 - \left(t\_0 - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-0.5 \cdot \log x + 0.91893853320467\right) + \mathsf{fma}\left(\mathsf{fma}\left(z, y - -0.0007936500793651, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\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)) < -1.0000000000000001e69Initial program 94.1%
Taylor expanded in y around inf
lower-*.f6482.4
Applied rewrites82.4%
lift-+.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
lower--.f6482.4
Applied rewrites82.4%
if -1.0000000000000001e69 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 1e180Initial program 94.1%
Taylor expanded in y around 0
Applied rewrites78.5%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
metadata-evalN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
Applied rewrites78.5%
if 1e180 < (+.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.1%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f6464.9
Applied rewrites64.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (log x) (- x 0.5))))
(if (<= (+ y 0.0007936500793651) -0.002)
(- t_0 (- (- x 0.91893853320467) (/ (fma (* y z) z 0.083333333333333) x)))
(if (<= (+ y 0.0007936500793651) 5e+38)
(-
(/
(fma
(fma 0.0007936500793651 z -0.0027777777777778)
z
0.083333333333333)
x)
(- -0.91893853320467 (- t_0 x)))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ (+ (* (* y z) z) 0.083333333333333) x))))))
double code(double x, double y, double z) {
double t_0 = log(x) * (x - 0.5);
double tmp;
if ((y + 0.0007936500793651) <= -0.002) {
tmp = t_0 - ((x - 0.91893853320467) - (fma((y * z), z, 0.083333333333333) / x));
} else if ((y + 0.0007936500793651) <= 5e+38) {
tmp = (fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x) - (-0.91893853320467 - (t_0 - x));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((y * z) * z) + 0.083333333333333) / x);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(log(x) * Float64(x - 0.5)) tmp = 0.0 if (Float64(y + 0.0007936500793651) <= -0.002) tmp = Float64(t_0 - Float64(Float64(x - 0.91893853320467) - Float64(fma(Float64(y * z), z, 0.083333333333333) / x))); elseif (Float64(y + 0.0007936500793651) <= 5e+38) tmp = Float64(Float64(fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x) - Float64(-0.91893853320467 - Float64(t_0 - x))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(y * z) * z) + 0.083333333333333) / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], -0.002], N[(t$95$0 - N[(N[(x - 0.91893853320467), $MachinePrecision] - N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], 5e+38], N[(N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(-0.91893853320467 - N[(t$95$0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(y * z), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log x \cdot \left(x - 0.5\right)\\
\mathbf{if}\;y + 0.0007936500793651 \leq -0.002:\\
\;\;\;\;t\_0 - \left(\left(x - 0.91893853320467\right) - \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x}\right)\\
\mathbf{elif}\;y + 0.0007936500793651 \leq 5 \cdot 10^{+38}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} - \left(-0.91893853320467 - \left(t\_0 - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(y \cdot z\right) \cdot z + 0.083333333333333}{x}\\
\end{array}
\end{array}
if (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < -2e-3Initial program 94.1%
Taylor expanded in y around inf
lower-*.f6482.4
Applied rewrites82.4%
lift-+.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
lower--.f6482.4
Applied rewrites82.4%
if -2e-3 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < 4.9999999999999997e38Initial program 94.1%
Taylor expanded in y around 0
Applied rewrites78.5%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lower--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
metadata-evalN/A
lower-fma.f64N/A
lift-+.f64N/A
add-flipN/A
Applied rewrites78.5%
if 4.9999999999999997e38 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) Initial program 94.1%
Taylor expanded in y around inf
lower-*.f6482.4
Applied rewrites82.4%
(FPCore (x y z)
:precision binary64
(if (<= z -3.4e+40)
(/
1.0
(/
x
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)))
(if (<= z 1.3e+29)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ (+ (* (* y z) z) 0.083333333333333) x))
(* (pow z 2.0) (fma 0.0007936500793651 (/ 1.0 x) (/ y x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.4e+40) {
tmp = 1.0 / (x / fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333));
} else if (z <= 1.3e+29) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((y * z) * z) + 0.083333333333333) / x);
} else {
tmp = pow(z, 2.0) * fma(0.0007936500793651, (1.0 / x), (y / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -3.4e+40) tmp = Float64(1.0 / Float64(x / fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333))); elseif (z <= 1.3e+29) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(y * z) * z) + 0.083333333333333) / x)); else tmp = Float64((z ^ 2.0) * fma(0.0007936500793651, Float64(1.0 / x), Float64(y / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -3.4e+40], N[(1.0 / N[(x / N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+29], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(y * z), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[Power[z, 2.0], $MachinePrecision] * N[(0.0007936500793651 * N[(1.0 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+40}:\\
\;\;\;\;\frac{1}{\frac{x}{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+29}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(y \cdot z\right) \cdot z + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;{z}^{2} \cdot \mathsf{fma}\left(0.0007936500793651, \frac{1}{x}, \frac{y}{x}\right)\\
\end{array}
\end{array}
if z < -3.39999999999999989e40Initial program 94.1%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites78.5%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.2
Applied rewrites63.2%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
div-flipN/A
lower-/.f64N/A
lower-/.f6463.2
Applied rewrites63.2%
if -3.39999999999999989e40 < z < 1.3e29Initial program 94.1%
Taylor expanded in y around inf
lower-*.f6482.4
Applied rewrites82.4%
if 1.3e29 < z Initial program 94.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6441.9
Applied rewrites41.9%
(FPCore (x y z)
:precision binary64
(if (<= z -3.4e+40)
(/
1.0
(/
x
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)))
(if (<= z 1.3e+29)
(-
(- (* (log x) (- x 0.5)) x)
(- -0.91893853320467 (/ (fma (* y z) z 0.083333333333333) x)))
(* (pow z 2.0) (fma 0.0007936500793651 (/ 1.0 x) (/ y x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.4e+40) {
tmp = 1.0 / (x / fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333));
} else if (z <= 1.3e+29) {
tmp = ((log(x) * (x - 0.5)) - x) - (-0.91893853320467 - (fma((y * z), z, 0.083333333333333) / x));
} else {
tmp = pow(z, 2.0) * fma(0.0007936500793651, (1.0 / x), (y / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -3.4e+40) tmp = Float64(1.0 / Float64(x / fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333))); elseif (z <= 1.3e+29) tmp = Float64(Float64(Float64(log(x) * Float64(x - 0.5)) - x) - Float64(-0.91893853320467 - Float64(fma(Float64(y * z), z, 0.083333333333333) / x))); else tmp = Float64((z ^ 2.0) * fma(0.0007936500793651, Float64(1.0 / x), Float64(y / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -3.4e+40], N[(1.0 / N[(x / N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+29], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] - N[(-0.91893853320467 - N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[z, 2.0], $MachinePrecision] * N[(0.0007936500793651 * N[(1.0 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+40}:\\
\;\;\;\;\frac{1}{\frac{x}{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+29}:\\
\;\;\;\;\left(\log x \cdot \left(x - 0.5\right) - x\right) - \left(-0.91893853320467 - \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;{z}^{2} \cdot \mathsf{fma}\left(0.0007936500793651, \frac{1}{x}, \frac{y}{x}\right)\\
\end{array}
\end{array}
if z < -3.39999999999999989e40Initial program 94.1%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites78.5%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.2
Applied rewrites63.2%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
div-flipN/A
lower-/.f64N/A
lower-/.f6463.2
Applied rewrites63.2%
if -3.39999999999999989e40 < z < 1.3e29Initial program 94.1%
Taylor expanded in y around inf
lower-*.f6482.4
Applied rewrites82.4%
lift-+.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
associate-+l-N/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower--.f6482.4
Applied rewrites82.4%
if 1.3e29 < z Initial program 94.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6441.9
Applied rewrites41.9%
(FPCore (x y z)
:precision binary64
(if (<= x 1.95e-31)
(/
(+
0.083333333333333
(*
z
(-
(* (fma y 1260.0011340009878 1.0) (* 0.0007936500793651 z))
0.0027777777777778)))
x)
(-
(* (log x) (- x 0.5))
(- (- x 0.91893853320467) (/ (fma (* y z) z 0.083333333333333) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.95e-31) {
tmp = (0.083333333333333 + (z * ((fma(y, 1260.0011340009878, 1.0) * (0.0007936500793651 * z)) - 0.0027777777777778))) / x;
} else {
tmp = (log(x) * (x - 0.5)) - ((x - 0.91893853320467) - (fma((y * z), z, 0.083333333333333) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.95e-31) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(fma(y, 1260.0011340009878, 1.0) * Float64(0.0007936500793651 * z)) - 0.0027777777777778))) / x); else tmp = Float64(Float64(log(x) * Float64(x - 0.5)) - Float64(Float64(x - 0.91893853320467) - Float64(fma(Float64(y * z), z, 0.083333333333333) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.95e-31], N[(N[(0.083333333333333 + N[(z * N[(N[(N[(y * 1260.0011340009878 + 1.0), $MachinePrecision] * N[(0.0007936500793651 * z), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(x - 0.91893853320467), $MachinePrecision] - N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.95 \cdot 10^{-31}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(\mathsf{fma}\left(y, 1260.0011340009878, 1\right) \cdot \left(0.0007936500793651 \cdot z\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\log x \cdot \left(x - 0.5\right) - \left(\left(x - 0.91893853320467\right) - \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x}\right)\\
\end{array}
\end{array}
if x < 1.9500000000000001e-31Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
sum-to-multN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f6463.1
Applied rewrites63.1%
if 1.9500000000000001e-31 < x Initial program 94.1%
Taylor expanded in y around inf
lower-*.f6482.4
Applied rewrites82.4%
lift-+.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
lower--.f6482.4
Applied rewrites82.4%
(FPCore (x y z)
:precision binary64
(if (<= x 1.95e-31)
(/
(+
0.083333333333333
(*
z
(-
(* (fma y 1260.0011340009878 1.0) (* 0.0007936500793651 z))
0.0027777777777778)))
x)
(-
(- (* (log x) (- x 0.5)) x)
(- -0.91893853320467 (/ (fma (* y z) z 0.083333333333333) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.95e-31) {
tmp = (0.083333333333333 + (z * ((fma(y, 1260.0011340009878, 1.0) * (0.0007936500793651 * z)) - 0.0027777777777778))) / x;
} else {
tmp = ((log(x) * (x - 0.5)) - x) - (-0.91893853320467 - (fma((y * z), z, 0.083333333333333) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.95e-31) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(fma(y, 1260.0011340009878, 1.0) * Float64(0.0007936500793651 * z)) - 0.0027777777777778))) / x); else tmp = Float64(Float64(Float64(log(x) * Float64(x - 0.5)) - x) - Float64(-0.91893853320467 - Float64(fma(Float64(y * z), z, 0.083333333333333) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.95e-31], N[(N[(0.083333333333333 + N[(z * N[(N[(N[(y * 1260.0011340009878 + 1.0), $MachinePrecision] * N[(0.0007936500793651 * z), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] - N[(-0.91893853320467 - N[(N[(N[(y * z), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.95 \cdot 10^{-31}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(\mathsf{fma}\left(y, 1260.0011340009878, 1\right) \cdot \left(0.0007936500793651 \cdot z\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x \cdot \left(x - 0.5\right) - x\right) - \left(-0.91893853320467 - \frac{\mathsf{fma}\left(y \cdot z, z, 0.083333333333333\right)}{x}\right)\\
\end{array}
\end{array}
if x < 1.9500000000000001e-31Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
sum-to-multN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f6463.1
Applied rewrites63.1%
if 1.9500000000000001e-31 < x Initial program 94.1%
Taylor expanded in y around inf
lower-*.f6482.4
Applied rewrites82.4%
lift-+.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
associate-+l-N/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower--.f6482.4
Applied rewrites82.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_0 -1e+69)
(*
(+
0.083333333333333
(*
z
(-
(* (* z (fma y 1260.0011340009878 1.0)) 0.0007936500793651)
0.0027777777777778)))
(/ 1.0 x))
(if (<= t_0 1e+31)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))
(/
1.0
(/
x
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)))))))
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+69) {
tmp = (0.083333333333333 + (z * (((z * fma(y, 1260.0011340009878, 1.0)) * 0.0007936500793651) - 0.0027777777777778))) * (1.0 / x);
} else if (t_0 <= 1e+31) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
} else {
tmp = 1.0 / (x / fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333));
}
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+69) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(Float64(z * fma(y, 1260.0011340009878, 1.0)) * 0.0007936500793651) - 0.0027777777777778))) * Float64(1.0 / x)); elseif (t_0 <= 1e+31) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); else tmp = Float64(1.0 / Float64(x / fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333))); 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+69], N[(N[(0.083333333333333 + N[(z * N[(N[(N[(z * N[(y * 1260.0011340009878 + 1.0), $MachinePrecision]), $MachinePrecision] * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+31], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x / N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $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^{+69}:\\
\;\;\;\;\left(0.083333333333333 + z \cdot \left(\left(z \cdot \mathsf{fma}\left(y, 1260.0011340009878, 1\right)\right) \cdot 0.0007936500793651 - 0.0027777777777778\right)\right) \cdot \frac{1}{x}\\
\mathbf{elif}\;t\_0 \leq 10^{+31}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\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)) < -1.0000000000000001e69Initial program 94.1%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites78.5%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.2
Applied rewrites63.2%
lift-*.f64N/A
lift-+.f64N/A
sum-to-multN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
mult-flipN/A
lower-fma.f64N/A
metadata-eval63.1
Applied rewrites63.1%
if -1.0000000000000001e69 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 9.9999999999999996e30Initial program 94.1%
Taylor expanded in z around 0
Applied rewrites57.5%
if 9.9999999999999996e30 < (+.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.1%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites78.5%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.2
Applied rewrites63.2%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
div-flipN/A
lower-/.f64N/A
lower-/.f6463.2
Applied rewrites63.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fma (- y -0.0007936500793651) z -0.0027777777777778))
(t_1
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_1 -1e+69)
(/ (* z t_0) x)
(if (<= t_1 1e+31)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))
(/ 1.0 (/ x (fma t_0 z 0.083333333333333)))))))
double code(double x, double y, double z) {
double t_0 = fma((y - -0.0007936500793651), z, -0.0027777777777778);
double t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_1 <= -1e+69) {
tmp = (z * t_0) / x;
} else if (t_1 <= 1e+31) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
} else {
tmp = 1.0 / (x / fma(t_0, z, 0.083333333333333));
}
return tmp;
}
function code(x, y, z) t_0 = fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778) t_1 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_1 <= -1e+69) tmp = Float64(Float64(z * t_0) / x); elseif (t_1 <= 1e+31) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); else tmp = Float64(1.0 / Float64(x / fma(t_0, z, 0.083333333333333))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+69], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 1e+31], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x / N[(t$95$0 * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right)\\
t_1 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+69}:\\
\;\;\;\;\frac{z \cdot t\_0}{x}\\
\mathbf{elif}\;t\_1 \leq 10^{+31}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{\mathsf{fma}\left(t\_0, z, 0.083333333333333\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)) < -1.0000000000000001e69Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
*-commutativeN/A
sum-to-multN/A
*-commutativeN/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites63.0%
Taylor expanded in y around inf
Applied rewrites42.1%
if -1.0000000000000001e69 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 9.9999999999999996e30Initial program 94.1%
Taylor expanded in z around 0
Applied rewrites57.5%
if 9.9999999999999996e30 < (+.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.1%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites78.5%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.2
Applied rewrites63.2%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
div-flipN/A
lower-/.f64N/A
lower-/.f6463.2
Applied rewrites63.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fma (- y -0.0007936500793651) z -0.0027777777777778))
(t_1
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_1 -1e+69)
(/ (* z t_0) x)
(if (<= t_1 1e+31)
(-
(- (* (log x) (- x 0.5)) x)
(- -0.91893853320467 (/ 0.083333333333333 x)))
(/ 1.0 (/ x (fma t_0 z 0.083333333333333)))))))
double code(double x, double y, double z) {
double t_0 = fma((y - -0.0007936500793651), z, -0.0027777777777778);
double t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_1 <= -1e+69) {
tmp = (z * t_0) / x;
} else if (t_1 <= 1e+31) {
tmp = ((log(x) * (x - 0.5)) - x) - (-0.91893853320467 - (0.083333333333333 / x));
} else {
tmp = 1.0 / (x / fma(t_0, z, 0.083333333333333));
}
return tmp;
}
function code(x, y, z) t_0 = fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778) t_1 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_1 <= -1e+69) tmp = Float64(Float64(z * t_0) / x); elseif (t_1 <= 1e+31) tmp = Float64(Float64(Float64(log(x) * Float64(x - 0.5)) - x) - Float64(-0.91893853320467 - Float64(0.083333333333333 / x))); else tmp = Float64(1.0 / Float64(x / fma(t_0, z, 0.083333333333333))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+69], N[(N[(z * t$95$0), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[t$95$1, 1e+31], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] - N[(-0.91893853320467 - N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x / N[(t$95$0 * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right)\\
t_1 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+69}:\\
\;\;\;\;\frac{z \cdot t\_0}{x}\\
\mathbf{elif}\;t\_1 \leq 10^{+31}:\\
\;\;\;\;\left(\log x \cdot \left(x - 0.5\right) - x\right) - \left(-0.91893853320467 - \frac{0.083333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{\mathsf{fma}\left(t\_0, z, 0.083333333333333\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)) < -1.0000000000000001e69Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
*-commutativeN/A
sum-to-multN/A
*-commutativeN/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites63.0%
Taylor expanded in y around inf
Applied rewrites42.1%
if -1.0000000000000001e69 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 9.9999999999999996e30Initial program 94.1%
Taylor expanded in z around 0
Applied rewrites57.5%
lift-+.f64N/A
lift-+.f64N/A
add-flipN/A
associate-+l-N/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
metadata-eval57.5
Applied rewrites57.5%
if 9.9999999999999996e30 < (+.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.1%
lift-+.f64N/A
lift-/.f64N/A
add-to-fractionN/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites78.5%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.2
Applied rewrites63.2%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
div-flipN/A
lower-/.f64N/A
lower-/.f6463.2
Applied rewrites63.2%
(FPCore (x y z)
:precision binary64
(if (<= x 1.7e+99)
(/
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(* x (- (* -1.0 (log (/ 1.0 x))) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.7e+99) {
tmp = fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = x * ((-1.0 * log((1.0 / x))) - 1.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.7e+99) tmp = Float64(fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(x * Float64(Float64(-1.0 * log(Float64(1.0 / x))) - 1.0)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.7e+99], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[(-1.0 * N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.7 \cdot 10^{+99}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)\\
\end{array}
\end{array}
if x < 1.69999999999999992e99Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6463.3
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f6463.3
Applied rewrites63.3%
if 1.69999999999999992e99 < x Initial program 94.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
(FPCore (x y z)
:precision binary64
(if (<= x 1.7e+99)
(/
(fma
(fma (- y -0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(* 1.0 (- (* (log x) (- x 0.5)) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.7e+99) {
tmp = fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = 1.0 * ((log(x) * (x - 0.5)) - x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.7e+99) tmp = Float64(fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(1.0 * Float64(Float64(log(x) * Float64(x - 0.5)) - x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.7e+99], N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(1.0 * N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.7 \cdot 10^{+99}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\end{array}
\end{array}
if x < 1.69999999999999992e99Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6463.3
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f6463.3
Applied rewrites63.3%
if 1.69999999999999992e99 < x Initial program 94.1%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
sum-to-multN/A
lower-*.f64N/A
Applied rewrites93.9%
Taylor expanded in x around inf
Applied rewrites36.2%
(FPCore (x y z) :precision binary64 (/ (fma (fma (- y -0.0007936500793651) z -0.0027777777777778) z 0.083333333333333) x))
double code(double x, double y, double z) {
return fma(fma((y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
}
function code(x, y, z) return Float64(fma(fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x) end
code[x_, y_, z_] := N[(N[(N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(\mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}
\end{array}
Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6463.3
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f6463.3
Applied rewrites63.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* z (fma (- y -0.0007936500793651) z -0.0027777777777778)) x))
(t_1
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_1 -1e+69)
t_0
(if (<= t_1 50.0)
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x)
t_0))))
double code(double x, double y, double z) {
double t_0 = (z * fma((y - -0.0007936500793651), z, -0.0027777777777778)) / x;
double t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_1 <= -1e+69) {
tmp = t_0;
} else if (t_1 <= 50.0) {
tmp = (0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(z * fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778)) / x) t_1 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_1 <= -1e+69) tmp = t_0; elseif (t_1 <= 50.0) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+69], t$95$0, If[LessEqual[t$95$1, 50.0], N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z \cdot \mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right)}{x}\\
t_1 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+69}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 50:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\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)) < -1.0000000000000001e69 or 50 < (+.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.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
*-commutativeN/A
sum-to-multN/A
*-commutativeN/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites63.0%
Taylor expanded in y around inf
Applied rewrites42.1%
if -1.0000000000000001e69 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 50Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
Taylor expanded in y around 0
lower-*.f6447.0
Applied rewrites47.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* z (fma (- y -0.0007936500793651) z -0.0027777777777778)) x))
(t_1
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)))
(if (<= t_1 -1e+69)
t_0
(if (<= t_1 0.2)
(/ (+ 0.083333333333333 (* -0.0027777777777778 z)) x)
t_0))))
double code(double x, double y, double z) {
double t_0 = (z * fma((y - -0.0007936500793651), z, -0.0027777777777778)) / x;
double t_1 = ((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333;
double tmp;
if (t_1 <= -1e+69) {
tmp = t_0;
} else if (t_1 <= 0.2) {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(z * fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778)) / x) t_1 = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) tmp = 0.0 if (t_1 <= -1e+69) tmp = t_0; elseif (t_1 <= 0.2) tmp = Float64(Float64(0.083333333333333 + Float64(-0.0027777777777778 * z)) / x); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+69], t$95$0, If[LessEqual[t$95$1, 0.2], N[(N[(0.083333333333333 + N[(-0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z \cdot \mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right)}{x}\\
t_1 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+69}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 0.2:\\
\;\;\;\;\frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\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)) < -1.0000000000000001e69 or 0.20000000000000001 < (+.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.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
*-commutativeN/A
sum-to-multN/A
*-commutativeN/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites63.0%
Taylor expanded in y around inf
Applied rewrites42.1%
if -1.0000000000000001e69 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 0.20000000000000001Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
Taylor expanded in z around 0
lower-*.f6429.3
Applied rewrites29.3%
(FPCore (x y z)
:precision binary64
(if (<= z -4e-56)
(/
(*
-29.99999999999964
(fma (- y -0.0007936500793651) z -0.0027777777777778))
x)
(/ (+ 0.083333333333333 (* -0.0027777777777778 z)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -4e-56) {
tmp = (-29.99999999999964 * fma((y - -0.0007936500793651), z, -0.0027777777777778)) / x;
} else {
tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -4e-56) tmp = Float64(Float64(-29.99999999999964 * fma(Float64(y - -0.0007936500793651), z, -0.0027777777777778)) / x); else tmp = Float64(Float64(0.083333333333333 + Float64(-0.0027777777777778 * z)) / x); end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -4e-56], N[(N[(-29.99999999999964 * N[(N[(y - -0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.083333333333333 + N[(-0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-56}:\\
\;\;\;\;\frac{-29.99999999999964 \cdot \mathsf{fma}\left(y - -0.0007936500793651, z, -0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x}\\
\end{array}
\end{array}
if z < -4.0000000000000002e-56Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
*-commutativeN/A
sum-to-multN/A
*-commutativeN/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites63.0%
Taylor expanded in z around 0
Applied rewrites31.1%
if -4.0000000000000002e-56 < z Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
Taylor expanded in z around 0
lower-*.f6429.3
Applied rewrites29.3%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* -0.0027777777777778 z)) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (-0.0027777777777778 * z)) / 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 + ((-0.0027777777777778d0) * z)) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (-0.0027777777777778 * z)) / x;
}
def code(x, y, z): return (0.083333333333333 + (-0.0027777777777778 * z)) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(-0.0027777777777778 * z)) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (-0.0027777777777778 * z)) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(-0.0027777777777778 * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x}
\end{array}
Initial program 94.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
Taylor expanded in z around 0
lower-*.f6429.3
Applied rewrites29.3%
(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.1%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6463.3
Applied rewrites63.3%
Taylor expanded in z around 0
Applied rewrites23.7%
herbie shell --seed 2025149
(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)))