
(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
(-
(+
(*
(+ z -1.0)
(* y (fma y (fma y (fma y -0.25 -0.3333333333333333) -0.5) -1.0)))
(* (log y) (+ x -1.0)))
t))
double code(double x, double y, double z, double t) {
return (((z + -1.0) * (y * fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0))) + (log(y) * (x + -1.0))) - t;
}
function code(x, y, z, t) return Float64(Float64(Float64(Float64(z + -1.0) * Float64(y * fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0))) + Float64(log(y) * Float64(x + -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(y * N[(y * N[(y * -0.25 + -0.3333333333333333), $MachinePrecision] + -0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + -1\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) + \log y \cdot \left(x + -1\right)\right) - t
\end{array}
Initial program 87.4%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6499.8
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) t))
(t_2 (+ (* (log y) (+ x -1.0)) (* (+ z -1.0) (log (- 1.0 y))))))
(if (<= t_2 -5e+14)
t_1
(if (<= t_2 200.0)
(- (* (fma y -0.5 -1.0) (* y z)) t)
(if (<= t_2 20000000000.0) (- (- 0.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)) + ((z + -1.0) * log((1.0 - y)));
double tmp;
if (t_2 <= -5e+14) {
tmp = t_1;
} else if (t_2 <= 200.0) {
tmp = (fma(y, -0.5, -1.0) * (y * z)) - t;
} else if (t_2 <= 20000000000.0) {
tmp = (0.0 - 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(z + -1.0) * log(Float64(1.0 - y)))) tmp = 0.0 if (t_2 <= -5e+14) tmp = t_1; elseif (t_2 <= 200.0) tmp = Float64(Float64(fma(y, -0.5, -1.0) * Float64(y * z)) - t); elseif (t_2 <= 20000000000.0) tmp = Float64(Float64(0.0 - 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[(z + -1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+14], t$95$1, If[LessEqual[t$95$2, 200.0], N[(N[(N[(y * -0.5 + -1.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 20000000000.0], N[(N[(0.0 - t), $MachinePrecision] - 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(z + -1\right) \cdot \log \left(1 - y\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 200:\\
\;\;\;\;\mathsf{fma}\left(y, -0.5, -1\right) \cdot \left(y \cdot z\right) - t\\
\mathbf{elif}\;t\_2 \leq 20000000000:\\
\;\;\;\;\left(0 - 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)))) < -5e14 or 2e10 < (+.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 94.5%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6493.0
Simplified93.0%
if -5e14 < (+.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)))) < 200Initial program 63.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.0%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6479.6
Simplified79.6%
if 200 < (+.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)))) < 2e10Initial program 83.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6483.8
Simplified83.8%
Taylor expanded in x around 0
--lowering--.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
log-lowering-log.f6483.3
Simplified83.3%
Final simplification88.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) (+ x -1.0)))
(t_2 (+ t_1 (* (+ z -1.0) (log (- 1.0 y))))))
(if (<= t_2 -5e+14)
t_1
(if (<= t_2 200.0)
(- (* (fma y -0.5 -1.0) (* y z)) t)
(if (<= t_2 2e+44) (- (- 0.0 t) (log y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * (x + -1.0);
double t_2 = t_1 + ((z + -1.0) * log((1.0 - y)));
double tmp;
if (t_2 <= -5e+14) {
tmp = t_1;
} else if (t_2 <= 200.0) {
tmp = (fma(y, -0.5, -1.0) * (y * z)) - t;
} else if (t_2 <= 2e+44) {
tmp = (0.0 - t) - log(y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(y) * Float64(x + -1.0)) t_2 = Float64(t_1 + Float64(Float64(z + -1.0) * log(Float64(1.0 - y)))) tmp = 0.0 if (t_2 <= -5e+14) tmp = t_1; elseif (t_2 <= 200.0) tmp = Float64(Float64(fma(y, -0.5, -1.0) * Float64(y * z)) - t); elseif (t_2 <= 2e+44) tmp = Float64(Float64(0.0 - t) - log(y)); else tmp = 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]}, Block[{t$95$2 = N[(t$95$1 + N[(N[(z + -1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+14], t$95$1, If[LessEqual[t$95$2, 200.0], N[(N[(N[(y * -0.5 + -1.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 2e+44], N[(N[(0.0 - t), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(x + -1\right)\\
t_2 := t\_1 + \left(z + -1\right) \cdot \log \left(1 - y\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 200:\\
\;\;\;\;\mathsf{fma}\left(y, -0.5, -1\right) \cdot \left(y \cdot z\right) - t\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\left(0 - 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)))) < -5e14 or 2.0000000000000002e44 < (+.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 94.7%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6493.6
Simplified93.6%
Taylor expanded in t around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6476.7
Simplified76.7%
if -5e14 < (+.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)))) < 200Initial program 63.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.0%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6479.6
Simplified79.6%
if 200 < (+.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)))) < 2.0000000000000002e44Initial program 84.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6484.4
Simplified84.4%
Taylor expanded in x around 0
--lowering--.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
log-lowering-log.f6481.0
Simplified81.0%
Final simplification78.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y)))
(t_2 (+ (* (log y) (+ x -1.0)) (* (+ z -1.0) (log (- 1.0 y))))))
(if (<= t_2 -1e+47)
t_1
(if (<= t_2 200.0)
(- (* (fma y -0.5 -1.0) (* y z)) t)
(if (<= t_2 2e+44) (- (- 0.0 t) (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)) + ((z + -1.0) * log((1.0 - y)));
double tmp;
if (t_2 <= -1e+47) {
tmp = t_1;
} else if (t_2 <= 200.0) {
tmp = (fma(y, -0.5, -1.0) * (y * z)) - t;
} else if (t_2 <= 2e+44) {
tmp = (0.0 - t) - 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(z + -1.0) * log(Float64(1.0 - y)))) tmp = 0.0 if (t_2 <= -1e+47) tmp = t_1; elseif (t_2 <= 200.0) tmp = Float64(Float64(fma(y, -0.5, -1.0) * Float64(y * z)) - t); elseif (t_2 <= 2e+44) tmp = Float64(Float64(0.0 - t) - 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[(z + -1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+47], t$95$1, If[LessEqual[t$95$2, 200.0], N[(N[(N[(y * -0.5 + -1.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 2e+44], N[(N[(0.0 - t), $MachinePrecision] - N[Log[y], $MachinePrecision]), $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(z + -1\right) \cdot \log \left(1 - y\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 200:\\
\;\;\;\;\mathsf{fma}\left(y, -0.5, -1\right) \cdot \left(y \cdot z\right) - t\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\left(0 - 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)))) < -1e47 or 2.0000000000000002e44 < (+.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 95.2%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6477.4
Simplified77.4%
if -1e47 < (+.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)))) < 200Initial program 65.4%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.1%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6476.4
Simplified76.4%
if 200 < (+.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)))) < 2.0000000000000002e44Initial program 84.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6484.4
Simplified84.4%
Taylor expanded in x around 0
--lowering--.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
log-lowering-log.f6481.0
Simplified81.0%
Final simplification78.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (+ (* (log y) (+ x -1.0)) (* (+ z -1.0) (log (- 1.0 y)))) t))
(t_2 (- (* (fma y -0.5 -1.0) (* y z)) t)))
(if (<= t_1 150.0) t_2 (if (<= t_1 1000.0) (- 0.0 (log y)) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = ((log(y) * (x + -1.0)) + ((z + -1.0) * log((1.0 - y)))) - t;
double t_2 = (fma(y, -0.5, -1.0) * (y * z)) - t;
double tmp;
if (t_1 <= 150.0) {
tmp = t_2;
} else if (t_1 <= 1000.0) {
tmp = 0.0 - 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(z + -1.0) * log(Float64(1.0 - y)))) - t) t_2 = Float64(Float64(fma(y, -0.5, -1.0) * Float64(y * z)) - t) tmp = 0.0 if (t_1 <= 150.0) tmp = t_2; elseif (t_1 <= 1000.0) tmp = Float64(0.0 - 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[(z + -1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y * -0.5 + -1.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$1, 150.0], t$95$2, If[LessEqual[t$95$1, 1000.0], N[(0.0 - N[Log[y], $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\log y \cdot \left(x + -1\right) + \left(z + -1\right) \cdot \log \left(1 - y\right)\right) - t\\
t_2 := \mathsf{fma}\left(y, -0.5, -1\right) \cdot \left(y \cdot z\right) - t\\
\mathbf{if}\;t\_1 \leq 150:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1000:\\
\;\;\;\;0 - \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) < 150 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 89.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.6%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6444.4
Simplified44.4%
if 150 < (-.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 80.9%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6480.9
Simplified80.9%
Taylor expanded in t around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6480.0
Simplified80.0%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
log-lowering-log.f6479.2
Simplified79.2%
Final simplification51.5%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ z -1.0) (* y (fma y (fma y -0.3333333333333333 -0.5) -1.0))) (* (log y) (+ x -1.0))) t))
double code(double x, double y, double z, double t) {
return (((z + -1.0) * (y * fma(y, fma(y, -0.3333333333333333, -0.5), -1.0))) + (log(y) * (x + -1.0))) - t;
}
function code(x, y, z, t) return Float64(Float64(Float64(Float64(z + -1.0) * Float64(y * fma(y, fma(y, -0.3333333333333333, -0.5), -1.0))) + Float64(log(y) * Float64(x + -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[(z + -1.0), $MachinePrecision] * N[(y * N[(y * N[(y * -0.3333333333333333 + -0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + -1\right) \cdot \left(y \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.3333333333333333, -0.5\right), -1\right)\right) + \log y \cdot \left(x + -1\right)\right) - t
\end{array}
Initial program 87.4%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6499.7
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (- (fma (+ z -1.0) (* y (fma y -0.5 -1.0)) (* (log y) (+ x -1.0))) t))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), (y * fma(y, -0.5, -1.0)), (log(y) * (x + -1.0))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(z + -1.0), Float64(y * fma(y, -0.5, -1.0)), Float64(log(y) * Float64(x + -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[(y * 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(z + -1, y \cdot \mathsf{fma}\left(y, -0.5, -1\right), \log y \cdot \left(x + -1\right)\right) - t
\end{array}
Initial program 87.4%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t)
:precision binary64
(if (<= (+ x -1.0) -10000000000.0)
(- (* (log y) (+ x -1.0)) t)
(if (<= (+ x -1.0) 10000000000.0)
(- (- y (fma y z t)) (log y))
(fma (+ x -1.0) (log y) (- 0.0 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + -1.0) <= -10000000000.0) {
tmp = (log(y) * (x + -1.0)) - t;
} else if ((x + -1.0) <= 10000000000.0) {
tmp = (y - fma(y, z, t)) - log(y);
} else {
tmp = fma((x + -1.0), log(y), (0.0 - t));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(x + -1.0) <= -10000000000.0) tmp = Float64(Float64(log(y) * Float64(x + -1.0)) - t); elseif (Float64(x + -1.0) <= 10000000000.0) tmp = Float64(Float64(y - fma(y, z, t)) - log(y)); else tmp = fma(Float64(x + -1.0), log(y), Float64(0.0 - t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + -1.0), $MachinePrecision], -10000000000.0], N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(x + -1.0), $MachinePrecision], 10000000000.0], N[(N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(0.0 - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + -1 \leq -10000000000:\\
\;\;\;\;\log y \cdot \left(x + -1\right) - t\\
\mathbf{elif}\;x + -1 \leq 10000000000:\\
\;\;\;\;\left(y - \mathsf{fma}\left(y, z, t\right)\right) - \log y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x + -1, \log y, 0 - t\right)\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -1e10Initial program 95.0%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6493.8
Simplified93.8%
if -1e10 < (-.f64 x #s(literal 1 binary64)) < 1e10Initial program 78.0%
associate--l+N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
--lowering--.f64N/A
neg-sub0N/A
--lowering--.f6478.0
Applied egg-rr78.0%
Taylor expanded in y around 0
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
neg-sub0N/A
--lowering--.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.3
Simplified99.3%
Taylor expanded in x around 0
sub-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
Simplified97.1%
if 1e10 < (-.f64 x #s(literal 1 binary64)) Initial program 95.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6495.5
Simplified95.5%
sub-negN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-commutativeN/A
sub0-negN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
--lowering--.f6495.5
Applied egg-rr95.5%
Final simplification95.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* (log y) (+ x -1.0)) t)))
(if (<= (+ x -1.0) -10000000000.0)
t_1
(if (<= (+ x -1.0) 10000000000.0) (- (- y (fma y z t)) (log y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (log(y) * (x + -1.0)) - t;
double tmp;
if ((x + -1.0) <= -10000000000.0) {
tmp = t_1;
} else if ((x + -1.0) <= 10000000000.0) {
tmp = (y - fma(y, z, t)) - log(y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(log(y) * Float64(x + -1.0)) - t) tmp = 0.0 if (Float64(x + -1.0) <= -10000000000.0) tmp = t_1; elseif (Float64(x + -1.0) <= 10000000000.0) tmp = Float64(Float64(y - fma(y, z, t)) - log(y)); else tmp = t_1; 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] - t), $MachinePrecision]}, If[LessEqual[N[(x + -1.0), $MachinePrecision], -10000000000.0], t$95$1, If[LessEqual[N[(x + -1.0), $MachinePrecision], 10000000000.0], N[(N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(x + -1\right) - t\\
\mathbf{if}\;x + -1 \leq -10000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x + -1 \leq 10000000000:\\
\;\;\;\;\left(y - \mathsf{fma}\left(y, z, t\right)\right) - \log y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -1e10 or 1e10 < (-.f64 x #s(literal 1 binary64)) Initial program 95.3%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6494.6
Simplified94.6%
if -1e10 < (-.f64 x #s(literal 1 binary64)) < 1e10Initial program 78.0%
associate--l+N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
--lowering--.f64N/A
neg-sub0N/A
--lowering--.f6478.0
Applied egg-rr78.0%
Taylor expanded in y around 0
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
neg-sub0N/A
--lowering--.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.3
Simplified99.3%
Taylor expanded in x around 0
sub-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
Simplified97.1%
Final simplification95.8%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.6e+94)
(fma (+ x -1.0) (log y) (- 0.0 t))
(if (<= t 1.8e+58)
(fma (+ x -1.0) (log y) (- 0.0 (* y z)))
(- (* x (log y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.6e+94) {
tmp = fma((x + -1.0), log(y), (0.0 - t));
} else if (t <= 1.8e+58) {
tmp = fma((x + -1.0), log(y), (0.0 - (y * z)));
} else {
tmp = (x * log(y)) - t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= -2.6e+94) tmp = fma(Float64(x + -1.0), log(y), Float64(0.0 - t)); elseif (t <= 1.8e+58) tmp = fma(Float64(x + -1.0), log(y), Float64(0.0 - Float64(y * z))); else tmp = Float64(Float64(x * log(y)) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.6e+94], N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(0.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+58], N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(0.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(x + -1, \log y, 0 - t\right)\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(x + -1, \log y, 0 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - t\\
\end{array}
\end{array}
if t < -2.5999999999999999e94Initial program 97.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6497.5
Simplified97.5%
sub-negN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-commutativeN/A
sub0-negN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
--lowering--.f6497.6
Applied egg-rr97.6%
if -2.5999999999999999e94 < t < 1.79999999999999998e58Initial program 81.4%
associate--l+N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
--lowering--.f64N/A
neg-sub0N/A
--lowering--.f6481.4
Applied egg-rr81.4%
Taylor expanded in y around 0
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
neg-sub0N/A
--lowering--.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.2
Simplified99.2%
Taylor expanded in z around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6495.1
Simplified95.1%
if 1.79999999999999998e58 < t Initial program 98.8%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6497.5
Simplified97.5%
Final simplification96.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* (fma y -0.5 -1.0) (* y z)) t)))
(if (<= (+ z -1.0) -1e+264)
t_1
(if (<= (+ z -1.0) 2e+194) (- (* (log y) (+ x -1.0)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (fma(y, -0.5, -1.0) * (y * z)) - t;
double tmp;
if ((z + -1.0) <= -1e+264) {
tmp = t_1;
} else if ((z + -1.0) <= 2e+194) {
tmp = (log(y) * (x + -1.0)) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(fma(y, -0.5, -1.0) * Float64(y * z)) - t) tmp = 0.0 if (Float64(z + -1.0) <= -1e+264) tmp = t_1; elseif (Float64(z + -1.0) <= 2e+194) 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[(y * -0.5 + -1.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[N[(z + -1.0), $MachinePrecision], -1e+264], t$95$1, If[LessEqual[N[(z + -1.0), $MachinePrecision], 2e+194], 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(y, -0.5, -1\right) \cdot \left(y \cdot z\right) - t\\
\mathbf{if}\;z + -1 \leq -1 \cdot 10^{+264}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z + -1 \leq 2 \cdot 10^{+194}:\\
\;\;\;\;\log y \cdot \left(x + -1\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 z #s(literal 1 binary64)) < -1.00000000000000004e264 or 1.99999999999999989e194 < (-.f64 z #s(literal 1 binary64)) Initial program 37.1%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6470.7
Simplified70.7%
if -1.00000000000000004e264 < (-.f64 z #s(literal 1 binary64)) < 1.99999999999999989e194Initial program 94.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6494.0
Simplified94.0%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (if (<= t -2.6e+94) (fma (+ x -1.0) (log y) (- 0.0 t)) (if (<= t 3.4e+57) (- (* (log y) (+ x -1.0)) (* y z)) (- (* x (log y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.6e+94) {
tmp = fma((x + -1.0), log(y), (0.0 - t));
} else if (t <= 3.4e+57) {
tmp = (log(y) * (x + -1.0)) - (y * z);
} else {
tmp = (x * log(y)) - t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= -2.6e+94) tmp = fma(Float64(x + -1.0), log(y), Float64(0.0 - t)); elseif (t <= 3.4e+57) tmp = Float64(Float64(log(y) * Float64(x + -1.0)) - Float64(y * z)); else tmp = Float64(Float64(x * log(y)) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.6e+94], N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(0.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+57], N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+94}:\\
\;\;\;\;\mathsf{fma}\left(x + -1, \log y, 0 - t\right)\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+57}:\\
\;\;\;\;\log y \cdot \left(x + -1\right) - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - t\\
\end{array}
\end{array}
if t < -2.5999999999999999e94Initial program 97.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6497.5
Simplified97.5%
sub-negN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-commutativeN/A
sub0-negN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
--lowering--.f6497.6
Applied egg-rr97.6%
if -2.5999999999999999e94 < t < 3.39999999999999992e57Initial program 81.4%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate--l-N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.2
Simplified99.2%
Taylor expanded in z around inf
*-lowering-*.f6495.1
Simplified95.1%
if 3.39999999999999992e57 < t Initial program 98.8%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6497.5
Simplified97.5%
Final simplification96.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= (+ x -1.0) -1e+50)
t_1
(if (<= (+ x -1.0) 2e+33) (- (* (fma y -0.5 -1.0) (* y z)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if ((x + -1.0) <= -1e+50) {
tmp = t_1;
} else if ((x + -1.0) <= 2e+33) {
tmp = (fma(y, -0.5, -1.0) * (y * z)) - t;
} 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) <= -1e+50) tmp = t_1; elseif (Float64(x + -1.0) <= 2e+33) tmp = Float64(Float64(fma(y, -0.5, -1.0) * Float64(y * z)) - t); else tmp = t_1; end return 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], -1e+50], t$95$1, If[LessEqual[N[(x + -1.0), $MachinePrecision], 2e+33], N[(N[(N[(y * -0.5 + -1.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x + -1 \leq -1 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x + -1 \leq 2 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(y, -0.5, -1\right) \cdot \left(y \cdot z\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -1.0000000000000001e50 or 1.9999999999999999e33 < (-.f64 x #s(literal 1 binary64)) Initial program 96.4%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6479.6
Simplified79.6%
if -1.0000000000000001e50 < (-.f64 x #s(literal 1 binary64)) < 1.9999999999999999e33Initial program 79.1%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.7%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6458.9
Simplified58.9%
Final simplification68.8%
(FPCore (x y z t) :precision binary64 (fma (+ x -1.0) (log y) (- 0.0 (fma y (+ z -1.0) t))))
double code(double x, double y, double z, double t) {
return fma((x + -1.0), log(y), (0.0 - fma(y, (z + -1.0), t)));
}
function code(x, y, z, t) return fma(Float64(x + -1.0), log(y), Float64(0.0 - fma(y, Float64(z + -1.0), t))) end
code[x_, y_, z_, t_] := N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(0.0 - N[(y * N[(z + -1.0), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x + -1, \log y, 0 - \mathsf{fma}\left(y, z + -1, t\right)\right)
\end{array}
Initial program 87.4%
associate--l+N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
--lowering--.f64N/A
neg-sub0N/A
--lowering--.f6487.4
Applied egg-rr87.4%
Taylor expanded in y around 0
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
neg-sub0N/A
--lowering--.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.3
Simplified99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (- (* (log y) (+ x -1.0)) (fma y (+ z -1.0) t)))
double code(double x, double y, double z, double t) {
return (log(y) * (x + -1.0)) - fma(y, (z + -1.0), t);
}
function code(x, y, z, t) return Float64(Float64(log(y) * Float64(x + -1.0)) - fma(y, Float64(z + -1.0), t)) end
code[x_, y_, z_, t_] := N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z + -1.0), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log y \cdot \left(x + -1\right) - \mathsf{fma}\left(y, z + -1, t\right)
\end{array}
Initial program 87.4%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate--l-N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.3
Simplified99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* y (* y (fma -0.5 z 0.5))) t))) (if (<= t -3.1e+37) t_1 (if (<= t 3.4e+57) (* y (- 1.0 z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y * (y * fma(-0.5, z, 0.5))) - t;
double tmp;
if (t <= -3.1e+37) {
tmp = t_1;
} else if (t <= 3.4e+57) {
tmp = y * (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(y * Float64(y * fma(-0.5, z, 0.5))) - t) tmp = 0.0 if (t <= -3.1e+37) tmp = t_1; elseif (t <= 3.4e+57) tmp = Float64(y * Float64(1.0 - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * N[(y * N[(-0.5 * z + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t, -3.1e+37], t$95$1, If[LessEqual[t, 3.4e+57], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(y \cdot \mathsf{fma}\left(-0.5, z, 0.5\right)\right) - t\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+57}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.1000000000000002e37 or 3.39999999999999992e57 < t Initial program 96.4%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.8%
Taylor expanded in y around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
accelerator-lowering-fma.f6464.6
Simplified64.6%
if -3.1000000000000002e37 < t < 3.39999999999999992e57Initial program 81.6%
associate--l+N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
--lowering--.f64N/A
neg-sub0N/A
--lowering--.f6481.6
Applied egg-rr81.6%
Taylor expanded in y around 0
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
neg-sub0N/A
--lowering--.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.2
Simplified99.2%
Taylor expanded in y around inf
sub-negN/A
neg-mul-1N/A
metadata-evalN/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f6420.5
Simplified20.5%
(FPCore (x y z t) :precision binary64 (if (<= t -3.1e+37) (- 0.0 t) (if (<= t 3.4e+57) (* y (- 1.0 z)) (- 0.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.1e+37) {
tmp = 0.0 - t;
} else if (t <= 3.4e+57) {
tmp = y * (1.0 - z);
} else {
tmp = 0.0 - 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 <= (-3.1d+37)) then
tmp = 0.0d0 - t
else if (t <= 3.4d+57) then
tmp = y * (1.0d0 - z)
else
tmp = 0.0d0 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.1e+37) {
tmp = 0.0 - t;
} else if (t <= 3.4e+57) {
tmp = y * (1.0 - z);
} else {
tmp = 0.0 - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.1e+37: tmp = 0.0 - t elif t <= 3.4e+57: tmp = y * (1.0 - z) else: tmp = 0.0 - t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.1e+37) tmp = Float64(0.0 - t); elseif (t <= 3.4e+57) tmp = Float64(y * Float64(1.0 - z)); else tmp = Float64(0.0 - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.1e+37) tmp = 0.0 - t; elseif (t <= 3.4e+57) tmp = y * (1.0 - z); else tmp = 0.0 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.1e+37], N[(0.0 - t), $MachinePrecision], If[LessEqual[t, 3.4e+57], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(0.0 - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+37}:\\
\;\;\;\;0 - t\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+57}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;0 - t\\
\end{array}
\end{array}
if t < -3.1000000000000002e37 or 3.39999999999999992e57 < t Initial program 96.4%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6464.5
Simplified64.5%
sub0-negN/A
neg-lowering-neg.f6464.5
Applied egg-rr64.5%
if -3.1000000000000002e37 < t < 3.39999999999999992e57Initial program 81.6%
associate--l+N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
sub-negN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
log-lowering-log.f64N/A
--lowering--.f64N/A
neg-sub0N/A
--lowering--.f6481.6
Applied egg-rr81.6%
Taylor expanded in y around 0
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
neg-sub0N/A
--lowering--.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.2
Simplified99.2%
Taylor expanded in y around inf
sub-negN/A
neg-mul-1N/A
metadata-evalN/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f6420.5
Simplified20.5%
Final simplification37.7%
(FPCore (x y z t) :precision binary64 (- (* (fma y -0.5 -1.0) (* y z)) t))
double code(double x, double y, double z, double t) {
return (fma(y, -0.5, -1.0) * (y * z)) - t;
}
function code(x, y, z, t) return Float64(Float64(fma(y, -0.5, -1.0) * Float64(y * z)) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(y * -0.5 + -1.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, -0.5, -1\right) \cdot \left(y \cdot z\right) - t
\end{array}
Initial program 87.4%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.7%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6439.9
Simplified39.9%
(FPCore (x y z t) :precision binary64 (- 0.0 t))
double code(double x, double y, double z, double t) {
return 0.0 - 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 = 0.0d0 - t
end function
public static double code(double x, double y, double z, double t) {
return 0.0 - t;
}
def code(x, y, z, t): return 0.0 - t
function code(x, y, z, t) return Float64(0.0 - t) end
function tmp = code(x, y, z, t) tmp = 0.0 - t; end
code[x_, y_, z_, t_] := N[(0.0 - t), $MachinePrecision]
\begin{array}{l}
\\
0 - t
\end{array}
Initial program 87.4%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6427.6
Simplified27.6%
sub0-negN/A
neg-lowering-neg.f6427.6
Applied egg-rr27.6%
Final simplification27.6%
herbie shell --seed 2024194
(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))