
(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}
Sampling outcomes in binary64 precision:
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 (log y) (- x 1.0) (* (fma (* (- z 1.0) (fma -0.3333333333333333 y -0.5)) y (- (- z 1.0))) y)) t))
double code(double x, double y, double z, double t) {
return fma(log(y), (x - 1.0), (fma(((z - 1.0) * fma(-0.3333333333333333, y, -0.5)), y, -(z - 1.0)) * y)) - t;
}
function code(x, y, z, t) return Float64(fma(log(y), Float64(x - 1.0), Float64(fma(Float64(Float64(z - 1.0) * fma(-0.3333333333333333, y, -0.5)), y, Float64(-Float64(z - 1.0))) * y)) - t) end
code[x_, y_, z_, t_] := N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision] + N[(N[(N[(N[(z - 1.0), $MachinePrecision] * N[(-0.3333333333333333 * y + -0.5), $MachinePrecision]), $MachinePrecision] * y + (-N[(z - 1.0), $MachinePrecision])), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log y, x - 1, \mathsf{fma}\left(\left(z - 1\right) \cdot \mathsf{fma}\left(-0.3333333333333333, y, -0.5\right), y, -\left(z - 1\right)\right) \cdot y\right) - t
\end{array}
Initial program 89.6%
Taylor expanded in y around 0
Applied rewrites99.1%
(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))))))
(if (<= t_2 -1e+33)
t_1
(if (<= t_2 152.2)
(fma (- y) (- z 1.0) (- t))
(if (<= t_2 40000.0) (- (- (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)));
double tmp;
if (t_2 <= -1e+33) {
tmp = t_1;
} else if (t_2 <= 152.2) {
tmp = fma(-y, (z - 1.0), -t);
} else if (t_2 <= 40000.0) {
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(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) tmp = 0.0 if (t_2 <= -1e+33) tmp = t_1; elseif (t_2 <= 152.2) tmp = fma(Float64(-y), Float64(z - 1.0), Float64(-t)); elseif (t_2 <= 40000.0) 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[(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]}, If[LessEqual[t$95$2, -1e+33], t$95$1, If[LessEqual[t$95$2, 152.2], N[((-y) * N[(z - 1.0), $MachinePrecision] + (-t)), $MachinePrecision], If[LessEqual[t$95$2, 40000.0], 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(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 152.2:\\
\;\;\;\;\mathsf{fma}\left(-y, z - 1, -t\right)\\
\mathbf{elif}\;t\_2 \leq 40000:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.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)))) < -9.9999999999999995e32 or 4e4 < (+.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)))) Initial program 93.6%
Taylor expanded in x around inf
Applied rewrites89.7%
if -9.9999999999999995e32 < (+.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)))) < 152.19999999999999Initial program 63.5%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in t around inf
Applied rewrites85.5%
if 152.19999999999999 < (+.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)))) < 4e4Initial program 92.9%
Taylor expanded in y around 0
Applied rewrites92.9%
Taylor expanded in x around 0
Applied rewrites89.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y))))))
(if (<= t_2 -2e+81)
t_1
(if (<= t_2 152.2)
(fma (- y) (- z 1.0) (- t))
(if (<= t_2 2e+110) (- (- (log y)) t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double t_2 = ((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)));
double tmp;
if (t_2 <= -2e+81) {
tmp = t_1;
} else if (t_2 <= 152.2) {
tmp = fma(-y, (z - 1.0), -t);
} else if (t_2 <= 2e+110) {
tmp = -log(y) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) tmp = 0.0 if (t_2 <= -2e+81) tmp = t_1; elseif (t_2 <= 152.2) tmp = fma(Float64(-y), Float64(z - 1.0), Float64(-t)); elseif (t_2 <= 2e+110) 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[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, -2e+81], t$95$1, If[LessEqual[t$95$2, 152.2], N[((-y) * N[(z - 1.0), $MachinePrecision] + (-t)), $MachinePrecision], If[LessEqual[t$95$2, 2e+110], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := \left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 152.2:\\
\;\;\;\;\mathsf{fma}\left(-y, z - 1, -t\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+110}:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.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)))) < -1.99999999999999984e81 or 2e110 < (+.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)))) Initial program 96.1%
Taylor expanded in x around inf
Applied rewrites80.7%
if -1.99999999999999984e81 < (+.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)))) < 152.19999999999999Initial program 70.5%
Taylor expanded in y around 0
Applied rewrites98.1%
Taylor expanded in t around inf
Applied rewrites81.6%
if 152.19999999999999 < (+.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)))) < 2e110Initial program 91.1%
Taylor expanded in y around 0
Applied rewrites90.6%
Taylor expanded in x around 0
Applied rewrites83.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t)))
(if (or (<= t_1 -200000.0) (not (<= t_1 590.0)))
(- (* (log y) (- x 1.0)) t)
(fma (- y) (- z 1.0) (- (log y))))))
double code(double x, double y, double z, double t) {
double t_1 = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t;
double tmp;
if ((t_1 <= -200000.0) || !(t_1 <= 590.0)) {
tmp = (log(y) * (x - 1.0)) - t;
} else {
tmp = fma(-y, (z - 1.0), -log(y));
}
return tmp;
}
function code(x, y, z, t) t_1 = 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_1 <= -200000.0) || !(t_1 <= 590.0)) tmp = Float64(Float64(log(y) * Float64(x - 1.0)) - t); else tmp = fma(Float64(-y), Float64(z - 1.0), Float64(-log(y))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = 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[Or[LessEqual[t$95$1, -200000.0], N[Not[LessEqual[t$95$1, 590.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-y) * N[(z - 1.0), $MachinePrecision] + (-N[Log[y], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t\\
\mathbf{if}\;t\_1 \leq -200000 \lor \neg \left(t\_1 \leq 590\right):\\
\;\;\;\;\log y \cdot \left(x - 1\right) - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, z - 1, -\log y\right)\\
\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) < -2e5 or 590 < (-.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.4%
Taylor expanded in y around 0
Applied rewrites91.1%
if -2e5 < (-.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) < 590Initial program 74.0%
Taylor expanded in y around 0
Applied rewrites99.9%
Taylor expanded in t around 0
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites94.9%
Final simplification91.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) (- x 1.0))))
(if (or (<= t -800000000.0) (not (<= t 0.26)))
(- t_1 t)
(fma (- y) (- z 1.0) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * (x - 1.0);
double tmp;
if ((t <= -800000000.0) || !(t <= 0.26)) {
tmp = t_1 - t;
} else {
tmp = fma(-y, (z - 1.0), t_1);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(y) * Float64(x - 1.0)) tmp = 0.0 if ((t <= -800000000.0) || !(t <= 0.26)) tmp = Float64(t_1 - t); else tmp = fma(Float64(-y), Float64(z - 1.0), t_1); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -800000000.0], N[Not[LessEqual[t, 0.26]], $MachinePrecision]], N[(t$95$1 - t), $MachinePrecision], N[((-y) * N[(z - 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(x - 1\right)\\
\mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 0.26\right):\\
\;\;\;\;t\_1 - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, z - 1, t\_1\right)\\
\end{array}
\end{array}
if t < -8e8 or 0.26000000000000001 < t Initial program 95.1%
Taylor expanded in y around 0
Applied rewrites94.5%
if -8e8 < t < 0.26000000000000001Initial program 83.7%
Taylor expanded in y around 0
Applied rewrites97.8%
Taylor expanded in t around 0
Applied rewrites97.8%
Final simplification96.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) (- x 1.0))))
(if (or (<= t -800000000.0) (not (<= t 0.26)))
(- t_1 t)
(fma (- y) z t_1))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * (x - 1.0);
double tmp;
if ((t <= -800000000.0) || !(t <= 0.26)) {
tmp = t_1 - t;
} else {
tmp = fma(-y, z, t_1);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(y) * Float64(x - 1.0)) tmp = 0.0 if ((t <= -800000000.0) || !(t <= 0.26)) tmp = Float64(t_1 - t); else tmp = fma(Float64(-y), z, t_1); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -800000000.0], N[Not[LessEqual[t, 0.26]], $MachinePrecision]], N[(t$95$1 - t), $MachinePrecision], N[((-y) * z + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(x - 1\right)\\
\mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 0.26\right):\\
\;\;\;\;t\_1 - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, z, t\_1\right)\\
\end{array}
\end{array}
if t < -8e8 or 0.26000000000000001 < t Initial program 95.1%
Taylor expanded in y around 0
Applied rewrites94.5%
if -8e8 < t < 0.26000000000000001Initial program 83.7%
Taylor expanded in y around 0
Applied rewrites97.8%
Taylor expanded in t around 0
Applied rewrites97.8%
Taylor expanded in z around inf
Applied rewrites97.8%
Final simplification96.1%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.18e-14)
(- (* (log y) (- x 1.0)) t)
(if (<= x 9.2e+27)
(- (+ (fma (- z 1.0) y (log y)) t))
(- (* (log y) x) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.18e-14) {
tmp = (log(y) * (x - 1.0)) - t;
} else if (x <= 9.2e+27) {
tmp = -(fma((z - 1.0), y, log(y)) + t);
} else {
tmp = (log(y) * x) - t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -1.18e-14) tmp = Float64(Float64(log(y) * Float64(x - 1.0)) - t); elseif (x <= 9.2e+27) tmp = Float64(-Float64(fma(Float64(z - 1.0), y, log(y)) + t)); else tmp = Float64(Float64(log(y) * x) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.18e-14], N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[x, 9.2e+27], (-N[(N[(N[(z - 1.0), $MachinePrecision] * y + N[Log[y], $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.18 \cdot 10^{-14}:\\
\;\;\;\;\log y \cdot \left(x - 1\right) - t\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+27}:\\
\;\;\;\;-\left(\mathsf{fma}\left(z - 1, y, \log y\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;\log y \cdot x - t\\
\end{array}
\end{array}
if x < -1.17999999999999993e-14Initial program 92.9%
Taylor expanded in y around 0
Applied rewrites92.9%
if -1.17999999999999993e-14 < x < 9.2000000000000002e27Initial program 84.7%
Taylor expanded in y around 0
Applied rewrites97.9%
Taylor expanded in x around 0
Applied rewrites96.1%
if 9.2000000000000002e27 < x Initial program 96.3%
Taylor expanded in x around inf
Applied rewrites94.8%
Final simplification94.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (- x 1.0) -2e+108) (not (<= (- x 1.0) 1e+72))) (* (log y) x) (- (* (* (- (* (fma -0.3333333333333333 y -0.5) y) 1.0) z) y) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x - 1.0) <= -2e+108) || !((x - 1.0) <= 1e+72)) {
tmp = log(y) * x;
} else {
tmp = ((((fma(-0.3333333333333333, y, -0.5) * y) - 1.0) * z) * y) - t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((Float64(x - 1.0) <= -2e+108) || !(Float64(x - 1.0) <= 1e+72)) tmp = Float64(log(y) * x); else tmp = Float64(Float64(Float64(Float64(Float64(fma(-0.3333333333333333, y, -0.5) * y) - 1.0) * z) * y) - t); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x - 1.0), $MachinePrecision], -2e+108], N[Not[LessEqual[N[(x - 1.0), $MachinePrecision], 1e+72]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(N[(N[(N[(-0.3333333333333333 * y + -0.5), $MachinePrecision] * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x - 1 \leq -2 \cdot 10^{+108} \lor \neg \left(x - 1 \leq 10^{+72}\right):\\
\;\;\;\;\log y \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(-0.3333333333333333, y, -0.5\right) \cdot y - 1\right) \cdot z\right) \cdot y - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -2.0000000000000001e108 or 9.99999999999999944e71 < (-.f64 x #s(literal 1 binary64)) Initial program 96.8%
Taylor expanded in x around inf
Applied rewrites84.1%
if -2.0000000000000001e108 < (-.f64 x #s(literal 1 binary64)) < 9.99999999999999944e71Initial program 85.6%
Taylor expanded in y around 0
Applied rewrites98.9%
Taylor expanded in z around inf
Applied rewrites65.5%
Final simplification72.1%
(FPCore (x y z t) :precision binary64 (fma (- y) (- z 1.0) (fma (log y) (- x 1.0) (- t))))
double code(double x, double y, double z, double t) {
return fma(-y, (z - 1.0), fma(log(y), (x - 1.0), -t));
}
function code(x, y, z, t) return fma(Float64(-y), Float64(z - 1.0), fma(log(y), Float64(x - 1.0), Float64(-t))) end
code[x_, y_, z_, t_] := N[((-y) * N[(z - 1.0), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-y, z - 1, \mathsf{fma}\left(\log y, x - 1, -t\right)\right)
\end{array}
Initial program 89.6%
Taylor expanded in y around 0
Applied rewrites98.6%
(FPCore (x y z t) :precision binary64 (if (<= z 3.2e+174) (- (* (log y) (- x 1.0)) t) (fma (- y) z (* (log y) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.2e+174) {
tmp = (log(y) * (x - 1.0)) - t;
} else {
tmp = fma(-y, z, (log(y) * x));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= 3.2e+174) tmp = Float64(Float64(log(y) * Float64(x - 1.0)) - t); else tmp = fma(Float64(-y), z, Float64(log(y) * x)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, 3.2e+174], N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-y) * z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.2 \cdot 10^{+174}:\\
\;\;\;\;\log y \cdot \left(x - 1\right) - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, z, \log y \cdot x\right)\\
\end{array}
\end{array}
if z < 3.2e174Initial program 93.9%
Taylor expanded in y around 0
Applied rewrites92.4%
if 3.2e174 < z Initial program 63.3%
Taylor expanded in y around 0
Applied rewrites97.2%
Taylor expanded in t around 0
Applied rewrites73.2%
Taylor expanded in z around inf
Applied rewrites73.2%
Taylor expanded in x around inf
Applied rewrites73.2%
(FPCore (x y z t) :precision binary64 (- (* (log y) (- x 1.0)) t))
double code(double x, double y, double z, double t) {
return (log(y) * (x - 1.0)) - 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 = (log(y) * (x - 1.0d0)) - t
end function
public static double code(double x, double y, double z, double t) {
return (Math.log(y) * (x - 1.0)) - t;
}
def code(x, y, z, t): return (math.log(y) * (x - 1.0)) - t
function code(x, y, z, t) return Float64(Float64(log(y) * Float64(x - 1.0)) - t) end
function tmp = code(x, y, z, t) tmp = (log(y) * (x - 1.0)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[Log[y], $MachinePrecision] * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log y \cdot \left(x - 1\right) - t
\end{array}
Initial program 89.6%
Taylor expanded in y around 0
Applied rewrites87.8%
(FPCore (x y z t) :precision binary64 (- (* (* (- (* (fma -0.3333333333333333 y -0.5) y) 1.0) z) y) t))
double code(double x, double y, double z, double t) {
return ((((fma(-0.3333333333333333, y, -0.5) * y) - 1.0) * z) * y) - t;
}
function code(x, y, z, t) return Float64(Float64(Float64(Float64(Float64(fma(-0.3333333333333333, y, -0.5) * y) - 1.0) * z) * y) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[(N[(-0.3333333333333333 * y + -0.5), $MachinePrecision] * y), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\mathsf{fma}\left(-0.3333333333333333, y, -0.5\right) \cdot y - 1\right) \cdot z\right) \cdot y - t
\end{array}
Initial program 89.6%
Taylor expanded in y around 0
Applied rewrites99.1%
Taylor expanded in z around inf
Applied rewrites48.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -800000000.0) (not (<= t 110000.0))) (- t) (fma (- y) z y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -800000000.0) || !(t <= 110000.0)) {
tmp = -t;
} else {
tmp = fma(-y, z, y);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((t <= -800000000.0) || !(t <= 110000.0)) tmp = Float64(-t); else tmp = fma(Float64(-y), z, y); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -800000000.0], N[Not[LessEqual[t, 110000.0]], $MachinePrecision]], (-t), N[((-y) * z + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 110000\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, z, y\right)\\
\end{array}
\end{array}
if t < -8e8 or 1.1e5 < t Initial program 95.1%
Taylor expanded in t around inf
Applied rewrites70.9%
if -8e8 < t < 1.1e5Initial program 83.7%
Taylor expanded in y around 0
Applied rewrites97.8%
Applied rewrites72.4%
Taylor expanded in y around inf
Applied rewrites19.0%
Taylor expanded in z around 0
Applied rewrites19.0%
Final simplification45.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -800000000.0) (not (<= t 110000.0))) (- t) (* (- y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -800000000.0) || !(t <= 110000.0)) {
tmp = -t;
} else {
tmp = -y * z;
}
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 <= (-800000000.0d0)) .or. (.not. (t <= 110000.0d0))) then
tmp = -t
else
tmp = -y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -800000000.0) || !(t <= 110000.0)) {
tmp = -t;
} else {
tmp = -y * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -800000000.0) or not (t <= 110000.0): tmp = -t else: tmp = -y * z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -800000000.0) || !(t <= 110000.0)) tmp = Float64(-t); else tmp = Float64(Float64(-y) * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -800000000.0) || ~((t <= 110000.0))) tmp = -t; else tmp = -y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -800000000.0], N[Not[LessEqual[t, 110000.0]], $MachinePrecision]], (-t), N[((-y) * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -800000000 \lor \neg \left(t \leq 110000\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot z\\
\end{array}
\end{array}
if t < -8e8 or 1.1e5 < t Initial program 95.1%
Taylor expanded in t around inf
Applied rewrites70.9%
if -8e8 < t < 1.1e5Initial program 83.7%
Taylor expanded in y around 0
Applied rewrites97.8%
Taylor expanded in z around inf
Applied rewrites18.6%
Final simplification45.4%
(FPCore (x y z t) :precision binary64 (fma (- y) (- z 1.0) (- t)))
double code(double x, double y, double z, double t) {
return fma(-y, (z - 1.0), -t);
}
function code(x, y, z, t) return fma(Float64(-y), Float64(z - 1.0), Float64(-t)) end
code[x_, y_, z_, t_] := N[((-y) * N[(z - 1.0), $MachinePrecision] + (-t)), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-y, z - 1, -t\right)
\end{array}
Initial program 89.6%
Taylor expanded in y around 0
Applied rewrites98.6%
Taylor expanded in t around inf
Applied rewrites47.9%
(FPCore (x y z t) :precision binary64 (fma (- y) z (- t)))
double code(double x, double y, double z, double t) {
return fma(-y, z, -t);
}
function code(x, y, z, t) return fma(Float64(-y), z, Float64(-t)) end
code[x_, y_, z_, t_] := N[((-y) * z + (-t)), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-y, z, -t\right)
\end{array}
Initial program 89.6%
Taylor expanded in y around 0
Applied rewrites98.6%
Taylor expanded in t around 0
Applied rewrites62.9%
Taylor expanded in z around inf
Applied rewrites62.9%
Taylor expanded in t around inf
Applied rewrites47.8%
(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 89.6%
Taylor expanded in t around inf
Applied rewrites37.7%
(FPCore (x y z t) :precision binary64 y)
double code(double x, double y, double z, double t) {
return y;
}
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
end function
public static double code(double x, double y, double z, double t) {
return y;
}
def code(x, y, z, t): return y
function code(x, y, z, t) return y end
function tmp = code(x, y, z, t) tmp = y; end
code[x_, y_, z_, t_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 89.6%
Taylor expanded in y around 0
Applied rewrites98.6%
Applied rewrites72.7%
Taylor expanded in y around inf
Applied rewrites12.4%
Taylor expanded in z around 0
Applied rewrites2.7%
Final simplification2.7%
herbie shell --seed 2025018
(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))