
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
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, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
}
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, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- (* (log y) (- x 1.0)) t)))
double code(double x, double y, double z, double t) {
return fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, ((log(y) * (x - 1.0)) - t));
}
function code(x, y, z, t) return fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(Float64(log(y) * Float64(x - 1.0)) - t)) end
code[x_, y_, z_, t_] := N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, \log y \cdot \left(x - 1\right) - t\right)
\end{array}
Initial program 88.9%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.5
Applied rewrites99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* (log y) x) t))
(t_2 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t)))
(if (<= t_2 -5e+41)
t_1
(if (<= t_2 111.0)
(fma (- 1.0 z) y (- t))
(if (<= t_2 2e+29) (- (- (log y)) t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (log(y) * x) - t;
double t_2 = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
double tmp;
if (t_2 <= -5e+41) {
tmp = t_1;
} else if (t_2 <= 111.0) {
tmp = fma((1.0 - z), y, -t);
} else if (t_2 <= 2e+29) {
tmp = -log(y) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(log(y) * x) - t) t_2 = Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) tmp = 0.0 if (t_2 <= -5e+41) tmp = t_1; elseif (t_2 <= 111.0) tmp = fma(Float64(1.0 - z), y, Float64(-t)); elseif (t_2 <= 2e+29) tmp = Float64(Float64(-log(y)) - t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+41], t$95$1, If[LessEqual[t$95$2, 111.0], N[(N[(1.0 - z), $MachinePrecision] * y + (-t)), $MachinePrecision], If[LessEqual[t$95$2, 2e+29], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x - t\\
t_2 := \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 111:\\
\;\;\;\;\mathsf{fma}\left(1 - z, y, -t\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+29}:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < -5.00000000000000022e41 or 1.99999999999999983e29 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) Initial program 93.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6492.7
Applied rewrites92.7%
if -5.00000000000000022e41 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 111Initial program 73.0%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.0
Applied rewrites99.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-log.f64N/A
lower-/.f64N/A
lift--.f6497.4
Applied rewrites97.4%
Taylor expanded in y around 0
lower--.f6497.0
Applied rewrites97.0%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6447.3
Applied rewrites47.3%
if 111 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 1.99999999999999983e29Initial program 78.8%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites94.4%
Taylor expanded in y around 0
mul-1-negN/A
lift-log.f64N/A
lift-neg.f6473.4
Applied rewrites73.4%
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (* (- (* -0.5 y) 1.0) y))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * (((-0.5 * y) - 1.0) * y))) - t;
}
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, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x - 1.0d0) * log(y)) + ((z - 1.0d0) * ((((-0.5d0) * y) - 1.0d0) * y))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * (((-0.5 * y) - 1.0) * y))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * (((-0.5 * y) - 1.0) * y))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * Float64(Float64(Float64(-0.5 * y) - 1.0) * y))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * (((-0.5 * y) - 1.0) * y))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \left(\left(-0.5 \cdot y - 1\right) \cdot y\right)\right) - t
\end{array}
Initial program 88.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6499.5
Applied rewrites99.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -1e+285)
(fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- t))
(if (<= z 8.5e+159)
(fma (- x 1.0) (log y) (- t))
(if (<= z 7.8e+247)
(- (* (* (- (* -0.5 y) 1.0) z) y) t)
(fma (- 1.0 z) y (* (log y) x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1e+285) {
tmp = fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, -t);
} else if (z <= 8.5e+159) {
tmp = fma((x - 1.0), log(y), -t);
} else if (z <= 7.8e+247) {
tmp = ((((-0.5 * y) - 1.0) * z) * y) - t;
} else {
tmp = fma((1.0 - z), y, (log(y) * x));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -1e+285) tmp = fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(-t)); elseif (z <= 8.5e+159) tmp = fma(Float64(x - 1.0), log(y), Float64(-t)); elseif (z <= 7.8e+247) tmp = Float64(Float64(Float64(Float64(Float64(-0.5 * y) - 1.0) * z) * y) - t); else tmp = fma(Float64(1.0 - z), y, Float64(log(y) * x)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -1e+285], N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision], If[LessEqual[z, 8.5e+159], N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision], If[LessEqual[z, 7.8e+247], N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision], N[(N[(1.0 - z), $MachinePrecision] * y + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+285}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+247}:\\
\;\;\;\;\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - z, y, \log y \cdot x\right)\\
\end{array}
\end{array}
if z < -9.9999999999999998e284Initial program 56.4%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.5
Applied rewrites99.5%
Taylor expanded in t around inf
mul-1-negN/A
lift-neg.f6462.2
Applied rewrites62.2%
if -9.9999999999999998e284 < z < 8.50000000000000076e159Initial program 93.5%
lift--.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-log.f64N/A
associate--l+N/A
lower-fma.f64N/A
lift--.f64N/A
lift-log.f64N/A
lower--.f64N/A
Applied rewrites93.5%
Taylor expanded in y around 0
mul-1-negN/A
lift-neg.f6492.6
Applied rewrites92.6%
if 8.50000000000000076e159 < z < 7.80000000000000003e247Initial program 70.1%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.2
Applied rewrites99.2%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites68.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6459.3
Applied rewrites59.3%
if 7.80000000000000003e247 < z Initial program 50.4%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.2
Applied rewrites99.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-log.f64N/A
lower-/.f64N/A
lift--.f6489.4
Applied rewrites89.4%
Taylor expanded in y around 0
lower--.f6488.7
Applied rewrites88.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6473.9
Applied rewrites73.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)))
(if (<= x -9e+162)
t_1
(if (<= x -2.9e-27)
(fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- t))
(if (<= x 2.9e-14)
(- (- (log y)) t)
(if (<= x 1.28e+151) (- (* (- y) z) t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -9e+162) {
tmp = t_1;
} else if (x <= -2.9e-27) {
tmp = fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, -t);
} else if (x <= 2.9e-14) {
tmp = -log(y) - t;
} else if (x <= 1.28e+151) {
tmp = (-y * z) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -9e+162) tmp = t_1; elseif (x <= -2.9e-27) tmp = fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(-t)); elseif (x <= 2.9e-14) tmp = Float64(Float64(-log(y)) - t); elseif (x <= 1.28e+151) tmp = Float64(Float64(Float64(-y) * z) - t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -9e+162], t$95$1, If[LessEqual[x, -2.9e-27], N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision], If[LessEqual[x, 2.9e-14], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], If[LessEqual[x, 1.28e+151], N[(N[((-y) * z), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -9 \cdot 10^{+162}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-27}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-14}:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{elif}\;x \leq 1.28 \cdot 10^{+151}:\\
\;\;\;\;\left(-y\right) \cdot z - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.99999999999999944e162 or 1.28000000000000006e151 < x Initial program 98.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6485.0
Applied rewrites85.0%
if -8.99999999999999944e162 < x < -2.90000000000000004e-27Initial program 87.9%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.5
Applied rewrites99.5%
Taylor expanded in t around inf
mul-1-negN/A
lift-neg.f6448.6
Applied rewrites48.6%
if -2.90000000000000004e-27 < x < 2.9000000000000003e-14Initial program 84.5%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.4
Applied rewrites99.4%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites99.4%
Taylor expanded in y around 0
mul-1-negN/A
lift-log.f64N/A
lift-neg.f6483.0
Applied rewrites83.0%
if 2.9000000000000003e-14 < x < 1.28000000000000006e151Initial program 87.9%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.2
Applied rewrites99.2%
Taylor expanded in z around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lift-neg.f6447.8
Applied rewrites47.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (fma (- y) z (* (log y) x)) t)))
(if (<= x -6.5e+31)
t_1
(if (<= x 2.9e-14) (fma (- 1.0 z) y (- (- (log y)) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(-y, z, (log(y) * x)) - t;
double tmp;
if (x <= -6.5e+31) {
tmp = t_1;
} else if (x <= 2.9e-14) {
tmp = fma((1.0 - z), y, (-log(y) - t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(fma(Float64(-y), z, Float64(log(y) * x)) - t) tmp = 0.0 if (x <= -6.5e+31) tmp = t_1; elseif (x <= 2.9e-14) tmp = fma(Float64(1.0 - z), y, Float64(Float64(-log(y)) - t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[((-y) * z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -6.5e+31], t$95$1, If[LessEqual[x, 2.9e-14], N[(N[(1.0 - z), $MachinePrecision] * y + N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-y, z, \log y \cdot x\right) - t\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(1 - z, y, \left(-\log y\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.5000000000000004e31 or 2.9000000000000003e-14 < x Initial program 93.5%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.3
Applied rewrites99.3%
Taylor expanded in x around inf
Applied rewrites98.0%
Taylor expanded in z around inf
Applied rewrites98.0%
if -6.5000000000000004e31 < x < 2.9000000000000003e-14Initial program 84.6%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.4
Applied rewrites99.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-log.f64N/A
lower-/.f64N/A
lift--.f6498.8
Applied rewrites98.8%
Taylor expanded in y around 0
lower--.f6498.4
Applied rewrites98.4%
Taylor expanded in x around 0
lower--.f64N/A
mul-1-negN/A
lift-log.f64N/A
lift-neg.f6496.5
Applied rewrites96.5%
(FPCore (x y z t)
:precision binary64
(if (<= x -6.5e+31)
(- (* (log y) x) t)
(if (<= x 0.0265)
(fma (- 1.0 z) y (- (- (log y)) t))
(fma (- x 1.0) (log y) (- t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.5e+31) {
tmp = (log(y) * x) - t;
} else if (x <= 0.0265) {
tmp = fma((1.0 - z), y, (-log(y) - t));
} else {
tmp = fma((x - 1.0), log(y), -t);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -6.5e+31) tmp = Float64(Float64(log(y) * x) - t); elseif (x <= 0.0265) tmp = fma(Float64(1.0 - z), y, Float64(Float64(-log(y)) - t)); else tmp = fma(Float64(x - 1.0), log(y), Float64(-t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.5e+31], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 0.0265], N[(N[(1.0 - z), $MachinePrecision] * y + N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]), $MachinePrecision], N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+31}:\\
\;\;\;\;\log y \cdot x - t\\
\mathbf{elif}\;x \leq 0.0265:\\
\;\;\;\;\mathsf{fma}\left(1 - z, y, \left(-\log y\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\
\end{array}
\end{array}
if x < -6.5000000000000004e31Initial program 93.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6493.0
Applied rewrites93.0%
if -6.5000000000000004e31 < x < 0.0264999999999999993Initial program 84.5%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.4
Applied rewrites99.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-log.f64N/A
lower-/.f64N/A
lift--.f6498.8
Applied rewrites98.8%
Taylor expanded in y around 0
lower--.f6498.5
Applied rewrites98.5%
Taylor expanded in x around 0
lower--.f64N/A
mul-1-negN/A
lift-log.f64N/A
lift-neg.f6496.2
Applied rewrites96.2%
if 0.0264999999999999993 < x Initial program 93.8%
lift--.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-log.f64N/A
associate--l+N/A
lower-fma.f64N/A
lift--.f64N/A
lift-log.f64N/A
lower--.f64N/A
Applied rewrites93.8%
Taylor expanded in y around 0
mul-1-negN/A
lift-neg.f6493.2
Applied rewrites93.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- t))))
(if (<= z -1e+285)
t_1
(if (<= z 8.5e+159) (fma (- x 1.0) (log y) (- t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, -t);
double tmp;
if (z <= -1e+285) {
tmp = t_1;
} else if (z <= 8.5e+159) {
tmp = fma((x - 1.0), log(y), -t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(-t)) tmp = 0.0 if (z <= -1e+285) tmp = t_1; elseif (z <= 8.5e+159) tmp = fma(Float64(x - 1.0), log(y), Float64(-t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision]}, If[LessEqual[z, -1e+285], t$95$1, If[LessEqual[z, 8.5e+159], N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\
\mathbf{if}\;z \leq -1 \cdot 10^{+285}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(x - 1, \log y, -t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.9999999999999998e284 or 8.50000000000000076e159 < z Initial program 61.6%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.3
Applied rewrites99.3%
Taylor expanded in t around inf
mul-1-negN/A
lift-neg.f6463.1
Applied rewrites63.1%
if -9.9999999999999998e284 < z < 8.50000000000000076e159Initial program 93.5%
lift--.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-log.f64N/A
associate--l+N/A
lower-fma.f64N/A
lift--.f64N/A
lift-log.f64N/A
lower--.f64N/A
Applied rewrites93.5%
Taylor expanded in y around 0
mul-1-negN/A
lift-neg.f6492.6
Applied rewrites92.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- t))))
(if (<= z -1e+285)
t_1
(if (<= z 8.5e+159) (- (* (log y) (- x 1.0)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, -t);
double tmp;
if (z <= -1e+285) {
tmp = t_1;
} else if (z <= 8.5e+159) {
tmp = (log(y) * (x - 1.0)) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(-t)) tmp = 0.0 if (z <= -1e+285) tmp = t_1; elseif (z <= 8.5e+159) tmp = Float64(Float64(log(y) * Float64(x - 1.0)) - t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision]}, If[LessEqual[z, -1e+285], t$95$1, If[LessEqual[z, 8.5e+159], N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\
\mathbf{if}\;z \leq -1 \cdot 10^{+285}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+159}:\\
\;\;\;\;\log y \cdot \left(x - 1\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.9999999999999998e284 or 8.50000000000000076e159 < z Initial program 61.6%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.3
Applied rewrites99.3%
Taylor expanded in t around inf
mul-1-negN/A
lift-neg.f6463.1
Applied rewrites63.1%
if -9.9999999999999998e284 < z < 8.50000000000000076e159Initial program 93.5%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6492.6
Applied rewrites92.6%
(FPCore (x y z t) :precision binary64 (- (fma (- y) (- z 1.0) (* (log y) (- x 1.0))) t))
double code(double x, double y, double z, double t) {
return fma(-y, (z - 1.0), (log(y) * (x - 1.0))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(-y), Float64(z - 1.0), Float64(log(y) * Float64(x - 1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[((-y) * N[(z - 1.0), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-y, z - 1, \log y \cdot \left(x - 1\right)\right) - t
\end{array}
Initial program 88.9%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.1
Applied rewrites99.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- t)))) (if (<= z -7.2e+116) t_1 (if (<= z 1.15e+153) (- (- (log y)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, -t);
double tmp;
if (z <= -7.2e+116) {
tmp = t_1;
} else if (z <= 1.15e+153) {
tmp = -log(y) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(-t)) tmp = 0.0 if (z <= -7.2e+116) tmp = t_1; elseif (z <= 1.15e+153) tmp = Float64(Float64(-log(y)) - t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision]}, If[LessEqual[z, -7.2e+116], t$95$1, If[LessEqual[z, 1.15e+153], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+153}:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.19999999999999941e116 or 1.1500000000000001e153 < z Initial program 66.3%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.1
Applied rewrites99.1%
Taylor expanded in t around inf
mul-1-negN/A
lift-neg.f6461.0
Applied rewrites61.0%
if -7.19999999999999941e116 < z < 1.1500000000000001e153Initial program 97.9%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.6
Applied rewrites99.6%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites62.5%
Taylor expanded in y around 0
mul-1-negN/A
lift-log.f64N/A
lift-neg.f6460.3
Applied rewrites60.3%
(FPCore (x y z t) :precision binary64 (fma (fma (* -0.5 y) (- z 1.0) (- (- z 1.0))) y (- t)))
double code(double x, double y, double z, double t) {
return fma(fma((-0.5 * y), (z - 1.0), -(z - 1.0)), y, -t);
}
function code(x, y, z, t) return fma(fma(Float64(-0.5 * y), Float64(z - 1.0), Float64(-Float64(z - 1.0))), y, Float64(-t)) end
code[x_, y_, z_, t_] := N[(N[(N[(-0.5 * y), $MachinePrecision] * N[(z - 1.0), $MachinePrecision] + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y + (-t)), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z - 1, -\left(z - 1\right)\right), y, -t\right)
\end{array}
Initial program 88.9%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.5
Applied rewrites99.5%
Taylor expanded in t around inf
mul-1-negN/A
lift-neg.f6445.9
Applied rewrites45.9%
(FPCore (x y z t) :precision binary64 (- (* (* (- (* -0.5 y) 1.0) z) y) t))
double code(double x, double y, double z, double t) {
return ((((-0.5 * y) - 1.0) * z) * y) - t;
}
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, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((((-0.5d0) * y) - 1.0d0) * z) * y) - t
end function
public static double code(double x, double y, double z, double t) {
return ((((-0.5 * y) - 1.0) * z) * y) - t;
}
def code(x, y, z, t): return ((((-0.5 * y) - 1.0) * z) * y) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(Float64(-0.5 * y) - 1.0) * z) * y) - t) end
function tmp = code(x, y, z, t) tmp = ((((-0.5 * y) - 1.0) * z) * y) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[(-0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-0.5 \cdot y - 1\right) \cdot z\right) \cdot y - t
\end{array}
Initial program 88.9%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.5
Applied rewrites99.5%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites64.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6445.7
Applied rewrites45.7%
(FPCore (x y z t) :precision binary64 (if (<= t -1860000000.0) (- t) (if (<= t 1.1e+44) (* (- 1.0 z) y) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1860000000.0) {
tmp = -t;
} else if (t <= 1.1e+44) {
tmp = (1.0 - z) * y;
} else {
tmp = -t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1860000000.0d0)) then
tmp = -t
else if (t <= 1.1d+44) then
tmp = (1.0d0 - z) * y
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1860000000.0) {
tmp = -t;
} else if (t <= 1.1e+44) {
tmp = (1.0 - z) * y;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1860000000.0: tmp = -t elif t <= 1.1e+44: tmp = (1.0 - z) * y else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1860000000.0) tmp = Float64(-t); elseif (t <= 1.1e+44) tmp = Float64(Float64(1.0 - z) * y); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1860000000.0) tmp = -t; elseif (t <= 1.1e+44) tmp = (1.0 - z) * y; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1860000000.0], (-t), If[LessEqual[t, 1.1e+44], N[(N[(1.0 - z), $MachinePrecision] * y), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1860000000:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+44}:\\
\;\;\;\;\left(1 - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -1.86e9 or 1.09999999999999998e44 < t Initial program 95.0%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6470.4
Applied rewrites70.4%
if -1.86e9 < t < 1.09999999999999998e44Initial program 83.9%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.3
Applied rewrites99.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate--l+N/A
div-subN/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f6410.2
Applied rewrites10.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6418.4
Applied rewrites18.4%
(FPCore (x y z t) :precision binary64 (if (<= t -1860000000.0) (- t) (if (<= t 1.1e+44) (* (- z) y) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1860000000.0) {
tmp = -t;
} else if (t <= 1.1e+44) {
tmp = -z * y;
} else {
tmp = -t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1860000000.0d0)) then
tmp = -t
else if (t <= 1.1d+44) then
tmp = -z * y
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1860000000.0) {
tmp = -t;
} else if (t <= 1.1e+44) {
tmp = -z * y;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1860000000.0: tmp = -t elif t <= 1.1e+44: tmp = -z * y else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1860000000.0) tmp = Float64(-t); elseif (t <= 1.1e+44) tmp = Float64(Float64(-z) * y); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1860000000.0) tmp = -t; elseif (t <= 1.1e+44) tmp = -z * y; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1860000000.0], (-t), If[LessEqual[t, 1.1e+44], N[((-z) * y), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1860000000:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+44}:\\
\;\;\;\;\left(-z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -1.86e9 or 1.09999999999999998e44 < t Initial program 95.0%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6470.4
Applied rewrites70.4%
if -1.86e9 < t < 1.09999999999999998e44Initial program 83.9%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.3
Applied rewrites99.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lift-*.f6418.2
Applied rewrites18.2%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6417.9
Applied rewrites17.9%
(FPCore (x y z t) :precision binary64 (fma (- 1.0 z) y (- t)))
double code(double x, double y, double z, double t) {
return fma((1.0 - z), y, -t);
}
function code(x, y, z, t) return fma(Float64(1.0 - z), y, Float64(-t)) end
code[x_, y_, z_, t_] := N[(N[(1.0 - z), $MachinePrecision] * y + (-t)), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1 - z, y, -t\right)
\end{array}
Initial program 88.9%
Taylor expanded in y around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.5
Applied rewrites99.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-log.f64N/A
lower-/.f64N/A
lift--.f6487.8
Applied rewrites87.8%
Taylor expanded in y around 0
lower--.f6487.5
Applied rewrites87.5%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6445.6
Applied rewrites45.6%
(FPCore (x y z t) :precision binary64 (- (* (- y) z) t))
double code(double x, double y, double z, double t) {
return (-y * z) - t;
}
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, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (-y * z) - t
end function
public static double code(double x, double y, double z, double t) {
return (-y * z) - t;
}
def code(x, y, z, t): return (-y * z) - t
function code(x, y, z, t) return Float64(Float64(Float64(-y) * z) - t) end
function tmp = code(x, y, z, t) tmp = (-y * z) - t; end
code[x_, y_, z_, t_] := N[(N[((-y) * z), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(-y\right) \cdot z - t
\end{array}
Initial program 88.9%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f6499.1
Applied rewrites99.1%
Taylor expanded in z around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lift-neg.f6445.5
Applied rewrites45.5%
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
return -t;
}
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, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t
end function
public static double code(double x, double y, double z, double t) {
return -t;
}
def code(x, y, z, t): return -t
function code(x, y, z, t) return Float64(-t) end
function tmp = code(x, y, z, t) tmp = -t; end
code[x_, y_, z_, t_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 88.9%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6434.9
Applied rewrites34.9%
herbie shell --seed 2025089
(FPCore (x y z t)
:name "Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2"
:precision binary64
(- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))