
(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;
}
real(8) function code(x, y, z, t)
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 19 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;
}
real(8) function code(x, y, z, t)
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 (/ 1.0 (/ 1.0 (fma (+ x -1.0) (log y) (fma (+ -1.0 z) (log1p (- y)) (- t))))))
double code(double x, double y, double z, double t) {
return 1.0 / (1.0 / fma((x + -1.0), log(y), fma((-1.0 + z), log1p(-y), -t)));
}
function code(x, y, z, t) return Float64(1.0 / Float64(1.0 / fma(Float64(x + -1.0), log(y), fma(Float64(-1.0 + z), log1p(Float64(-y)), Float64(-t))))) end
code[x_, y_, z_, t_] := N[(1.0 / N[(1.0 / N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(N[(-1.0 + z), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{1}{\mathsf{fma}\left(x + -1, \log y, \mathsf{fma}\left(-1 + z, \mathsf{log1p}\left(-y\right), -t\right)\right)}}
\end{array}
Initial program 89.6%
lift--.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lift-+.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* (log y) (+ x -1.0)) (* (+ -1.0 z) (log (- 1.0 y))))))
(if (<= t_1 -10000000000.0)
(- (* x (log y)) t)
(if (<= t_1 138.0)
(- (* z (log1p (- y))) t)
(if (<= t_1 1000.0) (- (- t) (log y)) (fma (log y) x (- t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (log(y) * (x + -1.0)) + ((-1.0 + z) * log((1.0 - y)));
double tmp;
if (t_1 <= -10000000000.0) {
tmp = (x * log(y)) - t;
} else if (t_1 <= 138.0) {
tmp = (z * log1p(-y)) - t;
} else if (t_1 <= 1000.0) {
tmp = -t - log(y);
} else {
tmp = fma(log(y), x, -t);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(Float64(-1.0 + z) * log(Float64(1.0 - y)))) tmp = 0.0 if (t_1 <= -10000000000.0) tmp = Float64(Float64(x * log(y)) - t); elseif (t_1 <= 138.0) tmp = Float64(Float64(z * log1p(Float64(-y))) - t); elseif (t_1 <= 1000.0) tmp = Float64(Float64(-t) - log(y)); else tmp = fma(log(y), x, Float64(-t)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 + z), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -10000000000.0], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$1, 138.0], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$1, 1000.0], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + (-t)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(x + -1\right) + \left(-1 + z\right) \cdot \log \left(1 - y\right)\\
\mathbf{if}\;t\_1 \leq -10000000000:\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{elif}\;t\_1 \leq 138:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\mathbf{elif}\;t\_1 \leq 1000:\\
\;\;\;\;\left(-t\right) - \log y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -t\right)\\
\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)))) < -1e10Initial program 97.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6496.7
Simplified96.7%
if -1e10 < (+.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)))) < 138Initial program 67.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6476.1
Simplified76.1%
if 138 < (+.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)))) < 1e3Initial program 86.0%
Taylor expanded in y around 0
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6486.0
Simplified86.0%
Taylor expanded in x around 0
mul-1-negN/A
log-recN/A
lower--.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f6485.3
Simplified85.3%
if 1e3 < (+.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 97.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6496.7
Simplified96.7%
lift-log.f64N/A
lift-*.f64N/A
sub-negN/A
lift-*.f64N/A
lift-neg.f64N/A
lower-fma.f6496.7
Applied egg-rr96.7%
Final simplification89.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* (log y) (+ x -1.0)) (* (+ -1.0 z) (log (- 1.0 y))))))
(if (<= t_1 -10000000000.0)
(- (* x (log y)) t)
(if (<= t_1 138.0)
(- (* y (* z (fma y -0.5 -1.0))) t)
(if (<= t_1 1000.0) (- (- t) (log y)) (fma (log y) x (- t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (log(y) * (x + -1.0)) + ((-1.0 + z) * log((1.0 - y)));
double tmp;
if (t_1 <= -10000000000.0) {
tmp = (x * log(y)) - t;
} else if (t_1 <= 138.0) {
tmp = (y * (z * fma(y, -0.5, -1.0))) - t;
} else if (t_1 <= 1000.0) {
tmp = -t - log(y);
} else {
tmp = fma(log(y), x, -t);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(Float64(-1.0 + z) * log(Float64(1.0 - y)))) tmp = 0.0 if (t_1 <= -10000000000.0) tmp = Float64(Float64(x * log(y)) - t); elseif (t_1 <= 138.0) tmp = Float64(Float64(y * Float64(z * fma(y, -0.5, -1.0))) - t); elseif (t_1 <= 1000.0) tmp = Float64(Float64(-t) - log(y)); else tmp = fma(log(y), x, Float64(-t)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 + z), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -10000000000.0], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$1, 138.0], N[(N[(y * N[(z * N[(y * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$1, 1000.0], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + (-t)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(x + -1\right) + \left(-1 + z\right) \cdot \log \left(1 - y\right)\\
\mathbf{if}\;t\_1 \leq -10000000000:\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{elif}\;t\_1 \leq 138:\\
\;\;\;\;y \cdot \left(z \cdot \mathsf{fma}\left(y, -0.5, -1\right)\right) - t\\
\mathbf{elif}\;t\_1 \leq 1000:\\
\;\;\;\;\left(-t\right) - \log y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -t\right)\\
\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)))) < -1e10Initial program 97.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6496.7
Simplified96.7%
if -1e10 < (+.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)))) < 138Initial program 67.8%
Taylor expanded in x around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-log.f6498.5
Simplified98.5%
Taylor expanded in y around 0
sub-negN/A
*-commutativeN/A
associate-*r*N/A
log-recN/A
lower-fma.f64N/A
Simplified93.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6476.1
Simplified76.1%
if 138 < (+.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)))) < 1e3Initial program 86.0%
Taylor expanded in y around 0
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6486.0
Simplified86.0%
Taylor expanded in x around 0
mul-1-negN/A
log-recN/A
lower--.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f6485.3
Simplified85.3%
if 1e3 < (+.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 97.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6496.7
Simplified96.7%
lift-log.f64N/A
lift-*.f64N/A
sub-negN/A
lift-*.f64N/A
lift-neg.f64N/A
lower-fma.f6496.7
Applied egg-rr96.7%
Final simplification89.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) t))
(t_2 (+ (* (log y) (+ x -1.0)) (* (+ -1.0 z) (log (- 1.0 y))))))
(if (<= t_2 -10000000000.0)
t_1
(if (<= t_2 138.0)
(- (* y (* z (fma y -0.5 -1.0))) t)
(if (<= t_2 1000.0) (- (- t) (log y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - t;
double t_2 = (log(y) * (x + -1.0)) + ((-1.0 + z) * log((1.0 - y)));
double tmp;
if (t_2 <= -10000000000.0) {
tmp = t_1;
} else if (t_2 <= 138.0) {
tmp = (y * (z * fma(y, -0.5, -1.0))) - t;
} else if (t_2 <= 1000.0) {
tmp = -t - log(y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - t) t_2 = Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(Float64(-1.0 + z) * log(Float64(1.0 - y)))) tmp = 0.0 if (t_2 <= -10000000000.0) tmp = t_1; elseif (t_2 <= 138.0) tmp = Float64(Float64(y * Float64(z * fma(y, -0.5, -1.0))) - t); elseif (t_2 <= 1000.0) tmp = Float64(Float64(-t) - log(y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 + z), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -10000000000.0], t$95$1, If[LessEqual[t$95$2, 138.0], N[(N[(y * N[(z * N[(y * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 1000.0], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
t_2 := \log y \cdot \left(x + -1\right) + \left(-1 + z\right) \cdot \log \left(1 - y\right)\\
\mathbf{if}\;t\_2 \leq -10000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 138:\\
\;\;\;\;y \cdot \left(z \cdot \mathsf{fma}\left(y, -0.5, -1\right)\right) - t\\
\mathbf{elif}\;t\_2 \leq 1000:\\
\;\;\;\;\left(-t\right) - \log y\\
\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)))) < -1e10 or 1e3 < (+.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 97.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6496.7
Simplified96.7%
if -1e10 < (+.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)))) < 138Initial program 67.8%
Taylor expanded in x around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-log.f6498.5
Simplified98.5%
Taylor expanded in y around 0
sub-negN/A
*-commutativeN/A
associate-*r*N/A
log-recN/A
lower-fma.f64N/A
Simplified93.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6476.1
Simplified76.1%
if 138 < (+.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)))) < 1e3Initial program 86.0%
Taylor expanded in y around 0
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6486.0
Simplified86.0%
Taylor expanded in x around 0
mul-1-negN/A
log-recN/A
lower--.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f6485.3
Simplified85.3%
Final simplification89.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y)))
(t_2 (+ (* (log y) (+ x -1.0)) (* (+ -1.0 z) (log (- 1.0 y))))))
(if (<= t_2 -10000000000.0)
t_1
(if (<= t_2 582.0)
(- (* y (* z (fma y -0.5 -1.0))) t)
(if (<= t_2 1000.0) (- (log y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = (log(y) * (x + -1.0)) + ((-1.0 + z) * log((1.0 - y)));
double tmp;
if (t_2 <= -10000000000.0) {
tmp = t_1;
} else if (t_2 <= 582.0) {
tmp = (y * (z * fma(y, -0.5, -1.0))) - t;
} else if (t_2 <= 1000.0) {
tmp = -log(y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(Float64(-1.0 + z) * log(Float64(1.0 - y)))) tmp = 0.0 if (t_2 <= -10000000000.0) tmp = t_1; elseif (t_2 <= 582.0) tmp = Float64(Float64(y * Float64(z * fma(y, -0.5, -1.0))) - t); elseif (t_2 <= 1000.0) tmp = Float64(-log(y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 + z), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -10000000000.0], t$95$1, If[LessEqual[t$95$2, 582.0], N[(N[(y * N[(z * N[(y * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 1000.0], (-N[Log[y], $MachinePrecision]), t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log y \cdot \left(x + -1\right) + \left(-1 + z\right) \cdot \log \left(1 - y\right)\\
\mathbf{if}\;t\_2 \leq -10000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 582:\\
\;\;\;\;y \cdot \left(z \cdot \mathsf{fma}\left(y, -0.5, -1\right)\right) - t\\
\mathbf{elif}\;t\_2 \leq 1000:\\
\;\;\;\;-\log y\\
\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)))) < -1e10 or 1e3 < (+.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 97.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6478.4
Simplified78.4%
if -1e10 < (+.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)))) < 582Initial program 79.9%
Taylor expanded in x around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-log.f6498.9
Simplified98.9%
Taylor expanded in y around 0
sub-negN/A
*-commutativeN/A
associate-*r*N/A
log-recN/A
lower-fma.f64N/A
Simplified97.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6465.6
Simplified65.6%
if 582 < (+.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)))) < 1e3Initial program 93.4%
Taylor expanded in y around 0
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6493.4
Simplified93.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6461.0
Simplified61.0%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
lower-log.f6461.0
Simplified61.0%
Final simplification71.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (+ (* (log y) (+ x -1.0)) (* (+ -1.0 z) (log (- 1.0 y)))) t))
(t_2 (- (* y (* z (fma y -0.5 -1.0))) t)))
(if (<= t_1 120.0) t_2 (if (<= t_1 1000.0) (- (log y)) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = ((log(y) * (x + -1.0)) + ((-1.0 + z) * log((1.0 - y)))) - t;
double t_2 = (y * (z * fma(y, -0.5, -1.0))) - t;
double tmp;
if (t_1 <= 120.0) {
tmp = t_2;
} else if (t_1 <= 1000.0) {
tmp = -log(y);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(Float64(-1.0 + z) * log(Float64(1.0 - y)))) - t) t_2 = Float64(Float64(y * Float64(z * fma(y, -0.5, -1.0))) - t) tmp = 0.0 if (t_1 <= 120.0) tmp = t_2; elseif (t_1 <= 1000.0) tmp = Float64(-log(y)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 + z), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(z * N[(y * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, 120.0], t$95$2, If[LessEqual[t$95$1, 1000.0], (-N[Log[y], $MachinePrecision]), t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\log y \cdot \left(x + -1\right) + \left(-1 + z\right) \cdot \log \left(1 - y\right)\right) - t\\
t_2 := y \cdot \left(z \cdot \mathsf{fma}\left(y, -0.5, -1\right)\right) - t\\
\mathbf{if}\;t\_1 \leq 120:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1000:\\
\;\;\;\;-\log y\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\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) < 120 or 1e3 < (-.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 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-log.f6451.4
Simplified51.4%
Taylor expanded in y around 0
sub-negN/A
*-commutativeN/A
associate-*r*N/A
log-recN/A
lower-fma.f64N/A
Simplified50.7%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6447.6
Simplified47.6%
if 120 < (-.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) < 1e3Initial program 76.4%
Taylor expanded in y around 0
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6476.4
Simplified76.4%
Taylor expanded in t around 0
lower-*.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6473.8
Simplified73.8%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
lower-log.f6472.4
Simplified72.4%
Final simplification53.6%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (log y) (+ x -1.0))
(*
(+ -1.0 z)
(* y (fma y (fma y (fma y -0.25 -0.3333333333333333) -0.5) -1.0))))
t))
double code(double x, double y, double z, double t) {
return ((log(y) * (x + -1.0)) + ((-1.0 + z) * (y * fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0)))) - t;
}
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(Float64(-1.0 + z) * Float64(y * fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0)))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 + z), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * -0.25 + -0.3333333333333333), $MachinePrecision] + -0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(x + -1\right) + \left(-1 + z\right) \cdot \left(y \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.25, -0.3333333333333333\right), -0.5\right), -1\right)\right)\right) - t
\end{array}
Initial program 89.6%
Taylor expanded in y around 0
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6499.3
Simplified99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (- (+ (* (log y) (+ x -1.0)) (* (+ -1.0 z) (* y (fma y (fma y -0.3333333333333333 -0.5) -1.0)))) t))
double code(double x, double y, double z, double t) {
return ((log(y) * (x + -1.0)) + ((-1.0 + z) * (y * fma(y, fma(y, -0.3333333333333333, -0.5), -1.0)))) - t;
}
function code(x, y, z, t) return Float64(Float64(Float64(log(y) * Float64(x + -1.0)) + Float64(Float64(-1.0 + z) * Float64(y * fma(y, fma(y, -0.3333333333333333, -0.5), -1.0)))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 + z), $MachinePrecision] * N[(y * N[(y * N[(y * -0.3333333333333333 + -0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y \cdot \left(x + -1\right) + \left(-1 + z\right) \cdot \left(y \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.3333333333333333, -0.5\right), -1\right)\right)\right) - t
\end{array}
Initial program 89.6%
Taylor expanded in y around 0
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6499.3
Simplified99.3%
Final simplification99.3%
(FPCore (x y z t)
:precision binary64
(if (<= (+ x -1.0) -2e+25)
(fma (log y) x (- t))
(if (<= (+ x -1.0) 4.0)
(- (- t) (fma y (+ -1.0 z) (log y)))
(fma (log y) (+ x -1.0) (- t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + -1.0) <= -2e+25) {
tmp = fma(log(y), x, -t);
} else if ((x + -1.0) <= 4.0) {
tmp = -t - fma(y, (-1.0 + z), log(y));
} else {
tmp = fma(log(y), (x + -1.0), -t);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(x + -1.0) <= -2e+25) tmp = fma(log(y), x, Float64(-t)); elseif (Float64(x + -1.0) <= 4.0) tmp = Float64(Float64(-t) - fma(y, Float64(-1.0 + z), log(y))); else tmp = fma(log(y), Float64(x + -1.0), Float64(-t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + -1.0), $MachinePrecision], -2e+25], N[(N[Log[y], $MachinePrecision] * x + (-t)), $MachinePrecision], If[LessEqual[N[(x + -1.0), $MachinePrecision], 4.0], N[((-t) - N[(y * N[(-1.0 + z), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision] + (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + -1 \leq -2 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -t\right)\\
\mathbf{elif}\;x + -1 \leq 4:\\
\;\;\;\;\left(-t\right) - \mathsf{fma}\left(y, -1 + z, \log y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x + -1, -t\right)\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -2.00000000000000018e25Initial program 98.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6498.1
Simplified98.1%
lift-log.f64N/A
lift-*.f64N/A
sub-negN/A
lift-*.f64N/A
lift-neg.f64N/A
lower-fma.f6498.1
Applied egg-rr98.1%
if -2.00000000000000018e25 < (-.f64 x #s(literal 1 binary64)) < 4Initial program 82.7%
Taylor expanded in x around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-log.f6499.1
Simplified99.1%
Taylor expanded in y around 0
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
lower-neg.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-log.f6498.1
Simplified98.1%
if 4 < (-.f64 x #s(literal 1 binary64)) Initial program 96.3%
Taylor expanded in y around 0
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6495.7
Simplified95.7%
Final simplification97.6%
(FPCore (x y z t) :precision binary64 (- (fma y (* (+ -1.0 z) (fma y -0.5 -1.0)) (* (log y) (+ x -1.0))) t))
double code(double x, double y, double z, double t) {
return fma(y, ((-1.0 + z) * fma(y, -0.5, -1.0)), (log(y) * (x + -1.0))) - t;
}
function code(x, y, z, t) return Float64(fma(y, Float64(Float64(-1.0 + z) * fma(y, -0.5, -1.0)), Float64(log(y) * Float64(x + -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(y * N[(N[(-1.0 + z), $MachinePrecision] * N[(y * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \left(-1 + z\right) \cdot \mathsf{fma}\left(y, -0.5, -1\right), \log y \cdot \left(x + -1\right)\right) - t
\end{array}
Initial program 89.6%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Simplified99.3%
Final simplification99.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= (+ x -1.0) -2e+25)
t_1
(if (<= (+ x -1.0) 200000.0) (- (- t) (log y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if ((x + -1.0) <= -2e+25) {
tmp = t_1;
} else if ((x + -1.0) <= 200000.0) {
tmp = -t - log(y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if ((x + (-1.0d0)) <= (-2d+25)) then
tmp = t_1
else if ((x + (-1.0d0)) <= 200000.0d0) then
tmp = -t - log(y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if ((x + -1.0) <= -2e+25) {
tmp = t_1;
} else if ((x + -1.0) <= 200000.0) {
tmp = -t - Math.log(y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if (x + -1.0) <= -2e+25: tmp = t_1 elif (x + -1.0) <= 200000.0: tmp = -t - math.log(y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (Float64(x + -1.0) <= -2e+25) tmp = t_1; elseif (Float64(x + -1.0) <= 200000.0) tmp = Float64(Float64(-t) - log(y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if ((x + -1.0) <= -2e+25) tmp = t_1; elseif ((x + -1.0) <= 200000.0) tmp = -t - log(y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + -1.0), $MachinePrecision], -2e+25], t$95$1, If[LessEqual[N[(x + -1.0), $MachinePrecision], 200000.0], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x + -1 \leq -2 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x + -1 \leq 200000:\\
\;\;\;\;\left(-t\right) - \log y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -2.00000000000000018e25 or 2e5 < (-.f64 x #s(literal 1 binary64)) Initial program 97.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6479.1
Simplified79.1%
if -2.00000000000000018e25 < (-.f64 x #s(literal 1 binary64)) < 2e5Initial program 82.9%
Taylor expanded in y around 0
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6481.6
Simplified81.6%
Taylor expanded in x around 0
mul-1-negN/A
log-recN/A
lower--.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f6480.8
Simplified80.8%
Final simplification80.0%
(FPCore (x y z t) :precision binary64 (if (<= (+ -1.0 z) 4.5e+263) (fma (log y) (+ x -1.0) (- y t)) (- (* z (log1p (- y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + z) <= 4.5e+263) {
tmp = fma(log(y), (x + -1.0), (y - t));
} else {
tmp = (z * log1p(-y)) - t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + z) <= 4.5e+263) tmp = fma(log(y), Float64(x + -1.0), Float64(y - t)); else tmp = Float64(Float64(z * log1p(Float64(-y))) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + z), $MachinePrecision], 4.5e+263], N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision] + N[(y - t), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + z \leq 4.5 \cdot 10^{+263}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x + -1, y - t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\end{array}
\end{array}
if (-.f64 z #s(literal 1 binary64)) < 4.50000000000000014e263Initial program 92.3%
lift--.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lift-+.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
Applied egg-rr99.6%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
lower-neg.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6499.1
Simplified99.1%
Taylor expanded in z around 0
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
unsub-negN/A
lower--.f6491.6
Simplified91.6%
if 4.50000000000000014e263 < (-.f64 z #s(literal 1 binary64)) Initial program 47.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6477.4
Simplified77.4%
Final simplification90.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* y (* z (fma y -0.5 -1.0))) t))) (if (<= t -2.8e+19) t_1 (if (<= t 3.4e+14) (* (log y) (+ x -1.0)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y * (z * fma(y, -0.5, -1.0))) - t;
double tmp;
if (t <= -2.8e+19) {
tmp = t_1;
} else if (t <= 3.4e+14) {
tmp = log(y) * (x + -1.0);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(y * Float64(z * fma(y, -0.5, -1.0))) - t) tmp = 0.0 if (t <= -2.8e+19) tmp = t_1; elseif (t <= 3.4e+14) tmp = Float64(log(y) * Float64(x + -1.0)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * N[(z * N[(y * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t, -2.8e+19], t$95$1, If[LessEqual[t, 3.4e+14], N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z \cdot \mathsf{fma}\left(y, -0.5, -1\right)\right) - t\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+14}:\\
\;\;\;\;\log y \cdot \left(x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.8e19 or 3.4e14 < t Initial program 94.6%
Taylor expanded in x around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-log.f6480.9
Simplified80.9%
Taylor expanded in y around 0
sub-negN/A
*-commutativeN/A
associate-*r*N/A
log-recN/A
lower-fma.f64N/A
Simplified80.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6480.9
Simplified80.9%
if -2.8e19 < t < 3.4e14Initial program 86.4%
Taylor expanded in y around 0
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6485.2
Simplified85.2%
Taylor expanded in t around 0
lower-*.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6482.3
Simplified82.3%
Final simplification81.8%
(FPCore (x y z t) :precision binary64 (if (<= (+ -1.0 z) 4.5e+263) (fma (log y) (+ x -1.0) (- t)) (- (* z (log1p (- y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + z) <= 4.5e+263) {
tmp = fma(log(y), (x + -1.0), -t);
} else {
tmp = (z * log1p(-y)) - t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + z) <= 4.5e+263) tmp = fma(log(y), Float64(x + -1.0), Float64(-t)); else tmp = Float64(Float64(z * log1p(Float64(-y))) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + z), $MachinePrecision], 4.5e+263], N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision] + (-t)), $MachinePrecision], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + z \leq 4.5 \cdot 10^{+263}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x + -1, -t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\end{array}
\end{array}
if (-.f64 z #s(literal 1 binary64)) < 4.50000000000000014e263Initial program 92.3%
Taylor expanded in y around 0
sub-negN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6491.4
Simplified91.4%
if 4.50000000000000014e263 < (-.f64 z #s(literal 1 binary64)) Initial program 47.4%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6477.4
Simplified77.4%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (- (fma y (- 1.0 z) (* (log y) (+ x -1.0))) t))
double code(double x, double y, double z, double t) {
return fma(y, (1.0 - z), (log(y) * (x + -1.0))) - t;
}
function code(x, y, z, t) return Float64(fma(y, Float64(1.0 - z), Float64(log(y) * Float64(x + -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(y * N[(1.0 - z), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 1 - z, \log y \cdot \left(x + -1\right)\right) - t
\end{array}
Initial program 89.6%
Taylor expanded in y around 0
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-fma.f64N/A
mul-1-negN/A
neg-sub0N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
associate--r+N/A
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6499.2
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (if (<= t -1.4e-9) (- t) (if (<= t 1.2e+17) (- y (* y z)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.4e-9) {
tmp = -t;
} else if (t <= 1.2e+17) {
tmp = y - (y * z);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t)
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 <= (-1.4d-9)) then
tmp = -t
else if (t <= 1.2d+17) then
tmp = y - (y * z)
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 <= -1.4e-9) {
tmp = -t;
} else if (t <= 1.2e+17) {
tmp = y - (y * z);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.4e-9: tmp = -t elif t <= 1.2e+17: tmp = y - (y * z) else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.4e-9) tmp = Float64(-t); elseif (t <= 1.2e+17) tmp = Float64(y - Float64(y * z)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.4e-9) tmp = -t; elseif (t <= 1.2e+17) tmp = y - (y * z); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.4e-9], (-t), If[LessEqual[t, 1.2e+17], N[(y - N[(y * z), $MachinePrecision]), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{-9}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+17}:\\
\;\;\;\;y - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -1.39999999999999992e-9 or 1.2e17 < t Initial program 95.6%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6471.8
Simplified71.8%
if -1.39999999999999992e-9 < t < 1.2e17Initial program 85.3%
lift--.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lift-+.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
Applied egg-rr99.5%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
lower-neg.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6498.7
Simplified98.7%
Taylor expanded in y around inf
sub-negN/A
distribute-rgt-inN/A
*-lft-identityN/A
distribute-lft-neg-inN/A
*-commutativeN/A
unsub-negN/A
lower--.f64N/A
lower-*.f6417.0
Simplified17.0%
(FPCore (x y z t) :precision binary64 (if (<= t -1.4e-9) (- t) (if (<= t 1.2e+17) (* z (- y)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.4e-9) {
tmp = -t;
} else if (t <= 1.2e+17) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t)
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 <= (-1.4d-9)) then
tmp = -t
else if (t <= 1.2d+17) 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 <= -1.4e-9) {
tmp = -t;
} else if (t <= 1.2e+17) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.4e-9: tmp = -t elif t <= 1.2e+17: tmp = z * -y else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.4e-9) tmp = Float64(-t); elseif (t <= 1.2e+17) tmp = Float64(z * Float64(-y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.4e-9) tmp = -t; elseif (t <= 1.2e+17) tmp = z * -y; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.4e-9], (-t), If[LessEqual[t, 1.2e+17], N[(z * (-y)), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{-9}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+17}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -1.39999999999999992e-9 or 1.2e17 < t Initial program 95.6%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6471.8
Simplified71.8%
if -1.39999999999999992e-9 < t < 1.2e17Initial program 85.3%
lift--.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lift-+.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
Applied egg-rr99.5%
Taylor expanded in y around 0
+-commutativeN/A
associate--l+N/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
lower-neg.f64N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6498.7
Simplified98.7%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6416.4
Simplified16.4%
Final simplification39.8%
(FPCore (x y z t) :precision binary64 (- (* y (* z (fma y -0.5 -1.0))) t))
double code(double x, double y, double z, double t) {
return (y * (z * fma(y, -0.5, -1.0))) - t;
}
function code(x, y, z, t) return Float64(Float64(y * Float64(z * fma(y, -0.5, -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(y * N[(z * N[(y * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(z \cdot \mathsf{fma}\left(y, -0.5, -1\right)\right) - t
\end{array}
Initial program 89.6%
Taylor expanded in x around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-log.f6462.8
Simplified62.8%
Taylor expanded in y around 0
sub-negN/A
*-commutativeN/A
associate-*r*N/A
log-recN/A
lower-fma.f64N/A
Simplified62.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6442.1
Simplified42.1%
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
return -t;
}
real(8) function code(x, y, z, t)
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
mul-1-negN/A
lower-neg.f6432.3
Simplified32.3%
herbie shell --seed 2024212
(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))