
(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 17 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 (fma (+ z -1.0) (log1p (- y)) (- (* (+ x -1.0) (log y)) t)))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), (((x + -1.0) * log(y)) - t));
}
function code(x, y, z, t) return fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(Float64(Float64(x + -1.0) * log(y)) - t)) end
code[x_, y_, z_, t_] := N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \left(x + -1\right) \cdot \log y - t\right)
\end{array}
Initial program 91.2%
+-commutative91.2%
associate--l+91.2%
fma-def91.2%
sub-neg91.2%
log1p-def99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (* (log y) (+ x -1.0)) (fma (log1p (- y)) (- 1.0 z) t)))
double code(double x, double y, double z, double t) {
return (log(y) * (x + -1.0)) - fma(log1p(-y), (1.0 - z), t);
}
function code(x, y, z, t) return Float64(Float64(log(y) * Float64(x + -1.0)) - fma(log1p(Float64(-y)), Float64(1.0 - z), t)) end
code[x_, y_, z_, t_] := N[(N[(N[Log[y], $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] - N[(N[Log[1 + (-y)], $MachinePrecision] * N[(1.0 - z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log y \cdot \left(x + -1\right) - \mathsf{fma}\left(\mathsf{log1p}\left(-y\right), 1 - z, t\right)
\end{array}
Initial program 91.2%
+-commutative91.2%
associate--l+91.2%
+-commutative91.2%
associate-+l-91.2%
sub-neg91.2%
metadata-eval91.2%
sub-neg91.2%
+-commutative91.2%
*-commutative91.2%
distribute-rgt-neg-in91.2%
fma-def91.2%
sub-neg91.2%
log1p-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (+ z -1.0)))) (- (+ (* (+ x -1.0) (log y)) (- (* -0.5 (* y t_1)) t_1)) t)))
double code(double x, double y, double z, double t) {
double t_1 = y * (z + -1.0);
return (((x + -1.0) * log(y)) + ((-0.5 * (y * t_1)) - t_1)) - 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
real(8) :: t_1
t_1 = y * (z + (-1.0d0))
code = (((x + (-1.0d0)) * log(y)) + (((-0.5d0) * (y * t_1)) - t_1)) - t
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (z + -1.0);
return (((x + -1.0) * Math.log(y)) + ((-0.5 * (y * t_1)) - t_1)) - t;
}
def code(x, y, z, t): t_1 = y * (z + -1.0) return (((x + -1.0) * math.log(y)) + ((-0.5 * (y * t_1)) - t_1)) - t
function code(x, y, z, t) t_1 = Float64(y * Float64(z + -1.0)) return Float64(Float64(Float64(Float64(x + -1.0) * log(y)) + Float64(Float64(-0.5 * Float64(y * t_1)) - t_1)) - t) end
function tmp = code(x, y, z, t) t_1 = y * (z + -1.0); tmp = (((x + -1.0) * log(y)) + ((-0.5 * (y * t_1)) - t_1)) - t; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(-0.5 * N[(y * t$95$1), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z + -1\right)\\
\left(\left(x + -1\right) \cdot \log y + \left(-0.5 \cdot \left(y \cdot t_1\right) - t_1\right)\right) - t
\end{array}
\end{array}
Initial program 91.2%
Taylor expanded in y around 0 99.4%
fma-def99.4%
*-commutative99.4%
unpow299.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
mul-1-neg99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
fma-udef99.4%
associate-*l*99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ x -1.0) -50000.0) (not (<= (+ x -1.0) -1.0))) (- (+ (* y (- 1.0 z)) (* x (log y))) t) (- (- (- y (* z y)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x + -1.0) <= -50000.0) || !((x + -1.0) <= -1.0)) {
tmp = ((y * (1.0 - z)) + (x * log(y))) - t;
} else {
tmp = ((y - (z * y)) - log(y)) - 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 (((x + (-1.0d0)) <= (-50000.0d0)) .or. (.not. ((x + (-1.0d0)) <= (-1.0d0)))) then
tmp = ((y * (1.0d0 - z)) + (x * log(y))) - t
else
tmp = ((y - (z * y)) - log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x + -1.0) <= -50000.0) || !((x + -1.0) <= -1.0)) {
tmp = ((y * (1.0 - z)) + (x * Math.log(y))) - t;
} else {
tmp = ((y - (z * y)) - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x + -1.0) <= -50000.0) or not ((x + -1.0) <= -1.0): tmp = ((y * (1.0 - z)) + (x * math.log(y))) - t else: tmp = ((y - (z * y)) - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x + -1.0) <= -50000.0) || !(Float64(x + -1.0) <= -1.0)) tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) + Float64(x * log(y))) - t); else tmp = Float64(Float64(Float64(y - Float64(z * y)) - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x + -1.0) <= -50000.0) || ~(((x + -1.0) <= -1.0))) tmp = ((y * (1.0 - z)) + (x * log(y))) - t; else tmp = ((y - (z * y)) - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x + -1.0), $MachinePrecision], -50000.0], N[Not[LessEqual[N[(x + -1.0), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + -1 \leq -50000 \lor \neg \left(x + -1 \leq -1\right):\\
\;\;\;\;\left(y \cdot \left(1 - z\right) + x \cdot \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y - z \cdot y\right) - \log y\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -5e4 or -1 < (-.f64 x 1) Initial program 93.2%
+-commutative93.2%
associate--l+93.2%
+-commutative93.2%
associate-+l-93.2%
sub-neg93.2%
metadata-eval93.2%
sub-neg93.2%
+-commutative93.2%
*-commutative93.2%
distribute-rgt-neg-in93.2%
fma-def93.2%
sub-neg93.2%
log1p-def99.7%
neg-sub099.7%
associate--r-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in y around 0 99.5%
Taylor expanded in x around inf 98.7%
if -5e4 < (-.f64 x 1) < -1Initial program 89.3%
+-commutative89.3%
associate--l+89.3%
+-commutative89.3%
associate-+l-89.3%
sub-neg89.3%
metadata-eval89.3%
sub-neg89.3%
+-commutative89.3%
*-commutative89.3%
distribute-rgt-neg-in89.3%
fma-def89.3%
sub-neg89.3%
log1p-def100.0%
neg-sub0100.0%
associate--r-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 98.6%
Taylor expanded in x around 0 97.9%
neg-mul-197.9%
unsub-neg97.9%
sub-neg97.9%
distribute-rgt-in97.9%
*-lft-identity97.9%
distribute-lft-neg-in97.9%
*-commutative97.9%
unsub-neg97.9%
*-commutative97.9%
Simplified97.9%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ x -1.0) (log y)) (* (+ z -1.0) (- (* -0.5 (* y y)) y))) t))
double code(double x, double y, double z, double t) {
return (((x + -1.0) * log(y)) + ((z + -1.0) * ((-0.5 * (y * y)) - 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)) * (((-0.5d0) * (y * y)) - y))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x + -1.0) * Math.log(y)) + ((z + -1.0) * ((-0.5 * (y * y)) - y))) - t;
}
def code(x, y, z, t): return (((x + -1.0) * math.log(y)) + ((z + -1.0) * ((-0.5 * (y * y)) - y))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x + -1.0) * log(y)) + Float64(Float64(z + -1.0) * Float64(Float64(-0.5 * Float64(y * y)) - y))) - t) end
function tmp = code(x, y, z, t) tmp = (((x + -1.0) * log(y)) + ((z + -1.0) * ((-0.5 * (y * y)) - y))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z + -1.0), $MachinePrecision] * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + -1\right) \cdot \log y + \left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right)\right) - t
\end{array}
Initial program 91.2%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
unpow299.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ x -1.0) -1.000002) (not (<= (+ x -1.0) -0.999999998))) (- (* (+ x -1.0) (log y)) t) (- (- (- y (* z y)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x + -1.0) <= -1.000002) || !((x + -1.0) <= -0.999999998)) {
tmp = ((x + -1.0) * log(y)) - t;
} else {
tmp = ((y - (z * y)) - log(y)) - 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 (((x + (-1.0d0)) <= (-1.000002d0)) .or. (.not. ((x + (-1.0d0)) <= (-0.999999998d0)))) then
tmp = ((x + (-1.0d0)) * log(y)) - t
else
tmp = ((y - (z * y)) - log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x + -1.0) <= -1.000002) || !((x + -1.0) <= -0.999999998)) {
tmp = ((x + -1.0) * Math.log(y)) - t;
} else {
tmp = ((y - (z * y)) - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x + -1.0) <= -1.000002) or not ((x + -1.0) <= -0.999999998): tmp = ((x + -1.0) * math.log(y)) - t else: tmp = ((y - (z * y)) - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x + -1.0) <= -1.000002) || !(Float64(x + -1.0) <= -0.999999998)) tmp = Float64(Float64(Float64(x + -1.0) * log(y)) - t); else tmp = Float64(Float64(Float64(y - Float64(z * y)) - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x + -1.0) <= -1.000002) || ~(((x + -1.0) <= -0.999999998))) tmp = ((x + -1.0) * log(y)) - t; else tmp = ((y - (z * y)) - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x + -1.0), $MachinePrecision], -1.000002], N[Not[LessEqual[N[(x + -1.0), $MachinePrecision], -0.999999998]], $MachinePrecision]], N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y - N[(z * y), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + -1 \leq -1.000002 \lor \neg \left(x + -1 \leq -0.999999998\right):\\
\;\;\;\;\left(x + -1\right) \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y - z \cdot y\right) - \log y\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -1.00000200000000006 or -0.999999997999999946 < (-.f64 x 1) Initial program 94.0%
+-commutative94.0%
associate--l+94.0%
+-commutative94.0%
associate-+l-94.0%
sub-neg94.0%
metadata-eval94.0%
sub-neg94.0%
+-commutative94.0%
*-commutative94.0%
distribute-rgt-neg-in94.0%
fma-def94.0%
sub-neg94.0%
log1p-def99.7%
neg-sub099.7%
associate--r-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in y around 0 93.7%
if -1.00000200000000006 < (-.f64 x 1) < -0.999999997999999946Initial program 88.5%
+-commutative88.5%
associate--l+88.5%
+-commutative88.5%
associate-+l-88.5%
sub-neg88.5%
metadata-eval88.5%
sub-neg88.5%
+-commutative88.5%
*-commutative88.5%
distribute-rgt-neg-in88.5%
fma-def88.5%
sub-neg88.5%
log1p-def100.0%
neg-sub0100.0%
associate--r-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 98.6%
Taylor expanded in x around 0 98.3%
neg-mul-198.3%
unsub-neg98.3%
sub-neg98.3%
distribute-rgt-in98.3%
*-lft-identity98.3%
distribute-lft-neg-in98.3%
*-commutative98.3%
unsub-neg98.3%
*-commutative98.3%
Simplified98.3%
Final simplification96.0%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ x -1.0) (log y)) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return (((x + -1.0) * log(y)) + (y * (1.0 - z))) - 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)) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x + -1.0) * Math.log(y)) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return (((x + -1.0) * math.log(y)) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x + -1.0) * log(y)) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = (((x + -1.0) * log(y)) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + -1\right) \cdot \log y + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 91.2%
+-commutative91.2%
associate--l+91.2%
+-commutative91.2%
associate-+l-91.2%
sub-neg91.2%
metadata-eval91.2%
sub-neg91.2%
+-commutative91.2%
*-commutative91.2%
distribute-rgt-neg-in91.2%
fma-def91.2%
sub-neg91.2%
log1p-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 99.0%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.0) (not (<= x 2.7e-16))) (- (* x (log y)) t) (- y (+ (log y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.0) || !(x <= 2.7e-16)) {
tmp = (x * log(y)) - t;
} else {
tmp = y - (log(y) + 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 ((x <= (-1.0d0)) .or. (.not. (x <= 2.7d-16))) then
tmp = (x * log(y)) - t
else
tmp = y - (log(y) + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.0) || !(x <= 2.7e-16)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = y - (Math.log(y) + t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.0) or not (x <= 2.7e-16): tmp = (x * math.log(y)) - t else: tmp = y - (math.log(y) + t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.0) || !(x <= 2.7e-16)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(y - Float64(log(y) + t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.0) || ~((x <= 2.7e-16))) tmp = (x * log(y)) - t; else tmp = y - (log(y) + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 2.7e-16]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(y - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 2.7 \cdot 10^{-16}\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;y - \left(\log y + t\right)\\
\end{array}
\end{array}
if x < -1 or 2.69999999999999999e-16 < x Initial program 93.2%
Taylor expanded in y around 0 99.6%
fma-def99.6%
*-commutative99.6%
unpow299.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
mul-1-neg99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
fma-udef99.6%
associate-*l*99.6%
distribute-rgt-neg-in99.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 92.1%
if -1 < x < 2.69999999999999999e-16Initial program 89.3%
+-commutative89.3%
associate--l+89.3%
fma-def89.3%
sub-neg89.3%
log1p-def100.0%
Simplified100.0%
Taylor expanded in x around 0 99.2%
mul-1-neg99.2%
Simplified99.2%
Taylor expanded in z around 0 87.6%
mul-1-neg87.6%
sub-neg87.6%
neg-mul-187.6%
log1p-def87.6%
neg-mul-187.6%
+-commutative87.6%
Simplified87.6%
Taylor expanded in y around 0 87.2%
mul-1-neg87.2%
+-commutative87.2%
unsub-neg87.2%
Simplified87.2%
Final simplification89.6%
(FPCore (x y z t) :precision binary64 (if (<= z -1.55e+119) (- (* z (- (* -0.5 (* y y)) y)) t) (if (<= z 1.25e+123) (- y (+ (log y) t)) (- (* z (- y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+119) {
tmp = (z * ((-0.5 * (y * y)) - y)) - t;
} else if (z <= 1.25e+123) {
tmp = y - (log(y) + t);
} else {
tmp = (z * -y) - 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 (z <= (-1.55d+119)) then
tmp = (z * (((-0.5d0) * (y * y)) - y)) - t
else if (z <= 1.25d+123) then
tmp = y - (log(y) + t)
else
tmp = (z * -y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+119) {
tmp = (z * ((-0.5 * (y * y)) - y)) - t;
} else if (z <= 1.25e+123) {
tmp = y - (Math.log(y) + t);
} else {
tmp = (z * -y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.55e+119: tmp = (z * ((-0.5 * (y * y)) - y)) - t elif z <= 1.25e+123: tmp = y - (math.log(y) + t) else: tmp = (z * -y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e+119) tmp = Float64(Float64(z * Float64(Float64(-0.5 * Float64(y * y)) - y)) - t); elseif (z <= 1.25e+123) tmp = Float64(y - Float64(log(y) + t)); else tmp = Float64(Float64(z * Float64(-y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.55e+119) tmp = (z * ((-0.5 * (y * y)) - y)) - t; elseif (z <= 1.25e+123) tmp = y - (log(y) + t); else tmp = (z * -y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e+119], N[(N[(z * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[z, 1.25e+123], N[(y - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+119}:\\
\;\;\;\;z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+123}:\\
\;\;\;\;y - \left(\log y + t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\end{array}
\end{array}
if z < -1.54999999999999998e119Initial program 74.9%
Taylor expanded in y around 0 98.2%
fma-def98.2%
*-commutative98.2%
unpow298.2%
sub-neg98.2%
metadata-eval98.2%
+-commutative98.2%
mul-1-neg98.2%
*-commutative98.2%
sub-neg98.2%
metadata-eval98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in z around inf 47.1%
*-commutative47.1%
*-commutative47.1%
unpow247.1%
Simplified47.1%
if -1.54999999999999998e119 < z < 1.24999999999999994e123Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
fma-def99.8%
sub-neg99.8%
log1p-def99.8%
Simplified99.8%
Taylor expanded in x around 0 66.1%
mul-1-neg66.1%
Simplified66.1%
Taylor expanded in z around 0 66.1%
mul-1-neg66.1%
sub-neg66.1%
neg-mul-166.1%
log1p-def66.1%
neg-mul-166.1%
+-commutative66.1%
Simplified66.1%
Taylor expanded in y around 0 65.8%
mul-1-neg65.8%
+-commutative65.8%
unsub-neg65.8%
Simplified65.8%
if 1.24999999999999994e123 < z Initial program 56.9%
+-commutative56.9%
associate--l+56.9%
+-commutative56.9%
associate-+l-56.9%
sub-neg56.9%
metadata-eval56.9%
sub-neg56.9%
+-commutative56.9%
*-commutative56.9%
distribute-rgt-neg-in56.9%
fma-def56.9%
sub-neg56.9%
log1p-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 99.7%
Taylor expanded in z around inf 66.6%
associate-*r*66.6%
neg-mul-166.6%
Simplified66.6%
Final simplification62.3%
(FPCore (x y z t) :precision binary64 (if (<= z 3.7e+229) (- (* (+ x -1.0) (log y)) t) (fma (- y) z (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.7e+229) {
tmp = ((x + -1.0) * log(y)) - t;
} else {
tmp = fma(-y, z, -t);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= 3.7e+229) tmp = Float64(Float64(Float64(x + -1.0) * log(y)) - t); else tmp = fma(Float64(-y), z, Float64(-t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, 3.7e+229], N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[((-y) * z + (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.7 \cdot 10^{+229}:\\
\;\;\;\;\left(x + -1\right) \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, z, -t\right)\\
\end{array}
\end{array}
if z < 3.70000000000000002e229Initial program 93.7%
+-commutative93.7%
associate--l+93.7%
+-commutative93.7%
associate-+l-93.7%
sub-neg93.7%
metadata-eval93.7%
sub-neg93.7%
+-commutative93.7%
*-commutative93.7%
distribute-rgt-neg-in93.7%
fma-def93.7%
sub-neg93.7%
log1p-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 92.2%
if 3.70000000000000002e229 < z Initial program 48.4%
+-commutative48.4%
associate--l+48.4%
+-commutative48.4%
associate-+l-48.4%
sub-neg48.4%
metadata-eval48.4%
sub-neg48.4%
+-commutative48.4%
*-commutative48.4%
distribute-rgt-neg-in48.4%
fma-def48.4%
sub-neg48.4%
log1p-def100.0%
neg-sub0100.0%
associate--r-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 99.8%
Taylor expanded in z around inf 99.8%
associate-*r*99.8%
neg-mul-199.8%
Simplified99.8%
fma-neg100.0%
Applied egg-rr100.0%
Final simplification92.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.1e+119) (- (* z (- (* -0.5 (* y y)) y)) t) (if (<= z 2.15e+126) (- (- t) (log y)) (- (* z (- y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e+119) {
tmp = (z * ((-0.5 * (y * y)) - y)) - t;
} else if (z <= 2.15e+126) {
tmp = -t - log(y);
} else {
tmp = (z * -y) - 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 (z <= (-1.1d+119)) then
tmp = (z * (((-0.5d0) * (y * y)) - y)) - t
else if (z <= 2.15d+126) then
tmp = -t - log(y)
else
tmp = (z * -y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.1e+119) {
tmp = (z * ((-0.5 * (y * y)) - y)) - t;
} else if (z <= 2.15e+126) {
tmp = -t - Math.log(y);
} else {
tmp = (z * -y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.1e+119: tmp = (z * ((-0.5 * (y * y)) - y)) - t elif z <= 2.15e+126: tmp = -t - math.log(y) else: tmp = (z * -y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.1e+119) tmp = Float64(Float64(z * Float64(Float64(-0.5 * Float64(y * y)) - y)) - t); elseif (z <= 2.15e+126) tmp = Float64(Float64(-t) - log(y)); else tmp = Float64(Float64(z * Float64(-y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.1e+119) tmp = (z * ((-0.5 * (y * y)) - y)) - t; elseif (z <= 2.15e+126) tmp = -t - log(y); else tmp = (z * -y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.1e+119], N[(N[(z * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[z, 2.15e+126], N[((-t) - N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+119}:\\
\;\;\;\;z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+126}:\\
\;\;\;\;\left(-t\right) - \log y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\end{array}
\end{array}
if z < -1.1000000000000001e119Initial program 74.9%
Taylor expanded in y around 0 98.2%
fma-def98.2%
*-commutative98.2%
unpow298.2%
sub-neg98.2%
metadata-eval98.2%
+-commutative98.2%
mul-1-neg98.2%
*-commutative98.2%
sub-neg98.2%
metadata-eval98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in z around inf 47.1%
*-commutative47.1%
*-commutative47.1%
unpow247.1%
Simplified47.1%
if -1.1000000000000001e119 < z < 2.1500000000000001e126Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
fma-def99.8%
sub-neg99.8%
log1p-def99.8%
Simplified99.8%
Taylor expanded in x around 0 66.1%
mul-1-neg66.1%
Simplified66.1%
Taylor expanded in y around 0 65.3%
mul-1-neg65.3%
distribute-neg-in65.3%
+-commutative65.3%
sub-neg65.3%
Simplified65.3%
if 2.1500000000000001e126 < z Initial program 56.9%
+-commutative56.9%
associate--l+56.9%
+-commutative56.9%
associate-+l-56.9%
sub-neg56.9%
metadata-eval56.9%
sub-neg56.9%
+-commutative56.9%
*-commutative56.9%
distribute-rgt-neg-in56.9%
fma-def56.9%
sub-neg56.9%
log1p-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 99.7%
Taylor expanded in z around inf 66.6%
associate-*r*66.6%
neg-mul-166.6%
Simplified66.6%
Final simplification61.9%
(FPCore (x y z t) :precision binary64 (- (* (* y (+ z -1.0)) (+ -1.0 (* y -0.5))) t))
double code(double x, double y, double z, double t) {
return ((y * (z + -1.0)) * (-1.0 + (y * -0.5))) - 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 = ((y * (z + (-1.0d0))) * ((-1.0d0) + (y * (-0.5d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((y * (z + -1.0)) * (-1.0 + (y * -0.5))) - t;
}
def code(x, y, z, t): return ((y * (z + -1.0)) * (-1.0 + (y * -0.5))) - t
function code(x, y, z, t) return Float64(Float64(Float64(y * Float64(z + -1.0)) * Float64(-1.0 + Float64(y * -0.5))) - t) end
function tmp = code(x, y, z, t) tmp = ((y * (z + -1.0)) * (-1.0 + (y * -0.5))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot \left(z + -1\right)\right) \cdot \left(-1 + y \cdot -0.5\right) - t
\end{array}
Initial program 91.2%
Taylor expanded in y around 0 99.4%
fma-def99.4%
*-commutative99.4%
unpow299.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
mul-1-neg99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 42.2%
*-commutative42.2%
sub-neg42.2%
metadata-eval42.2%
+-commutative42.2%
unpow242.2%
associate-*r*42.2%
associate-*r*42.2%
+-commutative42.2%
metadata-eval42.2%
sub-neg42.2%
*-commutative42.2%
*-commutative42.2%
sub-neg42.2%
metadata-eval42.2%
distribute-neg-in42.2%
neg-mul-142.2%
+-commutative42.2%
metadata-eval42.2%
sub-neg42.2%
associate-*r*42.2%
distribute-rgt-out42.2%
Simplified42.2%
Final simplification42.2%
(FPCore (x y z t) :precision binary64 (- (* (+ z -1.0) (- (* -0.5 (* y y)) y)) t))
double code(double x, double y, double z, double t) {
return ((z + -1.0) * ((-0.5 * (y * y)) - 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 = ((z + (-1.0d0)) * (((-0.5d0) * (y * y)) - y)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t;
}
def code(x, y, z, t): return ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(z + -1.0) * Float64(Float64(-0.5 * Float64(y * y)) - y)) - t) end
function tmp = code(x, y, z, t) tmp = ((z + -1.0) * ((-0.5 * (y * y)) - y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(z + -1\right) \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t
\end{array}
Initial program 91.2%
Taylor expanded in y around 0 99.4%
mul-1-neg99.4%
unsub-neg99.4%
*-commutative99.4%
unpow299.4%
Simplified99.4%
Taylor expanded in y around inf 42.2%
+-commutative42.2%
sub-neg42.2%
metadata-eval42.2%
*-commutative42.2%
associate-*r*42.2%
*-commutative42.2%
unpow242.2%
associate-*r*42.2%
mul-1-neg42.2%
sub-neg42.2%
metadata-eval42.2%
*-commutative42.2%
distribute-lft-neg-in42.2%
distribute-rgt-in42.2%
fma-udef42.2%
*-commutative42.2%
Simplified42.2%
Final simplification42.2%
(FPCore (x y z t) :precision binary64 (- (* z (- (* -0.5 (* y y)) y)) t))
double code(double x, double y, double z, double t) {
return (z * ((-0.5 * (y * y)) - 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 = (z * (((-0.5d0) * (y * y)) - y)) - t
end function
public static double code(double x, double y, double z, double t) {
return (z * ((-0.5 * (y * y)) - y)) - t;
}
def code(x, y, z, t): return (z * ((-0.5 * (y * y)) - y)) - t
function code(x, y, z, t) return Float64(Float64(z * Float64(Float64(-0.5 * Float64(y * y)) - y)) - t) end
function tmp = code(x, y, z, t) tmp = (z * ((-0.5 * (y * y)) - y)) - t; end
code[x_, y_, z_, t_] := N[(N[(z * N[(N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(-0.5 \cdot \left(y \cdot y\right) - y\right) - t
\end{array}
Initial program 91.2%
Taylor expanded in y around 0 99.4%
fma-def99.4%
*-commutative99.4%
unpow299.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
mul-1-neg99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
Taylor expanded in z around inf 41.9%
*-commutative41.9%
*-commutative41.9%
unpow241.9%
Simplified41.9%
Final simplification41.9%
(FPCore (x y z t) :precision binary64 (if (<= t -2.7e-13) (- t) (if (<= t 780.0) (* z (- y)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.7e-13) {
tmp = -t;
} else if (t <= 780.0) {
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 <= (-2.7d-13)) then
tmp = -t
else if (t <= 780.0d0) 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 <= -2.7e-13) {
tmp = -t;
} else if (t <= 780.0) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.7e-13: tmp = -t elif t <= 780.0: tmp = z * -y else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.7e-13) tmp = Float64(-t); elseif (t <= 780.0) 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 <= -2.7e-13) tmp = -t; elseif (t <= 780.0) tmp = z * -y; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.7e-13], (-t), If[LessEqual[t, 780.0], N[(z * (-y)), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-13}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 780:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -2.70000000000000011e-13 or 780 < t Initial program 95.8%
+-commutative95.8%
associate--l+95.8%
+-commutative95.8%
associate-+l-95.8%
sub-neg95.8%
metadata-eval95.8%
sub-neg95.8%
+-commutative95.8%
*-commutative95.8%
distribute-rgt-neg-in95.8%
fma-def95.8%
sub-neg95.8%
log1p-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t around inf 68.0%
neg-mul-168.0%
Simplified68.0%
if -2.70000000000000011e-13 < t < 780Initial program 87.2%
+-commutative87.2%
associate--l+87.2%
+-commutative87.2%
associate-+l-87.2%
sub-neg87.2%
metadata-eval87.2%
sub-neg87.2%
+-commutative87.2%
*-commutative87.2%
distribute-rgt-neg-in87.2%
fma-def87.2%
sub-neg87.2%
log1p-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 98.9%
Taylor expanded in z around inf 15.2%
associate-*r*15.2%
neg-mul-115.2%
Simplified15.2%
Taylor expanded in y around inf 15.0%
associate-*r*15.0%
neg-mul-115.0%
*-commutative15.0%
Simplified15.0%
Final simplification39.6%
(FPCore (x y z t) :precision binary64 (- (* z (- y)) t))
double code(double x, double y, double z, double t) {
return (z * -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 = (z * -y) - t
end function
public static double code(double x, double y, double z, double t) {
return (z * -y) - t;
}
def code(x, y, z, t): return (z * -y) - t
function code(x, y, z, t) return Float64(Float64(z * Float64(-y)) - t) end
function tmp = code(x, y, z, t) tmp = (z * -y) - t; end
code[x_, y_, z_, t_] := N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(-y\right) - t
\end{array}
Initial program 91.2%
+-commutative91.2%
associate--l+91.2%
+-commutative91.2%
associate-+l-91.2%
sub-neg91.2%
metadata-eval91.2%
sub-neg91.2%
+-commutative91.2%
*-commutative91.2%
distribute-rgt-neg-in91.2%
fma-def91.2%
sub-neg91.2%
log1p-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 99.0%
Taylor expanded in z around inf 41.8%
associate-*r*41.8%
neg-mul-141.8%
Simplified41.8%
Final simplification41.8%
(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 91.2%
+-commutative91.2%
associate--l+91.2%
+-commutative91.2%
associate-+l-91.2%
sub-neg91.2%
metadata-eval91.2%
sub-neg91.2%
+-commutative91.2%
*-commutative91.2%
distribute-rgt-neg-in91.2%
fma-def91.2%
sub-neg91.2%
log1p-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t around inf 33.2%
neg-mul-133.2%
Simplified33.2%
Final simplification33.2%
herbie shell --seed 2023230
(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))