
(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 13 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)) (fma (+ -1.0 x) (log y) (- t))))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), fma((-1.0 + x), log(y), -t));
}
function code(x, y, z, t) return fma(Float64(z + -1.0), log1p(Float64(-y)), fma(Float64(-1.0 + x), log(y), Float64(-t))) end
code[x_, y_, z_, t_] := N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \mathsf{fma}\left(-1 + x, \log y, -t\right)\right)
\end{array}
Initial program 91.0%
sub-neg91.0%
+-commutative91.0%
associate-+l+91.0%
fma-define91.0%
sub-neg91.0%
metadata-eval91.0%
sub-neg91.0%
log1p-define99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (fma (+ z -1.0) (log1p (- y)) (* (+ -1.0 x) (log y))) t))
double code(double x, double y, double z, double t) {
return fma((z + -1.0), log1p(-y), ((-1.0 + x) * log(y))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(z + -1.0), log1p(Float64(-y)), Float64(Float64(-1.0 + x) * log(y))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(z + -1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z + -1, \mathsf{log1p}\left(-y\right), \left(-1 + x\right) \cdot \log y\right) - t
\end{array}
Initial program 91.0%
+-commutative91.0%
fma-define91.0%
sub-neg91.0%
metadata-eval91.0%
sub-neg91.0%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(-
(+
(* (+ -1.0 x) (log y))
(*
(* y (+ -1.0 (* y (- (* y (- (* y -0.25) 0.3333333333333333)) 0.5))))
(+ z -1.0)))
t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + ((y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))) * (z + -1.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 = ((((-1.0d0) + x) * log(y)) + ((y * ((-1.0d0) + (y * ((y * ((y * (-0.25d0)) - 0.3333333333333333d0)) - 0.5d0)))) * (z + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + ((y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))) * (z + -1.0))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))) * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * Float64(Float64(y * -0.25) - 0.3333333333333333)) - 0.5)))) * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + ((y * (-1.0 + (y * ((y * ((y * -0.25) - 0.3333333333333333)) - 0.5)))) * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(y * N[(-1.0 + N[(y * N[(N[(y * N[(N[(y * -0.25), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + \left(y \cdot \left(-1 + y \cdot \left(y \cdot \left(y \cdot -0.25 - 0.3333333333333333\right) - 0.5\right)\right)\right) \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 91.0%
Taylor expanded in y around 0 99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* (* y (+ -1.0 (* y (- (* y -0.3333333333333333) 0.5)))) (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + ((y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))) * (z + -1.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 = ((((-1.0d0) + x) * log(y)) + ((y * ((-1.0d0) + (y * ((y * (-0.3333333333333333d0)) - 0.5d0)))) * (z + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + ((y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))) * (z + -1.0))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))) * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(Float64(y * Float64(-1.0 + Float64(y * Float64(Float64(y * -0.3333333333333333) - 0.5)))) * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + ((y * (-1.0 + (y * ((y * -0.3333333333333333) - 0.5)))) * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(y * N[(-1.0 + N[(y * N[(N[(y * -0.3333333333333333), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + \left(y \cdot \left(-1 + y \cdot \left(y \cdot -0.3333333333333333 - 0.5\right)\right)\right) \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 91.0%
Taylor expanded in y around 0 99.4%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (+ -1.0 x) (log y))))
(if (or (<= t -4e+50) (not (<= t 2.55e-14)))
(- t_1 t)
(- t_1 (* y (+ z -1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (-1.0 + x) * log(y);
double tmp;
if ((t <= -4e+50) || !(t <= 2.55e-14)) {
tmp = t_1 - t;
} else {
tmp = t_1 - (y * (z + -1.0));
}
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 = ((-1.0d0) + x) * log(y)
if ((t <= (-4d+50)) .or. (.not. (t <= 2.55d-14))) then
tmp = t_1 - t
else
tmp = t_1 - (y * (z + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (-1.0 + x) * Math.log(y);
double tmp;
if ((t <= -4e+50) || !(t <= 2.55e-14)) {
tmp = t_1 - t;
} else {
tmp = t_1 - (y * (z + -1.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = (-1.0 + x) * math.log(y) tmp = 0 if (t <= -4e+50) or not (t <= 2.55e-14): tmp = t_1 - t else: tmp = t_1 - (y * (z + -1.0)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-1.0 + x) * log(y)) tmp = 0.0 if ((t <= -4e+50) || !(t <= 2.55e-14)) tmp = Float64(t_1 - t); else tmp = Float64(t_1 - Float64(y * Float64(z + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (-1.0 + x) * log(y); tmp = 0.0; if ((t <= -4e+50) || ~((t <= 2.55e-14))) tmp = t_1 - t; else tmp = t_1 - (y * (z + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -4e+50], N[Not[LessEqual[t, 2.55e-14]], $MachinePrecision]], N[(t$95$1 - t), $MachinePrecision], N[(t$95$1 - N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-1 + x\right) \cdot \log y\\
\mathbf{if}\;t \leq -4 \cdot 10^{+50} \lor \neg \left(t \leq 2.55 \cdot 10^{-14}\right):\\
\;\;\;\;t\_1 - t\\
\mathbf{else}:\\
\;\;\;\;t\_1 - y \cdot \left(z + -1\right)\\
\end{array}
\end{array}
if t < -4.0000000000000003e50 or 2.5499999999999999e-14 < t Initial program 97.1%
+-commutative97.1%
fma-define97.1%
sub-neg97.1%
metadata-eval97.1%
sub-neg97.1%
log1p-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-sqr-sqrt75.9%
pow275.9%
Applied egg-rr75.9%
Taylor expanded in y around 0 96.7%
if -4.0000000000000003e50 < t < 2.5499999999999999e-14Initial program 86.3%
sub-neg86.3%
+-commutative86.3%
associate-+l+86.3%
fma-define86.3%
sub-neg86.3%
metadata-eval86.3%
sub-neg86.3%
log1p-define99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 68.7%
Simplified82.2%
Taylor expanded in t around -inf 56.5%
Simplified50.8%
Taylor expanded in y around 0 72.8%
Taylor expanded in t around 0 97.3%
sub-neg97.3%
metadata-eval97.3%
+-commutative97.3%
distribute-rgt-in97.3%
mul-1-neg97.3%
lft-mult-inverse97.3%
metadata-eval97.3%
distribute-neg-in97.3%
metadata-eval97.3%
sub-neg97.3%
distribute-rgt-neg-in97.3%
mul-1-neg97.3%
+-commutative97.3%
mul-1-neg97.3%
unsub-neg97.3%
sub-neg97.3%
metadata-eval97.3%
+-commutative97.3%
sub-neg97.3%
metadata-eval97.3%
+-commutative97.3%
Simplified97.3%
Final simplification97.0%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* (* y (+ -1.0 (* y -0.5))) (+ z -1.0))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * log(y)) + ((y * (-1.0 + (y * -0.5))) * (z + -1.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 = ((((-1.0d0) + x) * log(y)) + ((y * ((-1.0d0) + (y * (-0.5d0)))) * (z + (-1.0d0)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + ((y * (-1.0 + (y * -0.5))) * (z + -1.0))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + ((y * (-1.0 + (y * -0.5))) * (z + -1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(Float64(y * Float64(-1.0 + Float64(y * -0.5))) * Float64(z + -1.0))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + ((y * (-1.0 + (y * -0.5))) * (z + -1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(y * N[(-1.0 + N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + \left(y \cdot \left(-1 + y \cdot -0.5\right)\right) \cdot \left(z + -1\right)\right) - t
\end{array}
Initial program 91.0%
Taylor expanded in y around 0 99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.6e-62) (not (<= x 0.0122))) (* x (- (log y) (/ t x))) (- t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.6e-62) || !(x <= 0.0122)) {
tmp = x * (log(y) - (t / x));
} 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 ((x <= (-3.6d-62)) .or. (.not. (x <= 0.0122d0))) then
tmp = x * (log(y) - (t / x))
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.6e-62) || !(x <= 0.0122)) {
tmp = x * (Math.log(y) - (t / x));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.6e-62) or not (x <= 0.0122): tmp = x * (math.log(y) - (t / x)) else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.6e-62) || !(x <= 0.0122)) tmp = Float64(x * Float64(log(y) - Float64(t / x))); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.6e-62) || ~((x <= 0.0122))) tmp = x * (log(y) - (t / x)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.6e-62], N[Not[LessEqual[x, 0.0122]], $MachinePrecision]], N[(x * N[(N[Log[y], $MachinePrecision] - N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-62} \lor \neg \left(x \leq 0.0122\right):\\
\;\;\;\;x \cdot \left(\log y - \frac{t}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if x < -3.6e-62 or 0.0122000000000000008 < x Initial program 93.4%
sub-neg93.4%
+-commutative93.4%
associate-+l+93.4%
fma-define93.4%
sub-neg93.4%
metadata-eval93.4%
sub-neg93.4%
log1p-define99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 66.2%
Simplified72.8%
Taylor expanded in t around -inf 60.0%
Simplified59.3%
Taylor expanded in x around inf 71.3%
associate-/l*71.2%
Simplified71.2%
Taylor expanded in x around inf 90.2%
mul-1-neg90.2%
unsub-neg90.2%
Simplified90.2%
if -3.6e-62 < x < 0.0122000000000000008Initial program 87.4%
sub-neg87.4%
+-commutative87.4%
associate-+l+87.4%
fma-define87.4%
sub-neg87.4%
metadata-eval87.4%
sub-neg87.4%
log1p-define100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 76.1%
Simplified88.6%
Taylor expanded in t around inf 44.7%
neg-mul-144.7%
Simplified44.7%
Final simplification72.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.05e+89) (not (<= x 230000000000.0))) (* x (log y)) (- t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.05e+89) || !(x <= 230000000000.0)) {
tmp = x * log(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 ((x <= (-1.05d+89)) .or. (.not. (x <= 230000000000.0d0))) then
tmp = x * log(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 ((x <= -1.05e+89) || !(x <= 230000000000.0)) {
tmp = x * Math.log(y);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.05e+89) or not (x <= 230000000000.0): tmp = x * math.log(y) else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.05e+89) || !(x <= 230000000000.0)) tmp = Float64(x * log(y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.05e+89) || ~((x <= 230000000000.0))) tmp = x * log(y); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.05e+89], N[Not[LessEqual[x, 230000000000.0]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+89} \lor \neg \left(x \leq 230000000000\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if x < -1.04999999999999993e89 or 2.3e11 < x Initial program 96.2%
sub-neg96.2%
+-commutative96.2%
associate-+l+96.2%
fma-define96.2%
sub-neg96.2%
metadata-eval96.2%
sub-neg96.2%
log1p-define99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 65.1%
Simplified68.7%
Taylor expanded in x around inf 80.8%
*-commutative80.8%
Simplified80.8%
if -1.04999999999999993e89 < x < 2.3e11Initial program 86.5%
sub-neg86.5%
+-commutative86.5%
associate-+l+86.5%
fma-define86.5%
sub-neg86.5%
metadata-eval86.5%
sub-neg86.5%
log1p-define100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 74.6%
Simplified88.1%
Taylor expanded in t around inf 46.3%
neg-mul-146.3%
Simplified46.3%
Final simplification62.5%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 x) (log y)) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + x) * 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 = ((((-1.0d0) + x) * log(y)) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((-1.0 + x) * Math.log(y)) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return (((-1.0 + x) * math.log(y)) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + x) * log(y)) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = (((-1.0 + x) * log(y)) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + x\right) \cdot \log y + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 91.0%
Taylor expanded in y around 0 98.9%
mul-1-neg98.9%
distribute-rgt-neg-in98.9%
sub-neg98.9%
metadata-eval98.9%
+-commutative98.9%
distribute-neg-in98.9%
metadata-eval98.9%
unsub-neg98.9%
Simplified98.9%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (- (* (+ -1.0 x) (log y)) t))
double code(double x, double y, double z, double t) {
return ((-1.0 + x) * log(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 = (((-1.0d0) + x) * log(y)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((-1.0 + x) * Math.log(y)) - t;
}
def code(x, y, z, t): return ((-1.0 + x) * math.log(y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(-1.0 + x) * log(y)) - t) end
function tmp = code(x, y, z, t) tmp = ((-1.0 + x) * log(y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(-1 + x\right) \cdot \log y - t
\end{array}
Initial program 91.0%
+-commutative91.0%
fma-define91.0%
sub-neg91.0%
metadata-eval91.0%
sub-neg91.0%
log1p-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
add-sqr-sqrt73.1%
pow273.1%
Applied egg-rr73.1%
Taylor expanded in y around 0 89.7%
Final simplification89.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.8e+49) (not (<= t 1.5e-10))) (- t) (* y (- (- z) -1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.8e+49) || !(t <= 1.5e-10)) {
tmp = -t;
} else {
tmp = y * (-z - -1.0);
}
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 <= (-8.8d+49)) .or. (.not. (t <= 1.5d-10))) then
tmp = -t
else
tmp = y * (-z - (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.8e+49) || !(t <= 1.5e-10)) {
tmp = -t;
} else {
tmp = y * (-z - -1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8.8e+49) or not (t <= 1.5e-10): tmp = -t else: tmp = y * (-z - -1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8.8e+49) || !(t <= 1.5e-10)) tmp = Float64(-t); else tmp = Float64(y * Float64(Float64(-z) - -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -8.8e+49) || ~((t <= 1.5e-10))) tmp = -t; else tmp = y * (-z - -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.8e+49], N[Not[LessEqual[t, 1.5e-10]], $MachinePrecision]], (-t), N[(y * N[((-z) - -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{+49} \lor \neg \left(t \leq 1.5 \cdot 10^{-10}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\left(-z\right) - -1\right)\\
\end{array}
\end{array}
if t < -8.8000000000000003e49 or 1.5e-10 < t Initial program 97.0%
sub-neg97.0%
+-commutative97.0%
associate-+l+97.0%
fma-define97.0%
sub-neg97.0%
metadata-eval97.0%
sub-neg97.0%
log1p-define99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 72.5%
Simplified75.6%
Taylor expanded in t around inf 67.8%
neg-mul-167.8%
Simplified67.8%
if -8.8000000000000003e49 < t < 1.5e-10Initial program 86.4%
sub-neg86.4%
+-commutative86.4%
associate-+l+86.4%
fma-define86.4%
sub-neg86.4%
metadata-eval86.4%
sub-neg86.4%
log1p-define99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 68.3%
Simplified81.7%
Taylor expanded in t around -inf 56.1%
Simplified50.5%
Taylor expanded in y around 0 73.0%
Taylor expanded in y around inf 17.0%
*-commutative17.0%
sub-neg17.0%
metadata-eval17.0%
+-commutative17.0%
distribute-rgt-in17.0%
mul-1-neg17.0%
lft-mult-inverse17.0%
metadata-eval17.0%
distribute-neg-in17.0%
metadata-eval17.0%
sub-neg17.0%
distribute-lft-neg-in17.0%
distribute-rgt-neg-in17.0%
sub-neg17.0%
metadata-eval17.0%
+-commutative17.0%
Simplified17.0%
Final simplification39.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.8e+49) (not (<= t 1.5e-10))) (- t) (* z (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.8e+49) || !(t <= 1.5e-10)) {
tmp = -t;
} else {
tmp = z * -y;
}
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 <= (-8.8d+49)) .or. (.not. (t <= 1.5d-10))) then
tmp = -t
else
tmp = z * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.8e+49) || !(t <= 1.5e-10)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8.8e+49) or not (t <= 1.5e-10): tmp = -t else: tmp = z * -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8.8e+49) || !(t <= 1.5e-10)) tmp = Float64(-t); else tmp = Float64(z * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -8.8e+49) || ~((t <= 1.5e-10))) tmp = -t; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.8e+49], N[Not[LessEqual[t, 1.5e-10]], $MachinePrecision]], (-t), N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{+49} \lor \neg \left(t \leq 1.5 \cdot 10^{-10}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < -8.8000000000000003e49 or 1.5e-10 < t Initial program 97.0%
sub-neg97.0%
+-commutative97.0%
associate-+l+97.0%
fma-define97.0%
sub-neg97.0%
metadata-eval97.0%
sub-neg97.0%
log1p-define99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 72.5%
Simplified75.6%
Taylor expanded in t around inf 67.8%
neg-mul-167.8%
Simplified67.8%
if -8.8000000000000003e49 < t < 1.5e-10Initial program 86.4%
sub-neg86.4%
+-commutative86.4%
associate-+l+86.4%
fma-define86.4%
sub-neg86.4%
metadata-eval86.4%
sub-neg86.4%
log1p-define99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 68.3%
Simplified81.7%
Taylor expanded in t around -inf 56.1%
Simplified50.5%
Taylor expanded in y around 0 73.0%
Taylor expanded in z around inf 16.6%
associate-*r*16.6%
neg-mul-116.6%
Simplified16.6%
Final simplification39.0%
(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.0%
sub-neg91.0%
+-commutative91.0%
associate-+l+91.0%
fma-define91.0%
sub-neg91.0%
metadata-eval91.0%
sub-neg91.0%
log1p-define99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 70.1%
Simplified79.0%
Taylor expanded in t around inf 31.8%
neg-mul-131.8%
Simplified31.8%
herbie shell --seed 2024111
(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))